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