Commit b14cfcef authored by purerosefallen's avatar purerosefallen

tp

parent e41e2e9e
...@@ -118,7 +118,7 @@ function cm.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -118,7 +118,7 @@ function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
return return
end end
if Duel.GetTurnPlayer()~=tp then return end if Duel.GetTurnPlayer()==1-tp then return end
ct=ct+1 ct=ct+1
c:SetTurnCounter(ct) c:SetTurnCounter(ct)
end end
......
...@@ -19,7 +19,7 @@ function cm.sdfilter(c) ...@@ -19,7 +19,7 @@ function cm.sdfilter(c)
return c:IsType(TYPE_MONSTER) and c:GetRank()~=4 return c:IsType(TYPE_MONSTER) and c:GetRank()~=4
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():GetControler()~=tp return Duel.GetAttacker():GetControler()==1-tp
and not Duel.IsExistingMatchingCard(cm.sdfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) and not Duel.IsExistingMatchingCard(cm.sdfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -68,7 +68,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -68,7 +68,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp) function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and (os.clock()-cm.time)>=150 return Duel.GetTurnPlayer()==1-tp and (os.clock()-cm.time)>=150
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end
......
...@@ -42,7 +42,7 @@ function cm.mtop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,7 +42,7 @@ function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.discon(e,tp,eg,ep,ev,re,r,rp) function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return rp~=tp and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) and cm.xcon(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) and cm.xcon(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.DiscardHandCost(e,tp,eg,ep,ev,re,r,rp) function cm.DiscardHandCost(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
......
...@@ -12,7 +12,7 @@ function cm.initial_effect(c) ...@@ -12,7 +12,7 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Senya.CheckNoExtra(e,tp) and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()~=tp return Senya.CheckNoExtra(e,tp) and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()==1-tp
end) end)
e1:SetCost(Senya.SawawaRemoveCost(1)) e1:SetCost(Senya.SawawaRemoveCost(1))
e1:SetTarget(cm.tg) e1:SetTarget(cm.tg)
......
...@@ -33,7 +33,7 @@ function cm.initial_effect(c) ...@@ -33,7 +33,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.discon(e,tp,eg,ep,ev,re,r,rp) function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler()~=e:GetHandler() and ep~=tp and Senya.CheckNoExtra(e,tp) return re:IsActiveType(TYPE_MONSTER) and re:GetHandler()~=e:GetHandler() and ep==1-tp and Senya.CheckNoExtra(e,tp)
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,1,nil) end
...@@ -55,7 +55,7 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +55,7 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and e:GetHandler():GetPreviousControler()==tp and e:GetHandler():IsReason(REASON_DESTROY) return rp==1-tp and e:GetHandler():GetPreviousControler()==tp and e:GetHandler():IsReason(REASON_DESTROY)
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:GetFlagEffect(37564225)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:GetFlagEffect(37564225)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
......
...@@ -22,7 +22,7 @@ function cm.initial_effect(c) ...@@ -22,7 +22,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.descon(e,tp,eg,ep,ev,re,r,rp) function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Senya.CheckNoExtra(e,tp) return ep==1-tp and Senya.CheckNoExtra(e,tp)
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
......
...@@ -35,7 +35,7 @@ function cm.filter(c) ...@@ -35,7 +35,7 @@ function cm.filter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsControlerCanBeChanged() return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsControlerCanBeChanged()
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and chkc:IsControlerCanBeChanged() end if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()==1-tp and chkc:IsControlerCanBeChanged() end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
......
...@@ -18,7 +18,7 @@ function cm.initial_effect(c) ...@@ -18,7 +18,7 @@ function cm.initial_effect(c)
end end
function cm.dogcon(e,tp,eg,ep,ev,re,r,rp) function cm.dogcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not (c:GetPreviousControler()==tp and rp~=tp) then return false end if not (c:GetPreviousControler()==tp and rp==1-tp) then return false end
if c:IsReason(REASON_EFFECT) then return true end if c:IsReason(REASON_EFFECT) then return true end
local bc=Duel.GetAttacker() local bc=Duel.GetAttacker()
return c:IsReason(REASON_BATTLE) and c==Duel.GetAttackTarget() and bc and bc:IsControler(1-tp) return c:IsReason(REASON_BATTLE) and c==Duel.GetAttackTarget() and bc and bc:IsControler(1-tp)
......
...@@ -24,7 +24,7 @@ function cm.initial_effect(c) ...@@ -24,7 +24,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.discon(e,tp,eg,ep,ev,re,r,rp) function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and e:GetHandler():GetOriginalCode()==m and ep~=tp return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and e:GetHandler():GetOriginalCode()==m and ep==1-tp
end end
function cm.DiscardHandCost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.DiscardHandCost(e,tp,eg,ep,ev,re,r,rp,chk)
local ch=Duel.GetCurrentChain() local ch=Duel.GetCurrentChain()
......
...@@ -121,7 +121,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -121,7 +121,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.descon(e,tp,eg,ep,ev,re,r,rp) function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep==1-tp
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
......
...@@ -23,7 +23,7 @@ function cm.initial_effect(c) ...@@ -23,7 +23,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp) function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep==1-tp
end end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=4 end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=4 end
......
...@@ -48,7 +48,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,7 +48,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and chkc:IsControlerCanBeChanged() end if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()==1-tp and chkc:IsControlerCanBeChanged() end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
......
...@@ -33,7 +33,7 @@ function cm.initial_effect(c) ...@@ -33,7 +33,7 @@ function cm.initial_effect(c)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker() local at=Duel.GetAttacker()
return at:GetControler()~=tp and Duel.GetAttackTarget()==nil return at:GetControler()==1-tp and Duel.GetAttackTarget()==nil
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -22,7 +22,7 @@ function cm.initial_effect(c) ...@@ -22,7 +22,7 @@ function cm.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep==1-tp
end) end)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -32,7 +32,7 @@ function cm.initial_effect(c) ...@@ -32,7 +32,7 @@ function cm.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep==1-tp
end) end)
e2:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk) e2:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -20,7 +20,7 @@ function cm.initial_effect(c) ...@@ -20,7 +20,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.discon(e,tp,eg,ep,ev,re,r,rp) function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and ep~=tp return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and ep==1-tp
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -50,12 +50,12 @@ end ...@@ -50,12 +50,12 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc~=c and not c:IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp return re:IsActiveType(TYPE_MONSTER) and rc~=c and not c:IsStatus(STATUS_BATTLE_DESTROYED) and ep==1-tp
end end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp) function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and rc~=c and not c:IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp return re:IsHasType(EFFECT_TYPE_ACTIVATE) and rc~=c and not c:IsStatus(STATUS_BATTLE_DESTROYED) and ep==1-tp
end end
function cm.operation0(e,tp,eg,ep,ev,re,r,rp) function cm.operation0(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -19,7 +19,7 @@ function cm.initial_effect(c) ...@@ -19,7 +19,7 @@ function cm.initial_effect(c)
end end
function cm.discon(e,tp,eg,ep,ev,re,r,rp) function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and c:GetEquipGroup():IsExists(cm.cf,1,nil,re:GetHandler()) return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and c:GetEquipGroup():IsExists(cm.cf,1,nil,re:GetHandler())
end end
function cm.cf(c,rc) function cm.cf(c,rc)
if not c:IsAbleToGraveAsCost() then return false end if not c:IsAbleToGraveAsCost() then return false end
......
...@@ -50,7 +50,7 @@ function cm.spcon(e,c) ...@@ -50,7 +50,7 @@ function cm.spcon(e,c)
end end
function cm.rdcon(e,tp,eg,ep,ev,re,r,rp) function cm.rdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and Duel.GetAttackTarget()==nil return ep==1-tp and Duel.GetAttackTarget()==nil
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and e:GetHandler():IsSummonType(0x534) and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and e:GetHandler():IsSummonType(0x534)
end end
function cm.rdop(e,tp,eg,ep,ev,re,r,rp) function cm.rdop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -42,7 +42,7 @@ function cm.initial_effect(c) ...@@ -42,7 +42,7 @@ function cm.initial_effect(c)
e1:SetHintTiming(0,0x1c0) e1:SetHintTiming(0,0x1c0)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(function(e,tp) e1:SetCondition(function(e,tp)
return Duel.GetTurnPlayer()~=tp return Duel.GetTurnPlayer()==1-tp
end) end)
e1:SetTarget(cm.target1) e1:SetTarget(cm.target1)
e1:SetOperation(cm.operation1) e1:SetOperation(cm.operation1)
......
...@@ -19,7 +19,7 @@ function cm.cfilter(c,tp) ...@@ -19,7 +19,7 @@ function cm.cfilter(c,tp)
return c:IsControler(tp) and c:IsReason(REASON_EFFECT) return c:IsControler(tp) and c:IsReason(REASON_EFFECT)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.cfilter,1,nil,1-tp) and rp~=tp end if chk==0 then return eg:IsExists(cm.cfilter,1,nil,1-tp) and rp==1-tp end
Duel.SetTargetCard(eg) Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,1-tp,1) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,1-tp,1)
end end
......
...@@ -41,7 +41,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -41,7 +41,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp) function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE) and Senya.NanahiraExistingCondition(true)(e,tp) return Duel.GetTurnPlayer()==1-tp and (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE) and Senya.NanahiraExistingCondition(true)(e,tp)
end end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
......
...@@ -53,7 +53,7 @@ function cm.cnegop(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,7 +53,7 @@ function cm.cnegop(e,tp,eg,ep,ev,re,r,rp)
Senya.OverlayCard(e:GetHandler(),re:GetHandler()) Senya.OverlayCard(e:GetHandler(),re:GetHandler())
end end
function cm.sfilter(c,tp) function cm.sfilter(c,tp)
return c:GetSummonPlayer()~=tp return c:GetSummonPlayer()==1-tp
end end
function cm.ssfilter(c,e,tp) function cm.ssfilter(c,e,tp)
return c:IsType(TYPE_TRAP) and c.Senya_desc_with_nanahira and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetOriginalCode(),0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) return c:IsType(TYPE_TRAP) and c.Senya_desc_with_nanahira and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetOriginalCode(),0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT)
......
...@@ -49,7 +49,7 @@ function cm.lfilter(c,g) ...@@ -49,7 +49,7 @@ function cm.lfilter(c,g)
end end
function cm.location_check(p,tp,z) function cm.location_check(p,tp,z)
local tz=0 local tz=0
if p~=tp then if p==1-tp then
tz=((z & 0x1f0000) >> 16) tz=((z & 0x1f0000) >> 16)
else else
tz=(z & 0x1f) tz=(z & 0x1f)
...@@ -63,7 +63,7 @@ function cm.location_check(p,tp,z) ...@@ -63,7 +63,7 @@ function cm.location_check(p,tp,z)
res=(cz | res) res=(cz | res)
end end
end end
if p~=tp then res=(res << 16) end if p==1-tp then res=(res << 16) end
return ct,res return ct,res
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -32,7 +32,7 @@ function cm.initial_effect(c) ...@@ -32,7 +32,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp) function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,0,e:GetHandler())==0 return ep==1-tp and Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,0,e:GetHandler())==0
end end
function cm.damop(e,tp,eg,ep,ev,re,r,rp) function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2) Duel.ChangeBattleDamage(ep,ev*2)
......
...@@ -10,7 +10,7 @@ function cm.initial_effect(c) ...@@ -10,7 +10,7 @@ function cm.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep==1-tp
end) end)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.operation) e1:SetOperation(cm.operation)
......
...@@ -1496,7 +1496,7 @@ function cm.InstantCopyModule(c,lmct,lmcd,cost,excon,loc) ...@@ -1496,7 +1496,7 @@ function cm.InstantCopyModule(c,lmct,lmcd,cost,excon,loc)
end end
function cm.InstantCopyCondition(excon) function cm.InstantCopyCondition(excon)
return function(e,tp,eg,ep,ev,re,r,rp) return function(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and (not excon or excon(e,tp,eg,ep,ev,re,r,rp)) return rp==1-tp and (not excon or excon(e,tp,eg,ep,ev,re,r,rp))
end end
end end
function cm.InstantCopyTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.InstantCopyTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -66,7 +66,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +66,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.descon(e,tp,eg,ep,ev,re,r,rp) function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep==1-tp
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
...@@ -83,7 +83,7 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,7 +83,7 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.rdcon(e,tp,eg,ep,ev,re,r,rp) function cm.rdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and Duel.GetAttackTarget()==nil return ep==1-tp and Duel.GetAttackTarget()==nil
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end end
function cm.rdop(e,tp,eg,ep,ev,re,r,rp) function cm.rdop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -101,7 +101,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -101,7 +101,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if rc:IsStatus(STATUS_LEAVE_CONFIRMED) then if rc:IsStatus(STATUS_LEAVE_CONFIRMED) then
rc:CancelToGrave() rc:CancelToGrave()
end end
if rc:GetControler()~=tp then if rc:GetControler()==1-tp then
--Senya.ExileCard(rc) --Senya.ExileCard(rc)
Duel.MoveToField(rc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,true) Duel.MoveToField(rc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,true)
else else
......
...@@ -118,7 +118,7 @@ function cm.atkval(e,c) ...@@ -118,7 +118,7 @@ function cm.atkval(e,c)
return Senya.GetGainedCount_3L(c)*500 return Senya.GetGainedCount_3L(c)*500
end end
function cm.discon(e,tp,eg,ep,ev,re,r,rp) function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and ep~=tp return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and ep==1-tp
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -35,7 +35,7 @@ function cm.chkfilter_mokou(c) ...@@ -35,7 +35,7 @@ function cm.chkfilter_mokou(c)
end end
function cm.NegateEffectWithoutChainingCondition(e,tp,eg,ep,ev,re,r,rp) function cm.NegateEffectWithoutChainingCondition(e,tp,eg,ep,ev,re,r,rp)
local loc,np=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_CONTROLER) local loc,np=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_CONTROLER)
return e:GetHandler():GetFlagEffect(m)==0 and re:GetHandler():IsRelateToEffect(re) and not re:GetHandler():IsImmuneToEffect(e) and (loc & 0x0c)~=0 and np~=tp and re:GetHandler():IsAbleToGrave() return e:GetHandler():GetFlagEffect(m)==0 and re:GetHandler():IsRelateToEffect(re) and not re:GetHandler():IsImmuneToEffect(e) and (loc & 0x0c)~=0 and np==1-tp and re:GetHandler():IsAbleToGrave()
end end
function cm.NegateEffectWithoutChainingOperation(e,tp,eg,ep,ev,re,r,rp) function cm.NegateEffectWithoutChainingOperation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,m*16+2) then return end if not Duel.SelectYesNo(tp,m*16+2) then return end
......
...@@ -51,7 +51,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,7 +51,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp) function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and c==Duel.GetAttacker() and Duel.GetAttackTarget() and Duel.GetAttackTarget():IsDefensePos() return ep==1-tp and c==Duel.GetAttacker() and Duel.GetAttackTarget() and Duel.GetAttackTarget():IsDefensePos()
end end
function cm.damop(e,tp,eg,ep,ev,re,r,rp) function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2) Duel.ChangeBattleDamage(ep,ev*2)
......
...@@ -39,7 +39,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -39,7 +39,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker() local at=Duel.GetAttacker()
return at:GetControler()~=tp return at:GetControler()==1-tp
end end
function cm.MergeCard(g,p,loc,seq) function cm.MergeCard(g,p,loc,seq)
local tc=Duel.GetFieldCard(p,loc,seq) local tc=Duel.GetFieldCard(p,loc,seq)
......
...@@ -66,7 +66,7 @@ function cm.disop3(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +66,7 @@ function cm.disop3(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp) function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep==1-tp
end end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and Senya.check_set_sayuri(c) return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and Senya.check_set_sayuri(c)
......
...@@ -47,7 +47,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,7 +47,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.descon(e,tp,eg,ep,ev,re,r,rp) function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep==1-tp
end end
function cm.sfilter(c,e,tp) function cm.sfilter(c,e,tp)
return Senya.check_set_sayuri(c) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and c:IsLevelBelow(8) return Senya.check_set_sayuri(c) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and c:IsLevelBelow(8)
......
...@@ -12,7 +12,7 @@ function cm.initial_effect(c) ...@@ -12,7 +12,7 @@ function cm.initial_effect(c)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCost(Senya.SelfDiscardCost) e1:SetCost(Senya.SelfDiscardCost)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsOnField() and re:IsActiveType(TYPE_MONSTER) and ep~=tp return re:GetHandler():IsOnField() and re:IsActiveType(TYPE_MONSTER) and ep==1-tp
end) end)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.operation) e1:SetOperation(cm.operation)
......
...@@ -27,7 +27,7 @@ function c66677706.initial_effect(c) ...@@ -27,7 +27,7 @@ function c66677706.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c66677706.discon(e,tp,eg,ep,ev,re,r,rp) function c66677706.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and ep~=tp return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and ep==1-tp
end end
function c66677706.DiscardHandCost(e,tp,eg,ep,ev,re,r,rp,chk) function c66677706.DiscardHandCost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,nil) end
...@@ -49,7 +49,7 @@ function c66677706.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,7 +49,7 @@ function c66677706.disop(e,tp,eg,ep,ev,re,r,rp)
end end
function c66677706.descon(e,tp,eg,ep,ev,re,r,rp) function c66677706.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return rp~=tp and c:GetPreviousControler()==tp and (r & REASON_DESTROY)~=0 return rp==1-tp and c:GetPreviousControler()==tp and (r & REASON_DESTROY)~=0
end end
function c66677706.filter(c) function c66677706.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsSetCard(0x777) and c:IsFaceup() return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsSetCard(0x777) and c:IsFaceup()
......
...@@ -81,7 +81,7 @@ end ...@@ -81,7 +81,7 @@ end
function cm.discon1(e,tp,eg,ep,ev,re,r,rp) function cm.discon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return Duel.IsChainNegatable(ev) and ep~=tp and re:IsActiveType(TYPE_MONSTER) and e:GetHandler():GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_SEASERPENT) return Duel.IsChainNegatable(ev) and ep==1-tp and re:IsActiveType(TYPE_MONSTER) and e:GetHandler():GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_SEASERPENT)
end end
function cm.distg1(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
...@@ -105,7 +105,7 @@ end ...@@ -105,7 +105,7 @@ end
function cm.discon2(e,tp,eg,ep,ev,re,r,rp) function cm.discon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return Duel.IsChainNegatable(ev) and ep~=tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and e:GetHandler():GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_FAIRY) return Duel.IsChainNegatable(ev) and ep==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and e:GetHandler():GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_FAIRY)
end end
function cm.distg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true 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