Commit 7f892fa6 authored by TanakaKotoha's avatar TanakaKotoha

naobaijin

parent b823fe8e
Pipeline #697 passed with stages
in 40 minutes and 42 seconds
...@@ -25,7 +25,7 @@ function cm.initial_effect(c) ...@@ -25,7 +25,7 @@ function cm.initial_effect(c)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3) c:RegisterEffect(e3)
cm.rs_sweet_baby_summon_effect=e1 cm.rs_sweet_baby_summon_effect=e2
end end
function cm.tktg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
......
...@@ -82,6 +82,7 @@ function c12004023.atkval(e,c) ...@@ -82,6 +82,7 @@ function c12004023.atkval(e,c)
return math.abs(lp1-lp2) return math.abs(lp1-lp2)
end end
function c12004023.condition(e,tp,eg,ep,ev,re,r,rp) function c12004023.condition(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetControler()
return not Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_MZONE,1,nil) return not Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_MZONE,1,nil)
end end
function c12004023.efilter(e,te) function c12004023.efilter(e,te)
......
...@@ -18,7 +18,6 @@ function cm.initial_effect(c) ...@@ -18,7 +18,6 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.operation) e1:SetOperation(cm.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -38,7 +37,7 @@ function cm.filter(c) ...@@ -38,7 +37,7 @@ function cm.filter(c)
return c:IsSetCard(0x8fb5) and c:IsAbleToHand() return c:IsSetCard(0x8fb5) and c:IsAbleToHand()
end end
function cm.filter1(c) function cm.filter1(c)
return c:IsSetCard(0x8fb5) and c:IsAbleToHand() and c:IsFacedown() return c:IsSetCard(0x5fac) and c:IsAbleToHand() and c:IsFacedown()
end end
function cm.filter2(c) function cm.filter2(c)
return c:IsSetCard(0x8fb5) and c:IsAbleToHand() and c:IsFaceup() return c:IsSetCard(0x8fb5) and c:IsAbleToHand() and c:IsFaceup()
......
...@@ -55,7 +55,7 @@ function cm.filter(c) ...@@ -55,7 +55,7 @@ function cm.filter(c)
return c:IsAbleToDeck() and c:IsSetCard(0x8fb5) return c:IsAbleToDeck() and c:IsSetCard(0x8fb5)
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 e:GetHandler():IsAbleToDeck() and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) end if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
...@@ -65,7 +65,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,7 +65,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(c,tp,2,REASON_EFFECT) Duel.SendtoDeck(c,tp,2,REASON_EFFECT)
c:ReverseInDeck() c:ReverseInDeck()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SendtoDeck(g,nil,2,REASON_EFFECT) Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
if g then if g then
g:GetFirst():ReverseInDeck() g:GetFirst():ReverseInDeck()
...@@ -83,7 +83,7 @@ function cm.spcon(e,c) ...@@ -83,7 +83,7 @@ function cm.spcon(e,c)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsFaceup() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsFaceup() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and Duel.IsPlayerCanDraw(tp,1) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,e:GetHandler()) and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
......
...@@ -52,6 +52,7 @@ function cm.initial_effect(c) ...@@ -52,6 +52,7 @@ function cm.initial_effect(c)
e3:SetDescription(aux.Stringid(m,3)) e3:SetDescription(aux.Stringid(m,3))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetTarget(cm.thtg) e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop) e3:SetOperation(cm.thop)
......
...@@ -23,7 +23,7 @@ function cm.initial_effect(c) ...@@ -23,7 +23,7 @@ function cm.initial_effect(c)
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 tt=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_MZONE,0,nil) local tt=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_MZONE,0,nil)
if tt:IsExists(Card.IsType,1,nil,REASON_FUSION) then if tt:IsExists(Card.IsType,1,nil,TYPE_FUSION) then
tt=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_MZONE,LOCATION_MZONE,nil) tt=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
end end
if chk==0 then return tt:GetCount()>0 end if chk==0 then return tt:GetCount()>0 end
......
...@@ -25,7 +25,7 @@ function cm.initial_effect(c) ...@@ -25,7 +25,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:GetCounter(0x1fb0) and c:IsAbleToHand() return c:IsFaceup() and c:GetCounter(0x1fb0)>0 and c:IsAbleToHand()
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:IsOnField() and cm.filter(chkc) and chkc~=e:GetHandler() end if chkc then return chkc:IsOnField() and cm.filter(chkc) and chkc~=e:GetHandler() end
......
...@@ -51,14 +51,16 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,14 +51,16 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
local cg=c:GetColumnGroup():Filter(aux.disfilter1,nil) 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 if cg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tg=cg:Select(tp,1,1,nil) local tg=cg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -26,13 +26,15 @@ function cm.initial_effect(c) ...@@ -26,13 +26,15 @@ function cm.initial_effect(c)
e3:SetOperation(cm.stop) e3:SetOperation(cm.stop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.ckfilter(c,tp) function cm.ckfilter1(c,tp,seq)
return c:IsType(TYPE_MONSTER) and c:IsControler(tp) local seq1=4-aux.MZoneSequence(c:GetSequence())
return c:IsFaceup() and math.abs(seq-seq1)<=1
end end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp) function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
c=e:GetHandler() c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local cg=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,1-tp) local seq=aux.MZoneSequence(c:GetSequence())
local cg=Duel.GetMatchingGroup(cm.ckfilter1,tp,0,LOCATION_MZONE,nil,tp,seq)
if cg:GetCount()>0 then if cg:GetCount()>0 then
local tc=cg:GetFirst() local tc=cg:GetFirst()
while tc do while tc do
...@@ -69,7 +71,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -69,7 +71,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
local cg=c:GetColumnGroup():Filter(cm.ckfilter,nil,1-tp) local cg=c:GetColumnGroup():Filter(cm.ckfilter,nil,1-tp)
if cg:GetCount()>0 then if cg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
......
...@@ -57,7 +57,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,7 +57,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp) local mg1=Duel.GetFusionMaterial(tp)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
......
...@@ -55,7 +55,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +55,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
local cg=c:GetColumnGroup():Filter(Card.IsAbleToHand,nil) 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:Merge(cg2)
......
...@@ -26,13 +26,15 @@ function cm.initial_effect(c) ...@@ -26,13 +26,15 @@ function cm.initial_effect(c)
e3:SetOperation(cm.stop) e3:SetOperation(cm.stop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.ckfilter(c,tp) function cm.ckfilter1(c,tp,seq)
return c:IsType(TYPE_MONSTER) and c:IsControler(tp) local seq1=aux.MZoneSequence(c:GetSequence())
return c:IsFaceup() and math.abs(seq-seq1)<=1
end end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp) function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
c=e:GetHandler() c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local cg=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,tp) local seq=aux.MZoneSequence(c:GetSequence())
local cg=Duel.GetMatchingGroup(cm.ckfilter1,tp,LOCATION_MZONE,0,nil,tp,seq)
if cg:GetCount()>0 then if cg:GetCount()>0 then
local tc=cg:GetFirst() local tc=cg:GetFirst()
while tc do while tc do
...@@ -69,7 +71,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -69,7 +71,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
local cg=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,1-tp) local cg=c:GetColumnGroup(1,1):Filter(cm.ckfilter,nil,1-tp)
if cg:GetCount()>0 then if cg:GetCount()>0 then
local tc=cg:GetFirst() local tc=cg:GetFirst()
......
...@@ -57,7 +57,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,7 +57,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp) local mg1=Duel.GetFusionMaterial(tp)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
......
...@@ -36,7 +36,7 @@ function cm.spfil(c,e,tp) ...@@ -36,7 +36,7 @@ function cm.spfil(c,e,tp)
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 cm.spfil(chkc,e,tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) end if chkc then return cm.spfil(chkc,e,tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(cm.spfil,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingTarget(cm.spfil,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
local g=Duel.SelectTarget(tp,cm.spfil,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.spfil,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
...@@ -44,7 +44,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,7 +44,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
...@@ -68,7 +68,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,7 +68,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
local cg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil):Filter(cm.ckfilter1,nil,tp) 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 if cg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
...@@ -77,9 +79,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,9 +79,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
end end
else else
if Duel.IsPlayerCanDraw(tp,1) if Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2))then and Duel.SelectYesNo(tp,aux.Stringid(m,2))then
if Duel.DiscardHand(tp,card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD,nil)~=0 then if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD,nil)~=0 then
local sg=Duel.GetOperatedGroup() local sg=Duel.GetOperatedGroup()
local sc=sg:GetFirst() local sc=sg:GetFirst()
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
......
...@@ -18,6 +18,7 @@ function cm.initial_effect(c) ...@@ -18,6 +18,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--set --set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
...@@ -83,7 +84,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,7 +84,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
if Duel.GetCurrentPhase()==PHASE_DRAW then ph=PHASE_STANDBY end if Duel.GetCurrentPhase()==PHASE_DRAW then ph=PHASE_STANDBY end
if Duel.GetCurrentPhase()==PHASE_STANDBY then ph=PHASE_MAIN1 end if Duel.GetCurrentPhase()==PHASE_STANDBY then ph=PHASE_MAIN1 end
if Duel.GetCurrentPhase()==PHASE_MAIN1 then ph=PHASE_BATTLE end if Duel.GetCurrentPhase()==PHASE_MAIN1 then ph=PHASE_BATTLE end
......
...@@ -5,9 +5,9 @@ function cm.initial_effect(c) ...@@ -5,9 +5,9 @@ function cm.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0xa341),2,true) aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0xa341),2,true)
--spsummon --des
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
...@@ -68,7 +68,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,7 +68,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
local cg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil):Filter(cm.ckfilter1,nil,tp) 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 if cg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
......
...@@ -18,6 +18,7 @@ function cm.initial_effect(c) ...@@ -18,6 +18,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--set --set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
...@@ -79,12 +80,17 @@ end ...@@ -79,12 +80,17 @@ end
function cm.setfilter(c) function cm.setfilter(c)
return c:IsSetCard(0xa341) and c:IsType(TYPE_TRAP+TYPE_SPELL) and c:IsSSetable() return c:IsSetCard(0xa341) and c:IsType(TYPE_TRAP+TYPE_SPELL) and c:IsSSetable()
end end
function cm.spfilter1(c,e,tp)
return c:IsSetCard(0xa341) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.stop(e,tp,eg,ep,ev,re,r,rp) function cm.stop(e,tp,eg,ep,ev,re,r,rp)
c=e:GetHandler() c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
local ph=PHASE_END local ph=PHASE_END
if Duel.GetCurrentPhase()==PHASE_DRAW then ph=PHASE_STANDBY end if Duel.GetCurrentPhase()==PHASE_DRAW then ph=PHASE_STANDBY end
if Duel.GetCurrentPhase()==PHASE_STANDBY then ph=PHASE_MAIN1 end if Duel.GetCurrentPhase()==PHASE_STANDBY then ph=PHASE_MAIN1 end
......
...@@ -100,7 +100,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -100,7 +100,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
if Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))==0 then if Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))==0 then
--disable --disable
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -96,7 +96,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -96,7 +96,9 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
if seq1==4-seq or (math.abs(e:GetHandler():GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq<5) then local seq2=seq
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if ((seq1==4-seq and rp==1-tp) or seq1==seq) or (rp==tp and math.abs(c:GetSequence()-seq)<=1 and loc==LOCATION_MZONE and seq2<5) then
if Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))==0 then if Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))==0 then
--disable --disable
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -122,7 +122,7 @@ function cm.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -122,7 +122,7 @@ function cm.regop(e,tp,eg,ep,ev,re,r,rp)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT) e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetTargetRange(LOCATION_ONFIELD,0) e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetValue(cm.efilter1) e3:SetValue(cm.efilter2)
e3:SetReset(RESET_PHASE+PHASE_END) e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp) Duel.RegisterEffect(e3,tp)
end end
...@@ -132,7 +132,7 @@ end ...@@ -132,7 +132,7 @@ end
function cm.disable(e,c) function cm.disable(e,c)
return c:GetFieldID()~=e:GetLabel() and (not c:IsType(TYPE_MONSTER) or (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT)) return c:GetFieldID()~=e:GetLabel() and (not c:IsType(TYPE_MONSTER) or (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT))
end end
function cm.efilter1(e,te) function cm.efilter2(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer() return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end end
...@@ -151,6 +151,7 @@ function cm.mvtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -151,6 +151,7 @@ function cm.mvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not c:IsStatus(STATUS_BATTLE_DESTROYED) end if chk==0 then return not c:IsStatus(STATUS_BATTLE_DESTROYED) end
end end
function cm.mvop(e,tp,eg,ep,ev,re,r,rp) function cm.mvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
...@@ -358,8 +359,8 @@ function cm.TojiEquip(ec,e,tp,eg,ep,ev,re,r,rp) ...@@ -358,8 +359,8 @@ function cm.TojiEquip(ec,e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE) e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetTarget(cm.mvtg) e1:SetTarget(cm.mvtg2)
e1:SetOperation(cm.mvop) e1:SetOperation(cm.mvop2)
token:RegisterEffect(e1) token:RegisterEffect(e1)
return true return true
else Duel.SendtoGrave(token,REASON_RULE) return false else Duel.SendtoGrave(token,REASON_RULE) return false
...@@ -371,23 +372,13 @@ end ...@@ -371,23 +372,13 @@ end
function cm.valcon(e,re,r,rp) function cm.valcon(e,re,r,rp)
return r==REASON_BATTLE return r==REASON_BATTLE
end end
function cm.mvfilter1(c) function cm.mvtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
return c:IsFaceup()
end
function cm.mvfilter2(c,tp)
return c:IsFaceup() and c:GetSequence()<5
and Duel.IsExistingMatchingCard(cm.mvfilter3,tp,LOCATION_MZONE,0,1,c)
end
function cm.mvfilter3(c)
return c:IsFaceup() and c:GetSequence()<5
end
function cm.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local b1=Duel.IsExistingMatchingCard(cm.mvfilter1,tp,LOCATION_MZONE,0,1,nil) local b1=Duel.IsExistingMatchingCard(cm.mvfilter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0
local b2=Duel.IsExistingMatchingCard(cm.mvfilter2,tp,LOCATION_MZONE,0,1,nil,tp) local b2=Duel.IsExistingMatchingCard(cm.mvfilter2,tp,LOCATION_MZONE,0,1,nil,tp)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
end end
function cm.mvop(e,tp,eg,ep,ev,re,r,rp) function cm.mvop2(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsExistingMatchingCard(cm.mvfilter1,tp,LOCATION_MZONE,0,1,nil) local b1=Duel.IsExistingMatchingCard(cm.mvfilter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0
local b2=Duel.IsExistingMatchingCard(cm.mvfilter2,tp,LOCATION_MZONE,0,1,nil,tp) local b2=Duel.IsExistingMatchingCard(cm.mvfilter2,tp,LOCATION_MZONE,0,1,nil,tp)
...@@ -435,9 +426,9 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -435,9 +426,9 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_DECK,0,1,nil) local b1=Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local b2=Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if not (b1 or b2) then return end if not (b1 or b2) then return end
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2)) if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,6),aux.Stringid(m,7))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,1)) elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,6))
else op=Duel.SelectOption(tp,aux.Stringid(m,2))+1 end else op=Duel.SelectOption(tp,aux.Stringid(m,7))+1 end
if op==0 then if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_DECK,0,1,2,nil) local g=Duel.SelectMatchingCard(tp,cm.thfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_DECK,0,1,2,nil)
......
...@@ -12,6 +12,7 @@ cm.dfc_back_side=33400852 ...@@ -12,6 +12,7 @@ cm.dfc_back_side=33400852
c:RegisterEffect(e1) c:RegisterEffect(e1)
--move --move
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
...@@ -39,6 +40,7 @@ cm.dfc_back_side=33400852 ...@@ -39,6 +40,7 @@ cm.dfc_back_side=33400852
c:RegisterEffect(e4) c:RegisterEffect(e4)
-- --
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,5))
e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN) e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_SZONE) e5:SetRange(LOCATION_SZONE)
...@@ -103,32 +105,35 @@ function cm.actcon(e) ...@@ -103,32 +105,35 @@ function cm.actcon(e)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local a=Duel.GetAttacker() local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget() local d=Duel.GetAttackTarget()
if a and d then
local seq1=aux.MZoneSequence(a:GetSequence()) local seq1=aux.MZoneSequence(a:GetSequence())
local seq2=aux.MZoneSequence(d:GetSequence()) local seq2=aux.MZoneSequence(d:GetSequence())
return (a and cm.cfilter(a,tp)) or (d and cm.cfilter(d,tp)) and seq1==4-seq2 return ((a and cm.cfilter(a,tp)) or (d and cm.cfilter(d,tp)))and seq1==4-seq2
end
return false
end end
function cm.cfilter2(c) function cm.cfilter2(c)
return c:IsFaceup() and c:IsCode(m+1) and c:IsAbleToGrave() return c:IsFaceup() and c:IsCode(33400851) and c:IsAbleToGrave()
end end
function cm.ntdcon(e,tp,eg,ep,ev,re,r,rp) function cm.ntdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil) return Duel.IsExistingMatchingCard(cm.cfilter2,tp,LOCATION_ONFIELD,0,1,nil)
end end
function cm.ntdtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.ntdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c.dfc_back_side and c.dfc_front_side==c:GetOriginalCode() end if chk==0 then return 33400852 and 33400850==c:GetOriginalCode() end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.ntdop(e,tp,eg,ep,ev,re,r,rp,chk) function cm.ntdop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() or c:IsImmuneToEffect(e) or not Duel.IsExistingMatchingCard(cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil) then return end if not c:IsRelateToEffect(e) or c:IsFacedown() or c:IsImmuneToEffect(e) or not Duel.IsExistingMatchingCard(cm.cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil)
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
local tcode=c.dfc_back_side local tcode=c.dfc_back_side
c:SetEntityCode(tcode,true) c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0) c:ReplaceEffect(tcode,0,0)
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0) c:RegisterFlagEffect(33400850,0,0,0)
end end
end end
......
...@@ -12,6 +12,7 @@ cm.dfc_back_side=33400852 ...@@ -12,6 +12,7 @@ cm.dfc_back_side=33400852
c:RegisterEffect(e1) c:RegisterEffect(e1)
--move --move
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
...@@ -22,12 +23,17 @@ cm.dfc_back_side=33400852 ...@@ -22,12 +23,17 @@ cm.dfc_back_side=33400852
--disable --disable
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCondition(cm.actcon) e3:SetCondition(cm.actcon)
e3:SetOperation(cm.disop) e3:SetOperation(cm.disop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e6=e3:Clone()
e6:SetCode(EVENT_BE_BATTLE_TARGET)
c:RegisterEffect(e6)
-- --
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,5))
e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN) e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_SZONE) e5:SetRange(LOCATION_SZONE)
...@@ -88,65 +94,83 @@ end ...@@ -88,65 +94,83 @@ end
function cm.cfilter(c,tp) function cm.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xa341) and c:IsControler(tp) return c:IsFaceup() and c:IsSetCard(0xa341) and c:IsControler(tp)
end end
function cm.ckfilter2(c,tp) function cm.actcon(e,tp)
return c:IsFaceup() and c:IsControler(tp) local c=Duel.GetAttackTarget()
end if not c then return false end
function cm.actcon(e) local seq1=aux.MZoneSequence(c:GetSequence())
local tp=e:GetHandlerPlayer() local tc=Duel.GetAttacker()
local a=Duel.GetAttacker() if not tc then return false end
local d=Duel.GetAttackTarget() local seq2=aux.MZoneSequence(tc:GetSequence())
local seq1=aux.MZoneSequence(a:GetSequence()) if c:IsControler(1-tp) then c=Duel.GetAttacker() end
local seq2=aux.MZoneSequence(d:GetSequence()) return c and cm.cfilter(c,tp) and seq1==4-seq2
return (a and cm.cfilter(a,tp)) or (d and cm.cfilter(d,tp)) and seq1==4-seq2
end end
function cm.disop(e,tp,eg,ep,ev,re,r,rp,chk) function cm.disop(e,tp,eg,ep,ev,re,r,rp,chk)
local tp=e:GetHandlerPlayer() local c=e:GetHandler()
local a=Duel.GetAttacker() local tc=Duel.GetAttackTarget()
local d=Duel.GetAttackTarget() local dc=4-tc:GetSequence()
local t if tc:IsControler(tp) then
if d and cm.cfilter(d,tp) then tc=Duel.GetAttacker()
t=d dc=dc
d=a
a=t
end end
local cg=a:GetColumnGroup():Filter(cm.ckfilter2,nil,1-tp) c:CreateRelation(tc,RESET_EVENT+RESETS_STANDARD)
if cg:GetCount()>0 then
local tc=cg:GetFirst()
while tc do
if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetCondition(cm.discon2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET) e2:SetCondition(cm.discon2)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then local e4=Effect.CreateEffect(c)
local e3=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD)
e3:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_DISABLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetTargetRange(0,LOCATION_ONFIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e4:SetTarget(cm.distg2)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE) e4:SetReset(RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e3) e4:SetLabel(dc)
end Duel.RegisterEffect(e4,tp)
end local e5=Effect.CreateEffect(c)
tc=cg:GetNext() e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
end e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetOperation(cm.disop2)
e5:SetReset(RESET_PHASE+PHASE_BATTLE)
e5:SetLabel(dc)
Duel.RegisterEffect(e5,tp)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e6:SetTargetRange(0,LOCATION_ONFIELD)
e6:SetTarget(cm.distg2)
e6:SetReset(RESET_PHASE+PHASE_BATTLE)
e6:SetLabel(dc)
Duel.RegisterEffect(e6,tp)
end
function cm.discon2(e)
return e:GetOwner():IsRelateToCard(e:GetHandler())
end
function cm.distg2(e,c)
local seq=e:GetLabel()
local tp=e:GetHandlerPlayer()
return aux.GetColumn(c,tp)==seq
end
function cm.disop2(e,tp,eg,ep,ev,re,r,rp)
local tseq=e:GetLabel()
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if rp==1-tp and seq==4-tseq then
Duel.NegateEffect(ev)
end end
end end
function cm.cfilter2(c) function cm.cfilter2(c)
return c:IsFaceup() and c:IsCode(m-1) and c:IsAbleToGrave() return c:IsFaceup() and c:IsCode(33400850) and c:IsAbleToGrave()
end end
function cm.ntdcon(e,tp,eg,ep,ev,re,r,rp) function cm.ntdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil) return Duel.IsExistingMatchingCard(cm.cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil)
end end
function cm.ntdtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.ntdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -155,14 +179,14 @@ function cm.ntdtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -155,14 +179,14 @@ function cm.ntdtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.ntdop(e,tp,eg,ep,ev,re,r,rp,chk) function cm.ntdop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() or c:IsImmuneToEffect(e) or not Duel.IsExistingMatchingCard(cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil) then return end if not c:IsRelateToEffect(e) or c:IsFacedown() or c:IsImmuneToEffect(e) or not Duel.IsExistingMatchingCard(cm.cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil)
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
local tcode=c.dfc_back_side local tcode=c.dfc_back_side
c:SetEntityCode(tcode,true) c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0) c:ReplaceEffect(tcode,0,0)
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0) c:RegisterFlagEffect(33400851,0,0,0)
end end
end end
......
...@@ -129,53 +129,74 @@ function cm.ckfilter2(c,tp) ...@@ -129,53 +129,74 @@ function cm.ckfilter2(c,tp)
return c:IsFaceup() and c:IsControler(tp) return c:IsFaceup() and c:IsControler(tp)
end end
function cm.actcon(e) function cm.actcon(e)
local tp=e:GetHandlerPlayer() local c=Duel.GetAttackTarget()
local a=Duel.GetAttacker() if not c then return false end
local d=Duel.GetAttackTarget() local seq1=aux.MZoneSequence(c:GetSequence())
local seq1=aux.MZoneSequence(a:GetSequence()) local tc=Duel.GetAttacker()
local seq2=aux.MZoneSequence(d:GetSequence()) if not tc then return false end
return (a and cm.cfilter(a,tp)) or (d and cm.cfilter(d,tp)) and seq1==4-seq2 local seq2=aux.MZoneSequence(tc:GetSequence())
if c:IsControler(1-tp) then c=Duel.GetAttacker() end
return c and cm.cfilter(c,tp) and seq1==4-seq2
end end
function cm.disop(e,tp,eg,ep,ev,re,r,rp,chk) function cm.disop(e,tp,eg,ep,ev,re,r,rp,chk)
local tp=e:GetHandlerPlayer() local c=e:GetHandler()
local a=Duel.GetAttacker() local tc=Duel.GetAttackTarget()
local d=Duel.GetAttackTarget() local dc=4-tc:GetSequence()
local t if tc:IsControler(tp) then
if d and cm.cfilter(d,tp) then tc=Duel.GetAttacker()
t=d dc=dc
d=a
a=t
end end
local cg=a:GetColumnGroup():Filter(cm.ckfilter2,nil,1-tp) c:CreateRelation(tc,RESET_EVENT+RESETS_STANDARD)
if cg:GetCount()>0 then
local tc=cg:GetFirst()
while tc do
if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetCondition(cm.discon2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET) e2:SetCondition(cm.discon2)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then local e4=Effect.CreateEffect(c)
local e3=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD)
e3:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_DISABLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetTargetRange(0,LOCATION_ONFIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e4:SetTarget(cm.distg2)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE) e4:SetReset(RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e3) e4:SetLabel(dc)
end Duel.RegisterEffect(e4,tp)
end local e5=Effect.CreateEffect(c)
tc=cg:GetNext() e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
end e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetOperation(cm.disop2)
e5:SetReset(RESET_PHASE+PHASE_BATTLE)
e5:SetLabel(dc)
Duel.RegisterEffect(e5,tp)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e6:SetTargetRange(0,LOCATION_ONFIELD)
e6:SetTarget(cm.distg2)
e6:SetReset(RESET_PHASE+PHASE_BATTLE)
e6:SetLabel(dc)
Duel.RegisterEffect(e6,tp)
end
function cm.discon2(e)
return e:GetOwner():IsRelateToCard(e:GetHandler())
end
function cm.distg2(e,c)
local seq=e:GetLabel()
local tp=e:GetHandlerPlayer()
return aux.GetColumn(c,tp)==seq
end
function cm.disop2(e,tp,eg,ep,ev,re,r,rp)
local tseq=e:GetLabel()
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
if re:IsActiveType(TYPE_MONSTER) then seq=aux.MZoneSequence(seq) end
if rp==1-tp and seq==4-tseq then
Duel.NegateEffect(ev)
end end
end end
...@@ -189,9 +210,9 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -189,9 +210,9 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_MZONE,0,1,2,nil) Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_MZONE,0,1,2,nil)
end end
function cm.seqfilter(c,seq1,seq2) function cm.seqfilter(c,seq1,seq2)
local seq=4-c:GetSequence() local seq=c:GetSequence()
return (seq>seq1 and seq<seq2 ) or c:IsType(TYPE_FIELD) if c:IsType(TYPE_MONSTER) then seq=aux.MZoneSequence(c:GetSequence()) end
return (4-seq>seq1 and 4-seq<seq2 ) or c:IsType(TYPE_FIELD)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
...@@ -199,9 +220,13 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -199,9 +220,13 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
if sg:GetCount()==0 then return end if sg:GetCount()==0 then return end
local cc=sg:GetCount() local cc=sg:GetCount()
local tc1=sg:GetFirst() local tc1=sg:GetFirst()
local tc2=sg:GetNext() local tc2
local tg2
if cc>1 then
tc2=sg:GetNext()
tg2=tc2:GetColumnGroup():Filter(Card.IsControler,nil,1-tp)
end
local tg1=tc1:GetColumnGroup():Filter(Card.IsControler,nil,1-tp) 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) Duel.Destroy(tg1,REASON_EFFECT)
else else
...@@ -239,20 +264,22 @@ end ...@@ -239,20 +264,22 @@ end
function cm.backon(e,tp,eg,ep,ev,re,r,rp) function cm.backon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() 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 return ((c:GetFlagEffect(33400850)>0 and 33400850) or (c:GetFlagEffect(33400851)>0 and 33400851)) and c:GetOriginalCode()==33400852
end end
function cm.backop(e,tp,eg,ep,ev,re,r,rp) function cm.backop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:GetFlagEffect(tp,m-2)>0 then if c:GetFlagEffect(33400850)>0 then
c:SetEntityCode(m-2) c:SetEntityCode(33400850)
Duel.ConfirmCards(tp,Group.FromCards(c)) Duel.ConfirmCards(tp,Group.FromCards(c))
Duel.ConfirmCards(1-tp,Group.FromCards(c)) Duel.ConfirmCards(1-tp,Group.FromCards(c))
c:ReplaceEffect(m-2,0,0) c:ReplaceEffect(33400850,0,0)
c:ResetFlagEffect(33400850)
end end
if c:GetFlagEffect(tp,m-1)>0 then if c:GetFlagEffect(33400851)>0 then
c:SetEntityCode(m-1) c:SetEntityCode(33400851)
Duel.ConfirmCards(tp,Group.FromCards(c)) Duel.ConfirmCards(tp,Group.FromCards(c))
Duel.ConfirmCards(1-tp,Group.FromCards(c)) Duel.ConfirmCards(1-tp,Group.FromCards(c))
c:ReplaceEffect(m-1,0,0) c:ReplaceEffect(33400851,0,0)
c:ResetFlagEffect(33400851)
end end
end end
\ No newline at end of file
...@@ -36,13 +36,16 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -36,13 +36,16 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function cm.ckfilter1(c,mat) function cm.ckfilter1(c,mat,tp)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
return c:IsOnField() and mat:IsExists(cm.ckfilter2,1,c,seq) return c:IsOnField() and mat:IsExists(cm.ckfilter2,1,c,tp,seq1)
end end
function cm.ckfilter2(c,seq) function cm.ckfilter2(c,tp,seq)
local seq1=aux.MZoneSequence(c:GetSequence()) local seq1=aux.MZoneSequence(c:GetSequence())
return c:IsOnField() and c:IsControler(tp) and math.abs(seq1-seq)<=1 if seq then
return c:IsOnField() and ((seq<5 and math.abs(c:GetSequence()-seq)<=1) or (seq==seq1 or seq==4-seq1))
end
return false
end end
function cm.desfilter(c) function cm.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
...@@ -54,6 +57,7 @@ function cm.efilter(e,re) ...@@ -54,6 +57,7 @@ function cm.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer() return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
...@@ -74,18 +78,18 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,18 +78,18 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
local cg=mat1:IsExists(cm.ckfilter1,1,nil,mat1) local cg=mat1:IsExists(cm.ckfilter1,1,nil,mat1,tp)
tc:SetMaterial(mat1) if cg then
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) local e3=Effect.CreateEffect(c)
Duel.BreakEffect() e3:SetType(EFFECT_TYPE_SINGLE)
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) e3:SetCode(EFFECT_IMMUNE_EFFECT)
else e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf) e3:SetRange(LOCATION_MZONE)
local fop=ce:GetOperation() e3:SetValue(cm.efilter)
fop(ce,e,tp,tc,mat2) e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
end e3:SetOwnerPlayer(tp)
tc:CompleteProcedure() tc:RegisterEffect(e3)
if cg>0 and Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then if Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local b1=Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) local b1=Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b2=Duel.IsExistingMatchingCard(cm.desfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) local b2=Duel.IsExistingMatchingCard(cm.desfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2)) if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
...@@ -103,16 +107,16 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -103,16 +107,16 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
if cg>0 then tc:CompleteProcedure()
local e3=Effect.CreateEffect(c) end
e3:SetType(EFFECT_TYPE_SINGLE) tc:SetMaterial(mat1)
e3:SetCode(EFFECT_IMMUNE_EFFECT) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) Duel.BreakEffect()
e3:SetRange(LOCATION_MZONE) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
e3:SetValue(cm.efilter) else
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE) local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
e3:SetOwnerPlayer(tp) local fop=ce:GetOperation()
tc:RegisterEffect(e3) fop(ce,e,tp,tc,mat2)
end end
end end
end end
\ No newline at end of file
...@@ -12,6 +12,9 @@ function cm.initial_effect(c) ...@@ -12,6 +12,9 @@ function cm.initial_effect(c)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e4=e1:Clone()
e1:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e4)
--move --move
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
......
...@@ -86,9 +86,9 @@ function c33700921.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,9 +86,9 @@ function c33700921.operation(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(33700921,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) e:GetHandler():RegisterFlagEffect(33700921,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end end
function c33700921.dop(e,tp,eg,ep,ev,re,r,rp) function c33700921.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,0)
if Duel.SelectYesNo(tp,aux.Stringid(33700921,0)) then if Duel.SelectYesNo(tp,aux.Stringid(33700921,0)) then
Duel.Recover(tp,ev,REASON_EFFECT) Duel.Recover(tp,ev,REASON_EFFECT)
end end
Duel.ChangeBattleDamage(ep,0)
end end
...@@ -65,8 +65,8 @@ function c33700933.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -65,8 +65,8 @@ function c33700933.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c33700933.activate(e,tp,eg,ep,ev,re,r,rp,chk) function c33700933.activate(e,tp,eg,ep,ev,re,r,rp,chk)
local lp=Duel.GetLP(tp)-1 local lp=Duel.GetLP(tp)-1
if lp<=0 then return end if Duel.GetLP(tp)<=1 then return end
Duel.SetLP(tp,lp) Duel.SetLP(tp,1)
local b1=lp<9999 local b1=lp<9999
local b2=lp>=9999 and Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) local b2=lp>=9999 and Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b3=lp>=15000 and Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,LOCATION_HAND,1,nil) local b3=lp>=15000 and Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,LOCATION_HAND,1,nil)
......
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