Commit 4bdf1675 authored by salix5's avatar salix5

Merge pull request #286 from mercury233/patch-1

temp fix for Ghostrick Socuteboss
parents eb602115 aa093009
...@@ -35,6 +35,9 @@ end ...@@ -35,6 +35,9 @@ 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)
...@@ -47,12 +50,15 @@ end ...@@ -47,12 +50,15 @@ 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 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)
...@@ -60,11 +66,27 @@ function c32224143.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,11 +66,27 @@ function c32224143.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c32224143.discon(e) function c32224143.discon(e)
if Duel.IsExistingMatchingCard(c32224143.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) then local need_reset=false
local g1=Duel.GetMatchingGroup(c32224143.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)
local g2=Duel.GetMatchingGroup(c32224143.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)
local og1=e:GetLabelObject():Clone()
local og2=e:GetLabelObject():Clone()
og1:Sub(g1)
g2:Sub(og2)
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