Commit c99e8d96 authored by DailyShana's avatar DailyShana

refine/temp fix

parent 5cd2d54d
...@@ -35,9 +35,6 @@ end ...@@ -35,9 +35,6 @@ end
function c32224143.filter(c,atk) function c32224143.filter(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk) and c:IsDestructable() return c:IsFaceup() and c:IsAttackBelow(atk) and c:IsDestructable()
end end
function c32224143.gfilter(c)
return not (c:GetSummonType()==SUMMON_TYPE_ADVANCE or c:GetSummonType()==SUMMON_TYPE_FUSION or c:GetSummonType()==SUMMON_TYPE_RITUAL or c:GetSummonType()==SUMMON_TYPE_SYNCHRO or c:GetSummonType()==SUMMON_TYPE_XYZ)
end
function c32224143.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c32224143.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local cg=Duel.GetMatchingGroup(c32224143.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local cg=Duel.GetMatchingGroup(c32224143.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local atk=cg:GetSum(Card.GetAttack) local atk=cg:GetSum(Card.GetAttack)
...@@ -50,43 +47,39 @@ end ...@@ -50,43 +47,39 @@ end
function c32224143.operation(e,tp,eg,ep,ev,re,r,rp) function c32224143.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local seq=tc:GetSequence() local seq=tc:GetSequence()
local g=Duel.GetMatchingGroup(c32224143.cfilter,tp,LOCATION_MZONE,0,nil)
g:KeepAlive()
if tc:IsControler(1-tp) then seq=seq+16 end if tc:IsControler(1-tp) then seq=seq+16 end
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Destroy(tc,REASON_EFFECT)~=0 then if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(c32224143.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
tc:RegisterFlagEffect(32224143,RESET_EVENT+0x5fe0000,0,1)
tc=g:GetNext()
end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE_FIELD) e1:SetCode(EFFECT_DISABLE_FIELD)
e1:SetLabel(seq) e1:SetLabel(seq)
e1:SetLabelObject(g)
e1:SetCondition(c32224143.discon) e1:SetCondition(c32224143.discon)
e1:SetOperation(c32224143.disop) e1:SetOperation(c32224143.disop)
e1:SetReset(0) e1:SetReset(0)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
end end
function c32224143.cfilter2(c)
return c32224143.cfilter(c) and c:GetFlagEffect(32224143)~=0
end
function c32224143.discon(e) function c32224143.discon(e)
local need_reset=false local g=Duel.GetMatchingGroup(c32224143.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)
local g1=Duel.GetMatchingGroup(c32224143.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil) if g:IsExists(c32224143.cfilter2,1,nil) then
local g2=Duel.GetMatchingGroup(c32224143.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil) local tc=g:GetFirst()
local og1=e:GetLabelObject():Clone() while tc do
local og2=e:GetLabelObject():Clone() tc:RegisterFlagEffect(32224143,RESET_EVENT+0x5fe0000,0,1)
og1:Sub(g1) tc=g:GetNext()
g2:Sub(og2) end
if g1:GetCount()==0 then
need_reset=true
elseif og1:Equal(og2) and g2:Filter(c32224143.gfilter,nil):GetCount()==0 then
need_reset=true
end
if need_reset then
e:Reset()
return false
else
local g=Duel.GetMatchingGroup(c32224143.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)
g:KeepAlive()
e:SetLabelObject(g)
return true return true
end end
e:Reset()
return false
end end
function c32224143.disop(e,tp) function c32224143.disop(e,tp)
return bit.lshift(0x1,e:GetLabel()) return bit.lshift(0x1,e:GetLabel())
......
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