Commit 2b81782a authored by POLYMER's avatar POLYMER

fix

parent 53cdc751
...@@ -24,40 +24,38 @@ function cm.MagicCombineDemon(c) ...@@ -24,40 +24,38 @@ function cm.MagicCombineDemon(c)
return m and m.named_with_MagicCombineDemon return m and m.named_with_MagicCombineDemon
end end
function cm.cfilter1(c) function cm.cfilter1(c)
return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilter2(c) function cm.cfilter2(c)
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return (c:GetType()==TYPE_SPELL or c:IsType(TYPE_QUICKPLAY))
and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilterz(c) function cm.cfilterz(c)
return c:IsFaceup() and cm.Spiritualist(c) return c:IsFaceup() and cm.Spiritualist(c)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil) if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,4,0,1,nil) then return end
local g2=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil) cm_copy = false
local g = {}
if Duel.IsPlayerAffectedByEffect(tp,40011471) then if Duel.IsPlayerAffectedByEffect(tp,40011471) then
g1:Merge(g2) g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)
end
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(cm.cfilterz,tp,LOCATION_MZONE,0,1,nil) then
if Duel.IsPlayerAffectedByEffect(tp,40011471) then
Duel.SelectYesNo(tp,aux.Stringid(m,2))
else else
Duel.SelectYesNo(tp,aux.Stringid(m,1)) g=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) if #g<=0 then return end
local sg=g1:Select(tp,1,1,nil):GetFirst() if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
local te,ceg,cep,cev,cre,cr,crp=sg:CheckActivateEffect(false,true,true) cm_copy = true
local te,ceg,cep,cev,cre,cr,crp=sg:GetFirst():CheckActivateEffect(true,true,true)
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
local tg=te:GetTarget() local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject()) te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te) e:SetLabelObject(te)
Duel.ClearOperationInfo(0) Duel.ClearOperationInfo(0)
e:SetLabel(1)
else
e:SetLabel(0)
end end
end end
function cm.filter(c) function cm.filter(c)
...@@ -71,14 +69,14 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -71,14 +69,14 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(3,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_HAND) then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.BreakEffect() Duel.BreakEffect()
if e:GetLabel()==1 then if cm_copy then
cm_copy = false
local te=e:GetLabelObject() local te=e:GetLabelObject()
if te then if te then
e:SetLabelObject(te:GetLabelObject()) e:SetLabelObject(te:GetLabelObject())
...@@ -87,16 +85,14 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,16 +85,14 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
local sg=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_MZONE,0,nil) local sg=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_MZONE,0,nil)
local tc=sg:GetFirst() if #sg then return end
while tc do for tc in aux.Next(sg) do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000) e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
tc=sg:GetNext()
end
end end
end end
end end
\ No newline at end of file
...@@ -24,53 +24,51 @@ function cm.MagicCombineMagic(c) ...@@ -24,53 +24,51 @@ function cm.MagicCombineMagic(c)
return m and m.named_with_MagicCombineMagic return m and m.named_with_MagicCombineMagic
end end
function cm.cfilter1(c) function cm.cfilter1(c)
return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilter2(c) function cm.cfilter2(c)
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return (c:GetType()==TYPE_SPELL or c:IsType(TYPE_QUICKPLAY))
and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilterz(c) function cm.cfilterz(c)
return c:IsFaceup() and cm.Spiritualist(c) return c:IsFaceup() and cm.Spiritualist(c)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil) if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,4,0,1,nil) then return end
local g2=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil) cm_copy = false
local g = {}
if Duel.IsPlayerAffectedByEffect(tp,40011471) then if Duel.IsPlayerAffectedByEffect(tp,40011471) then
g1:Merge(g2) g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)
end
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(cm.cfilterz,tp,LOCATION_MZONE,0,1,nil) then
if Duel.IsPlayerAffectedByEffect(tp,40011471) then
Duel.SelectYesNo(tp,aux.Stringid(m,2))
else else
Duel.SelectYesNo(tp,aux.Stringid(m,1)) g=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) if #g<=0 then return end
local sg=g1:Select(tp,1,1,nil):GetFirst() if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
local te,ceg,cep,cev,cre,cr,crp=sg:CheckActivateEffect(false,true,true) cm_copy = true
local te,ceg,cep,cev,cre,cr,crp=sg:GetFirst():CheckActivateEffect(true,true,true)
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
local tg=te:GetTarget() local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject()) te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te) e:SetLabelObject(te)
Duel.ClearOperationInfo(0) Duel.ClearOperationInfo(0)
e:SetLabel(1)
else
e:SetLabel(0)
end end
end end
function cm.filter(c) function cm.filter(c)
return cm.MagicCombineMagic(c) and not c:IsCode(m) and c:IsAbleToDeck() return cm.MagicCombineMagic(c) and not c:IsCode(m) and c:IsAbleToDeck()
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 chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(cm.rpfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_REMOVED)
end end
function cm.rfilter(c) function cm.rfilter(c)
return c:GetType()==TYPE_SPELL and c:IsFaceup() return c:GetType()==TYPE_SPELL and c:IsFaceup() and c:IsAbleToGrave()
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
...@@ -80,7 +78,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,7 +78,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)~=0 then if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,1000,REASON_EFFECT) Duel.Damage(1-tp,1000,REASON_EFFECT)
Duel.BreakEffect() Duel.BreakEffect()
if e:GetLabel()==1 then if cm_copy then
cm_copy = false
local te=e:GetLabelObject() local te=e:GetLabelObject()
if te then if te then
e:SetLabelObject(te:GetLabelObject()) e:SetLabelObject(te:GetLabelObject())
......
...@@ -24,40 +24,38 @@ function cm.MagicCombineDemon(c) ...@@ -24,40 +24,38 @@ function cm.MagicCombineDemon(c)
return m and m.named_with_MagicCombineDemon return m and m.named_with_MagicCombineDemon
end end
function cm.cfilter1(c) function cm.cfilter1(c)
return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilter2(c) function cm.cfilter2(c)
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return (c:GetType()==TYPE_SPELL or c:IsType(TYPE_QUICKPLAY))
and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilterz(c) function cm.cfilterz(c)
return c:IsFaceup() and cm.Spiritualist(c) return c:IsFaceup() and cm.Spiritualist(c)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil) if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,4,0,1,nil) then return end
local g2=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil) cm_copy = false
local g = {}
if Duel.IsPlayerAffectedByEffect(tp,40011471) then if Duel.IsPlayerAffectedByEffect(tp,40011471) then
g1:Merge(g2) g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)
end
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(cm.cfilterz,tp,LOCATION_MZONE,0,1,nil) then
if Duel.IsPlayerAffectedByEffect(tp,40011471) then
Duel.SelectYesNo(tp,aux.Stringid(m,2))
else else
Duel.SelectYesNo(tp,aux.Stringid(m,1)) g=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) if #g<=0 then return end
local sg=g1:Select(tp,1,1,nil):GetFirst() if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
local te,ceg,cep,cev,cre,cr,crp=sg:CheckActivateEffect(false,true,true) cm_copy = true
local te,ceg,cep,cev,cre,cr,crp=sg:GetFirst():CheckActivateEffect(true,true,true)
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
local tg=te:GetTarget() local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject()) te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te) e:SetLabelObject(te)
Duel.ClearOperationInfo(0) Duel.ClearOperationInfo(0)
e:SetLabel(1)
else
e:SetLabel(0)
end end
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
...@@ -87,7 +85,8 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,7 +85,8 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
Duel.BreakEffect() Duel.BreakEffect()
if e:GetLabel()==1 then if cm_copy then
cm_copy = false
local te=e:GetLabelObject() local te=e:GetLabelObject()
if te then if te then
e:SetLabelObject(te:GetLabelObject()) e:SetLabelObject(te:GetLabelObject())
......
...@@ -25,40 +25,38 @@ function cm.MagicCombineDemon(c) ...@@ -25,40 +25,38 @@ function cm.MagicCombineDemon(c)
return m and m.named_with_MagicCombineDemon return m and m.named_with_MagicCombineDemon
end end
function cm.cfilter1(c) function cm.cfilter1(c)
return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilter2(c) function cm.cfilter2(c)
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return (c:GetType()==TYPE_SPELL or c:IsType(TYPE_QUICKPLAY))
and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilterz(c) function cm.cfilterz(c)
return c:IsFaceup() and cm.Spiritualist(c) return c:IsFaceup() and cm.Spiritualist(c)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil) if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,4,0,1,nil) then return end
local g2=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil) cm_copy = false
local g = {}
if Duel.IsPlayerAffectedByEffect(tp,40011471) then if Duel.IsPlayerAffectedByEffect(tp,40011471) then
g1:Merge(g2) g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)
end
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(cm.cfilterz,tp,LOCATION_MZONE,0,1,nil) then
if Duel.IsPlayerAffectedByEffect(tp,40011471) then
Duel.SelectYesNo(tp,aux.Stringid(m,2))
else else
Duel.SelectYesNo(tp,aux.Stringid(m,1)) g=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) if #g<=0 then return end
local sg=g1:Select(tp,1,1,nil):GetFirst() if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
local te,ceg,cep,cev,cre,cr,crp=sg:CheckActivateEffect(false,true,true) cm_copy = true
local te,ceg,cep,cev,cre,cr,crp=sg:GetFirst():CheckActivateEffect(true,true,true)
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
local tg=te:GetTarget() local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject()) te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te) e:SetLabelObject(te)
Duel.ClearOperationInfo(0) Duel.ClearOperationInfo(0)
e:SetLabel(1)
else
e:SetLabel(0)
end end
end end
function cm.filter(c) function cm.filter(c)
...@@ -99,7 +97,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -99,7 +97,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e4:SetReset(RESET_PHASE+PHASE_END) e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp) Duel.RegisterEffect(e4,tp)
Duel.BreakEffect() Duel.BreakEffect()
if e:GetLabel()==1 then if cm_copy then
cm_copy = false
local te=e:GetLabelObject() local te=e:GetLabelObject()
if te then if te then
e:SetLabelObject(te:GetLabelObject()) e:SetLabelObject(te:GetLabelObject())
......
...@@ -35,40 +35,38 @@ function cm.recon1(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,40 +35,38 @@ function cm.recon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cfilter6,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.cfilter6,tp,LOCATION_MZONE,0,1,nil)
end end
function cm.cfilter1(c) function cm.cfilter1(c)
return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilter2(c) function cm.cfilter2(c)
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return (c:GetType()==TYPE_SPELL or c:IsType(TYPE_QUICKPLAY))
and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilterz(c) function cm.cfilterz(c)
return c:IsFaceup() and cm.Spiritualist(c) return c:IsFaceup() and cm.Spiritualist(c)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil) if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,4,0,1,nil) then return end
local g2=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil) cm_copy = false
local g = {}
if Duel.IsPlayerAffectedByEffect(tp,40011471) then if Duel.IsPlayerAffectedByEffect(tp,40011471) then
g1:Merge(g2) g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)
end
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(cm.cfilterz,tp,LOCATION_MZONE,0,1,nil) then
if Duel.IsPlayerAffectedByEffect(tp,40011471) then
Duel.SelectYesNo(tp,aux.Stringid(m,2))
else else
Duel.SelectYesNo(tp,aux.Stringid(m,1)) g=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) if #g<=0 then return end
local sg=g1:Select(tp,1,1,nil):GetFirst() if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
local te,ceg,cep,cev,cre,cr,crp=sg:CheckActivateEffect(false,true,true) cm_copy = true
local te,ceg,cep,cev,cre,cr,crp=sg:GetFirst():CheckActivateEffect(true,true,true)
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
local tg=te:GetTarget() local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject()) te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te) e:SetLabelObject(te)
Duel.ClearOperationInfo(0) Duel.ClearOperationInfo(0)
e:SetLabel(1)
else
e:SetLabel(0)
end end
end end
function cm.filter(c) function cm.filter(c)
...@@ -90,7 +88,8 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -90,7 +88,8 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(g) Duel.HintSelection(g)
if Duel.Destroy(g,REASON_EFFECT)~=0 then if Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.BreakEffect() Duel.BreakEffect()
if e:GetLabel()==1 then if cm_copy then
cm_copy = false
local te=e:GetLabelObject() local te=e:GetLabelObject()
if te then if te then
e:SetLabelObject(te:GetLabelObject()) e:SetLabelObject(te:GetLabelObject())
......
...@@ -20,40 +20,37 @@ function cm.initial_effect(c) ...@@ -20,40 +20,37 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cm.cfilter1(c) function cm.cfilter1(c)
return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return c:GetType()==TYPE_SPELL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilter2(c) function cm.cfilter2(c)
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cfilterz(c) function cm.cfilterz(c)
return c:IsFaceup() and cm.Spiritualist(c) return c:IsFaceup() and cm.Spiritualist(c)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil) if not Duel.IsExistingMatchingCard(cm.cfilterz,tp,4,0,1,nil) then return end
local g2=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil) cm_copy = false
local g = {}
if Duel.IsPlayerAffectedByEffect(tp,40011471) then if Duel.IsPlayerAffectedByEffect(tp,40011471) then
g1:Merge(g2) g=Duel.GetMatchingGroup(cm.cfilter2,tp,LOCATION_GRAVE,0,nil)
end
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(cm.cfilterz,tp,LOCATION_MZONE,0,1,nil) then
if Duel.IsPlayerAffectedByEffect(tp,40011471) then
Duel.SelectYesNo(tp,aux.Stringid(m,2))
else else
Duel.SelectYesNo(tp,aux.Stringid(m,1)) g=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_GRAVE,0,nil)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) if #g<=0 then return end
local sg=g1:Select(tp,1,1,nil):GetFirst() if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(3,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
local te,ceg,cep,cev,cre,cr,crp=sg:CheckActivateEffect(false,true,true) cm_copy = true
local te,ceg,cep,cev,cre,cr,crp=sg:GetFirst():CheckActivateEffect(true,true,true)
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
local tg=te:GetTarget() local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject()) te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te) e:SetLabelObject(te)
Duel.ClearOperationInfo(0) Duel.ClearOperationInfo(0)
e:SetLabel(1)
else
e:SetLabel(0)
end end
end end
function cm.filter(c) function cm.filter(c)
...@@ -82,6 +79,16 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,6 +79,16 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.BreakEffect()
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
end end
end end
end end
\ No newline at end of file
...@@ -64,7 +64,7 @@ function c67201128.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,7 +64,7 @@ function c67201128.spop(e,tp,eg,ep,ev,re,r,rp)
end end
-- --
function c67201128.opcon(e,tp,eg,ep,ev,re,r,rp) function c67201128.opcon(e,tp,eg,ep,ev,re,r,rp)
return ev==1-tp or ev==tp or ev==PLAYER_ALL return ev==tp or ev==PLAYER_ALL
end end
function c67201128.filter(c) function c67201128.filter(c)
return c:IsSetCard(0x3670) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x3670) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
......
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