Commit c1cf25e4 authored by DailyShana's avatar DailyShana

aux.IsCodeListed

parent f1e5fedd
...@@ -12,7 +12,7 @@ function c111280.initial_effect(c) ...@@ -12,7 +12,7 @@ function c111280.initial_effect(c)
e1:SetOperation(c111280.activate) e1:SetOperation(c111280.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c111280.dark_magician_list=true c111280.card_code_list={46986414}
function c111280.cfilter(c) function c111280.cfilter(c)
return c:IsFaceup() and c:IsCode(46986414,38033121) return c:IsFaceup() and c:IsCode(46986414,38033121)
end end
......
...@@ -10,7 +10,7 @@ function c13604200.initial_effect(c) ...@@ -10,7 +10,7 @@ function c13604200.initial_effect(c)
e1:SetOperation(c13604200.activate) e1:SetOperation(c13604200.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c13604200.dark_magician_list=true c13604200.card_code_list={46986414}
function c13604200.cfilter(c) function c13604200.cfilter(c)
return c:IsFaceup() and c:IsCode(38033121) return c:IsFaceup() and c:IsCode(38033121)
end end
......
...@@ -9,7 +9,7 @@ function c21082832.initial_effect(c) ...@@ -9,7 +9,7 @@ function c21082832.initial_effect(c)
e1:SetOperation(c21082832.activate) e1:SetOperation(c21082832.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c21082832.dark_magician_list=true c21082832.card_code_list={46986414}
function c21082832.filter(c,e,tp,m1,m2,ft) function c21082832.filter(c,e,tp,m1,m2,ft)
if not c:IsSetCard(0xcf) or bit.band(c:GetType(),0x81)~=0x81 if not c:IsSetCard(0xcf) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
......
...@@ -10,7 +10,7 @@ function c2314238.initial_effect(c) ...@@ -10,7 +10,7 @@ function c2314238.initial_effect(c)
e1:SetOperation(c2314238.activate) e1:SetOperation(c2314238.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c2314238.dark_magician_list=true c2314238.card_code_list={46986414}
function c2314238.cfilter(c) function c2314238.cfilter(c)
return c:IsFaceup() and c:IsCode(46986414) return c:IsFaceup() and c:IsCode(46986414)
end end
......
...@@ -26,12 +26,12 @@ function c47222536.initial_effect(c) ...@@ -26,12 +26,12 @@ function c47222536.initial_effect(c)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
c47222536.dark_magician_list=true c47222536.card_code_list={46986414}
function c47222536.target(e,tp,eg,ep,ev,re,r,rp,chk) function c47222536.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 end
end end
function c47222536.filter(c) function c47222536.filter(c)
return (c.dark_magician_list or c:IsCode(46986414)) and c:IsAbleToHand() return (aux.IsCodeListed(c,46986414) or c:IsCode(46986414)) and c:IsAbleToHand()
end end
function c47222536.activate(e,tp,eg,ep,ev,re,r,rp) function c47222536.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
......
...@@ -38,7 +38,7 @@ function c48680970.initial_effect(c) ...@@ -38,7 +38,7 @@ function c48680970.initial_effect(c)
e4:SetOperation(c48680970.desop) e4:SetOperation(c48680970.desop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
c48680970.dark_magician_list=true c48680970.card_code_list={46986414}
function c48680970.filter1(c,e,tp) function c48680970.filter1(c,e,tp)
return c:IsCode(46986414) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(46986414) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
......
...@@ -11,7 +11,7 @@ function c63391643.initial_effect(c) ...@@ -11,7 +11,7 @@ function c63391643.initial_effect(c)
e1:SetOperation(c63391643.activate) e1:SetOperation(c63391643.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c63391643.dark_magician_list=true c63391643.card_code_list={46986414}
function c63391643.cfilter(c) function c63391643.cfilter(c)
return c:IsFaceup() and c:IsCode(46986414) return c:IsFaceup() and c:IsCode(46986414)
end end
......
...@@ -34,7 +34,7 @@ function c67227834.initial_effect(c) ...@@ -34,7 +34,7 @@ function c67227834.initial_effect(c)
e4:SetOperation(c67227834.recop) e4:SetOperation(c67227834.recop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
c67227834.dark_magician_list=true c67227834.card_code_list={46986414}
function c67227834.eqlimit(e,c) function c67227834.eqlimit(e,c)
return c:IsCode(46986414,38033121) return c:IsCode(46986414,38033121)
end end
......
...@@ -12,7 +12,7 @@ function c68334074.initial_effect(c) ...@@ -12,7 +12,7 @@ function c68334074.initial_effect(c)
e1:SetOperation(c68334074.activate) e1:SetOperation(c68334074.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c68334074.dark_magician_list=true c68334074.card_code_list={46986414}
function c68334074.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c68334074.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x1,2,REASON_COST) end if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x1,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x1,2,REASON_COST) Duel.RemoveCounter(tp,1,0,0x1,2,REASON_COST)
......
...@@ -10,7 +10,7 @@ function c69542930.initial_effect(c) ...@@ -10,7 +10,7 @@ function c69542930.initial_effect(c)
e1:SetOperation(c69542930.activate) e1:SetOperation(c69542930.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c69542930.dark_magician_list=true c69542930.card_code_list={46986414}
function c69542930.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c69542930.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,46986414) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,46986414) end
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,46986414) local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,46986414)
......
...@@ -34,7 +34,7 @@ function c7084129.initial_effect(c) ...@@ -34,7 +34,7 @@ function c7084129.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c7084129.thfilter(c) function c7084129.thfilter(c)
return c.dark_magician_list and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() return aux.IsCodeListed(c,46986414) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end end
function c7084129.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c7084129.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c7084129.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c7084129.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
...@@ -11,7 +11,7 @@ function c73616671.initial_effect(c) ...@@ -11,7 +11,7 @@ function c73616671.initial_effect(c)
e1:SetOperation(c73616671.activate) e1:SetOperation(c73616671.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c73616671.dark_magician_list=true c73616671.card_code_list={46986414}
function c73616671.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c73616671.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_SPELLCASTER) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_SPELLCASTER) end
local g=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_SPELLCASTER) local g=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_SPELLCASTER)
......
...@@ -10,7 +10,7 @@ function c75190122.initial_effect(c) ...@@ -10,7 +10,7 @@ function c75190122.initial_effect(c)
e1:SetOperation(c75190122.activate) e1:SetOperation(c75190122.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c75190122.dark_magician_list=true c75190122.card_code_list={46986414}
function c75190122.cfilter(c,code) function c75190122.cfilter(c,code)
local code1,code2=c:GetOriginalCodeRule() local code1,code2=c:GetOriginalCodeRule()
return c:IsFaceup() and (code1==code or code2==code) return c:IsFaceup() and (code1==code or code2==code)
......
...@@ -22,7 +22,7 @@ function c7922915.initial_effect(c) ...@@ -22,7 +22,7 @@ function c7922915.initial_effect(c)
e2:SetOperation(c7922915.negop) e2:SetOperation(c7922915.negop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
c7922915.dark_magician_list=true c7922915.card_code_list={46986414}
function c7922915.filter(c,e,tp) function c7922915.filter(c,e,tp)
return c:IsCode(46986414) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(46986414) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
......
...@@ -10,7 +10,7 @@ function c87210505.initial_effect(c) ...@@ -10,7 +10,7 @@ function c87210505.initial_effect(c)
e1:SetOperation(c87210505.activate) e1:SetOperation(c87210505.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c87210505.dark_magician_list=true c87210505.card_code_list={46986414}
function c87210505.costfilter(c) function c87210505.costfilter(c)
return c:IsFaceup() and c:IsCode(46986414) return c:IsFaceup() and c:IsCode(46986414)
end end
......
...@@ -10,7 +10,7 @@ function c99789342.initial_effect(c) ...@@ -10,7 +10,7 @@ function c99789342.initial_effect(c)
e1:SetOperation(c99789342.activate) e1:SetOperation(c99789342.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c99789342.dark_magician_list=true c99789342.card_code_list={46986414}
function c99789342.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c99789342.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0 if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0
and Duel.GetActivityCount(tp,ACTIVITY_FLIPSUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end and Duel.GetActivityCount(tp,ACTIVITY_FLIPSUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end
......
...@@ -1575,6 +1575,13 @@ end ...@@ -1575,6 +1575,13 @@ end
function Auxiliary.IsMaterialListSetCard(c,setcode) function Auxiliary.IsMaterialListSetCard(c,setcode)
return c.material_setcode and c.material_setcode==setcode return c.material_setcode and c.material_setcode==setcode
end end
function Auxiliary.IsCodeListed(c,code)
if not c.card_code_list then return false end
for i,ccode in ipairs(c.card_code_list) do
if code==ccode then return true end
end
return false
end
--card effect disable filter(target) --card effect disable filter(target)
function Auxiliary.disfilter1(c) function Auxiliary.disfilter1(c)
return c:IsFaceup() and not c:IsDisabled() and (not c:IsType(TYPE_NORMAL) or bit.band(c:GetOriginalType(),TYPE_EFFECT)~=0) return c:IsFaceup() and not c:IsDisabled() and (not c:IsType(TYPE_NORMAL) or bit.band(c:GetOriginalType(),TYPE_EFFECT)~=0)
......
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