Effect.SetValue
Signature
lua
Effect.SetValue(Effect e, function|int|bool val) -> voidDescription
Sets e's value field. The value can be a number, boolean, or callback function depending on the effect code.
How To Use It
SetValue supplies the amount, flag, card code, or callback required by the effect code.
Simple stat changes usually use a number:
lua
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)Some effect codes need a function instead:
lua
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetValue(function(e,c) return c==e:GetLabelObject() end)When a function is supplied, the core marks the effect as using a function value. Replacing it with a number or boolean clears that function-value flag.
Related Functions
Parameters
eEffectvalfunction|int|bool
Source
D:\Programs\GitHub\ygopro-core\libeffect.cpp:628
Guided Examples
Learn how to use this function in context:
- Battle Position Effects
- Effects That Apply Continuously
- Continuous Stat Modifiers
- Creation, Building, and Registration of an Effect Object
- Equip Spells and Equip Cards
- Field Spells
More guided lessons (3)
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 6466 indexed script(s).
- Search this function in the Script Explorer with
Effect.SetValue.
Script Examples
Salamandra with Chain (62091148)
Source: Scripts/c62091148.lua
lua
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(700)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)Artmage Non-Finito (74631897)
Source: Scripts/c74631897.lua
lua
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
e2:SetValue(s.splimit)
c:RegisterEffect(e2)
--summon processPendulum Evolution (55795155)
Source: Scripts/c55795155.lua
lua
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)