Commit e9c166cd authored by Koishi_Mint's avatar Koishi_Mint Committed by mercury233

fix linked zone summon trigger (#1051)

Fix issue against Burning Abyss monsters.
parent 577d03ea
...@@ -29,12 +29,15 @@ function c11674673.initial_effect(c) ...@@ -29,12 +29,15 @@ function c11674673.initial_effect(c)
e2:SetOperation(c11674673.spop) e2:SetOperation(c11674673.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c11674673.thcfilter(c,tp,lg) function c11674673.thcfilter(c,ec)
return c:IsControler(tp) and lg:IsContains(c) if c:IsLocation(LOCATION_MZONE) then
return ec:GetLinkedGroup():IsContains(c)
else
return bit.extract(ec:GetLinkedZone(c:GetPreviousControler()),c:GetPreviousSequence())~=0
end
end end
function c11674673.thcon(e,tp,eg,ep,ev,re,r,rp) function c11674673.thcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup() return eg:IsExists(c11674673.thcfilter,1,nil,e:GetHandler())
return eg:IsExists(c11674673.thcfilter,1,nil,tp,lg)
end end
function c11674673.cfilter(c) function c11674673.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost() return c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost()
......
...@@ -29,12 +29,16 @@ function c1948619.initial_effect(c) ...@@ -29,12 +29,16 @@ function c1948619.initial_effect(c)
e3:SetOperation(c1948619.spop) e3:SetOperation(c1948619.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c1948619.setcfilter(c,tp,lg) function c1948619.setcfilter(c,tp,ec)
return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0x8) and lg:IsContains(c) if c:IsLocation(LOCATION_MZONE) then
return c:IsSetCard(0x8) and c:IsFaceup() and c:IsControler(tp) and ec:GetLinkedGroup():IsContains(c)
else
return c:IsPreviousSetCard(0x8) and c:IsPreviousPosition(POS_FACEUP)
and c:GetPreviousControler()==tp and bit.extract(ec:GetLinkedZone(tp),c:GetPreviousSequence())~=0
end
end end
function c1948619.setcon(e,tp,eg,ep,ev,re,r,rp) function c1948619.setcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup() return eg:IsExists(c1948619.setcfilter,1,nil,tp,e:GetHandler())
return eg:IsExists(c1948619.setcfilter,1,nil,tp,lg)
end end
function c1948619.setfilter(c) function c1948619.setfilter(c)
return ((c:IsType(TYPE_SPELL) and c:IsSetCard(0x46)) or (c:IsType(TYPE_QUICKPLAY) and c:IsSetCard(0xa5))) and c:IsSSetable() return ((c:IsType(TYPE_SPELL) and c:IsSetCard(0x46)) or (c:IsType(TYPE_QUICKPLAY) and c:IsSetCard(0xa5))) and c:IsSSetable()
......
...@@ -80,13 +80,16 @@ function c22423493.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,13 +80,16 @@ function c22423493.disop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function c22423493.thcfilter(c,lg) function c22423493.thcfilter(c,ec)
return lg:IsContains(c) if c:IsLocation(LOCATION_MZONE) then
return ec:GetLinkedGroup():IsContains(c)
else
return bit.extract(ec:GetLinkedZone(c:GetPreviousControler()),c:GetPreviousSequence())~=0
end
end end
function c22423493.thcon(e,tp,eg,ep,ev,re,r,rp) function c22423493.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local lg=c:GetLinkedGroup() return not eg:IsContains(c) and eg:FilterCount(c22423493.thcfilter,nil,c)==2
return not eg:IsContains(c) and eg:FilterCount(c22423493.thcfilter,nil,lg)==2
end end
function c22423493.thfilter(c) function c22423493.thfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsLevelAbove(5) and c:IsAbleToHand() return c:IsRace(RACE_MACHINE) and c:IsLevelAbove(5) and c:IsAbleToHand()
......
...@@ -36,12 +36,16 @@ function c32448765.initial_effect(c) ...@@ -36,12 +36,16 @@ function c32448765.initial_effect(c)
e5:SetOperation(c32448765.atkop) e5:SetOperation(c32448765.atkop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
function c32448765.cfilter(c,g) function c32448765.cfilter(c,ec)
return c:IsSetCard(0xfb) and g:IsContains(c) if c:IsLocation(LOCATION_MZONE) then
return c:IsSetCard(0xfb) and c:IsFaceup() and ec:GetLinkedGroup():IsContains(c)
else
return c:IsPreviousSetCard(0xfb) and c:IsPreviousPosition(POS_FACEUP)
and bit.extract(ec:GetLinkedZone(c:GetPreviousControler()),c:GetPreviousSequence())~=0
end
end end
function c32448765.damcon(e,tp,eg,ep,ev,re,r,rp) function c32448765.damcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup() return eg:IsExists(c32448765.cfilter,1,nil,e:GetHandler())
return lg and eg:IsExists(c32448765.cfilter,1,nil,lg)
end end
function c32448765.damop(e,tp,eg,ep,ev,re,r,rp) function c32448765.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,32448765) Duel.Hint(HINT_CARD,0,32448765)
......
...@@ -26,12 +26,16 @@ function c51011872.initial_effect(c) ...@@ -26,12 +26,16 @@ function c51011872.initial_effect(c)
e3:SetOperation(c51011872.drop) e3:SetOperation(c51011872.drop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c51011872.cfilter(c,g) function c51011872.cfilter(c,ec)
return c:IsSetCard(0xfb) and g:IsContains(c) if c:IsLocation(LOCATION_MZONE) then
return c:IsSetCard(0xfb) and c:IsFaceup() and ec:GetLinkedGroup():IsContains(c)
else
return c:IsPreviousSetCard(0xfb) and c:IsPreviousPosition(POS_FACEUP)
and bit.extract(ec:GetLinkedZone(c:GetPreviousControler()),c:GetPreviousSequence())~=0
end
end end
function c51011872.reccon(e,tp,eg,ep,ev,re,r,rp) function c51011872.reccon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup() return eg:IsExists(c51011872.cfilter,1,nil,e:GetHandler())
return lg and eg:IsExists(c51011872.cfilter,1,nil,lg)
end end
function c51011872.recop(e,tp,eg,ep,ev,re,r,rp) function c51011872.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,51011872) Duel.Hint(HINT_CARD,0,51011872)
......
...@@ -17,14 +17,19 @@ function c53309998.initial_effect(c) ...@@ -17,14 +17,19 @@ function c53309998.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c53309998.cfilter(c,g) function c53309998.cfilter(c,zone)
return g:IsContains(c) local seq=c:GetSequence()
if c:IsLocation(LOCATION_MZONE) then
if c:IsControler(1) then seq=seq+16 end
else
seq=c:GetPreviousSequence()
if c:GetPreviousControler()==1 then seq=seq+16 end
end
return bit.extract(zone,seq)~=0
end end
function c53309998.spcon(e,tp,eg,ep,ev,re,r,rp) function c53309998.spcon(e,tp,eg,ep,ev,re,r,rp)
local lg1=Duel.GetLinkedGroup(tp,1,1) local zone=Duel.GetLinkedZone(0)+(Duel.GetLinkedZone(1)<<0x10)
local lg2=Duel.GetLinkedGroup(1-tp,1,1) return eg:IsExists(c53309998.cfilter,1,nil,zone)
lg1:Merge(lg2)
return lg1 and eg:IsExists(c53309998.cfilter,1,nil,lg1)
end end
function c53309998.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c53309998.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
...@@ -27,11 +27,16 @@ function c5821478.initial_effect(c) ...@@ -27,11 +27,16 @@ function c5821478.initial_effect(c)
end end
function c5821478.cfilter(c,zone) function c5821478.cfilter(c,zone)
local seq=c:GetSequence() local seq=c:GetSequence()
if c:IsControler(1) then seq=seq+16 end if c:IsLocation(LOCATION_MZONE) then
if c:IsControler(1) then seq=seq+16 end
else
seq=c:GetPreviousSequence()
if c:GetPreviousControler()==1 then seq=seq+16 end
end
return bit.extract(zone,seq)~=0 return bit.extract(zone,seq)~=0
end end
function c5821478.descon(e,tp,eg,ep,ev,re,r,rp) function c5821478.descon(e,tp,eg,ep,ev,re,r,rp)
local zone=Duel.GetLinkedZone(0)+Duel.GetLinkedZone(1)*0x10000 local zone=Duel.GetLinkedZone(0)+(Duel.GetLinkedZone(1)<<0x10)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c5821478.cfilter,1,nil,zone) return not eg:IsContains(e:GetHandler()) and eg:IsExists(c5821478.cfilter,1,nil,zone)
end end
function c5821478.desfilter(c) function c5821478.desfilter(c)
......
...@@ -19,7 +19,7 @@ function c72529749.cfilter(c,ec) ...@@ -19,7 +19,7 @@ function c72529749.cfilter(c,ec)
if c:IsLocation(LOCATION_MZONE) then if c:IsLocation(LOCATION_MZONE) then
return ec:GetLinkedGroup():IsContains(c) return ec:GetLinkedGroup():IsContains(c)
else else
return bit.band(ec:GetLinkedZone(c:GetPreviousControler()),bit.lshift(0x1,c:GetPreviousSequence()))~=0 return bit.extract(ec:GetLinkedZone(c:GetPreviousControler()),c:GetPreviousSequence())~=0
end end
end end
function c72529749.rmcon(e,tp,eg,ep,ev,re,r,rp) function c72529749.rmcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -72,12 +72,15 @@ function c74937659.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,12 +72,15 @@ function c74937659.tgop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function c74937659.cfilter(c,g) function c74937659.cfilter(c,ec)
return g:IsContains(c) if c:IsLocation(LOCATION_MZONE) then
return ec:GetLinkedGroup():IsContains(c)
else
return bit.extract(ec:GetLinkedZone(c:GetPreviousControler()),c:GetPreviousSequence())~=0
end
end end
function c74937659.thcon(e,tp,eg,ep,ev,re,r,rp) function c74937659.thcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup() return eg:IsExists(c74937659.cfilter,1,nil,e:GetHandler())
return lg and eg:IsExists(c74937659.cfilter,1,nil,lg)
end end
function c74937659.thfilter(c) function c74937659.thfilter(c)
return c:IsType(TYPE_FLIP) and c:IsAbleToHand() return c:IsType(TYPE_FLIP) and c:IsAbleToHand()
......
...@@ -37,7 +37,12 @@ function c94365540.condition(e,c) ...@@ -37,7 +37,12 @@ function c94365540.condition(e,c)
end end
function c94365540.cfilter(c,tp,zone) function c94365540.cfilter(c,tp,zone)
local seq=c:GetSequence() local seq=c:GetSequence()
if c:IsControler(tp) then seq=seq+16 end if c:IsLocation(LOCATION_MZONE) then
if c:IsControler(1-tp) then seq=seq+16 end
else
seq=c:GetPreviousSequence()
if c:GetPreviousControler()==1-tp then seq=seq+16 end
end
return bit.extract(zone,seq)~=0 return bit.extract(zone,seq)~=0
end end
function c94365540.lkfilter(c) function c94365540.lkfilter(c)
...@@ -47,7 +52,7 @@ function c94365540.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,7 +52,7 @@ function c94365540.spcon(e,tp,eg,ep,ev,re,r,rp)
local zone=0 local zone=0
local lg=Duel.GetMatchingGroup(c94365540.lkfilter,tp,0,LOCATION_MZONE,nil) local lg=Duel.GetMatchingGroup(c94365540.lkfilter,tp,0,LOCATION_MZONE,nil)
for tc in aux.Next(lg) do for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetLinkedZone()) zone=bit.bor(zone,tc:GetLinkedZone(tp))
end end
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c94365540.cfilter,1,nil,tp,zone) return not eg:IsContains(e:GetHandler()) and eg:IsExists(c94365540.cfilter,1,nil,tp,zone)
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