Commit f42f8038 authored by TanakaKotoha's avatar TanakaKotoha

naobaijin

parent bdc4ac3e
Pipeline #692 passed with stages
in 41 minutes and 23 seconds
No preview for this file type
......@@ -14,8 +14,8 @@ function c10909012.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,10909012)
e1:SetTarget(c10909012.target)
e1:SetOperation(c10909012.operation)
e1:SetTarget(c10909012.target1)
e1:SetOperation(c10909012.operation1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10909012,1))
......@@ -26,8 +26,8 @@ function c10909012.initial_effect(c)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,109090120)
e2:SetCost(c10909012.cost)
e2:SetTarget(c10909012.target)
e2:SetOperation(c10909012.operation)
e2:SetTarget(c10909012.rmtg)
e2:SetOperation(c10909012.rmop)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
......@@ -70,11 +70,11 @@ function c10909012.filter1(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c10909012.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and c:IsCode(10909012) and (not f or f(c))
return c:IsType(TYPE_FUSION) and c:IsCode(10909003) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c10909012.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c10909012.target1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
......@@ -94,7 +94,7 @@ function c10909012.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,tp,LOCATION_GRAVE)
end
function c10909012.operation(e,tp,eg,ep,ev,re,r,rp)
function c10909012.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
......
......@@ -29,7 +29,7 @@ function c10909013.filter(c,e,tp,eg,ep,ev,re,r,rp)
end
function c10909013.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10909013.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp,eg,ep,ev,re,r,rp) end
local tc=Duel.SelectMatchingCard(tp,c10909013.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp):GetFirst()
local tc=Duel.SelectMatchingCard(tp,c10909013.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp):GetFirst()
c10909013[Duel.GetCurrentChain()]=GMGlobal["Effects"]["c"..tc:GetCode()]
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_COST)
end
......
......@@ -2,6 +2,7 @@ local m=119007
local cm=_G["c"..m]
cm.name="带来死亡的神"
function cm.initial_effect(c)
aux.AddCodeList(c,119006)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
......@@ -46,7 +47,10 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetControler()
local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) then return end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local ag=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if not ag:GetFirst():IsLocation(LOCATION_HAND) then Duel.HintSelection(Group.FromCards(ag:GetFirst())) end
if ag:GetFirst():IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,ag:GetFirst()) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,ag)
local tc=g:GetFirst()
local x=0 --总 星 级
local y=0 --不 同 名 怪 兽 数 量
......@@ -70,10 +74,13 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
lv=lv+ttc:GetLevel()
g:RemoveCard(ttc)
sg:AddCard(ttc)
if not ttc:IsLocation(LOCATION_HAND) then Duel.HintSelection(Group.FromCards(ttc)) end
if ttc:IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,ttc) end
ttc=tg:GetNext()
end
local count2=0
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
sg:Merge(ag)
local ttg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,5,5,sg)
local tttc=ttg:GetFirst()
while tttc do
......@@ -81,6 +88,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
lv=lv+tttc:GetLevel()
g:RemoveCard(tttc)
sg:AddCard(tttc)
if not tttc:IsLocation(LOCATION_HAND) then Duel.HintSelection(Group.FromCards(tttc)) end
if tttc:IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,tttc) end
tttc=ttg:GetNext()
end
if lv<24 then
......@@ -90,11 +99,13 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
g:RemoveCard(ttttc)
lv=lv+ttttc:GetLevel()
sg:AddCard(ttttc)
if not ttttc:IsLocation(LOCATION_HAND) then Duel.HintSelection(Group.FromCards(ttttc)) end
if ttttc:IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,ttttc) end
end
end
sg:Sub(ag)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
Duel.BreakEffect()
local ag=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if Duel.SpecialSummon(ag,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)~=0 then
ag:GetFirst():CompleteProcedure()
Duel.Damage(1-tp,sg:GetCount()*200,REASON_EFFECT)
......
......@@ -105,7 +105,7 @@ function Sr_aonami.euip(c,tp,ec,tc,ttt)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
ec:RegisterEffect(e2)
end
function Sr_aonami.eqlimit(e,c)
return c==e:GetLabelObject()
......
......@@ -35,7 +35,7 @@ end
function cm.ovfilter(c)
if c:GetOverlayCount()<1 then return false end
local sg=c:GetOverlayGroup()
return c:IsFaceup() and sg:IsExists(Card.IsSetCard,1,nil,0xfb7)
return c:IsFaceup() and sg:IsExists(Card.IsSetCard,1,nil,0xfa7)
end
function cm.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
......
......@@ -68,7 +68,7 @@ end
function cm.epexop(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(cm.disfilter,tp,0,LOCATION_ONFIELD,nil)
if dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
if dg:GetCount()>0 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_ONFIELD,0,1,e:GetHandler(),c:GetCode()) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg1=dg:Select(tp,1,1,nil)
......
......@@ -49,7 +49,7 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
if tc then
Sr_aonami.euip(c,tp,tc,c,500)
Duel.BreakEffect()
if c.epexop(e,tp,eg,ep,ev,re,r,rp) then c.epexop(e,tp,eg,ep,ev,re,r,rp) end
if c.epexop(e,tp,eg,ep,ev,re,r,rp) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_ONFIELD,0,1,e:GetHandler(),c:GetCode()) then c.epexop(e,tp,eg,ep,ev,re,r,rp) end
end
end
function cm.epexop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -48,7 +48,7 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
if tc then
Sr_aonami.euip(c,tp,tc,c,500)
Duel.BreakEffect()
if c.epexop(e,tp,eg,ep,ev,re,r,rp) then c.epexop(e,tp,eg,ep,ev,re,r,rp) end
if c.epexop(e,tp,eg,ep,ev,re,r,rp) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_ONFIELD,0,1,e:GetHandler(),c:GetCode()) then c.epexop(e,tp,eg,ep,ev,re,r,rp) end
end
end
function cm.filter(c,e,tp)
......
......@@ -123,7 +123,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():ResetFlagEffect(m)
end
function cm.spcostfilter(c)
return c:IsSetCard(0x2e8) and c:IsAbleToRemoveAsCost()
return c:IsSetCard(0x2e8) and c:IsAbleToRemoveAsCost() and c:IsType(TYPE_MONSTER)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spcostfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
......
......@@ -35,7 +35,6 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCost(cm.cost)
e2:SetCondition(cm.ctcon)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
......
......@@ -51,9 +51,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
local cg=c:GetColumnGroup():Filter(aux.disfilter1,nil)
if aux.disfilter1(c) then cg:AddCard(c) end
if aux.disfilter1(c) then cg:AddCard(c) end
if cg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tg=cg:Select(tp,1,1,nil)
......
......@@ -63,8 +63,8 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
local cg=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,1-tp)
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
local cg=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,1-tp)
if cg:GetCount()>0 then
local tc=cg:GetFirst()
while tc do
......
......@@ -35,7 +35,7 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local cg=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,1-tp)
if cg:GetCount()>0 then
local tc=cg:GetFirst()
while tc do
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......@@ -69,7 +69,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
local cg=c:GetColumnGroup():Filter(cm.ckfilter,nil,1-tp)
if cg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
......
......@@ -57,7 +57,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
......
......@@ -55,9 +55,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
local cg=c:GetColumnGroup():Filter(Card.IsAbleToHand,nil)
local cg2=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,tp)
local cg2=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,tp)
cg:Merge(cg2)
cg:AddCard(c)
if cg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
......
......@@ -64,11 +64,11 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
local cg=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,tp)
if cg:GetCount()>0 then
local tc=cg:GetFirst()
while tc do
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -35,7 +35,7 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local cg=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,tp)
if cg:GetCount()>0 then
local tc=cg:GetFirst()
while tc do
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......@@ -69,15 +69,15 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
local cg=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,1-tp)
if cg:GetCount()>0 then
local tc=cg:GetFirst()
while tc do
while tc do
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
tc=cg:GetNext()
end
end
end
else
if Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_DECK,0,1,nil)then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -57,7 +57,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
......
......@@ -68,7 +68,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
local cg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil):Filter(cm.ckfilter1,nil,tp)
if cg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -83,8 +83,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
local ph=PHASE_END
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
if Duel.GetCurrentPhase()==PHASE_DRAW then ph=PHASE_STANDBY end
if Duel.GetCurrentPhase()==PHASE_STANDBY then ph=PHASE_MAIN1 end
if Duel.GetCurrentPhase()==PHASE_MAIN1 then ph=PHASE_BATTLE end
......
......@@ -68,7 +68,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
local cg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil):Filter(cm.ckfilter1,nil,tp)
if cg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
......
......@@ -84,7 +84,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
local ph=PHASE_END
if Duel.GetCurrentPhase()==PHASE_DRAW then ph=PHASE_STANDBY end
if Duel.GetCurrentPhase()==PHASE_STANDBY then ph=PHASE_MAIN1 end
......
......@@ -100,7 +100,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
if Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))==0 then
--disable
local e2=Effect.CreateEffect(c)
......@@ -159,7 +159,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.ConfirmCards(1-tp,g)
end
--activate from hand
local e1=Effect.CreateEffect(c)
......
......@@ -96,7 +96,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or math.abs(e:GetHandler():GetSequence()-seq)<=1 then
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then
if Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))==0 then
--disable
local e2=Effect.CreateEffect(c)
......@@ -123,13 +123,13 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
end
else
if Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2))then
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2))then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
end
end
function cm.cfilter(c,seq2)
......
......@@ -128,6 +128,7 @@ function cm.ntdop(e,tp,eg,ep,ev,re,r,rp,chk)
local tcode=c.dfc_back_side
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
end
end
......
......@@ -62,6 +62,15 @@ function cm.initial_effect(c)
e7:SetCountLimit(1)
e7:SetOperation(cm.tgop)
c:RegisterEffect(e7)
--back
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_ADJUST)
e9:SetRange(LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_HAND+LOCATION_EXTRA)
e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e9:SetCondition(cm.backon)
e9:SetOperation(cm.backop)
c:RegisterEffect(e9)
end
function cm.mvfilter1(c)
return c:IsFaceup()
......@@ -193,7 +202,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc2=sg:GetNext()
local tg1=tc1:GetColumnGroup():Filter(Card.IsControler,nil,1-tp)
local tg2=tc2:GetColumnGroup():Filter(Card.IsControler,nil,1-tp)
if cc==1 then
if cc==1 then
Duel.Destroy(tg1,REASON_EFFECT)
else
tg1:Merge(tg2)
......@@ -226,4 +235,24 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
end
end
function cm.backon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ((c:GetFlagEffect(tp,m-2)>0 and m-2) or (c:GetFlagEffect(tp,m-1)>0 and m-1)) and c:GetOriginalCode()==m
end
function cm.backop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(tp,m-2)>0 then
c:SetEntityCode(m-2)
Duel.ConfirmCards(tp,Group.FromCards(c))
Duel.ConfirmCards(1-tp,Group.FromCards(c))
c:ReplaceEffect(m-2,0,0)
end
if c:GetFlagEffect(tp,m-1)>0 then
c:SetEntityCode(m-1)
Duel.ConfirmCards(tp,Group.FromCards(c))
Duel.ConfirmCards(1-tp,Group.FromCards(c))
c:ReplaceEffect(m-1,0,0)
end
end
\ No newline at end of file
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