Commit cb8266e6 authored by nekrozar's avatar nekrozar

use aux.IsMaterialListCode

parent 627fee1b
......@@ -11,11 +11,10 @@ function c17194258.initial_effect(c)
c:RegisterEffect(e1)
end
function c17194258.filter1(c,tp)
return c.material and Duel.IsExistingMatchingCard(c17194258.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c)
return Duel.IsExistingMatchingCard(c17194258.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c)
end
function c17194258.filter2(c,fc)
if c:IsForbidden() or not c:IsAbleToHand() then return false end
return c:IsCode(table.unpack(fc.material))
return aux.IsMaterialListCode(fc,c:GetCode()) and c:IsAbleToHand()
end
function c17194258.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17194258.filter1,tp,LOCATION_EXTRA,0,1,nil,tp) end
......
......@@ -21,8 +21,8 @@ function c2390019.initial_effect(c)
c:RegisterEffect(e2)
end
function c2390019.ffilter(c,e,tp)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
and c.material and Duel.IsExistingMatchingCard(c2390019.cfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,c,e,tp)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
and Duel.IsExistingMatchingCard(c2390019.cfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,c,e,tp)
end
function c2390019.cfilter(c,fc,e,tp)
if c:IsSetCard(0xf) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() then
......@@ -32,7 +32,7 @@ function c2390019.cfilter(c,fc,e,tp)
else return false end
end
function c2390019.filter(c,fc,e,tp)
return c:IsCode(table.unpack(fc.material)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return aux.IsMaterialListCode(fc,c:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c2390019.cfilter2(c,g,mg,ft,rm)
if not rm and ft==0 and not c:IsLocation(LOCATION_MZONE) then return false end
......@@ -61,8 +61,8 @@ function c2390019.cost(e,tp,eg,ep,ev,re,r,rp,chk)
rg:RemoveCard(sc)
mg:RemoveCard(sc)
if not sc:IsLocation(LOCATION_MZONE) then ft=ft-1 end
until g:GetCount()==5 or rg:GetCount()==0 or mg:GetClassCount(Card.GetCode)==g:GetCount()
or (ft==0 and not rg:IsExists(Card.IsLocation,1,nil,LOCATION_MZONE))
until g:GetCount()==5 or rg:GetCount()==0 or mg:GetClassCount(Card.GetCode)==g:GetCount()
or (ft==0 and not rg:IsExists(Card.IsLocation,1,nil,LOCATION_MZONE))
or not Duel.SelectYesNo(tp,aux.Stringid(2390019,0))
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabel(Duel.GetOperatedGroup():GetCount())
......@@ -90,7 +90,7 @@ function c2390019.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
function c2390019.tdfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
and c:IsSetCard(0xf) and c:IsAbleToDeck()
end
function c2390019.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -67,10 +67,10 @@ function c48048590.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c48048590.filter1(c,e,tp)
return c.material and Duel.IsExistingMatchingCard(c48048590.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,c)
return Duel.IsExistingMatchingCard(c48048590.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,c)
end
function c48048590.filter2(c,e,tp,fc)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and c:IsCode(table.unpack(fc.material))
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and aux.IsMaterialListCode(fc,c:GetCode())
end
function c48048590.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c48048590.cost(e,tp,eg,ep,ev,re,r,rp,0)
......
......@@ -18,10 +18,10 @@ function c49469105.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,c49469105.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c49469105.filter1(c,g)
return c.material and g:IsExists(c49469105.filter2,1,nil,c)
return g:IsExists(c49469105.filter2,1,nil,c)
end
function c49469105.filter2(c,fc)
return c:IsCode(table.unpack(fc.material))
return aux.IsMaterialListCode(fc,c:GetCode())
end
function c49469105.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -11,11 +11,10 @@ function c66127916.initial_effect(c)
c:RegisterEffect(e1)
end
function c66127916.filter1(c,tp)
return c.material and Duel.IsExistingMatchingCard(c66127916.filter2,tp,LOCATION_DECK,0,1,nil,c)
return Duel.IsExistingMatchingCard(c66127916.filter2,tp,LOCATION_DECK,0,1,nil,c)
end
function c66127916.filter2(c,fc)
if c:IsForbidden() or not c:IsAbleToHand() then return false end
return c:IsCode(table.unpack(fc.material))
return aux.IsMaterialListCode(fc,c:GetCode()) and c:IsAbleToHand()
end
function c66127916.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c66127916.filter1,tp,LOCATION_EXTRA,0,1,nil,tp) end
......
......@@ -21,7 +21,7 @@ function c69270537.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c69270537.spfilter(c,e,tp,fc)
return fc.material and c:IsCode(table.unpack(fc.material)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return aux.IsMaterialListCode(fc,c:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c69270537.fcheck(sp)
return function(tp,g,c)
......
......@@ -11,11 +11,10 @@ function c89312388.initial_effect(c)
c:RegisterEffect(e1)
end
function c89312388.filter2(c,fc)
if not c:IsAbleToGraveAsCost() then return false end
return c:IsCode(table.unpack(fc.material))
return aux.IsMaterialListCode(fc,c:GetCode()) and c:IsAbleToGraveAsCost()
end
function c89312388.filter1(c,tp)
return c.material and Duel.IsExistingMatchingCard(c89312388.filter2,tp,LOCATION_DECK,0,1,nil,c)
return Duel.IsExistingMatchingCard(c89312388.filter2,tp,LOCATION_DECK,0,1,nil,c)
end
function c89312388.coscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c89312388.filter1,tp,LOCATION_EXTRA,0,1,nil,tp) end
......
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