Commit 537e611a authored by nekrozar's avatar nekrozar Committed by DailyShana

fix Dark Artist (#676)

parent 4dd5a59f
......@@ -2,26 +2,19 @@
function c72520073.initial_effect(c)
--defdown
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(72520073,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_START)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c72520073.defcon)
e1:SetOperation(c72520073.defop)
e1:SetValue(c72520073.defval)
c:RegisterEffect(e1)
end
function c72520073.defcon(e,tp,eg,ep,ev,re,r,rp)
function c72520073.defcon(e)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c==Duel.GetAttackTarget() and bc:IsAttribute(ATTRIBUTE_LIGHT)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and c==Duel.GetAttackTarget() and bc:IsAttribute(ATTRIBUTE_LIGHT)
end
function c72520073.defop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENSE)
e1:SetValue(c:GetDefense()/2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e1)
end
function c72520073.defval(e,c)
return math.ceil(e:GetHandler():GetDefense()/2)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment