Commit 967a2fe8 authored by dest's avatar dest Committed by nanahira

fix rp check (#1062)

parent a495d045
......@@ -11,7 +11,7 @@ function c10069180.initial_effect(c)
c:RegisterEffect(e1)
end
function c10069180.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetActiveType()==TYPE_SPELL+TYPE_CONTINUOUS and Duel.IsChainNegatable(ev)
return rp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetActiveType()==TYPE_SPELL+TYPE_CONTINUOUS and Duel.IsChainNegatable(ev)
end
function c10069180.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -41,7 +41,7 @@ function c10248389.atkval(e,c)
return c:GetAttack()*2
end
function c10248389.disop(e,tp,eg,ep,ev,re,r,rp)
if rp~=tp then
if rp==1-tp then
Duel.NegateEffect(ev)
end
end
......@@ -13,7 +13,7 @@ function c10489311.initial_effect(c)
end
function c10489311.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,0x41)==0x41 and rp~=tp and c:GetPreviousControler()==tp
return bit.band(r,0x41)==0x41 and rp==1-tp and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c10489311.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -17,7 +17,7 @@ function c10813327.initial_effect(c)
end
function c10813327.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp~=tp and c:GetPreviousControler()==tp
return c:IsReason(REASON_EFFECT) and rp==1-tp and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c10813327.spfilter(c,e,tp)
......
......@@ -19,7 +19,7 @@ function c11074235.initial_effect(c)
end
function c11074235.cfilter(c,tp)
return bit.band(c:GetPreviousTypeOnField(),TYPE_SPELL+TYPE_TRAP)~=0 and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp
and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp
end
function c11074235.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c11074235.cfilter,1,nil,tp)
......
......@@ -55,7 +55,7 @@ function c11851647.lvop(e,tp,eg,ep,ev,re,r,rp)
end
function c11851647.reccon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:GetPreviousControler()==tp and bit.band(r,REASON_DESTROY)~=0 and c:IsPreviousLocation(LOCATION_ONFIELD)
return rp==1-tp and c:GetPreviousControler()==tp and bit.band(r,REASON_DESTROY)~=0 and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c11851647.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -24,7 +24,7 @@ function c11868731.initial_effect(c)
c:RegisterEffect(e3)
end
function c11868731.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()~=tp
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()==1-tp
and e:GetHandler():GetPreviousControler()==tp
end
function c11868731.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -13,7 +13,7 @@ function c12160911.initial_effect(c)
c:RegisterEffect(e1)
end
function c12160911.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND) and rp~=tp and bit.band(r,REASON_EFFECT)==REASON_EFFECT
return e:GetHandler():IsPreviousLocation(LOCATION_HAND) and rp==1-tp and bit.band(r,REASON_EFFECT)==REASON_EFFECT
end
function c12160911.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -51,7 +51,7 @@ function c12444060.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c12444060.descon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and e:GetHandler():GetPreviousControler()==tp
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function c12444060.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
......
......@@ -21,7 +21,7 @@ function c12980373.initial_effect(c)
c:RegisterEffect(e2)
end
function c12980373.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()~=tp
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()==1-tp
and e:GetHandler():GetPreviousControler()==tp
end
function c12980373.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -14,7 +14,7 @@ function c13026402.initial_effect(c)
c:RegisterEffect(e1)
end
function c13026402.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp~=tp
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp
and re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c13026402.cost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -14,7 +14,7 @@ function c13166204.filter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x54)
end
function c13166204.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and eg:IsExists(c13166204.filter,1,nil,tp) and Duel.IsChainDisablable(ev)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and eg:IsExists(c13166204.filter,1,nil,tp) and Duel.IsChainDisablable(ev)
end
function c13166204.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -31,7 +31,7 @@ function c1344018.initial_effect(c)
c:RegisterEffect(e3)
end
function c1344018.evalue(e,re,rp)
return re:IsActiveType(TYPE_TRAP) and rp~=e:GetHandlerPlayer()
return re:IsActiveType(TYPE_TRAP) and rp==1-e:GetHandlerPlayer()
end
function c1344018.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0x98) and c:IsType(TYPE_PENDULUM)
......
......@@ -20,7 +20,7 @@ function c13758665.cfilter(c)
end
function c13758665.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c13758665.cfilter,tp,LOCATION_MZONE,0,1,nil)
and rp~=tp and re:IsActiveType(TYPE_TRAP) and Duel.IsChainDisablable(ev)
and rp==1-tp and re:IsActiveType(TYPE_TRAP) and Duel.IsChainDisablable(ev)
end
function c13758665.negop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
......
......@@ -15,7 +15,7 @@ function c13995824.initial_effect(c)
c:RegisterEffect(e1)
end
function c13995824.ddcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and e:GetHandler():GetPreviousControler()==tp
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function c13995824.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -39,7 +39,7 @@ function c14017402.splimit(e,se,sp,st)
return true
end
function c14017402.refcon(e,re,val,r,rp,rc)
return bit.band(r,REASON_EFFECT)~=0 and rp~=e:GetHandler():GetControler() and e:GetHandler():IsAttackPos()
return bit.band(r,REASON_EFFECT)~=0 and rp==1-e:GetHandler():GetControler() and e:GetHandler():IsAttackPos()
end
function c14017402.ffilter(c)
return c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_SYNCHRO)
......
......@@ -20,7 +20,7 @@ function c14152862.initial_effect(c)
end
function c14152862.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
return rp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c14152862.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
......
......@@ -30,7 +30,7 @@ end
function c14730606.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY) and rp~=tp
and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY) and rp==1-tp
end
function c14730606.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -91,7 +91,7 @@ function c15180041.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c15180041.spcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp))
return (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp))
and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c15180041.filter(c,e,tp)
......
......@@ -45,7 +45,7 @@ function c15256925.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c15256925.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) and rp~=tp
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) and rp==1-tp
end
function c15256925.spfilter(c,e,tp)
return c:IsCode(30208479,40737112) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
......
......@@ -14,7 +14,7 @@ function c15294090.cfilter(c,tp)
return c:IsPreviousSetCard(0xc008) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c15294090.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and rp~=tp and eg:IsExists(c15294090.cfilter,1,nil,tp)
return bit.band(r,REASON_EFFECT)~=0 and rp==1-tp and eg:IsExists(c15294090.cfilter,1,nil,tp)
end
function c15294090.spfilter(c,e,tp)
return c:IsReason(REASON_DESTROY) and c:GetTurnID()==Duel.GetTurnCount() and c:IsSetCard(0xc008)
......
......@@ -20,7 +20,7 @@ end
function c15667446.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c15667446.atfilter(chkc) end
if chk==0 then return true end
if rp~=tp and tp==e:GetLabel() then
if rp==1-tp and tp==e:GetLabel() then
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
......
......@@ -24,7 +24,7 @@ function c1580833.initial_effect(c)
end
function c1580833.filter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) and c:IsSetCard(0xd8)
and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp)) and not c:IsReason(REASON_REPLACE)
and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)) and not c:IsReason(REASON_REPLACE)
end
function c1580833.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -66,7 +66,7 @@ function c1621413.atkop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c1621413.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,16195942)
end
function c1621413.distg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -11,7 +11,7 @@ function c1637760.initial_effect(c)
c:RegisterEffect(e1)
end
function c1637760.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and Duel.GetTurnPlayer()~=tp and rp~=tp
return Duel.GetCurrentChain()==0 and Duel.GetTurnPlayer()~=tp and rp==1-tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c1637760.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -39,7 +39,7 @@ function c1644289.eqlimit(e,c)
return c:IsSetCard(0x30)
end
function c1644289.tglimit(e,re,rp)
return rp~=e:GetHandlerPlayer() and re:IsActiveType(TYPE_TRAP+TYPE_MONSTER)
return rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_TRAP+TYPE_MONSTER)
end
function c1644289.filter(c)
return c:IsFaceup() and c:IsSetCard(0x30)
......
......@@ -99,7 +99,7 @@ function c16898077.damop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c16898077.damcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and rp~=tp
return Duel.GetTurnPlayer()~=tp and rp==1-tp
end
function c16898077.damtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -114,7 +114,7 @@ function c16898077.damop2(e,tp,eg,ep,ev,re,r,rp)
end
end
function c16898077.damcon3(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and rp~=tp
return Duel.GetTurnPlayer()~=tp and rp==1-tp
end
function c16898077.sfilter(c,e)
return c:IsFacedown() and (not e or c:IsRelateToEffect(e))
......
......@@ -11,7 +11,7 @@ function c16970158.initial_effect(c)
c:RegisterEffect(e1)
end
function c16970158.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(83764718) and Duel.IsChainDisablable(ev)
return rp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(83764718) and Duel.IsChainDisablable(ev)
end
function c16970158.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -95,7 +95,7 @@ end
function c17016362.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_BATTLE)
or (rp~=tp and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp)
or (rp==1-tp and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp)
end
function c17016362.spfilter(c,e,tp)
return c:IsSetCard(0xc6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -25,7 +25,7 @@ function c17475251.initial_effect(c)
c:RegisterEffect(e3)
end
function c17475251.setcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and e:GetHandler():GetPreviousControler()==tp
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function c17475251.filter(c)
return c:IsSetCard(0x7c) and c:IsType(TYPE_SPELL) and c:IsSSetable()
......
......@@ -13,7 +13,7 @@ function c17988746.initial_effect(c)
c:RegisterEffect(e1)
end
function c17988746.condition(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and tp~=rp and Duel.GetAttacker():IsControler(1-tp)
return ep==tp and 1-tp==rp and Duel.GetAttacker():IsControler(1-tp)
end
function c17988746.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -33,7 +33,7 @@ function c18252559.activate(e,tp,eg,ep,ev,re,r,rp)
end
function c18252559.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:IsReason(REASON_DESTROY)
return rp==1-tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
end
function c18252559.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -62,7 +62,7 @@ function c18386170.drop(e,tp,eg,ep,ev,re,r,rp)
end
function c18386170.hdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (rp~=tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)) or c:IsReason(REASON_BATTLE)
return (rp==1-tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)) or c:IsReason(REASON_BATTLE)
end
function c18386170.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
......
......@@ -67,7 +67,7 @@ function c19502505.negop(e,tp,eg,ep,ev,re,r,rp)
end
function c19502505.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp))
return (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp))
and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c19502505.thfilter(c)
......
......@@ -51,7 +51,7 @@ function c19596712.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c19596712.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_SZONE
return rp==1-tp and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_SZONE
and re:IsActiveType(TYPE_TRAP) and Duel.IsChainDisablable(ev)
end
function c19596712.negop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -37,7 +37,7 @@ function c19801646.econ(e)
end
function c19801646.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (c:GetReasonPlayer()~=tp and c:IsReason(REASON_EFFECT)))
return (c:IsReason(REASON_BATTLE) or (c:GetReasonPlayer()==1-tp and c:IsReason(REASON_EFFECT)))
and c:IsPreviousPosition(POS_FACEUP) and not c:IsLocation(LOCATION_DECK)
end
function c19801646.thfilter(c)
......
......@@ -13,7 +13,7 @@ function c20721759.initial_effect(c)
end
function c20721759.condition(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
return rp~=tp and eg:GetCount()==1 and ec:IsPreviousLocation(LOCATION_MZONE) and ec:GetPreviousControler()==tp
return rp==1-tp and eg:GetCount()==1 and ec:IsPreviousLocation(LOCATION_MZONE) and ec:GetPreviousControler()==tp
and ec:IsReason(REASON_DESTROY) and ec:IsReason(REASON_EFFECT)
end
function c20721759.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -47,7 +47,7 @@ function c20747792.spfilter(c,e,tp)
return c:IsSetCard(0x20a2) and not c:IsCode(20747792) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c20747792.spcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler()) and rp~=tp
return eg:IsContains(e:GetHandler()) and rp==1-tp
end
function c20747792.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler()) and Duel.GetAttacker():IsControler(1-tp)
......
......@@ -44,7 +44,7 @@ function c20951752.chop1(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(0)
end
function c20951752.chop2(e,tp,eg,ep,ev,re,r,rp)
if rp~=tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:IsActiveType(TYPE_COUNTER) then return end
if rp==1-tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:IsActiveType(TYPE_COUNTER) then return end
e:GetLabelObject():SetLabel(1)
end
function c20951752.sumcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -55,7 +55,7 @@ function c21123811.initial_effect(c)
c:RegisterEffect(e6)
end
function c21123811.discon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c21123811.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -45,7 +45,7 @@ function c21250202.regfilter(c,tp)
and c:IsType(TYPE_PENDULUM) and c:IsFaceup() and c:IsSetCard(0x99)
end
function c21250202.regop1(e,tp,eg,ep,ev,re,r,rp)
if rp~=tp and eg:GetCount()==1 and eg:IsExists(c21250202.regfilter,1,nil,tp) then
if rp==1-tp and eg:GetCount()==1 and eg:IsExists(c21250202.regfilter,1,nil,tp) then
e:GetHandler():RegisterFlagEffect(21250202,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1,ev)
end
end
......
......@@ -25,7 +25,7 @@ function c21313376.initial_effect(c)
end
c21313376.xyz_number=14
function c21313376.refcon(e,re,val,r,rp,rc)
return bit.band(r,REASON_EFFECT)~=0 and rp~=e:GetHandlerPlayer()
return bit.band(r,REASON_EFFECT)~=0 and rp==1-e:GetHandlerPlayer()
end
function c21313376.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
......
......@@ -23,7 +23,7 @@ function c22499034.initial_effect(c)
c:RegisterEffect(e2)
end
function c22499034.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE) and rp~=tp
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE) and rp==1-tp
end
function c22499034.thfilter(c,tp)
return c:IsSetCard(0xf9) and c:GetType()==0x20002
......
......@@ -11,7 +11,7 @@ function c22747316.initial_effect(c)
c:RegisterEffect(e1)
end
function c22747316.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
return rp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,re:GetHandler():GetCode())
end
function c22747316.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -37,7 +37,7 @@ function c22804410.initial_effect(c)
end
function c22804410.spfilter(c,tp)
return c:IsPreviousSetCard(0xdd) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c22804410.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c22804410.spfilter,1,nil,tp)
......
......@@ -17,7 +17,7 @@ function c23002292.initial_effect(c)
c:RegisterEffect(e2)
end
function c23002292.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE)
return rp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and re:IsActiveType(TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c23002292.cost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -15,7 +15,7 @@ function c23051413.initial_effect(c)
c:RegisterEffect(e1)
end
function c23051413.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and e:GetHandler()==Duel.GetAttacker()
return rp==1-tp and e:GetHandler()==Duel.GetAttacker()
end
function c23051413.filter(c,e,tp)
return c:IsSetCard(0x2a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -12,7 +12,7 @@ function c23327298.initial_effect(c)
end
function c23327298.cfilter(c,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
and c:IsControler(tp) and c:GetPreviousControler()==tp and c:GetReasonPlayer()~=tp
and c:IsControler(tp) and c:GetPreviousControler()==tp and c:GetReasonPlayer()==1-tp
end
function c23327298.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c23327298.cfilter,1,nil,tp)
......
......@@ -70,7 +70,7 @@ function c23545031.thop(e,tp,eg,ep,ev,re,r,rp)
end
function c23545031.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:GetPreviousControler()==tp
return rp==1-tp and c:GetPreviousControler()==tp
and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp)))
end
function c23545031.spcfilter(c)
......
......@@ -78,7 +78,7 @@ function c24731391.thfilter(c)
end
function c24731391.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp~=tp and c:GetPreviousControler()==tp
return c:IsReason(REASON_EFFECT) and rp==1-tp and c:GetPreviousControler()==tp
end
function c24731391.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c24731391.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -61,7 +61,7 @@ function c24845628.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c24845628.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return re and rp~=tp and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
return re and rp==1-tp and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c24845628.filter(c)
return c:IsSetCard(0x80) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
......
......@@ -56,7 +56,7 @@ function c25700114.activate(e,tp,eg,ep,ev,re,r,rp)
end
function c25700114.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and bit.band(r,0x41)==0x41 and c:GetPreviousControler()==tp
return rp==1-tp and bit.band(r,0x41)==0x41 and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c25700114.filter(c)
......
......@@ -13,7 +13,7 @@ end
function c2584136.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and rp~=tp
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and rp==1-tp
and bc:IsFaceup() and bc:IsRelateToBattle()
end
function c2584136.eqlimit(e,c)
......
......@@ -22,7 +22,7 @@ function c26016357.initial_effect(c)
c:RegisterEffect(e2)
end
function c26016357.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()~=tp
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()==1-tp
and e:GetHandler():GetPreviousControler()==tp
end
function c26016357.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -47,7 +47,7 @@ function c26077387.spop1(e,tp,eg,ep,ev,re,r,rp)
end
function c26077387.cfilter(c,tp,rp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and bit.band(c:GetPreviousTypeOnField(),TYPE_LINK)~=0
and c:IsPreviousSetCard(0x1115) and (c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT)))
and c:IsPreviousSetCard(0x1115) and (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT)))
end
function c26077387.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c26077387.cfilter,1,nil,tp,rp)
......
......@@ -49,7 +49,7 @@ function c26268488.indct(e,re,r,rp)
else return 0 end
end
function c26268488.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
end
function c26268488.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -69,7 +69,7 @@ end
function c2648201.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and c:GetPreviousControler()==tp and ec:IsReason(REASON_DESTROY) and ec:GetReasonPlayer()~=tp
return c:IsReason(REASON_LOST_TARGET) and c:GetPreviousControler()==tp and ec:IsReason(REASON_DESTROY) and ec:GetReasonPlayer()==1-tp
end
function c2648201.spfilter(c,e,tp)
return c:IsSetCard(0x107f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -39,7 +39,7 @@ function c26533075.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c26533075.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_DESTROY)~=0 and rp~=tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
return bit.band(r,REASON_DESTROY)~=0 and rp==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
and e:GetHandler():IsPreviousPosition(POS_FACEDOWN)
end
......
......@@ -24,7 +24,7 @@ function c26570480.initial_effect(c)
c:RegisterEffect(e2)
end
function c26570480.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()~=tp
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()==1-tp
and e:GetHandler():GetPreviousControler()==tp
end
function c26570480.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -63,7 +63,7 @@ function c26949946.indtg(e,c)
return c:IsSetCard(0x101b) and c~=e:GetHandler()
end
function c26949946.setcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and e:GetHandler():GetPreviousControler()==tp
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function c26949946.filter(c)
return c:GetType()==TYPE_SPELL+TYPE_QUICKPLAY and c:IsSSetable()
......
......@@ -74,7 +74,7 @@ function c27354732.acop(e,tp,eg,ep,ev,re,r,rp)
end
function c27354732.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c27354732.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x1,2,REASON_COST) end
......
......@@ -12,5 +12,5 @@ function c27527047.initial_effect(c)
c:RegisterEffect(e1)
end
function c27527047.tgval(e,re,rp)
return rp~=e:GetHandlerPlayer() and re:IsActiveType(TYPE_MONSTER)
return rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_MONSTER)
end
......@@ -51,7 +51,7 @@ function c28139785.ddop(e,tp,eg,ep,ev,re,r,rp)
end
function c28139785.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetPreviousControler()==tp and rp~=tp and c:IsReason(REASON_DESTROY)
return c:GetPreviousControler()==tp and rp==1-tp and c:IsReason(REASON_DESTROY)
end
function c28139785.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:GetLevel()>0 and c:IsAbleToHand()
......
......@@ -88,7 +88,7 @@ function c2819435.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c2819435.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_TOKEN) and e:GetHandler():GetFlagEffect(1)>0
return rp==1-tp and not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_TOKEN) and e:GetHandler():GetFlagEffect(1)>0
end
function c2819435.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -18,7 +18,7 @@ function c28486799.initial_effect(c)
c:RegisterEffect(e2)
end
function c28486799.drcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and rp~=tp and ev>=1000
return ep==tp and rp==1-tp and ev>=1000
and (re or (Duel.GetAttacker() and Duel.GetAttacker():IsControler(1-tp)))
end
function c28486799.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -21,7 +21,7 @@ function c29143726.initial_effect(c)
c:RegisterEffect(e2)
end
function c29143726.spcon1(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and bit.band(r,REASON_EFFECT)~=0 and e:GetHandler():GetPreviousControler()==tp
return rp==1-tp and bit.band(r,REASON_EFFECT)~=0 and e:GetHandler():GetPreviousControler()==tp
and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c29143726.spcon2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -65,7 +65,7 @@ function c29223325.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c29223325.descon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and e:GetHandler():GetPreviousControler()==tp
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function c29223325.desop(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
......
......@@ -48,7 +48,7 @@ function c2930675.cfilter(c,seq2)
end
function c2930675.discon(e,tp,eg,ep,ev,re,r,rp)
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
return rp~=tp and re:IsActiveType(TYPE_TRAP) and loc==LOCATION_SZONE
return rp==1-tp and re:IsActiveType(TYPE_TRAP) and loc==LOCATION_SZONE
and Duel.IsExistingMatchingCard(c2930675.cfilter,tp,LOCATION_MZONE,0,1,nil,seq)
end
function c2930675.disop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -78,7 +78,7 @@ function c29353756.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c29353756.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_SZONE
return rp==1-tp and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_SZONE
and re:IsActiveType(TYPE_TRAP) and Duel.IsChainDisablable(ev)
end
function c29353756.negop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -15,7 +15,7 @@ function c29628180.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x108)
end
function c29628180.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
return rp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
and Duel.IsExistingMatchingCard(c29628180.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c29628180.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -14,7 +14,7 @@ function c29934351.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x21)
end
function c29934351.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
return rp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
and Duel.IsExistingMatchingCard(c29934351.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c29934351.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -50,7 +50,7 @@ function c30100551.drop(e,tp,eg,ep,ev,re,r,rp)
end
function c30100551.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp)
return c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp)
end
function c30100551.desop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
......
......@@ -72,7 +72,7 @@ function c30604579.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local pos=c:GetPreviousPosition()
if c:IsReason(REASON_BATTLE) then pos=c:GetBattlePosition() end
if rp~=tp and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY)
if rp==1-tp and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and bit.band(pos,POS_FACEUP)~=0 then
c:RegisterFlagEffect(30604579,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
......
......@@ -22,7 +22,7 @@ function c30653113.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_HAND) and c:IsControler(tp) and c:IsReason(REASON_EFFECT) and c:IsReason(REASON_DISCARD)
end
function c30653113.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and eg:IsExists(c30653113.cfilter,1,nil,tp)
return rp==1-tp and eg:IsExists(c30653113.cfilter,1,nil,tp)
end
function c30653113.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -23,7 +23,7 @@ function c3105404.initial_effect(c)
end
function c3105404.filter(c,e,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and ((c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp)))
and ((c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp)))
and c:IsSetCard(0x1047) and c:GetBaseAttack()>0 and c:IsCanBeEffectTarget(e) and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED)
end
function c3105404.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -23,7 +23,7 @@ end
function c31772684.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
and rp~=tp and c:GetPreviousControler()==tp
and rp==1-tp and c:GetPreviousControler()==tp
end
function c31772684.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -57,7 +57,7 @@ function c31801517.atkop(e,tp,eg,ep,ev,re,r,rp)
end
function c31801517.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetPreviousControler()==tp and rp~=tp and c:IsReason(REASON_EFFECT)
return c:GetPreviousControler()==tp and rp==1-tp and c:IsReason(REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_MZONE) and c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,93717133)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......
......@@ -46,7 +46,7 @@ end
function c31829185.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and rp~=tp and bit.band(r,REASON_DESTROY)~=0 then
and rp==1-tp and bit.band(r,REASON_DESTROY)~=0 then
c:RegisterFlagEffect(31829185,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
......
......@@ -14,7 +14,7 @@ end
function c32146097.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE)
or rp~=tp and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp)
or rp==1-tp and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp)
and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0
end
function c32146097.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -13,7 +13,7 @@ function c32539892.initial_effect(c)
c:RegisterEffect(e1)
end
function c32539892.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_HAND and bit.band(r,0x4040)==0x4040 and rp~=tp
return e:GetHandler():GetPreviousLocation()==LOCATION_HAND and bit.band(r,0x4040)==0x4040 and rp==1-tp
end
function c32539892.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -21,7 +21,7 @@ function c32619583.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c32619583.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)>0
and rp~=tp and tp==e:GetLabel() and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>1 then
and rp==1-tp and tp==e:GetLabel() and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>1 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(1-tp,aux.TRUE,tp,0,LOCATION_HAND,2,2,nil)
......
......@@ -29,7 +29,7 @@ function c33438666.initial_effect(c)
end
function c33438666.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp))
and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp))
end
function c33438666.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=eg:FilterCount(c33438666.repfilter,nil,tp)
......
......@@ -22,5 +22,5 @@ function c33655493.tg(e,c)
return c:IsFaceup() and c:GetCode()~=33655493
end
function c33655493.tgval(e,re,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and rp~=e:GetHandlerPlayer()
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and rp==1-e:GetHandlerPlayer()
end
......@@ -48,7 +48,7 @@ function c34004470.atop(e,tp,eg,ep,ev,re,r,rp)
end
function c34004470.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,0x41)==0x41 and rp~=tp and c:GetPreviousControler()==tp
return bit.band(r,0x41)==0x41 and rp==1-tp and c:GetPreviousControler()==tp
end
function c34004470.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -41,7 +41,7 @@ function c34093683.tgtg(e,c)
end
function c34093683.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp))
return (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp))
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function c34093683.thfilter(c)
......
......@@ -12,7 +12,7 @@ function c34193084.initial_effect(c)
c:RegisterEffect(e1)
end
function c34193084.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_DECK) and bit.band(r,REASON_EFFECT)~=0 and rp~=tp
return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_DECK) and bit.band(r,REASON_EFFECT)~=0 and rp==1-tp
end
function c34193084.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -52,7 +52,7 @@ function c34230233.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c34230233.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and rp~=tp and tp==e:GetLabel() then
if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and rp==1-tp and tp==e:GetLabel() then
Duel.BreakEffect()
local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if hg:GetCount()>0 then
......
......@@ -26,7 +26,7 @@ function c34408491.initial_effect(c)
end
function c34408491.atkcon(e,tp,eg,ep,ev,re,r,rp)
if ep~=tp then return false end
if bit.band(r,REASON_EFFECT)~=0 then return rp~=tp end
if bit.band(r,REASON_EFFECT)~=0 then return rp==1-tp end
return e:GetHandler():IsRelateToBattle()
end
function c34408491.atkop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -49,7 +49,7 @@ function c34664411.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c34664411.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,0x41)==0x41 and rp~=tp and c:GetPreviousControler()==tp
return bit.band(r,0x41)==0x41 and rp==1-tp and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function c34664411.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -23,7 +23,7 @@ function c34680482.initial_effect(c)
c:RegisterEffect(e2)
end
function c34680482.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()~=tp
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()==1-tp
and e:GetHandler():GetPreviousControler()==tp
end
function c34680482.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -18,7 +18,7 @@ end
function c34968834.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
if rp~=tp and tp==e:GetLabel() then
if rp==1-tp and tp==e:GetLabel() then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
end
......@@ -30,7 +30,7 @@ end
function c34968834.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)==0 then return end
if rp~=tp and tp==e:GetLabel() and Duel.IsExistingMatchingCard(c34968834.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
if rp==1-tp and tp==e:GetLabel() and Duel.IsExistingMatchingCard(c34968834.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(34968834,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -14,7 +14,7 @@ function c3536537.initial_effect(c)
end
function c3536537.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:GetPreviousControler()==tp and bit.band(r,REASON_DESTROY)~=0
return rp==1-tp and c:GetPreviousControler()==tp and bit.band(r,REASON_DESTROY)~=0
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function c3536537.filter(c)
......
......@@ -75,7 +75,7 @@ function c36328300.activate(e,tp,eg,ep,ev,re,r,rp)
end
function c36328300.plcfilter(c,tp)
return c:IsPreviousSetCard(0x2034) and c:GetPreviousControler()==tp
and c:IsPreviousPosition(POS_FACEUP) and c:GetReasonPlayer()~=tp
and c:IsPreviousPosition(POS_FACEUP) and c:GetReasonPlayer()==1-tp
and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c36328300.plcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -67,7 +67,7 @@ function c36368606.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete()
end
function c36368606.immcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function c36368606.immfilter(c)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK)
......
......@@ -100,7 +100,7 @@ function c36484016.activate(e,tp,eg,ep,ev,re,r,rp)
end
function c36484016.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,0x41)==0x41 and rp~=tp and c:GetPreviousControler()==tp
return bit.band(r,0x41)==0x41 and rp==1-tp and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c36484016.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -42,7 +42,7 @@ function c36894320.initial_effect(c)
c:RegisterEffect(e4)
end
function c36894320.valcon(e,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and rp~=e:GetHandlerPlayer()
return bit.band(r,REASON_EFFECT)~=0 and rp==1-e:GetHandlerPlayer()
end
function c36894320.acfilter(c)
return c:IsFaceup() and c:IsCode(9409625) and c:IsAbleToGraveAsCost()
......
......@@ -28,7 +28,7 @@ function c3701074.initial_effect(c)
c:RegisterEffect(e4)
end
function c3701074.rectg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rp~=tp end
if chk==0 then return rp==1-tp end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,1-tp,0)
end
......
......@@ -27,7 +27,7 @@ function c37241623.checkop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c37241623.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)==c37241623[0] and re:IsActiveType(TYPE_XYZ) and Duel.IsChainNegatable(ev)
return rp==1-tp and Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)==c37241623[0] and re:IsActiveType(TYPE_XYZ) and Duel.IsChainNegatable(ev)
end
function c37241623.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -57,7 +57,7 @@ function c37337327.scop(e,tp,eg,ep,ev,re,r,rp)
end
function c37337327.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:GetReasonPlayer()~=tp and c:IsSummonType(SUMMON_TYPE_LINK)
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:GetReasonPlayer()==1-tp and c:IsSummonType(SUMMON_TYPE_LINK)
end
function c37337327.spfilter(c,e,tp)
return c:IsSetCard(0x43) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
......
......@@ -66,7 +66,7 @@ function c37663536.actcon(e)
end
function c37663536.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_FUSION) and c:GetReasonPlayer()~=tp
return c:IsSummonType(SUMMON_TYPE_FUSION) and c:GetReasonPlayer()==1-tp
and c:IsReason(REASON_EFFECT) and c:IsPreviousPosition(POS_FACEUP)
end
function c37663536.spfilter(c,e,tp)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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