Commit 7330c3bd authored by Nemo Ma's avatar Nemo Ma

fix

parent 79d8001b
......@@ -156,20 +156,18 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re1=c:GetReasonEffect()
if not rc and re1 then
local sc=re1:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
Duel.SetTargetCard(sc)
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
Duel.SetTargetCard(rc)
sg:AddCard(rc)
end
local a=Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
......@@ -181,6 +179,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and e:GetLabelObject():GetLabel()==1
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
......
......@@ -120,20 +120,18 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re1=c:GetReasonEffect()
if not rc and re1 then
local sc=re1:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
Duel.SetTargetCard(sc)
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
Duel.SetTargetCard(rc)
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
......@@ -146,8 +144,10 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if c:IsLocation(LOCATION_HAND) or not c:IsAbleToHand() then return end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and e:GetLabelObject():GetLabel()==1
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Debug.Message(1200)
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
if c:IsRelateToEffect(e) then
......
......@@ -199,20 +199,18 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re1=c:GetReasonEffect()
if not rc and re1 then
local sc=re1:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
Duel.SetTargetCard(sc)
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
Duel.SetTargetCard(rc)
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
......@@ -223,6 +221,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and e:GetLabelObject():GetLabel()==1
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
......
......@@ -152,17 +152,18 @@ function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
and bc:IsAbleToRemove(tp,POS_FACEDOWN)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local e=e:GetHandler()
local bc=e:GetLabelObject()
local c=e:GetHandler()
if bc:IsRelateToBattle() and bc:IsControler(1-tp) and bc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Hint(HINT_CARD,0,m)
if Duel.Remove(bc,POS_FACEDOWN,REASON_EFFECT)~=0 then
Duel.Remove(bc,POS_FACEDOWN,REASON_EFFECT)
if bc:IsLocation(LOCATION_REMOVED) and bc:IsFacedown() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
end
......@@ -184,20 +185,18 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re1=c:GetReasonEffect()
if not rc and re1 then
local sc=re1:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
Duel.SetTargetCard(sc)
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
Duel.SetTargetCard(rc)
sg:AddCard(rc)
end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),tp,POS_FACEDOWN)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
......
......@@ -198,20 +198,18 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re1=c:GetReasonEffect()
if not rc and re1 then
local sc=re1:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
Duel.SetTargetCard(sc)
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
Duel.SetTargetCard(rc)
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND)
......
......@@ -140,20 +140,18 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re1=c:GetReasonEffect()
if not rc and re1 then
local sc=re1:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
Duel.SetTargetCard(sc)
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
Duel.SetTargetCard(rc)
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
end
......
......@@ -22,11 +22,19 @@ function cm.initial_effect(c)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
e2:SetLabelObject(e17)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_CUSTOM+m)
e3:SetCondition(cm.thcon2)
e3:SetLabelObject(e17)
c:RegisterEffect(e3)
local e17=Effect.CreateEffect(c)
e17:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e17:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e17:SetCode(EVENT_CHAIN_NEGATED)
e17:SetOperation(cm.negcheckop)
c:RegisterEffect(e17)
local e30=Effect.CreateEffect(c)
e30:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e30:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......@@ -46,6 +54,15 @@ function cm.initial_effect(c)
end
--Effect 1
--negate--
function cm.negcheckop(e,tp,eg,ep,ev,re,r,rp)
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
if rp==tp and de and dp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and e:GetHandler()==re:GetHandler() and e:GetHandler():GetReasonEffect()==de then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function cm.negreg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
......@@ -197,35 +214,30 @@ function cm.imptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,1,0,0)
end
function cm.impop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
if e:GetLabelObject():GetLabel()==1 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
else
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
......@@ -241,12 +253,6 @@ function cm.impop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -278,14 +284,13 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
local n=Duel.GetFlagEffect(tp,30015000)
local n1=Duel.GetFlagEffect(tp,30015500)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -298,11 +303,5 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
\ No newline at end of file
......@@ -29,11 +29,19 @@ function cm.initial_effect(c)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
e2:SetLabelObject(e17)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_CUSTOM+m)
e3:SetCondition(cm.thcon2)
e3:SetLabelObject(e17)
c:RegisterEffect(e3)
local e17=Effect.CreateEffect(c)
e17:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e17:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e17:SetCode(EVENT_CHAIN_NEGATED)
e17:SetOperation(cm.negcheckop)
c:RegisterEffect(e17)
local e30=Effect.CreateEffect(c)
e30:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e30:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......@@ -53,6 +61,15 @@ function cm.initial_effect(c)
end
--Effect 1
--negate--
function cm.negcheckop(e,tp,eg,ep,ev,re,r,rp)
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
if rp==tp and de and dp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and e:GetHandler()==re:GetHandler() and e:GetHandler():GetReasonEffect()==de then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function cm.negreg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
......@@ -192,35 +209,30 @@ function cm.imptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,1,0,0)
end
function cm.impop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
if e:GetLabelObject():GetLabel()==1 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
else
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
......@@ -236,12 +248,6 @@ function cm.impop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -273,14 +279,13 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
local n=Duel.GetFlagEffect(tp,30015000)
local n1=Duel.GetFlagEffect(tp,30015500)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -293,11 +298,5 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
----neg----
\ No newline at end of file
......@@ -25,11 +25,19 @@ function cm.initial_effect(c)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
e2:SetLabelObject(e17)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_CUSTOM+m)
e3:SetCondition(cm.thcon2)
e3:SetLabelObject(e17)
c:RegisterEffect(e3)
local e17=Effect.CreateEffect(c)
e17:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e17:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e17:SetCode(EVENT_CHAIN_NEGATED)
e17:SetOperation(cm.negcheckop)
c:RegisterEffect(e17)
local e30=Effect.CreateEffect(c)
e30:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e30:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......@@ -49,6 +57,15 @@ function cm.initial_effect(c)
end
--Effect 1
--negate--
function cm.negcheckop(e,tp,eg,ep,ev,re,r,rp)
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
if rp==tp and de and dp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and e:GetHandler()==re:GetHandler() and e:GetHandler():GetReasonEffect()==de then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function cm.negreg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
......@@ -144,35 +161,30 @@ function cm.imptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,1,0,0)
end
function cm.impop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
if e:GetLabelObject():GetLabel()==1 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
else
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
......@@ -188,12 +200,6 @@ function cm.impop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -225,14 +231,13 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
local n=Duel.GetFlagEffect(tp,30015000)
local n1=Duel.GetFlagEffect(tp,30015500)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -245,11 +250,5 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
----neg----
\ No newline at end of file
......@@ -25,11 +25,19 @@ function cm.initial_effect(c)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
e2:SetLabelObject(e17)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_CUSTOM+m)
e3:SetCondition(cm.thcon2)
e3:SetLabelObject(e17)
c:RegisterEffect(e3)
local e17=Effect.CreateEffect(c)
e17:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e17:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e17:SetCode(EVENT_CHAIN_NEGATED)
e17:SetOperation(cm.negcheckop)
c:RegisterEffect(e17)
local e30=Effect.CreateEffect(c)
e30:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e30:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......@@ -49,6 +57,15 @@ function cm.initial_effect(c)
end
--Activate
--negate--
function cm.negcheckop(e,tp,eg,ep,ev,re,r,rp)
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
if rp==tp and de and dp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and e:GetHandler()==re:GetHandler() and e:GetHandler():GetReasonEffect()==de then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function cm.negreg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
......@@ -127,35 +144,30 @@ function cm.imptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,1,0,0)
end
function cm.impop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
if e:GetLabelObject():GetLabel()==1 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
else
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
......@@ -171,12 +183,6 @@ function cm.impop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -208,14 +214,13 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
local n=Duel.GetFlagEffect(tp,30015000)
local n1=Duel.GetFlagEffect(tp,30015500)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -228,11 +233,5 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
----neg----
\ No newline at end of file
......@@ -71,6 +71,33 @@ end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_NEGATED)
e1:SetLabelObject(e)
e1:SetOperation(cm.negcheck)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
--negate--
function cm.negcheck(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
if rp==tp and de and dp==1-tp and re==te then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetOperation(cm.negevent)
e1:SetLabelObject(te)
Duel.RegisterEffect(e1,tp)
end
end
function cm.negevent(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
Duel.RaiseEvent(te:GetHandler(),EVENT_CUSTOM+m,te,0,tp,tp,0)
e:Reset()
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -105,6 +132,15 @@ end
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_NEGATED)
e1:SetLabelObject(e)
e1:SetOperation(cm.negcheck)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -149,35 +185,30 @@ function cm.imptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,1,0,0)
end
function cm.impop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
if e:GetLabelObject():GetLabel()==1 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
else
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
......@@ -193,12 +224,6 @@ function cm.impop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -230,14 +255,13 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
local n=Duel.GetFlagEffect(tp,30015000)
local n1=Duel.GetFlagEffect(tp,30015500)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -250,11 +274,5 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
\ No newline at end of file
......@@ -132,35 +132,30 @@ function cm.imptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,1,0,0)
end
function cm.impop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
if e:GetLabelObject():GetLabel()==1 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
else
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
......@@ -176,12 +171,6 @@ function cm.impop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -213,14 +202,13 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
local n=Duel.GetFlagEffect(tp,30015000)
local n1=Duel.GetFlagEffect(tp,30015500)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -233,11 +221,5 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
\ No newline at end of file
......@@ -134,35 +134,30 @@ function cm.imptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,1,0,0)
end
function cm.impop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
if e:GetLabelObject():GetLabel()==1 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
else
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
......@@ -178,12 +173,6 @@ function cm.impop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -215,14 +204,13 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
local n=Duel.GetFlagEffect(tp,30015000)
local n1=Duel.GetFlagEffect(tp,30015500)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -235,11 +223,5 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
\ No newline at end of file
......@@ -159,35 +159,30 @@ function cm.imptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,1,0,0)
end
function cm.impop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
if e:GetLabelObject():GetLabel()==1 then
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.RegisterFlagEffect(tp,30015500,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,2))
else
Duel.RegisterFlagEffect(tp,30015000,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
......@@ -203,12 +198,6 @@ function cm.impop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -240,7 +229,6 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if c:IsLocation(LOCATION_REMOVED) or not c:IsAbleToRemove(tp,POS_FACEDOWN) then return end
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then
......@@ -260,11 +248,5 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
if sc and sc:IsRelateToEffect(e)
and sc:GetOwner()==1-tp
and not sc:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and sc:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.Remove(sc,POS_FACEDOWN,REASON_EFFECT)
end
end
----neg----
\ No newline at end of file
......@@ -255,22 +255,21 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local sg=Group.FromCards(c)
if e:GetLabelObject():GetLabel()==1 then
local rc=c:GetReasonCard()
local re1=c:GetReasonEffect()
if not rc and re1 then
local sc=re1:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
Duel.SetTargetCard(sc)
sg:AddCard(sc)
end
else
e:GetLabelObject():SetLabel(0)
end
if rc then
Duel.SetTargetCard(rc)
sg:AddCard(rc)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
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