Effect.SetProperty
Signature
Effect.SetProperty(Effect e, int prop1, [int prop2]) -> voidDescription
Sets e's property flags. prop1 holds the normal effect property flags; prop2 is used for the second property word when needed. Internal flags are preserved when prop1 is replaced. Learner-facing flags include EFFECT_FLAG_CARD_TARGET for official targets, EFFECT_FLAG_DAMAGE_STEP and EFFECT_FLAG_DAMAGE_CAL for Damage Step timing, and EFFECT_FLAG_PLAYER_TARGET for effects that apply to players.
How To Use It
Use SetProperty for flags that change targeting, timing, visibility, and activation rules.
For targeting effects, EFFECT_FLAG_CARD_TARGET should be paired with Duel.SelectTarget in the Target callback:
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.target)Other common flags include EFFECT_FLAG_DELAY for missed-timing-sensitive triggers, EFFECT_FLAG_DAMAGE_STEP for effects that can activate in the Damage Step, and EFFECT_FLAG_CANNOT_DISABLE for rules or equip limits that should not be negated normally.
Related Functions
Parameters
eEffect- Effect whose property flags are set.prop1int- Primary effect property bitmask.prop2intoptional - Optional second property bitmask for flags stored in the second property word.
Source
D:\Programs\GitHub\ygopro-core\libeffect.cpp:620
Guided Examples
Learn how to use this function in context:
- Activated Effects
- Activation Legality
- Categories, Properties, And Hint Timing
- Chain Timing And Activation Windows
- Creation, Building, and Registration of an Effect Object
- Write Your First Custom Card
More guided lessons (1)
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 10475 indexed script(s).
- Search this function in the Script Explorer with
Effect.SetProperty.
Script Examples
Salamandra with Chain (62091148)
Source: Scripts/c62091148.lua
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(aux.dscon)
e1:SetCost(s.cost)Astrograph Sorcerer, the Starfrost Magician (48171151)
Source: Scripts/c48171151.lua
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(custom_code)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id+o)Artmage Non-Finito (74631897)
Source: Scripts/c74631897.lua
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(s.condition)