Commit c059d38a authored by wyykak's avatar wyykak

fix 21146

Signed-off-by: wyykak's avatarwyykak <wyy_1414@126.com>
parent 94a11e8f
Pipeline #39580 passed with stage
in 2 minutes and 45 seconds
--猛毒『毒蛾的黑暗演舞』 -- 猛毒『毒蛾的黑暗演舞』
function c21146.initial_effect(c) function c21146.initial_effect(c)
--Activate -- Activate
local e1=Effect.CreateEffect(c) local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE) e1:SetCategory(CATEGORY_REMOVE + CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
...@@ -12,53 +12,56 @@ function c21146.initial_effect(c) ...@@ -12,53 +12,56 @@ function c21146.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c21146.filter(c) function c21146.filter(c)
return (math.abs(c:GetAttack()-c:GetDefense())==200 or math.abs(c:GetAttack()-c:GetDefense())==2000) return (math.abs(c:GetAttack() - c:GetDefense()) == 200 or
and not c:IsType(TYPE_LINK) and c:IsReleasable() math.abs(c:GetAttack() - c:GetDefense()) == 2000) and
not c:IsType(TYPE_LINK) and c:IsReleasable()
end end
function c21146.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c21146.cost(e, tp, eg, ep, ev, re, r, rp, chk)
if chk==0 then local a, b, dot = DOT.DotCounter.Get(1 - tp)
local a,b,dot=DOT.DotCounter.Get(1-tp) local LO = 0x6
local LO=0x6 if dot > 0 then LO = 0x7 end
if dot>0 then LO=0x7 end if chk == 0 then
return Duel.IsExistingMatchingCard(c21146.filter,tp,LO,0,1,nil) end return Duel.IsExistingMatchingCard(c21146.filter, tp, LO, 0, 1, nil)
local g=Duel.SelectMatchingCard(tp,c21146.filter,tp,LO,0,1,1,nil) end
Duel.Release(g,REASON_COST) local g = Duel.SelectMatchingCard(tp, c21146.filter, tp, LO, 0, 1, 1, nil)
Duel.Release(g, REASON_COST)
end end
function c21146.target(e,tp,eg,ep,ev,re,r,rp,chk) function c21146.target(e, tp, eg, ep, ev, re, r, rp, chk)
if chk==0 then return true end if chk == 0 then return true end
end end
function c21146.activate(e,tp,eg,ep,ev,re,r,rp) function c21146.activate(e, tp, eg, ep, ev, re, r, rp)
local c=e:GetHandler() local c = e:GetHandler()
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler()) local g = Duel.SelectMatchingCard(tp, aux.TRUE, tp, 0, LOCATION_ONFIELD, 1,
if #g>0 then 1, e:GetHandler())
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT) if #g > 0 then
local e1=Effect.CreateEffect(c) Duel.Remove(g, POS_FACEDOWN, REASON_EFFECT)
local e1 = Effect.CreateEffect(c)
e1:SetLabel(0) e1:SetLabel(0)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
e1:SetCondition(c21146.damcon) e1:SetCondition(c21146.damcon)
e1:SetOperation(c21146.damop) e1:SetOperation(c21146.damop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_OPPO_TURN,4) e1:SetReset(RESET_PHASE + PHASE_STANDBY + RESET_OPPO_TURN, 4)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1, tp)
DOT.DotCounter.Add(nil,1-tp,0,300,1200,e) DOT.DotCounter.Add(nil, 1 - tp, 0, 300, 1200, e)
end end
end end
function c21146.damcon(e,tp,eg,ep,ev,re,r,rp) function c21146.damcon(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetTurnPlayer()~=tp return Duel.GetTurnPlayer() ~= tp
end end
function c21146.damop(e,tp,eg,ep,ev,re,r,rp) function c21146.damop(e, tp, eg, ep, ev, re, r, rp)
local c=e:GetHandler() local c = e:GetHandler()
local ct=e:GetLabel() local ct = e:GetLabel()
if(ct<4) then if (ct < 4) then
ct=ct+1 ct = ct + 1
e:SetLabel(ct) e:SetLabel(ct)
c:SetTurnCounter(ct) c:SetTurnCounter(ct)
Duel.Damage(1-tp,300,REASON_EFFECT) Duel.Damage(1 - tp, 300, REASON_EFFECT)
if ct==4 then if ct == 4 then
DOT.DotCounter.Add(nil,1-tp,0,-300,-300,e) DOT.DotCounter.Add(nil, 1 - tp, 0, -300, -300, e)
else else
DOT.DotCounter.Add(nil,1-tp,0,0,-300,e) DOT.DotCounter.Add(nil, 1 - tp, 0, 0, -300, e)
end end
end end
end 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