Commit 52351481 authored by mercury233's avatar mercury233 Committed by GitHub

fix CONTAIN! (#3081)

parent eee95416
...@@ -22,11 +22,14 @@ end ...@@ -22,11 +22,14 @@ end
function s.checkfilter(c) function s.checkfilter(c)
return c:IsCode(37617348) and c:IsFaceup() return c:IsCode(37617348) and c:IsFaceup()
end end
function s.tgfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.NegateEffectMonsterFilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,s.tgfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
...@@ -39,24 +42,22 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,24 +42,22 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
if not tc:IsDisabled() then Duel.NegateRelatedChain(tc,RESET_TURN_SET)
Duel.NegateRelatedChain(tc,RESET_TURN_SET) local e2=Effect.CreateEffect(c)
local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE)
e2:SetCode(EFFECT_DISABLE) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2)
tc:RegisterEffect(e2) local e3=e2:Clone()
local e3=e2:Clone() e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetCode(EFFECT_DISABLE_EFFECT) e3:SetValue(RESET_TURN_SET)
e3:SetValue(RESET_TURN_SET) tc:RegisterEffect(e3)
tc:RegisterEffect(e3) if tc:IsType(TYPE_TRAPMONSTER) then
if tc:IsType(TYPE_TRAPMONSTER) then local e4=e2:Clone()
local e4=e2:Clone() e4:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e4:SetCode(EFFECT_DISABLE_TRAPMONSTER) tc:RegisterEffect(e4)
tc:RegisterEffect(e4)
end
Duel.AdjustInstantly()
end end
Duel.AdjustInstantly()
if check and not tc:IsImmuneToEffect(e) then if check and not tc:IsImmuneToEffect(e) then
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE) e5:SetType(EFFECT_TYPE_SINGLE)
......
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