Commit b5fee1ff authored by Tachibana's avatar Tachibana

1145141919810

parent 6efad2e5
Pipeline #14320 passed with stages
in 30 minutes and 47 seconds
......@@ -7,10 +7,11 @@ function cm.initial_effect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_TOHAND+CATEGORY_REMOVE+CATEGORY_TOGRAVE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(cm.scon1)
e2:SetTarget(cm.stg)
e2:SetOperation(cm.sop)
c:RegisterEffect(e2)
--Activate
local e1=e2:Clone()
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
......@@ -21,9 +22,12 @@ end
function cm.cfilter(c)
return c:IsFaceup() and c:IsCode(10701101)
end
function cm.cfilter1(c)
return c:IsFaceup() and not c:IsSetCard(0x3481)
end
function cm.scon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
and Duel.GetTurnPlayer()~=tp and not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
return not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) and
not Duel.IsExistingMatchingCard(cm.cfilter1,tp,LOCATION_MZONE,0,1,nil)
end
function cm.stg(e,tp,eg,ep,ev,re,r,rp,chk)
--self
......@@ -48,13 +52,13 @@ function cm.sop(e,tp,eg,ep,ev,re,r,rp)
local b3=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,1-tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,1-tp,LOCATION_HAND,0,1,nil) and Duel.IsPlayerCanDraw(1-tp,1)
--Select
local op1=0
if a1 and a2 and a3 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,0),aux.Stringid(m,1),aux.Stringid(m,2))
elseif a1 and a2 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif a2 and a3 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,2))+1
elseif a1 and a3 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,0),aux.Stringid(m,2)+1)
elseif a1 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,0))
elseif a2 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1))+1
elseif a3 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,2))+2
if a1 and a2 and a3 then op1=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1),aux.Stringid(m,2))
elseif a1 and a2 then op1=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif a2 and a3 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))+1
elseif a1 and a3 then op1=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,2)+1)
elseif a1 then op1=Duel.SelectOption(tp,aux.Stringid(m,0))
elseif a2 then op1=Duel.SelectOption(tp,aux.Stringid(m,1))+1
elseif a3 then op1=Duel.SelectOption(tp,aux.Stringid(m,2))+2
else return end
local op2=0
if b1 and b2 and b3 then op2=Duel.SelectOption(1-tp,aux.Stringid(m,0),aux.Stringid(m,1),aux.Stringid(m,2))
......@@ -68,7 +72,7 @@ function cm.sop(e,tp,eg,ep,ev,re,r,rp)
--active
if op1==op2 then
if op1==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local tc=Duel.SelectMatchingCard(tp,aux.NegateMonsterFilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if tc and tc:IsLocation(LOCATION_MZONE) then
local e1=Effect.CreateEffect(c)
......@@ -96,6 +100,7 @@ function cm.sop(e,tp,eg,ep,ev,re,r,rp)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DISABLE)
local tc1=Duel.SelectMatchingCard(1-tp,aux.NegateMonsterFilter,1-tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if tc1 and tc1:IsLocation(LOCATION_MZONE) then
local e1=Effect.CreateEffect(c)
......@@ -126,64 +131,83 @@ function cm.sop(e,tp,eg,ep,ev,re,r,rp)
elseif op1==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
local tc1=Duel.SelectMatchingCard(1-tp,Card.IsAbleToHand,1-tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if Duel.SendtoHand(tc,REASON_EFFECT)~=0 then
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc2=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,1,1,nil):GetFirst()
Duel.Remove(tc2,POS_FACEDOWN,REASON_EFFECT)
end
if Duel.SendtoHand(tc1,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local tc1=Duel.SelectMatchingCard(1-tp,Card.IsAbleToHand,1-tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if Duel.SendtoHand(tc1,nil,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local tc2=Duel.SelectMatchingCard(1-tp,Card.IsAbleToRemove,1-tp,LOCATION_EXTRA,0,1,1,nil):GetFirst()
Duel.Remove(tc2,POS_FACEDOWN,REASON_EFFECT)
end
elseif op1==2 then
local sg1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil)
local sg2=Duel.GetMatchingGroup(Card.IsAbleToRemove,1-tp,LOCATION_HAND,0,nil)
local x1=0
local x2=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 then
local sg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,LOCATION_HAND,nil)
if Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local oc=sg:GetFirst()
while sg do
local e1=Effect.CreateEffect(cc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(oc)
e1:SetCountLimit(1)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
oc=sg:GetNext()
end
Duel.Draw(tp,2,REASON_EFFECT)
end
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and Duel.Remove(sg1,POS_FACEDOWN,REASON_EFFECT)~=0 then
x1=1
end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local tc1=Duel.SelectMatchingCard(1-tp,Card.IsAbleToGrave,1-tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if Duel.SendtoGrave(tc1,REASON_EFFECT)~=0 and Duel.Remove(sg2,POS_FACEDOWN,REASON_EFFECT)~=0 then
x2=1
end
local tc1=Duel.SelectMatchingCard(1-tp,Card.IsAbleToGrave,1-tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if Duel.SendtoGrave(tc1,REASON_EFFECT)~=0 then
local sg=Duel.GetMatchingGroup(Card.IsAbleToRemove,1-tp,LOCATION_HAND,0,nil)
if Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local oc=sg:GetFirst()
while sg do
local e1=Effect.CreateEffect(cc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(oc)
e1:SetCountLimit(1)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
oc=sg:GetNext()
end
Duel.Draw(1-tp,2,REASON_EFFECT)
local fid=c:GetFieldID()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetCondition(cm.retcon)
e1:SetOperation(cm.retop)
e1:SetReset(RESET_PHASE+PHASE_END)
if x1==1 and x2==1 then
local sg=Group.__add(sg1,sg2)
sg:KeepAlive()
e1:SetLabelObject(sg)
Duel.RegisterEffect(e1,tp)
Duel.Draw(tp,2,REASON_EFFECT)
Duel.Draw(1-tp,2,REASON_EFFECT)
local sc=sg:GetFirst()
while sc do
sc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
sc=sg:GetNext()
end
elseif x1==1 then
sg1:KeepAlive()
e1:SetLabelObject(sg1)
Duel.RegisterEffect(e1,tp)
Duel.Draw(tp,2,REASON_EFFECT)
local sc=sg1:GetFirst()
while sc do
sc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
sc=sg1:GetNext()
end
elseif x2==1 then
sg2:KeepAlive()
e1:SetLabelObject(sg2)
Duel.RegisterEffect(e1,tp)
Duel.Draw(1-tp,2,REASON_EFFECT)
local sc=sg2:GetFirst()
while sc do
sc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
sc=sg2:GetNext()
end
end
else return end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,1,nil)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,1,nil)
local g2=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,1,1,nil)
local g3=Duel.SelectMatchingCard(1-tp,Card.IsAbleToGrave,1-tp,LOCATION_HAND,0,1,1,nil)
local g4=Duel.SelectMatchingCard(1-tp,Card.IsAbleToGrave,1-tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local g3=Duel.SelectMatchingCard(1-tp,Card.IsAbleToGrave,1-tp,LOCATION_HAND,0,1,1,nil)
local g4=Duel.SelectMatchingCard(1-tp,Card.IsAbleToGrave,1-tp,LOCATION_ONFIELD,0,1,1,nil)
g1:Merge(g2,g3,g4)
Duel.SendtoGrave(g1,REASON_EFFECT)
end
......@@ -207,13 +231,27 @@ end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function cm.retfilter(c,label)
return c:GetFlagEffectLabel(m)==label
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local sg=g:Filter(cm.retfilter,nil,e:GetLabel())
if sg:GetCount()>0 then
return true
else
e:Reset()
return false
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
local g=e:GetLabelObject()
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
--
function cm.scon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
and Duel.GetTurnPlayer()~=tp and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) and
not Duel.IsExistingMatchingCard(cm.cfilter1,tp,LOCATION_MZONE,0,1,nil)
end
......
......@@ -37,7 +37,7 @@ function cm.initial_effect(c)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
end
function cm.tgfilter(c)
function cm.tgfilter(c,e,tp)
return c:IsSetCard(0x3481) or c:IsRace(RACE_ZOMBIE) and c:IsAbleToGrave() and
Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode())
end
......@@ -45,10 +45,10 @@ function cm.spfilter(c,e,tp,code)
return c:IsSetCard(0x3481) and not c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,0,1,nil) and (Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) or Duel.GetTurnPlayer()~=1-tp) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.tgfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) and (Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) or Duel.GetTurnPlayer()~=tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
......@@ -58,7 +58,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and Duel.SendtoGrave(tc,0,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,code) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,code)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) and Duel.GetTurnPlayer()~=tp then
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) and Duel.GetTurnPlayer()==tp then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if g1:GetCount()>0 then
......
......@@ -84,8 +84,9 @@ function cm.ntrop(e,tp,eg,ep,ev,re,r,rp)
Duel.GetControl(tc,tp)
--cannot attack, trigger
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_TARGET)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_ATTACK)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_TRIGGER)
......
......@@ -88,10 +88,5 @@ end
function cm.excon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsCode(10701101)
end
--
function cm.excon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsCode(10701101)
end
......@@ -32,6 +32,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
--SpecialSummon others
local e4=e3:Clone()
e4:SetCondition(cm.ocon)
e4:SetTarget(cm.otg)
e4:SetOperation(cm.oop)
c:RegisterEffect(e4)
......@@ -76,7 +77,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.tgtg(e,c)
return not e:GetLabelObject()
return c~=e:GetLabelObject()
end
--SpecialSummon self
function cm.scon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -5,7 +5,6 @@ function cm.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,cm.ffilter,2,true)
--aux.AddFusionProcFun2(c,cm.ffilter1,cm.ffilter2,true)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -16,7 +15,6 @@ function cm.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_CONTROL)
e3:SetType(EFFECT_TYPE_IGNITION)
--e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e3:SetCondition(cm.condition)
......@@ -31,8 +29,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
end
function cm.ffilter(c,fc,sub,mg,sg)
return not sg or sg:FilterCount(aux.TRUE,c)==0
or (c:IsSetCard(0xa01) and c:IsType(TYPE_MONSTER) and c:IsLevelAbove(1) and sg:IsExists(Card.IsLevelAbove,1,c,10-c:GetLevel()))
return c:IsFusionSetCard(0xa01) and c:IsLevelAbove(1) and (not sg or sg:FilterCount(aux.TRUE,c)==0
or sg:IsExists(Card.IsLevelAbove,1,c,10-c:GetLevel()))
end
function cm.ffilter2(c)
return c:IsFusionSetCard(0xa01)
......
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