Commit dbbdd29f authored by Aephiex's avatar Aephiex Committed by nanahira

misc update (#1034)

* Update utility.lua

* update

* Update c11366199.lua

* Update utility.lua

* Update utility.lua

* Update utility.lua

* Update utility.lua
parent 553675f9
......@@ -51,8 +51,6 @@ function c10485110.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c10485110.operation(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0xe,0xe,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0xe,0xe,aux.ExceptThisCard(e))
Duel.SendtoGrave(g,REASON_EFFECT)
end
......@@ -28,7 +28,7 @@ function c11052544.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c11052544.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c11052544.cfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(c11052544.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local g=Duel.GetMatchingGroup(c11052544.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if g:GetCount()>=ct then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,ct,ct,nil)
......
......@@ -46,6 +46,6 @@ function c11264180.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(tc:GetDefense()/2)
tc:RegisterEffect(e2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,c11264180.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
local dg=Duel.SelectMatchingCard(tp,c11264180.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e))
Duel.Destroy(dg,REASON_EFFECT)
end
......@@ -8,21 +8,16 @@ function c11366199.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ATTRIBUTE_WIND)
c:RegisterEffect(e1)
--special summon(hand)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11366199,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCost(c11366199.spcost1)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCost(c11366199.spcost)
e2:SetTarget(c11366199.sptg)
e2:SetOperation(c11366199.spop)
c:RegisterEffect(e2)
--special summon(grave)
local e3=e2:Clone()
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(c11366199.spcost2)
c:RegisterEffect(e3)
--cannot set
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
......@@ -46,28 +41,34 @@ end
function c11366199.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end
function c11366199.spfilter(c,att)
return c:IsAttribute(att) and c:IsAbleToRemoveAsCost()
function c11366199.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_WIND+ATTRIBUTE_DARK)
end
function c11366199.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11366199.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_WIND)
and Duel.IsExistingMatchingCard(c11366199.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_DARK) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c11366199.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_WIND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c11366199.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_DARK)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
function c11366199.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c11366199.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_WIND)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c11366199.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11366199.spfilter,tp,LOCATION_HAND,0,1,nil,ATTRIBUTE_WIND)
and Duel.IsExistingMatchingCard(c11366199.spfilter,tp,LOCATION_HAND,0,1,nil,ATTRIBUTE_DARK) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c11366199.spfilter,tp,LOCATION_HAND,0,1,1,nil,ATTRIBUTE_WIND)
function c11366199.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c11366199.spcostfilter,tp,LOCATION_HAND+LOCATION_GRAVE-e:GetHandler():GetLocation(),0,nil)
local sg=Group.CreateGroup()
if chk==0 then return g:IsExists(c11366199.spcost_selector,1,nil,tp,g,sg,1) end
for i=1,2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c11366199.spfilter,tp,LOCATION_HAND,0,1,1,nil,ATTRIBUTE_DARK)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
local g1=g:FilterSelect(tp,c11366199.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c11366199.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -30,6 +30,6 @@ function c11596936.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c11596936.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c11596936.filter,tp,0,LOCATION_ONFIELD,e:GetHandler())
local sg=Duel.GetMatchingGroup(c11596936.filter,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
......@@ -23,6 +23,6 @@ function c1224927.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c1224927.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c1224927.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local sg=Duel.GetMatchingGroup(c1224927.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
......@@ -58,7 +58,7 @@ end
function c13035077.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler())
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,aux.ExceptThisCard(e))
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c13035077.thfilter,tp,LOCATION_DECK,0,1,1,nil)
......
......@@ -23,7 +23,7 @@ function c13210191.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,ct1+((ct1>ct2) and ct2 or ct1),0,0)
end
function c13210191.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c13210191.filter,tp,LOCATION_ONFIELD,0,e:GetHandler())
local g1=Duel.GetMatchingGroup(c13210191.filter,tp,LOCATION_ONFIELD,0,aux.ExceptThisCard(e))
local ct1=Duel.Destroy(g1,REASON_EFFECT)
if ct1==0 then return end
local g2=Duel.GetMatchingGroup(c13210191.filter,tp,0,LOCATION_ONFIELD,nil)
......
......@@ -92,7 +92,7 @@ end
function c13893596.winop(e,tp,eg,ep,ev,re,r,rp)
local WIN_REASON_EXODIUS = 0x14
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c13893596.filter,tp,LOCATION_GRAVE,0,nil,c)
local g=Duel.GetMatchingGroup(c13893596.filter,tp,LOCATION_GRAVE,0,nil,aux.ExceptThisCard(e))
if g:GetClassCount(Card.GetCode)==5 then
Duel.Win(tp,WIN_REASON_EXODIUS)
end
......
......@@ -22,7 +22,7 @@ function c14644902.filter(c,e,tp)
end
function c14644902.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rg=Duel.SelectReleaseGroup(tp,c14644902.rfilter,1,1,c,e,tp)
local rg=Duel.SelectReleaseGroup(tp,c14644902.rfilter,1,1,aux.ExceptThisCard(e),e,tp)
if Duel.Release(rg,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c14644902.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
......
......@@ -98,9 +98,7 @@ function c14799437.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c14799437.desop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
......
......@@ -38,7 +38,7 @@ function c15256925.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c15256925.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c15256925.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
local g=Duel.SelectMatchingCard(tp,c15256925.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
......
......@@ -22,35 +22,40 @@ function c15574615.initial_effect(c)
e2:SetOperation(c15574615.operation)
c:RegisterEffect(e2)
end
function c15574615.sprfilter(c)
function c15574615.spcostfilter(c)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost()
and c:IsCode(80208158,16796157,43791861,79185500)
end
c15574615.spcost_list={80208158,16796157,43791861,79185500}
function c15574615.spcost_selector(c,tp,g,sg,i)
if not c:IsCode(c15574615.spcost_list[i]) then return false end
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<4 then
flag=g:IsExists(c4335427.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=Duel.GetMZoneCount(tp,sg,tp)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c15574615.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1
local mg=Duel.GetMatchingGroup(c15574615.sprfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
return mg:GetClassCount(Card.GetCode)==4
and mg:Filter(Card.IsLocation,nil,LOCATION_MZONE):GetClassCount(Card.GetCode)>=ct
local g=Duel.GetMatchingGroup(c15574615.spcostfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
local sg=Group.CreateGroup()
return g:IsExists(c15574615.spcost_selector,1,nil,tp,g,sg,1)
end
function c15574615.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1
local mg=Duel.GetMatchingGroup(c15574615.sprfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
local g=Group.CreateGroup()
local g=Duel.GetMatchingGroup(c15574615.spcostfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
local sg=Group.CreateGroup()
for i=1,4 do
local tc=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
if ct>0 then
tc=mg:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE):GetFirst()
ct=ct-1
else
tc=mg:Select(tp,1,1,nil):GetFirst()
end
mg:Remove(Card.IsCode,nil,tc:GetCode())
g:AddCard(tc)
local g1=g:FilterSelect(tp,c15574615.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.SendtoGrave(g,REASON_COST)
end
......@@ -58,29 +63,37 @@ function c15574615.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c15574615.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c15574615.spfilter(c,e,tp)
return c:IsCode(80208158,16796157,43791861,79185500) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c15574615.sptarget_selector(c,tp,g,sg,i)
if not c:IsCode(c15574615.spcost_list[i]) then return false end
if i<4 then
sg:AddCard(c)
g:RemoveCard(c)
local flag=g:IsExists(c4335427.sptarget_selector,1,nil,tp,g,sg,i+1)
sg:RemoveCard(c)
g:AddCard(c)
return flag
else
return true
end
end
function c15574615.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c15574615.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
local sg=Group.CreateGroup()
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=3
and Duel.IsExistingTarget(c15574615.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,80208158)
and Duel.IsExistingTarget(c15574615.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,16796157)
and Duel.IsExistingTarget(c15574615.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,43791861)
and Duel.IsExistingTarget(c15574615.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,79185500) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectTarget(tp,c15574615.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,80208158)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,c15574615.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,16796157)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g3=Duel.SelectTarget(tp,c15574615.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,43791861)
and g:IsExists(c15574615.sptarget_selector,1,nil,tp,g,sg,1)
end
for i=1,4 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g4=Duel.SelectTarget(tp,c15574615.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,79185500)
g1:Merge(g2)
g1:Merge(g3)
g1:Merge(g4)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,4,0,0)
local g1=g:FilterSelect(tp,c15574615.sptarget_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,4,0,0)
end
function c15574615.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
......
......@@ -48,9 +48,7 @@ function c16172067.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c16172067.desop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
......
......@@ -26,7 +26,7 @@ function c16272453.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c16272453.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c16272453.dfilter,tp,LOCATION_ONFIELD,0,e:GetHandler())
local g=Duel.GetMatchingGroup(c16272453.dfilter,tp,LOCATION_ONFIELD,0,aux.ExceptThisCard(e))
local ct=Duel.Destroy(g,REASON_EFFECT)
if ct>0 then
Duel.BreakEffect()
......
......@@ -163,9 +163,7 @@ function c16306932.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c16306932.tdop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,exc)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
......
......@@ -19,6 +19,6 @@ function c18144506.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c18144506.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c18144506.filter,tp,0,LOCATION_ONFIELD,e:GetHandler())
local sg=Duel.GetMatchingGroup(c18144506.filter,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
......@@ -20,6 +20,6 @@ function c18591904.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c18591904.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -15,38 +15,39 @@ function c19028307.initial_effect(c)
e2:SetCode(EFFECT_NO_BATTLE_DAMAGE)
c:RegisterEffect(e2)
end
function c19028307.spfilter(c,rac)
return c:IsRace(rac) and c:IsAbleToRemoveAsCost() and (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup())
function c19028307.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_BEASTWARRIOR+RACE_MACHINE) and (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup())
end
function c19028307.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c19028307.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=Duel.GetMZoneCount(tp,sg,tp)>0
and sg:FilterCount(Card.IsRace,nil,RACE_BEASTWARRIOR)>0
and sg:FilterCount(Card.IsRace,nil,RACE_MACHINE)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c19028307.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local n=0
if Duel.IsExistingMatchingCard(c19028307.spfilter,tp,LOCATION_MZONE,0,1,c,RACE_BEASTWARRIOR) then n=n-1 end
if Duel.IsExistingMatchingCard(c19028307.spfilter,tp,LOCATION_MZONE,0,1,c,RACE_MACHINE) then n=n-1 end
return Duel.GetLocationCount(tp,LOCATION_MZONE)>n
and Duel.IsExistingMatchingCard(c19028307.spfilter,tp,0x16,0,1,c,RACE_BEASTWARRIOR)
and Duel.IsExistingMatchingCard(c19028307.spfilter,tp,0x16,0,1,c,RACE_MACHINE)
local g=Duel.GetMatchingGroup(c19028307.spcostfilter,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
return g:IsExists(c19028307.spcost_selector,1,nil,tp,g,sg,1)
end
function c19028307.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g1=nil
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft~=0 then
local loc=0x16
if ft<0 then loc=LOCATION_MZONE end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
g1=Duel.SelectMatchingCard(tp,c19028307.spfilter,tp,loc,0,1,1,c,RACE_BEASTWARRIOR)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c19028307.spfilter,tp,loc,0,1,1,c,RACE_MACHINE)
g1:Merge(g2)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
g1=Duel.SelectMatchingCard(tp,c19028307.spfilter,tp,LOCATION_MZONE,0,1,1,c,RACE_BEASTWARRIOR+RACE_MACHINE)
local rc=RACE_BEASTWARRIOR
if g1:GetFirst():IsRace(RACE_BEASTWARRIOR) then rc=RACE_MACHINE end
local g=Duel.GetMatchingGroup(c19028307.spcostfilter,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
for i=1,2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c19028307.spfilter,tp,0x16,0,1,1,c,rc)
g1:Merge(g2)
local g1=g:FilterSelect(tp,c19028307.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(g1,POS_FACEUP,REASON_COST)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
......@@ -19,6 +19,6 @@ function c19613556.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c19613556.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c19613556.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local sg=Duel.GetMatchingGroup(c19613556.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
......@@ -29,8 +29,6 @@ function c19684740.chlimit(e,ep,tp)
return tp==ep
end
function c19684740.thop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
......@@ -61,7 +61,7 @@ function c19959563.filter(c)
end
function c19959563.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19959563.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(c19959563.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,e:GetHandler())
local g=Duel.GetMatchingGroup(c19959563.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c19959563.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -61,8 +61,6 @@ function c20073910.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c20073910.thop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
......@@ -20,6 +20,6 @@ function c20727787.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c20727787.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c20727787.filter,tp,LOCATION_SZONE,LOCATION_SZONE,e:GetHandler())
local g=Duel.GetMatchingGroup(c20727787.filter,tp,LOCATION_SZONE,LOCATION_SZONE,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -87,9 +87,7 @@ function c21105106.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c21105106.rmop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,exc)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,aux.ExceptThisCard(e))
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
function c21105106.filter(c,tp)
......
......@@ -11,22 +11,35 @@ function c22666164.initial_effect(c)
e1:SetOperation(c22666164.operation)
c:RegisterEffect(e1)
end
function c22666164.cfilter(c,code)
return c:IsFaceup() and c:IsCode(code) and c:IsAbleToGraveAsCost()
function c22666164.spcostfilter(c)
return c:IsFaceup() and c:IsAbleToGraveAsCost() and c:IsCode(60999392,23782705,96384007)
end
c22666164.spcost_list={60999392,23782705,96384007}
function c22666164.spcost_selector(c,tp,g,sg,i)
if not c:IsCode(c22666164.spcost_list[i]) then return false end
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<3 then
flag=g:IsExists(c22666164.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=Duel.GetMZoneCount(tp,sg,tp)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c22666164.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22666164.cfilter,tp,LOCATION_ONFIELD,0,1,nil,60999392)
and Duel.IsExistingMatchingCard(c22666164.cfilter,tp,LOCATION_ONFIELD,0,1,nil,23782705)
and Duel.IsExistingMatchingCard(c22666164.cfilter,tp,LOCATION_ONFIELD,0,1,nil,96384007) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c22666164.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil,60999392)
local g=Duel.GetMatchingGroup(c22666164.spcostfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
if chk==0 then return g:IsExists(c22666164.spcost_selector,1,nil,tp,g,sg,1) end
for i=1,3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c22666164.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil,23782705)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g3=Duel.SelectMatchingCard(tp,c22666164.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil,96384007)
g1:Merge(g2)
g1:Merge(g3)
Duel.SendtoGrave(g1,REASON_COST)
local g1=g:FilterSelect(tp,c22666164.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.SendtoGrave(sg,REASON_COST)
end
function c22666164.filter(c,e,tp)
return c:IsCode(58054262) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
......
......@@ -74,9 +74,7 @@ function c23015896.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c23015896.desop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
function c23015896.spcon2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -27,6 +27,6 @@ function c2314238.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c2314238.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c2314238.filter,tp,0,LOCATION_ONFIELD,e:GetHandler())
local sg=Duel.GetMatchingGroup(c2314238.filter,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
......@@ -27,9 +27,7 @@ function c2407234.negfilter(c)
end
function c2407234.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local exc=c
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(c2407234.negfilter,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(c2407234.negfilter,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
......
......@@ -22,23 +22,41 @@ function c25460258.initial_effect(c)
e2:SetOperation(c25460258.rmop)
c:RegisterEffect(e2)
end
function c25460258.spfilter(c,att)
return c:IsAttribute(att) and c:IsAbleToRemoveAsCost()
function c25460258.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end
function c25460258.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c25460258.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c25460258.spcon(e,c)
if c==nil then return true end
if Duel.GetMZoneCount(tp)<=0 then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c25460258.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_LIGHT)
and Duel.IsExistingMatchingCard(c25460258.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_DARK)
local g=Duel.GetMatchingGroup(c25460258.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
return g:IsExists(c25460258.spcost_selector,1,nil,tp,g,sg,1)
end
function c25460258.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c25460258.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
for i=1,2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c25460258.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_LIGHT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c25460258.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_DARK)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
local g1=g:FilterSelect(tp,c25460258.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c25460258.cfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost()
......
......@@ -27,7 +27,7 @@ function c28596933.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c28596933.filter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
local sg=Duel.GetMatchingGroup(c28596933.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local sg=Duel.GetMatchingGroup(c28596933.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
end
......@@ -80,8 +80,6 @@ function c29146185.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c29146185.desop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -36,7 +36,7 @@ function c31222701.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(shg1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,shg1)
end
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if ct>=3 and rg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(31222701,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
......
......@@ -55,6 +55,6 @@ function c32391631.destg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c32391631.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c32391631.desfilter,Duel.GetTurnPlayer(),LOCATION_MZONE,0,e:GetHandler())
local g=Duel.GetMatchingGroup(c32391631.desfilter,Duel.GetTurnPlayer(),LOCATION_MZONE,0,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -90,6 +90,6 @@ function c32750510.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c32750510.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c32750510.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
local g=Duel.GetMatchingGroup(c32750510.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -57,6 +57,6 @@ function c33093439.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c33093439.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.SendtoGrave(g,REASON_EFFECT)
end
......@@ -20,7 +20,7 @@ function c34370473.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetCount()*500)
end
function c34370473.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c34370473.filter,tp,LOCATION_ONFIELD,0,e:GetHandler())
local g=Duel.GetMatchingGroup(c34370473.filter,tp,LOCATION_ONFIELD,0,aux.ExceptThisCard(e))
local ct=Duel.Destroy(g,REASON_EFFECT)
Duel.Recover(tp,ct*500,REASON_EFFECT)
end
......@@ -13,25 +13,32 @@ function c34898052.initial_effect(c)
c:RegisterEffect(e1)
end
function c34898052.rfilter(c,att)
return c:IsAttribute(att) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
return (not att or c:IsAttribute(att)) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c34898052.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c34898052.rfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_EARTH)
and Duel.IsExistingMatchingCard(c34898052.rfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_WATER)
and Duel.IsExistingMatchingCard(c34898052.rfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_FIRE)
and Duel.IsExistingMatchingCard(c34898052.rfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_WIND)
c34898052.cost_table={ATTRIBUTE_EARTH,ATTRIBUTE_WATER,ATTRIBUTE_FIRE,ATTRIBUTE_WIND}
function c34898052.rcostselector(c,g,sg,i)
if not c:IsAttribute(c34898052.cost_table[i]) then return false end
if i<4 then
g:RemoveCard(c)
sg:AddCard(c)
local flag=g:IsExists(c34898052.rcostselector,1,nil,g,sg,i+1)
g:AddCard(c)
sg:RemoveCard(c)
return flag
else
return true
end
end
function c34898052.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c34898052.rfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
if chk==0 then return g:IsExists(c34898052.rcostselector,1,nil,g,sg,1) end
for i=1,4 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c34898052.rfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_EARTH)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c34898052.rfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_WATER)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c34898052.rfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_FIRE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g3=Duel.SelectMatchingCard(tp,c34898052.rfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_WIND)
g:Merge(g1)
g:Merge(g2)
g:Merge(g3)
local g1=g:FilterSelect(tp,c34898052.rcostselector,1,1,nil,g,sg,i)
g:Sub(g1)
sg:Merge(g1)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c34898052.target(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -41,7 +48,7 @@ function c34898052.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c34898052.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
......
......@@ -22,14 +22,14 @@ function c3493058.activate(e,tp,eg,ep,ev,re,r,rp)
if dc==1 or dc==6 then
Duel.Damage(tp,1000,REASON_EFFECT)
elseif dc==5 then
local g=Duel.GetMatchingGroup(c3493058.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local g=Duel.GetMatchingGroup(c3493058.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if g:GetCount()<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,2,2,nil)
Duel.Destroy(dg,REASON_EFFECT)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c3493058.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
local g=Duel.SelectMatchingCard(tp,c3493058.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
end
......@@ -54,7 +54,7 @@ end
function c35984222.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP)~=0 then
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,c)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
end
......@@ -71,9 +71,7 @@ function c36956512.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c36956512.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local exc=c
if not exc:IsRelateToEffect(e) then exc=nil end
local tg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local tg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
local tc=tg:GetFirst()
while tc do
local atk=tc:GetAttack()
......
......@@ -28,7 +28,7 @@ function c37318031.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c37318031.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c37318031.cfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(c37318031.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local g=Duel.GetMatchingGroup(c37318031.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if g:GetCount()>=ct then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,ct,ct,nil)
......
......@@ -26,8 +26,6 @@ function c37721209.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c37721209.operation(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -34,6 +34,6 @@ function c38049934.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c38049934.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetLabel(),e:GetHandler())
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetLabel(),aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -11,27 +11,39 @@ function c38179121.initial_effect(c)
e1:SetOperation(c38179121.activate)
c:RegisterEffect(e1)
end
function c38179121.costfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_DINOSAUR) and c:IsAbleToRemoveAsCost()
function c38179121.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsType(TYPE_MONSTER)
end
function c38179121.costfilter2(c)
return c:IsType(TYPE_MONSTER) and not c:IsRace(RACE_DINOSAUR) and c:IsAbleToRemoveAsCost()
function c38179121.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c38179121.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsRace,nil,RACE_DINOSAUR)==1
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c38179121.filter(c,e,tp)
return c:IsRace(RACE_DINOSAUR) and c:IsLevelAbove(7) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c38179121.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c38179121.filter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,e,tp)
local tc=nil
if g:GetCount()==1 and g:GetFirst():IsLocation(LOCATION_HAND) then tc=g:GetFirst() end
if chk==0 then return Duel.IsExistingMatchingCard(c38179121.costfilter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,tc)
and Duel.IsExistingMatchingCard(c38179121.costfilter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,tc) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c38179121.costfilter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,tc)
local exc=nil
if g:GetCount()==1 and g:GetFirst():IsLocation(LOCATION_HAND) then exc=g:GetFirst() end
local rg=Duel.GetMatchingGroup(c38179121.spcostfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,exc)
local sg=Group.CreateGroup()
if chk==0 then return rg:IsExists(c38179121.spcost_selector,1,nil,tp,rg,sg,1) end
for i=1,2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c38179121.costfilter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,tc)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
local g1=rg:FilterSelect(tp,c38179121.spcost_selector,1,1,nil,tp,rg,sg,i)
sg:Merge(g1)
rg:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c38179121.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -80,16 +80,35 @@ end
function c38695361.cfilter(c,att)
return c:IsAttribute(att) and c:IsAbleToRemoveAsCost()
end
function c38695361.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end
function c38695361.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c38695361.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c38695361.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c38695361.cfilter,tp,LOCATION_GRAVE,0,1,c,ATTRIBUTE_LIGHT)
and Duel.IsExistingMatchingCard(c38695361.cfilter,tp,LOCATION_GRAVE,0,1,c,ATTRIBUTE_DARK) end
local g=Duel.GetMatchingGroup(c38695361.spcostfilter,tp,LOCATION_GRAVE,0,c)
local sg=Group.CreateGroup()
if chk==0 then return g:IsExists(c38695361.spcost_selector,1,nil,tp,g,sg,1) end
for i=1,2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c38695361.cfilter,tp,LOCATION_GRAVE,0,1,1,c,ATTRIBUTE_LIGHT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c38695361.cfilter,tp,LOCATION_GRAVE,0,1,1,c,ATTRIBUTE_DARK)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
local g1=g:FilterSelect(tp,c38695361.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c38695361.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
......
......@@ -42,9 +42,7 @@ function c39272762.negcon(e,tp,eg,ep,ev,re,r,rp)
end
function c39272762.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local exc=c
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
......
......@@ -43,8 +43,6 @@ function c39765958.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c39765958.desop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local sg=Duel.GetMatchingGroup(c39765958.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local sg=Duel.GetMatchingGroup(c39765958.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
......@@ -77,9 +77,7 @@ function c41753322.postg2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c41753322.posop2(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
function c41753322.dcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -24,6 +24,6 @@ function c42175079.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c42175079.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -103,9 +103,7 @@ function c42589641.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c42589641.thop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
function c42589641.hdcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -19,6 +19,6 @@ function c42703248.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,sg:GetCount(),0,0)
end
function c42703248.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c42703248.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local sg=Duel.GetMatchingGroup(c42703248.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
......@@ -31,53 +31,42 @@ function c42901635.initial_effect(c)
e3:SetOperation(c42901635.spop2)
c:RegisterEffect(e3)
end
function c42901635.cfilter(c)
return (c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToRemoveAsCost()
function c42901635.spcostfilter(c)
return (c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) or c:IsFaceup())
and c:IsAbleToRemoveAsCost() and c:IsCode(42023223,79418928,15502037)
end
function c42901635.sprfilter1(c,mg,ft)
local mg2=mg:Clone()
local ct=ft
if c:IsLocation(LOCATION_MZONE) then ct=ct+1 end
mg2:RemoveCard(c)
return c:IsCode(42023223) and mg2:IsExists(c42901635.sprfilter2,1,nil,mg2,ct)
end
function c42901635.sprfilter2(c,mg,ft)
local mg2=mg:Clone()
local ct=ft
if c:IsLocation(LOCATION_MZONE) then ct=ct+1 end
mg2:RemoveCard(c)
return c:IsCode(79418928) and mg2:IsExists(c42901635.sprfilter3,1,nil,ct)
end
function c42901635.sprfilter3(c,ft)
local ct=ft
if c:IsLocation(LOCATION_MZONE) then ct=ct+1 end
return c:IsCode(15502037) and ct>0
c42901635.spcost_list={42023223,79418928,15502037}
function c42901635.spcost_selector(c,tp,g,sg,i)
if not c:IsCode(c42901635.spcost_list[i]) then return false end
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<3 then
flag=g:IsExists(c42901635.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=Duel.GetMZoneCount(tp,sg,tp)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c42901635.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local mg=Duel.GetMatchingGroup(c42901635.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
return mg:IsExists(c42901635.sprfilter1,1,nil,mg,ft)
local g=Duel.GetMatchingGroup(c42901635.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
return g:IsExists(c42901635.spcost_selector,1,nil,tp,g,sg,1)
end
function c42901635.spop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c42901635.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=mg:FilterSelect(tp,c42901635.sprfilter1,1,1,nil,mg,ft)
local tc1=g1:GetFirst()
mg:RemoveCard(tc1)
if tc1:IsLocation(LOCATION_MZONE) then ft=ft+1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=mg:FilterSelect(tp,c42901635.sprfilter2,1,1,nil,mg,ft)
local tc2=g2:GetFirst()
if tc2:IsLocation(LOCATION_MZONE) then ft=ft+1 end
mg:RemoveCard(tc2)
local g=Duel.GetMatchingGroup(c42901635.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
for i=1,3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g3=mg:FilterSelect(tp,c42901635.sprfilter3,1,1,nil,ft)
g1:Merge(g2)
g1:Merge(g3)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
local g1=g:FilterSelect(tp,c42901635.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c42901635.costfilter(c)
return c:IsType(TYPE_MONSTER) and (c:IsSetCard(0x2066) or c:IsCode(99785935,39256679,11549357)) and c:IsLevelBelow(4) and c:IsAbleToRemoveAsCost()
......@@ -106,26 +95,39 @@ function c42901635.spcon2(e,tp,eg,ep,ev,re,r,rp)
return c:IsReason(REASON_BATTLE)
or (rp~=tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp)
end
function c42901635.spfilter(c,e,tp,code)
return c:IsFaceup() and c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c42901635.spfilter(c,e,tp)
return c:IsFaceup() and c:IsCode(99785935,39256679,11549357)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsCanBeEffectTarget(e)
end
function c42901635.sptarget_selector(c,tp,g,sg,i)
if not c:IsCode(c42901635.spcost_list[i]) then return false end
if i<3 then
sg:AddCard(c)
g:RemoveCard(c)
local flag=g:IsExists(c42901635.sptarget_selector,1,nil,tp,g,sg,i+1)
sg:RemoveCard(c)
g:AddCard(c)
return flag
else
return true
end
end
function c42901635.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c42901635.spfilter,tp,LOCATION_REMOVED,0,nil,e,tp)
local sg=Group.CreateGroup()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>2
and Duel.IsExistingTarget(c42901635.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp,42023223)
and Duel.IsExistingTarget(c42901635.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp,79418928)
and Duel.IsExistingTarget(c42901635.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp,15502037)
and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:IsExists(c42901635.sptarget_selector,1,nil,tp,g,sg,1) end
for i=1,3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,c42901635.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp,42023223)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c42901635.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp,79418928)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g3=Duel.SelectMatchingCard(tp,c42901635.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp,15502037)
g1:Merge(g2)
g1:Merge(g3)
Duel.SetTargetCard(g1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,3,0,0)
local g1=g:FilterSelect(tp,c42901635.sptarget_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,3,0,0)
end
function c42901635.spop2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
......
......@@ -74,8 +74,6 @@ function c4335427.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetChainLimit(aux.FALSE)
end
function c4335427.rmop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0x1e,0x1e,exc)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0x1e,0x1e,aux.ExceptThisCard(e))
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
......@@ -37,9 +37,7 @@ function c45960523.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c45960523.rmop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(c45960523.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(c45960523.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
......
......@@ -52,8 +52,6 @@ function c46772449.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -76,9 +76,7 @@ function c4779091.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c4779091.desop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
function c4779091.spcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -25,6 +25,6 @@ function c50215517.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c50215517.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c50215517.filter,tp,0,LOCATION_ONFIELD,e:GetHandler())
local sg=Duel.GetMatchingGroup(c50215517.filter,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
......@@ -29,7 +29,7 @@ function c52098461.activate(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and c52098461.filter(tc)
and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
end
......@@ -44,9 +44,7 @@ function c52512994.rfilter(c)
end
function c52512994.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local exc=c
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local rt=Duel.GetOperatedGroup():FilterCount(c52512994.rfilter,nil)
if rt>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -25,7 +25,7 @@ function c52971673.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c52971673.cfilter,tp,LOCATION_MZONE,0,nil)
local dt=Duel.Destroy(g,REASON_EFFECT)
if dt==0 then return end
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if dg:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......
......@@ -22,6 +22,6 @@ function c5479217.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c5479217.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -26,6 +26,6 @@ function c5577649.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c5577649.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c5577649.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local g=Duel.GetMatchingGroup(c5577649.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -60,9 +60,7 @@ function c57774843.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c57774843.operation(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
function c57774843.condition2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -32,7 +32,7 @@ function c57831349.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and ec:IsRelateToEffect(re) then
ec:CancelToGrave()
if Duel.SendtoDeck(ec,nil,2,REASON_EFFECT)~=0 and ec:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
local g=Duel.GetMatchingGroup(c57831349.desfilter,tp,LOCATION_ONFIELD,0,e:GetHandler())
local g=Duel.GetMatchingGroup(c57831349.desfilter,tp,LOCATION_ONFIELD,0,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......
......@@ -39,23 +39,38 @@ end
function c58054262.filter(c,code,e,tp)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58054262.sptargetfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCode(60999392,23782705,96384007)
end
c58054262.sptarget_list={60999392,23782705,96384007}
function c58054262.sptarget_selector(c,tp,g,sg,i)
if not c:IsCode(c58054262.sptarget_list[i]) then return false end
if i<3 then
sg:AddCard(c)
g:RemoveCard(c)
local flag=g:IsExists(c58054262.sptarget_selector,1,nil,tp,g,sg,i+1)
sg:RemoveCard(c)
g:AddCard(c)
return flag
else
return true
end
end
function c58054262.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c22666164.sptargetfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
local sg=Group.CreateGroup()
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2
and Duel.IsExistingTarget(c58054262.filter,tp,LOCATION_GRAVE,0,1,nil,60999392,e,tp)
and Duel.IsExistingTarget(c58054262.filter,tp,LOCATION_GRAVE,0,1,nil,23782705,e,tp)
and Duel.IsExistingTarget(c58054262.filter,tp,LOCATION_GRAVE,0,1,nil,96384007,e,tp)
and g:IsExists(c22666164.sptarget_selector,1,nil,tp,g,sg,1)
end
for i=1,3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectTarget(tp,c58054262.filter,tp,LOCATION_GRAVE,0,1,1,nil,60999392,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,c58054262.filter,tp,LOCATION_GRAVE,0,1,1,nil,23782705,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g3=Duel.SelectTarget(tp,c58054262.filter,tp,LOCATION_GRAVE,0,1,1,nil,96384007,e,tp)
g1:Merge(g2)
g1:Merge(g3)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,3,0,0)
local g1=g:FilterSelect(tp,c58054262.sptarget_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,3,0,0)
end
function c58054262.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
......
......@@ -91,16 +91,14 @@ function c58330108.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c58330108.operation(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local gc=Duel.GetMatchingGroup(c58330108.filter,tp,LOCATION_GRAVE,0,nil):GetClassCount(Card.GetCode)
if gc==1 then
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
else
local loc=LOCATION_ONFIELD
if gc>2 then loc=LOCATION_ONFIELD+LOCATION_GRAVE end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,loc,loc,exc)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,loc,loc,aux.ExceptThisCard(e))
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
......@@ -17,8 +17,6 @@ function c58760121.postg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c58760121.posop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(c58760121.filter,tp,LOCATION_MZONE,0,exc)
local g=Duel.GetMatchingGroup(c58760121.filter,tp,LOCATION_MZONE,0,aux.ExceptThisCard(e))
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE,0,POS_FACEDOWN_DEFENSE,0)
end
......@@ -71,7 +71,7 @@ function c59913418.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*200)
end
function c59913418.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsControler,nil,1-tp)
if ct>0 then
......
......@@ -43,8 +43,6 @@ function c60258960.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c60258960.desop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -39,8 +39,6 @@ function c64599569.sucop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e3)
end
function c64599569.tgop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,0,exc)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,0,aux.ExceptThisCard(e))
Duel.SendtoGrave(g,REASON_EFFECT)
end
......@@ -52,11 +52,9 @@ function c64681432.destg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c64681432.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local exc=c
if not exc:IsRelateToEffect(e) then exc=nil end
local sg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local sg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
local ct=Duel.Destroy(sg,REASON_EFFECT,LOCATION_REMOVED)
if ct>0 and c:IsFaceup() and exc~=nil then
if ct>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -19,6 +19,6 @@ function c64697431.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,sg:GetCount(),0,0)
end
function c64697431.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c64697431.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local sg=Duel.GetMatchingGroup(c64697431.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
......@@ -48,7 +48,7 @@ function c67231737.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c67231737.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local gc=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_MZONE,0,c,TYPE_LINK)
local gc=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_MZONE,0,aux.ExceptThisCard(e),TYPE_LINK)
if gc==0 then return end
local a=Duel.GetAttacker()
if a:IsRelateToBattle() and a:IsFaceup() then
......
......@@ -51,9 +51,7 @@ function c68299524.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c68299524.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local exc=c
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(c68299524.filter,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(c68299524.filter,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
local tc=g:GetFirst()
local val=e:GetLabel()
while tc do
......
......@@ -33,9 +33,7 @@ function c68396121.filter(c)
end
function c68396121.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local exc=c
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(c68396121.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local g=Duel.GetMatchingGroup(c68396121.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
......
......@@ -20,23 +20,37 @@ function c6890729.initial_effect(c)
e2:SetOperation(c6890729.thop)
c:RegisterEffect(e2)
end
function c6890729.cfilter(c,code)
return c:IsCode(code) and c:IsAbleToDeckAsCost()
function c6890729.spcostfilter(c)
return c:IsAbleToDeckAsCost() and c:IsCode(43017476,22587018,58071123)
end
c6890729.spcost_list={43017476,22587018,58071123}
function c6890729.spcost_selector(c,tp,g,sg,i)
if not c:IsCode(c6890729.spcost_list[i]) then return false end
if i<3 then
sg:AddCard(c)
g:RemoveCard(c)
local flag=g:IsExists(c6890729.spcost_selector,1,nil,tp,g,sg,i+1)
sg:RemoveCard(c)
g:AddCard(c)
return flag
else
return true
end
end
function c6890729.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c6890729.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,43017476)
and Duel.IsExistingMatchingCard(c6890729.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,22587018)
and Duel.IsExistingMatchingCard(c6890729.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,58071123) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectMatchingCard(tp,c6890729.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,43017476)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectMatchingCard(tp,c6890729.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,22587018)
local g=Duel.GetMatchingGroup(c6890729.spcostfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and g:IsExists(c6890729.spcost_selector,1,nil,tp,g,sg,1)
end
for i=1,3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g3=Duel.SelectMatchingCard(tp,c6890729.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,58071123)
g1:Merge(g2)
g1:Merge(g3)
Duel.ConfirmCards(1-tp,g1)
Duel.SendtoDeck(g1,nil,2,REASON_COST)
local g1=g:FilterSelect(tp,c6890729.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function c6890729.filter(c,e,tp)
return c:IsCode(6022371) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
......
......@@ -25,8 +25,6 @@ function c698785.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c698785.operation(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -54,6 +54,6 @@ function c70902743.target2(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c70902743.operation2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end
local g=Duel.GetMatchingGroup(c70902743.filter2,tp,LOCATION_MZONE,0,e:GetHandler())
local g=Duel.GetMatchingGroup(c70902743.filter2,tp,LOCATION_MZONE,0,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -42,7 +42,7 @@ function c71172240.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c71172240.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c71172240.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
local g=Duel.GetMatchingGroup(c71172240.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
......
......@@ -41,9 +41,7 @@ function c71525232.filter(c)
end
function c71525232.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local exc=c
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup()
local mg,atk=og:GetMaxGroup(c71525232.filter)
......
......@@ -37,7 +37,7 @@ function c72355272.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c72355272.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c72355272.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local g=Duel.GetMatchingGroup(c72355272.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
......
......@@ -45,7 +45,7 @@ function c72370114.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c72370114.desop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c72370114.cfilter,tp,LOCATION_MZONE,0,e:GetHandler())
local ct=Duel.GetMatchingGroupCount(c72370114.cfilter,tp,LOCATION_MZONE,0,aux.ExceptThisCard(e))
local g=Duel.GetMatchingGroup(c72370114.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if ct>0 and g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......
......@@ -23,6 +23,6 @@ function c72426662.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c72426662.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
......@@ -32,23 +32,41 @@ function c72989439.initial_effect(c)
e3:SetOperation(c72989439.atop)
c:RegisterEffect(e3)
end
function c72989439.spfilter(c,att)
return c:IsAttribute(att) and c:IsAbleToRemoveAsCost()
function c72989439.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end
function c72989439.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c72989439.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c72989439.spcon(e,c)
if c==nil then return true end
if Duel.GetMZoneCount(tp)<=0 then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c72989439.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_LIGHT)
and Duel.IsExistingMatchingCard(c72989439.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_DARK)
local g=Duel.GetMatchingGroup(c72989439.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
return g:IsExists(c72989439.spcost_selector,1,nil,tp,g,sg,1)
end
function c72989439.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c72989439.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
for i=1,2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c72989439.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_LIGHT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c72989439.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_DARK)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
local g1=g:FilterSelect(tp,c72989439.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c72989439.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -21,7 +21,7 @@ function c73507661.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,sg:GetCount()*300)
end
function c73507661.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c73507661.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local sg=Duel.GetMatchingGroup(c73507661.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
local ct=Duel.Destroy(sg,REASON_EFFECT)
Duel.Damage(tp,ct*300,REASON_EFFECT,true)
Duel.Damage(1-tp,ct*300,REASON_EFFECT,true)
......
......@@ -74,9 +74,7 @@ function c74530899.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetCount()*300)
end
function c74530899.thop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
if g:GetCount()==0 then return end
Duel.SendtoHand(g,nil,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
......
......@@ -34,9 +34,7 @@ function c75433814.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
end
function c75433814.ctop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
local tc=g:GetFirst()
while tc do
tc:AddCounter(0x1024,1)
......
......@@ -39,9 +39,7 @@ function c77336644.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c77336644.desop(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
function c77336644.spcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -20,8 +20,6 @@ function c77428945.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c77428945.operation(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(c77428945.filter,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(c77428945.filter,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
......@@ -50,6 +50,6 @@ function c77778835.desfilter(c,rc)
return rc:IsHasCardTarget(c)
end
function c77778835.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c77778835.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e:GetHandler())
local g=Duel.GetMatchingGroup(c77778835.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -29,7 +29,7 @@ function c79337169.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79337169.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
end
function c79337169.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c79337169.filter,tp,LOCATION_MZONE,0,e:GetHandler())
local g=Duel.GetMatchingGroup(c79337169.filter,tp,LOCATION_MZONE,0,aux.ExceptThisCard(e))
local tc=g:GetFirst()
local c=e:GetHandler()
while tc do
......
......@@ -35,7 +35,7 @@ end
function c80666118.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(c80666118.filter,tp,LOCATION_MZONE,LOCATION_MZONE,c,c:GetAttack())
local g=Duel.GetMatchingGroup(c80666118.filter,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e),c:GetAttack())
local ct=Duel.Destroy(g,REASON_EFFECT)
if ct>0 then
Duel.BreakEffect()
......
......@@ -44,7 +44,7 @@ function c81146288.distg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c81146288.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
local g=Duel.GetMatchingGroup(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
......
......@@ -30,23 +30,41 @@ function c82301904.initial_effect(c)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(82301904,ACTIVITY_CHAIN,aux.FALSE)
end
function c82301904.spfilter(c,att)
return c:IsAttribute(att) and c:IsAbleToRemoveAsCost()
function c82301904.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end
function c82301904.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c82301904.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c82301904.spcon(e,c)
if c==nil then return true end
if Duel.GetMZoneCount(tp)<=0 then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c82301904.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_LIGHT)
and Duel.IsExistingMatchingCard(c82301904.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_DARK)
local g=Duel.GetMatchingGroup(c82301904.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
return g:IsExists(c82301904.spcost_selector,1,nil,tp,g,sg,1)
end
function c82301904.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c82301904.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
for i=1,2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c82301904.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_LIGHT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c82301904.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_DARK)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
local g1=g:FilterSelect(tp,c82301904.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c82301904.sgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) and Duel.GetCustomActivityCount(82301904,tp,ACTIVITY_CHAIN)==0 end
......
......@@ -51,9 +51,7 @@ function c82308875.operation(e,tp,eg,ep,ev,re,r,rp)
elseif not b1 and b2 and b3 then op=Duel.SelectOption(tp,aux.Stringid(82308875,2),aux.Stringid(82308875,3))+1
else op=Duel.SelectOption(tp,aux.Stringid(82308875,1),aux.Stringid(82308875,2),aux.Stringid(82308875,3)) end
if op==0 then
local exc=c
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.SendtoGrave(g,REASON_EFFECT)
elseif op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -46,9 +46,7 @@ function c82697249.ctfilter(c)
end
function c82697249.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,0,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,0,aux.ExceptThisCard(e))
if Duel.Destroy(g,REASON_EFFECT)~=0 then
local ct=Duel.GetOperatedGroup():FilterCount(c82697249.ctfilter,nil)
if ct>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -41,9 +41,7 @@ function c84417082.target1(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c84417082.operation1(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(c84417082.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(c84417082.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
function c84417082.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -54,9 +54,7 @@ function c84488827.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c84488827.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
elseif e:GetLabel()==2 then
local g=Duel.GetMatchingGroup(c84488827.sfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
......
......@@ -33,8 +33,6 @@ function c86099788.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c86099788.operation(e,tp,eg,ep,ev,re,r,rp)
local exc=e:GetHandler()
if not exc:IsRelateToEffect(e) then exc=nil end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,exc)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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