Commit 3aec8474 authored by Huangnan's avatar Huangnan

fix

parent b8f80cdf
Pipeline #29965 passed with stages
in 37 minutes and 27 seconds
......@@ -22,6 +22,7 @@ function c33332306.initial_effect(c)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetCountLimit(1,id+o)
......
......@@ -58,12 +58,12 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
local ctype=bit.band(g:GetFirst():GetType(),TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)
local dg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp,ctype,tgc)
local dg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp,ctype,g:GetFirst())
Duel.HintSelection(g)
local tc=dg:GetFirst()
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if tc and Duel.SpecialSummonStep(tc,nil,tp,tp,true,false,POS_FACEUP)~=0 then
if Duel.SpecialSummonStep(tc,nil,tp,tp,true,false,POS_FACEUP)~=0 then
local ra=g:GetFirst():GetRace()
local att=g:GetFirst():GetAttribute()
local e1=Effect.CreateEffect(c)
......
......@@ -27,8 +27,7 @@ function cm.cfilter1(c)
return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end
function cm.cfilter2(c)
return (c:GetType()==TYPE_SPELL or c:IsType(TYPE_QUICKPLAY))
and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end
function cm.cfilterz(c)
return c:IsFaceup() and cm.Spiritualist(c)
......@@ -38,13 +37,15 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,4,0,1,nil) then return end
cm_copy = false
local g = {}
local x = 0
if Duel.IsPlayerAffectedByEffect(tp,40011471) then
g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)
g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)+Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
x=1
else
g=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
end
if #g<=0 then return end
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
if Duel.SelectYesNo(tp,aux.Stringid(m,1+x)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
......@@ -55,7 +56,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
Duel.ClearOperationInfo(0)
end
end
function cm.filter(c)
......
......@@ -27,25 +27,26 @@ function cm.cfilter1(c)
return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end
function cm.cfilter2(c)
return (c:GetType()==TYPE_SPELL or c:IsType(TYPE_QUICKPLAY))
and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end
function cm.cfilterz(c)
return c:IsFaceup() and cm.Spiritualist(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,4,0,1,nil) then return end
if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,LOCATION_MZONE,0,1,nil) then return end
cm_copy = false
local g = {}
local x = 0
if Duel.IsPlayerAffectedByEffect(tp,40011471) then
g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)
g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)+Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
x=1
else
g=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
end
if #g<=0 then return end
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
if Duel.SelectYesNo(tp,aux.Stringid(m,1+x)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
cm_copy = true
......@@ -55,7 +56,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
Duel.ClearOperationInfo(0)
end
end
function cm.filter(c)
......
......@@ -27,25 +27,26 @@ function cm.cfilter1(c)
return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end
function cm.cfilter2(c)
return (c:GetType()==TYPE_SPELL or c:IsType(TYPE_QUICKPLAY))
and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end
function cm.cfilterz(c)
return c:IsFaceup() and cm.Spiritualist(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,4,0,1,nil) then return end
if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,LOCATION_MZONE,0,1,nil) then return end
cm_copy = false
local g = {}
local x = 0
if Duel.IsPlayerAffectedByEffect(tp,40011471) then
g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)
g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)+Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
x=1
else
g=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
end
if #g<=0 then return end
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
if Duel.SelectYesNo(tp,aux.Stringid(m,1+x)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
cm_copy = true
......@@ -55,7 +56,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
Duel.ClearOperationInfo(0)
end
end
function cm.filter(c,e,tp)
......
......@@ -38,25 +38,26 @@ function cm.cfilter1(c)
return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end
function cm.cfilter2(c)
return (c:GetType()==TYPE_SPELL or c:IsType(TYPE_QUICKPLAY))
and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end
function cm.cfilterz(c)
return c:IsFaceup() and cm.Spiritualist(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,4,0,1,nil) then return end
if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,LOCATION_MZONE,0,1,nil) then return end
cm_copy = false
local g = {}
local x = 0
if Duel.IsPlayerAffectedByEffect(tp,40011471) then
g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)
g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)+Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
x=1
else
g=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
end
if #g<=0 then return end
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
if Duel.SelectYesNo(tp,aux.Stringid(m,1+x)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
cm_copy = true
......@@ -66,7 +67,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
Duel.ClearOperationInfo(0)
end
end
function cm.filter(c)
......
......@@ -98,12 +98,12 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.spfilter(c,e,tp,ctype)
return c:IsType(ctype) and c:IsCanBeSpecialSummoned(e,nil,tp,true,true) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and cm.MagicCombineDemon(c)
function cm.spfilter(c,e,tp,ctype,tgc)
return c:IsType(ctype) and c:IsCanBeSpecialSummoned(e,nil,tp,true,true) and Duel.GetLocationCountFromEx(tp,tp,tgc,c)>0 and cm.MagicCombineDemon(c)
end
function cm.tgfilter(c,e,tp)
local ctype=bit.band(c:GetType(),TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)
return c:IsFaceup() and ctype~=0 and c:IsAbleToGrave() and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp,ctype)
return c:IsFaceup() and ctype~=0 and c:IsAbleToGrave() and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp,ctype,c)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
......@@ -115,7 +115,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
local ctype=bit.band(g:GetFirst():GetType(),TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)
local dg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp,ctype)
local dg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp,ctype,g:GetFirst())
Duel.HintSelection(g)
local tc=dg:GetFirst()
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
......
......@@ -30,17 +30,19 @@ function cm.cfilterz(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,4,0,1,nil) then return end
if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,LOCATION_MZONE,0,1,nil) then return end
cm_copy = false
local g = {}
local x = 0
if Duel.IsPlayerAffectedByEffect(tp,40011471) then
g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)
g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)+Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
x=1
else
g=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
end
if #g<=0 then return end
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
if Duel.SelectYesNo(tp,aux.Stringid(m,1+x)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
cm_copy = true
......@@ -50,7 +52,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
Duel.ClearOperationInfo(0)
end
end
function cm.filter(c)
......@@ -73,6 +75,15 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
if cm_copy then
cm_copy = false
local te=e:GetLabelObject()
if te then
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
......@@ -80,6 +91,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.BreakEffect()
end
if cm_copy then
cm_copy = false
local te=e:GetLabelObject()
......@@ -89,6 +101,5 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
end
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