Skip to content

Commit 39e7cf6

Browse files
committed
Table in Card.IsSetCar, Duel.IsMainPhase and Cost.SelfDiscard
1 parent ccd491d commit 39e7cf6

17 files changed

Lines changed: 45 additions & 61 deletions

official/c11132674.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function s.xyzop(e,tp,chk)
4141
return true
4242
end
4343
function s.thfilter(c)
44-
return (c:IsSetCard(SET_SPRINGANS) or c:IsSetCard(SET_THERION)) and c:IsAbleToHand()
44+
return c:IsSetCard({SET_SPRINGANS,SET_THERION}) and c:IsAbleToHand()
4545
end
4646
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
4747
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end

official/c13486638.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
3232
if chk==0 then return #g>0 end
3333
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
3434
local sc=g:Select(tp,1,1,nil):GetFirst()
35-
if sc:IsSetCard(SET_XYZ_DRAGON) or sc:IsSetCard(SET_THE_PHANTOM_KNIGHTS) or sc:IsSetCard(SET_RAIDRAPTOR) then
35+
if sc:IsSetCard({SET_XYZ_DRAGON,SET_THE_PHANTOM_KNIGHTS,SET_RAIDRAPTOR}) then
3636
e:SetLabel(1)
3737
else
3838
e:SetLabel(0)

official/c14920218.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function s.pcon(e,tp,eg,ep,ev,re,r,rp)
3636
return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,e:GetHandler(),SET_MAGICIAN)
3737
end
3838
function s.pfilter(c)
39-
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and (c:IsSetCard(SET_MAGICIAN) or c:IsSetCard(SET_ODD_EYES)) and not c:IsCode(id) and c:IsAbleToHand()
39+
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsSetCard({SET_MAGICIAN,SET_ODD_EYES}) and not c:IsCode(id) and c:IsAbleToHand()
4040
end
4141
function s.ptg(e,tp,eg,ep,ev,re,r,rp,chk)
4242
if chk==0 then return Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_EXTRA,0,1,nil) end

official/c17330916.lua

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function s.initial_effect(c)
1212
e1:SetRange(LOCATION_HAND)
1313
e1:SetCost(s.reg)
1414
c:RegisterEffect(e1)
15-
--scale
15+
--This card's Pendulum Scale becomes 4
1616
local e2=Effect.CreateEffect(c)
1717
e2:SetType(EFFECT_TYPE_SINGLE)
1818
e2:SetCode(EFFECT_CHANGE_LSCALE)
@@ -24,17 +24,17 @@ function s.initial_effect(c)
2424
local e3=e2:Clone()
2525
e3:SetCode(EFFECT_CHANGE_RSCALE)
2626
c:RegisterEffect(e3)
27-
--lvdown
27+
--Reduce the Levels of monsters in your hand by 1
2828
local e4=Effect.CreateEffect(c)
2929
e4:SetDescription(aux.Stringid(id,1))
3030
e4:SetType(EFFECT_TYPE_IGNITION)
3131
e4:SetRange(LOCATION_HAND)
3232
e4:SetCountLimit(1)
33-
e4:SetCost(s.lvcost)
33+
e4:SetCost(Cost.SelfDiscard)
3434
e4:SetTarget(s.lvtg)
3535
e4:SetOperation(s.lvop)
3636
c:RegisterEffect(e4)
37-
--to hand
37+
--Add 1 Level 4 or lower "Performapal" monster from your Deck to your hand
3838
local e5=Effect.CreateEffect(c)
3939
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
4040
e5:SetType(EFFECT_TYPE_IGNITION)
@@ -64,20 +64,15 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
6464
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
6565
end
6666
function s.thop(e,tp,eg,ep,ev,re,r,rp)
67-
if not e:GetHandler():IsRelateToEffect(e) then return end
6867
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
6968
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
7069
if #g>0 then
7170
Duel.SendtoHand(g,nil,REASON_EFFECT)
7271
Duel.ConfirmCards(1-tp,g)
7372
end
7473
end
75-
function s.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
76-
if chk==0 then return e:GetHandler():IsDiscardable() end
77-
Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD)
78-
end
7974
function s.filter(c)
80-
return (c:IsSetCard(SET_PERFORMAPAL) or c:IsSetCard(SET_ODD_EYES)) and c:IsMonster() and c:IsLevelAbove(2)
75+
return c:IsSetCard({SET_PERFORMAPAL,SET_ODD_EYES}) and c:IsMonster() and c:IsLevelAbove(2)
8176
end
8277
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
8378
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
@@ -92,8 +87,7 @@ function s.lvop(e,tp,eg,ep,ev,re,r,rp)
9287
Duel.ConfirmCards(1-tp,g)
9388
Duel.ShuffleHand(tp)
9489
local hg=Duel.GetMatchingGroup(s.afilter,tp,LOCATION_HAND,0,nil,g:GetFirst():GetCode())
95-
local tc=hg:GetFirst()
96-
for tc in aux.Next(hg) do
90+
for tc in hg:Iter() do
9791
local e1=Effect.CreateEffect(c)
9892
e1:SetType(EFFECT_TYPE_SINGLE)
9993
e1:SetCode(EFFECT_UPDATE_LEVEL)

official/c20773176.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ end
2929
s.listed_series={SET_NEKROZ,SET_ZEFRA}
3030
s.listed_names={id}
3131
function s.splimit(e,c,sump,sumtype,sumpos,targetp)
32-
if c:IsSetCard(SET_NEKROZ) or c:IsSetCard(SET_ZEFRA) then return false end
32+
if c:IsSetCard({SET_NEKROZ,SET_ZEFRA}) then return false end
3333
return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
3434
end
3535
function s.filter(c,tp)
3636
return c:IsReason(REASON_BATTLE|REASON_EFFECT)
37-
and (c:IsSetCard(SET_NEKROZ) or c:IsSetCard(SET_ZEFRA)) and not c:IsCode(id)
37+
and c:IsSetCard({SET_NEKROZ,SET_ZEFRA}) and not c:IsCode(id)
3838
and c:IsPreviousControler(tp)
3939
and ((c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP))
4040
or c:IsPreviousLocation(LOCATION_PZONE))

official/c21495657.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp)
3434
return e:GetHandler():IsPendulumSummoned() or e:GetHandler():IsPreviousLocation(LOCATION_DECK)
3535
end
3636
function s.filter(c)
37-
return c:IsFaceup() and (c:IsSetCard(SET_YANG_ZING) or c:IsSetCard(SET_ZEFRA)) and not c:IsType(TYPE_TUNER) and not c:IsCode(id)
37+
return c:IsFaceup() and c:IsSetCard({SET_YANG_ZIN,SET_ZEFRA}) and not c:IsType(TYPE_TUNER) and not c:IsCode(id)
3838
end
3939
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
4040
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end

official/c22617205.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function s.initial_effect(c)
3434
end
3535
s.listed_series={SET_TELLARKNIGHT,SET_ZEFRA}
3636
function s.splimit(e,c,sump,sumtype,sumpos,targetp)
37-
if c:IsSetCard(SET_TELLARKNIGHT) or c:IsSetCard(SET_ZEFRA) then return false end
37+
if c:IsSetCard({SET_TELLARKNIGHT,SET_ZEFRA}) then return false end
3838
return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
3939
end
4040
function s.filter1(c)

official/c23720856.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ end
2929
s.listed_names={}
3030
s.listed_series={SET_GAGAGA,SET_ZUBABA,SET_DODODO,SET_GOGOGO}
3131
function s.cfilter(c)
32-
return c:IsFaceup() and (c:IsSetCard(SET_GAGAGA) or c:IsSetCard(SET_ZUBABA)) and not c:IsCode(id)
32+
return c:IsFaceup() and c:IsSetCard({SET_GAGAGA,SET_ZUBABA}) and not c:IsCode(id)
3333
end
3434
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
3535
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
@@ -45,7 +45,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
4545
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
4646
end
4747
function s.spfilter(c,e,tp)
48-
return (c:IsSetCard(SET_DODODO) or c:IsSetCard(SET_GOGOGO)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
48+
return c:IsSetCard({SET_DODODO,SET_GOGOGO}) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
4949
end
5050
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
5151
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end

official/c26493435.lua

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
--希望郷-オノマトピア-
22
--Onomatopia
33
local s,id=GetID()
4+
local COUNTER_HI_FIVE=0x30
45
function s.initial_effect(c)
5-
c:EnableCounterPermit(0x30)
6+
c:EnableCounterPermit(COUNTER_HI_FIVE)
67
--Activate
78
local e1=Effect.CreateEffect(c)
89
e1:SetType(EFFECT_TYPE_ACTIVATE)
910
e1:SetCode(EVENT_FREE_CHAIN)
1011
c:RegisterEffect(e1)
11-
--add counter
12+
--Place 1 Hi-Five the Sky Counter on this card
1213
local e2=Effect.CreateEffect(c)
1314
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
1415
e2:SetProperty(EFFECT_FLAG_DELAY)
@@ -17,7 +18,7 @@ function s.initial_effect(c)
1718
e2:SetCondition(s.ctcon)
1819
e2:SetOperation(s.ctop)
1920
c:RegisterEffect(e2)
20-
--atk/def
21+
--Monsters you control gain 200 ATK and DEF for each Hi-Five the Sky Counter on this card
2122
local e3=Effect.CreateEffect(c)
2223
e3:SetType(EFFECT_TYPE_FIELD)
2324
e3:SetCode(EFFECT_UPDATE_ATTACK)
@@ -28,7 +29,7 @@ function s.initial_effect(c)
2829
local e4=e3:Clone()
2930
e4:SetCode(EFFECT_UPDATE_DEFENSE)
3031
c:RegisterEffect(e4)
31-
--special summon
32+
--Special Summon 1 "Zubaba", "Gagaga", "Gogogo", or "Dododo" monster from your Deck
3233
local e5=Effect.CreateEffect(c)
3334
e5:SetDescription(aux.Stringid(id,0))
3435
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
@@ -41,26 +42,25 @@ function s.initial_effect(c)
4142
c:RegisterEffect(e5)
4243
end
4344
s.listed_series={SET_UTOPIA,SET_ZUBABA,SET_GAGAGA,SET_GOGOGO,SET_DODODO}
44-
s.counter_place_list={0x30}
45+
s.counter_place_list={COUNTER_HI_FIVE}
4546
function s.ctfilter(c,tp)
4647
return c:IsFaceup() and c:IsSetCard(SET_UTOPIA) and c:IsControler(tp)
4748
end
4849
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
4950
return eg:IsExists(s.ctfilter,1,nil,tp)
5051
end
5152
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
52-
e:GetHandler():AddCounter(0x30,1)
53+
e:GetHandler():AddCounter(COUNTER_HI_FIVE,1)
5354
end
5455
function s.val(e,c)
55-
return e:GetHandler():GetCounter(0x30)*200
56+
return e:GetHandler():GetCounter(COUNTER_HI_FIVE)*200
5657
end
5758
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
58-
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x30,2,REASON_COST) end
59-
e:GetHandler():RemoveCounter(tp,0x30,2,REASON_COST)
59+
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,COUNTER_HI_FIVE,2,REASON_COST) end
60+
e:GetHandler():RemoveCounter(tp,COUNTER_HI_FIVE,2,REASON_COST)
6061
end
6162
function s.filter(c,e,tp)
62-
return (c:IsSetCard(SET_ZUBABA) or c:IsSetCard(SET_GAGAGA) or c:IsSetCard(SET_GOGOGO) or c:IsSetCard(SET_DODODO))
63-
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
63+
return c:IsSetCard({SET_ZUBABA,SET_GAGAGA,SET_GOGOGO,SET_DODODO}) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
6464
end
6565
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
6666
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0

official/c27970830.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
6464
Duel.RemoveCounter(tp,1,0,COUNTER_BUSHIDO,2,REASON_COST)
6565
end
6666
function s.filter1(c)
67-
return c:IsFaceup() and (c:IsSetCard(SET_SIX_SAMURAI) or c:IsSetCard(SET_SHIEN)) and c:IsType(TYPE_EFFECT)
67+
return c:IsFaceup() and c:IsSetCard({SET_SIX_SAMURAI,SET_SHIEN}) and c:IsType(TYPE_EFFECT)
6868
end
6969
function s.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
7070
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter1(chkc) end

0 commit comments

Comments
 (0)