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)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
-- Activate
local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE + CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
......@@ -12,53 +12,56 @@ function c21146.initial_effect(c)
c:RegisterEffect(e1)
end
function c21146.filter(c)
return (math.abs(c:GetAttack()-c:GetDefense())==200 or math.abs(c:GetAttack()-c:GetDefense())==2000)
and not c:IsType(TYPE_LINK) and c:IsReleasable()
return (math.abs(c:GetAttack() - c:GetDefense()) == 200 or
math.abs(c:GetAttack() - c:GetDefense()) == 2000) and
not c:IsType(TYPE_LINK) and c:IsReleasable()
end
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 LO=0x6
if dot>0 then LO=0x7 end
return Duel.IsExistingMatchingCard(c21146.filter,tp,LO,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c21146.filter,tp,LO,0,1,1,nil)
Duel.Release(g,REASON_COST)
function c21146.cost(e, tp, eg, ep, ev, re, r, rp, chk)
local a, b, dot = DOT.DotCounter.Get(1 - tp)
local LO = 0x6
if dot > 0 then LO = 0x7 end
if chk == 0 then
return Duel.IsExistingMatchingCard(c21146.filter, tp, LO, 0, 1, nil)
end
local g = Duel.SelectMatchingCard(tp, c21146.filter, tp, LO, 0, 1, 1, nil)
Duel.Release(g, REASON_COST)
end
function c21146.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
function c21146.target(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then return true end
end
function c21146.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler())
if #g>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
local e1=Effect.CreateEffect(c)
function c21146.activate(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local g = Duel.SelectMatchingCard(tp, aux.TRUE, tp, 0, LOCATION_ONFIELD, 1,
1, e:GetHandler())
if #g > 0 then
Duel.Remove(g, POS_FACEDOWN, REASON_EFFECT)
local e1 = Effect.CreateEffect(c)
e1:SetLabel(0)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e1:SetCountLimit(1)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
e1:SetCondition(c21146.damcon)
e1:SetOperation(c21146.damop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_OPPO_TURN,4)
Duel.RegisterEffect(e1,tp)
DOT.DotCounter.Add(nil,1-tp,0,300,1200,e)
e1:SetReset(RESET_PHASE + PHASE_STANDBY + RESET_OPPO_TURN, 4)
Duel.RegisterEffect(e1, tp)
DOT.DotCounter.Add(nil, 1 - tp, 0, 300, 1200, e)
end
end
function c21146.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
function c21146.damcon(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetTurnPlayer() ~= tp
end
function c21146.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
if(ct<4) then
ct=ct+1
function c21146.damop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local ct = e:GetLabel()
if (ct < 4) then
ct = ct + 1
e:SetLabel(ct)
c:SetTurnCounter(ct)
Duel.Damage(1-tp,300,REASON_EFFECT)
if ct==4 then
DOT.DotCounter.Add(nil,1-tp,0,-300,-300,e)
Duel.Damage(1 - tp, 300, REASON_EFFECT)
if ct == 4 then
DOT.DotCounter.Add(nil, 1 - tp, 0, -300, -300, e)
else
DOT.DotCounter.Add(nil,1-tp,0,0,-300,e)
DOT.DotCounter.Add(nil, 1 - tp, 0, 0, -300, e)
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