Commit 153090a9 authored by Nemo Ma's avatar Nemo Ma

fix

parent 4e1212f4
...@@ -205,7 +205,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -205,7 +205,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i]) local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i]) local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE) local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
......
...@@ -209,7 +209,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -209,7 +209,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i]) local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i]) local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE) local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
......
...@@ -265,7 +265,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -265,7 +265,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i]) local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i]) local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE) local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
......
...@@ -243,7 +243,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -243,7 +243,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i]) local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i]) local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE) local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
......
...@@ -86,7 +86,7 @@ function cm.fselect(g,ng,goal,tp) ...@@ -86,7 +86,7 @@ function cm.fselect(g,ng,goal,tp)
aux.GCheckAdditional=nil aux.GCheckAdditional=nil
return tc return tc
end end
function cm.fselect2(g,g1,lv,tp) function cm.fselect3(g,g1,lv,tp)
return g:GetSum(cm.lvplus)==lv and Duel.GetMZoneCount(tp,g+g1)>0 return g:GetSum(cm.lvplus)==lv and Duel.GetMZoneCount(tp,g+g1)>0
end end
function cm.hspcheck(g,ng,goal,tp) function cm.hspcheck(g,ng,goal,tp)
...@@ -101,13 +101,13 @@ function cm.hspgcheck(g,c,mg,f,min,max,ext_params) ...@@ -101,13 +101,13 @@ function cm.hspgcheck(g,c,mg,f,min,max,ext_params)
end end
function cm.hspcheck2(g,g1,lv,tp) function cm.hspcheck2(g,g1,lv,tp)
Duel.SetSelectedCard(g) Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect2,1,#g,g1,lv,tp) return g:CheckSubGroup(cm.fselect3,1,#g,g1,lv,tp)
end end
function cm.hspgcheck2(g,c,mg,f,min,max,ext_params) function cm.hspgcheck2(g,c,mg,f,min,max,ext_params)
local g1,lv,tp=table.unpack(ext_params) local g1,lv,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=lv then return true end if g:GetSum(cm.lvplus)<=lv then return true end
Duel.SetSelectedCard(g) Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect2,1,#g,g1,lv,tp) return g:CheckSubGroup(cm.fselect3,1,#g,g1,lv,tp)
end end
function cm.accost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.accost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -264,7 +264,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -264,7 +264,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i]) local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i]) local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE) local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
......
...@@ -89,7 +89,7 @@ function cm.fselect(g,ng,goal,tp) ...@@ -89,7 +89,7 @@ function cm.fselect(g,ng,goal,tp)
aux.GCheckAdditional=nil aux.GCheckAdditional=nil
return tc return tc
end end
function cm.fselect2(g,g1,lv,tp) function cm.fselect3(g,g1,lv,tp)
return g:GetSum(cm.lvplus)==lv and Duel.GetMZoneCount(tp,g+g1)>0 return g:GetSum(cm.lvplus)==lv and Duel.GetMZoneCount(tp,g+g1)>0
end end
function cm.hspcheck(g,ng,goal,tp) function cm.hspcheck(g,ng,goal,tp)
...@@ -104,13 +104,13 @@ function cm.hspgcheck(g,c,mg,f,min,max,ext_params) ...@@ -104,13 +104,13 @@ function cm.hspgcheck(g,c,mg,f,min,max,ext_params)
end end
function cm.hspcheck2(g,g1,lv,tp) function cm.hspcheck2(g,g1,lv,tp)
Duel.SetSelectedCard(g) Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect2,1,#g,g1,lv,tp) return g:CheckSubGroup(cm.fselect3,1,#g,g1,lv,tp)
end end
function cm.hspgcheck2(g,c,mg,f,min,max,ext_params) function cm.hspgcheck2(g,c,mg,f,min,max,ext_params)
local g1,lv,tp=table.unpack(ext_params) local g1,lv,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=lv then return true end if g:GetSum(cm.lvplus)<=lv then return true end
Duel.SetSelectedCard(g) Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect2,1,#g,g1,lv,tp) return g:CheckSubGroup(cm.fselect3,1,#g,g1,lv,tp)
end end
function cm.chcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.chcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -293,7 +293,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -293,7 +293,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i]) local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i]) local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE) local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
......
...@@ -17,7 +17,7 @@ function c33200522.initial_effect(c) ...@@ -17,7 +17,7 @@ function c33200522.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,33200522) e2:SetCountLimit(1,33200522)
e2:SetCondition(c33200522.tzcon) e2:SetCondition(c33200522.tzcon)
e2:SetTarget(c33200522.tztg) e2:SetTarget(c33200522.tztg)
......
...@@ -20,9 +20,9 @@ function c33200916.initial_effect(c) ...@@ -20,9 +20,9 @@ function c33200916.initial_effect(c)
e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,33210916) e2:SetCountLimit(1,33210916)
e2:SetCost(c33200916.spcost) e2:SetCost(c33200916.spcost1)
e2:SetTarget(c33200916.sptg) e2:SetTarget(c33200916.sptg1)
e2:SetOperation(c33200916.spop) e2:SetOperation(c33200916.spop1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--remove --remove
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
...@@ -70,18 +70,18 @@ end ...@@ -70,18 +70,18 @@ end
function c33200916.tgfilter(c) function c33200916.tgfilter(c)
return (c:IsSetCard(0x332a) or c:IsSetCard(0x881)) and c:IsType(TYPE_MONSTER) and c:IsReleasable() return (c:IsSetCard(0x332a) or c:IsSetCard(0x881)) and c:IsType(TYPE_MONSTER) and c:IsReleasable()
end end
function c33200916.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c33200916.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33200916.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(c33200916.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c33200916.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,c33200916.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c33200916.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c33200916.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function c33200916.spop(e,tp,eg,ep,ev,re,r,rp) function c33200916.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
......
...@@ -58,18 +58,15 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,18 +58,15 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,40009560)>0 or Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.GetFlagEffect(tp,40009560)>0 or Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_MZONE,0,1,nil)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
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 tc,c=Duel.GetFirstTarget(),e:GetHandler() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
end end
end end
function cm.immcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,40009560)>0
end
\ No newline at end of file
...@@ -12,10 +12,10 @@ function cm.initial_effect(c) ...@@ -12,10 +12,10 @@ function cm.initial_effect(c)
e2:SetDescription(aux.Stringid(m,0)) e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DISABLE) e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetCountLimit(1,m) e2:SetCountLimit(1,m)
e2:SetCost(cm.descost) e2:SetCost(cm.descost)
e2:SetTarget(cm.target) e2:SetTarget(cm.target)
...@@ -42,10 +42,10 @@ function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -42,10 +42,10 @@ function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
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 aux.disfilter1(chkc) end if chkc then return chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -9,7 +9,7 @@ end ...@@ -9,7 +9,7 @@ end
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON) e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost) e1:SetCost(cm.cost)
...@@ -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,1))
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCost(cm.setcost) e2:SetCost(cm.setcost)
...@@ -29,47 +30,59 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -29,47 +30,59 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end end
function cm.filter1(c) function cm.tgfilter1(c)
return cm.Diablotherhood(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() return cm.Diablotherhood(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end end
function cm.filter2(c,e,tp) function cm.spfilter(c,e,tp)
return cm.Diablotherhood(c) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return cm.Diablotherhood(c) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.dfilter(c) function cm.dfilter(c)
return c:IsFaceup() and c:IsCode(40010230) return c:IsFaceup() and c:IsCode(40010230)
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)
local b1=Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil) local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil,e,tp) local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #g>0
local b2=Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil)
--local b2=true --local b2=true
if chk==0 then return b1 or b2 end if chk==0 then return b2 end
local op=0 local op=0
if b1 and b2 then if b1 then
if (Duel.GetFlagEffect(tp,40009560)>0 or Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_MZONE,0,1,nil)) then if (Duel.GetFlagEffect(tp,40009560)>0 or Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_MZONE,0,1,nil)) then
op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1),aux.Stringid(m,2)) op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1),aux.Stringid(m,2))
else else
op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1)) op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
end end
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(m,0))
else else
op=Duel.SelectOption(tp,aux.Stringid(m,1))+1 op=Duel.SelectOption(tp,aux.Stringid(m,1))+1
end end
e:SetLabel(op) e:SetLabel(op)
if op~=0 then
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
--Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,LOCATION_DECK)
if op==1 then
e:SetCategory(CATEGORY_TOGRAVE)
else
e:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,LOCATION_DECK)
end
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,LOCATION_DECK)
end
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 op=e:GetLabel() local op=e:GetLabel()
if op~=1 then local res=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK,0,1,1,nil) if op~=1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #g>0 then
if g:GetCount()>0 then local tg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT) res=Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
end
end end
if op~=0 then if op~=0 then
local g1=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g1=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g1:GetCount()>0 then if g1:GetCount()>0 then
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP) if op==2 and res~=0 then Duel.BreakEffect() end
Duel.SendtoGrave(g1,REASON_EFFECT)
end end
end end
end end
......
...@@ -2594,7 +2594,6 @@ function cm.AllEffectRstop(e,tp,eg,ep,ev,re,r,rp) ...@@ -2594,7 +2594,6 @@ function cm.AllEffectRstop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
if x then if x then
Debug.Message(114)
local ex2=se:Clone() local ex2=se:Clone()
ex2:SetCode(EVENT_LEAVE_FIELD) ex2:SetCode(EVENT_LEAVE_FIELD)
sc:RegisterEffect(ex2) sc:RegisterEffect(ex2)
......
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