Commit d6d2cde4 authored by salix5's avatar salix5

fix

use GetSummonLocation() in filter function
parent 75d3ebc9
...@@ -10,7 +10,7 @@ function c2055403.initial_effect(c) ...@@ -10,7 +10,7 @@ function c2055403.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c2055403.filter(c,tp) function c2055403.filter(c,tp)
return c:GetSummonPlayer()~=tp and c:IsPreviousLocation(LOCATION_HAND+LOCATION_EXTRA) and c:IsAbleToDeck() return c:GetSummonPlayer()~=tp and bit.band(c:GetSummonLocation(),LOCATION_HAND+LOCATION_EXTRA)~=0 and c:IsAbleToDeck()
end end
function c2055403.target(e,tp,eg,ep,ev,re,r,rp,chk) function c2055403.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(c2055403.filter,nil,tp) local g=eg:Filter(c2055403.filter,nil,tp)
......
...@@ -5,37 +5,21 @@ function c26257572.initial_effect(c) ...@@ -5,37 +5,21 @@ function c26257572.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--reg --disable
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EFFECT_CANNOT_TRIGGER)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c26257572.regop) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c26257572.target)
c:RegisterEffect(e2) c:RegisterEffect(e2)
-- local e3=e2:Clone()
local e3=Effect.CreateEffect(c) e3:SetCode(EFFECT_DISABLE)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c26257572.target)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=e3:Clone() local e4=e2:Clone()
e4:SetCode(EFFECT_DISABLE) e4:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
c:RegisterEffect(e5)
end
function c26257572.regop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsPreviousLocation(LOCATION_DECK) then
tc:RegisterFlagEffect(26257572,RESET_EVENT+0x16e0000,0,1)
end
tc=eg:GetNext()
end
end end
function c26257572.target(e,c) function c26257572.target(e,c)
return c:GetFlagEffect(26257572)~=0 return c:GetSummonLocation()==LOCATION_DECK
end end
...@@ -53,8 +53,7 @@ function c26674724.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,8 +53,7 @@ function c26674724.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c26674724.tdfilter(c) function c26674724.tdfilter(c)
return c:IsPreviousLocation(LOCATION_EXTRA) return c:GetSummonLocation()==LOCATION_EXTRA and c:IsAbleToDeck()
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL and c:IsAbleToDeck()
end end
function c26674724.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c26674724.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c26674724.tdfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c26674724.tdfilter(chkc) end
......
...@@ -20,7 +20,7 @@ function c37675138.initial_effect(c) ...@@ -20,7 +20,7 @@ function c37675138.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c37675138.descon(e,tp,eg,ep,ev,re,r,rp) function c37675138.descon(e,tp,eg,ep,ev,re,r,rp)
return re:GetOwner():IsRace(RACE_ZOMBIE) and e:GetHandler():IsPreviousLocation(LOCATION_GRAVE) return re:GetOwner():IsRace(RACE_ZOMBIE) and e:GetHandler():GetSummonLocation()==LOCATION_GRAVE
and e:GetHandler():GetPreviousControler()==tp and e:GetHandler():GetPreviousControler()==tp
end end
function c37675138.desfilter(c) function c37675138.desfilter(c)
......
...@@ -9,23 +9,6 @@ function c44394295.initial_effect(c) ...@@ -9,23 +9,6 @@ function c44394295.initial_effect(c)
e1:SetTarget(c44394295.target) e1:SetTarget(c44394295.target)
e1:SetOperation(c44394295.activate) e1:SetOperation(c44394295.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if not c44394295.global_check then
c44394295.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c44394295.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c44394295.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsPreviousLocation(LOCATION_EXTRA) then
tc:RegisterFlagEffect(44394295,RESET_EVENT+0x46e0000,0,0)
end
tc=eg:GetNext()
end
end end
function c44394295.filter1(c,e) function c44394295.filter1(c,e)
return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
...@@ -36,7 +19,7 @@ function c44394295.filter2(c,e,tp,m,f,chkf) ...@@ -36,7 +19,7 @@ function c44394295.filter2(c,e,tp,m,f,chkf)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c44394295.cfilter(c) function c44394295.cfilter(c)
return c:GetFlagEffect(44394295)~=0 return c:GetSummonLocation()==LOCATION_EXTRA
end end
function c44394295.target(e,tp,eg,ep,ev,re,r,rp,chk) function c44394295.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
......
...@@ -60,8 +60,7 @@ function c52846880.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,8 +60,7 @@ function c52846880.condition(e,tp,eg,ep,ev,re,r,rp)
local bc=Duel.GetAttackTarget() local bc=Duel.GetAttackTarget()
if not bc then return false end if not bc then return false end
if tc:IsControler(1-tp) then tc,bc=bc,tc end if tc:IsControler(1-tp) then tc,bc=bc,tc end
if tc:IsSetCard(0xb4) and bc:IsPreviousLocation(LOCATION_EXTRA) if tc:IsSetCard(0xb4) and bc:GetSummonLocation()==LOCATION_EXTRA then
and bit.band(bc:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL then
e:SetLabelObject(bc) e:SetLabelObject(bc)
return true return true
else return false end else return false end
......
...@@ -49,7 +49,7 @@ function c66762372.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,7 +49,7 @@ function c66762372.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c66762372.cfilter(c,tp) function c66762372.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x79) and c:IsPreviousLocation(LOCATION_EXTRA) and c:GetPreviousControler()==tp return c:IsFaceup() and c:IsSetCard(0x79) and c:GetSummonLocation()==LOCATION_EXTRA and c:GetPreviousControler()==tp
end end
function c66762372.setcon(e,tp,eg,ep,ev,re,r,rp) function c66762372.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c66762372.cfilter,1,nil,tp) return eg:IsExists(c66762372.cfilter,1,nil,tp)
......
...@@ -22,12 +22,12 @@ end ...@@ -22,12 +22,12 @@ end
function c88724332.target(e,c) function c88724332.target(e,c)
return c:IsPosition(POS_FACEUP_ATTACK) and not c:IsRace(RACE_WYRM) return c:IsPosition(POS_FACEUP_ATTACK) and not c:IsRace(RACE_WYRM)
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
and c:IsPreviousLocation(LOCATION_DECK+LOCATION_EXTRA) and bit.band(c:GetSummonLocation(),LOCATION_DECK+LOCATION_EXTRA)~=0
end end
function c88724332.deftg(e,c) function c88724332.deftg(e,c)
return c:IsFaceup() and not c:IsRace(RACE_WYRM) return c:IsFaceup() and not c:IsRace(RACE_WYRM)
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
and c:IsPreviousLocation(LOCATION_DECK+LOCATION_EXTRA) and bit.band(c:GetSummonLocation(),LOCATION_DECK+LOCATION_EXTRA)~=0
end end
function c88724332.defval(e,c) function c88724332.defval(e,c)
return -c:GetBaseDefence() return -c:GetBaseDefence()
......
...@@ -50,6 +50,5 @@ function c89463537.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,6 +50,5 @@ function c89463537.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c89463537.distg(e,c) function c89463537.distg(e,c)
return c:IsPreviousLocation(LOCATION_EXTRA) return c:GetSummonLocation()==LOCATION_EXTRA
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end end
...@@ -16,5 +16,5 @@ function c91468551.initial_effect(c) ...@@ -16,5 +16,5 @@ function c91468551.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c91468551.atktg(e,c) function c91468551.atktg(e,c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)~=0 and c:IsPreviousLocation(LOCATION_GRAVE) return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)~=0 and c:GetSummonLocation()==LOCATION_GRAVE
end end
...@@ -57,8 +57,7 @@ function c99185129.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,8 +57,7 @@ function c99185129.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end end
function c99185129.filter(c) function c99185129.filter(c)
return c:IsPreviousLocation(LOCATION_EXTRA) return c:GetSummonLocation()==LOCATION_EXTRA and not (c:GetAttack()==0 and c:IsDisabled())
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end end
function c99185129.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c99185129.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c99185129.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c99185129.filter(chkc) end
......
...@@ -13,8 +13,7 @@ function c99311109.initial_effect(c) ...@@ -13,8 +13,7 @@ function c99311109.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c99311109.cfilter(c) function c99311109.cfilter(c)
return c:IsPreviousLocation(LOCATION_EXTRA) return c:GetFlagEffect(LOCATION_EXTRA)~=0
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end end
function c99311109.condition(e,tp,eg,ep,ev,re,r,rp) function c99311109.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c99311109.cfilter,tp,LOCATION_MZONE,0,1,nil) return not Duel.IsExistingMatchingCard(c99311109.cfilter,tp,LOCATION_MZONE,0,1,nil)
...@@ -30,8 +29,7 @@ function c99311109.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,8 +29,7 @@ function c99311109.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c99311109.filter(c) function c99311109.filter(c)
return c:IsFaceup() and c:IsPreviousLocation(LOCATION_EXTRA) and c:IsControlerCanBeChanged() return c:IsFaceup() and c:IsControlerCanBeChanged() and c:GetSummonLocation()==LOCATION_EXTRA
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end end
function c99311109.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c99311109.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 c99311109.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c99311109.filter(chkc) 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