Skip to content

Effect.SetProperty ​

Signature ​

lua
Effect.SetProperty(Effect e, int prop1, [int prop2]) -> void

Description ​

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:

lua
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.

Parameters ​

  • e Effect - Effect whose property flags are set.
  • prop1 int - Primary effect property bitmask.
  • prop2 int optional - 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:

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.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua4
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua1
Artmage Non-Finito74631897Scripts/c74631897.lua4
Pendulum Evolution55795155Scripts/c55795155.lua3
Levia-Dragoon - Daedalus78579058Scripts/c78579058.lua2
Lady's Dragonmaid48658295Scripts/c48658295.lua3
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua3
Surprise Fusion35167375Scripts/c35167375.lua1
Astrograph Sorcerer76794549Scripts/c76794549.lua1
Ultra Polymerization76647978Scripts/c76647978.lua1
Goyo Emperor59255742Scripts/c59255742.lua2
Accel Synchro Stardust Dragon30983281Scripts/c30983281.lua3
Melffy Playtime Surprise58036097Scripts/c58036097.lua1
Ashtraja Susanoo17020474Scripts/c17020474.lua2
Deftero Enneacraft - "alazoneIA"92171126Scripts/c92171126.lua3
Destiny HERO - Destro-Dogma25158975Scripts/c25158975.lua2
Yomagna the Fire Phantom17350692Scripts/c17350692.lua2
Fiendsmith's Sequence49867899Scripts/c49867899.lua2
D/D/D Alfred the Divine Sage King11852093Scripts/c11852093.lua1
El Shaddoll Apkallone50907446Scripts/c50907446.lua8
Meteoroa Drytron24166324Scripts/c24166324.lua1
Mixousia the Confounder80843006Scripts/c80843006.lua2
Gem-Knight Dispersion24220368Scripts/c24220368.lua1
Invoked Sorath43989315Scripts/c43989315.lua1
...and 10451 more

Script Examples ​

Salamandra with Chain (62091148) ​

Source: Scripts/c62091148.lua

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

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

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)