Skip to content

Commit ca9c9e9

Browse files
committed
Update "Dragon Ruler" cards
- Added support to "Chasmatis, Dragon Ruler of Poles" - fixed an incorrect operation info in the effects that would return the monsters to the hand - script modernization
1 parent 5ac662b commit ca9c9e9

File tree

8 files changed

+121
-123
lines changed

8 files changed

+121
-123
lines changed

official/c26400609.lua

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
--瀑征竜-タイダル
2+
--Tidal, Dragon Ruler of Waterfalls
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--special summon
5+
--Special Summon this card from the hand or GY
56
local e1=Effect.CreateEffect(c)
67
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
89
e1:SetType(EFFECT_TYPE_IGNITION)
9-
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
10+
e1:SetRange(LOCATION_HAND|LOCATION_GRAVE)
1011
e1:SetCountLimit(1,id)
1112
e1:SetCost(s.hspcost)
1213
e1:SetTarget(s.hsptg)
1314
e1:SetOperation(s.hspop)
1415
c:RegisterEffect(e1)
15-
--return
16+
--Return this card to the hand
1617
local e2=Effect.CreateEffect(c)
1718
e2:SetDescription(aux.Stringid(id,1))
1819
e2:SetCategory(CATEGORY_TOHAND)
1920
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
2021
e2:SetRange(LOCATION_MZONE)
21-
e2:SetCountLimit(1,id)
2222
e2:SetCode(EVENT_PHASE+PHASE_END)
23+
e2:SetCountLimit(1,id)
2324
e2:SetCondition(s.retcon)
2425
e2:SetTarget(s.rettg)
2526
e2:SetOperation(s.retop)
2627
c:RegisterEffect(e2)
27-
--tograve
28+
--Send 1 monster from your Deck to the Graveyard
2829
local e3=Effect.CreateEffect(c)
2930
e3:SetDescription(aux.Stringid(id,2))
3031
e3:SetCategory(CATEGORY_TOGRAVE)
@@ -34,15 +35,15 @@ function s.initial_effect(c)
3435
e3:SetCost(s.tgcost)
3536
e3:SetTarget(s.tgtg)
3637
e3:SetOperation(s.tgop)
37-
c:RegisterEffect(e3)
38-
--search
38+
c:RegisterEffect(e3,false,REGISTER_FLAG_DRAGON_RULER)
39+
--Add 1 WATER Dragon-Type monster from your Deck to your hand
3940
local e4=Effect.CreateEffect(c)
4041
e4:SetDescription(aux.Stringid(id,3))
4142
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
4243
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
44+
e4:SetProperty(EFFECT_FLAG_DELAY)
4345
e4:SetCode(EVENT_REMOVE)
4446
e4:SetCountLimit(1,id)
45-
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
4647
e4:SetTarget(s.thtg)
4748
e4:SetOperation(s.thop)
4849
c:RegisterEffect(e4)
@@ -52,15 +53,15 @@ function s.rfilter(c)
5253
and (c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c,true))
5354
end
5455
function s.hspcost(e,tp,eg,ep,ev,re,r,rp,chk)
55-
local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,e:GetHandler())
56-
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #rg>1
57-
and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end
56+
local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler())
57+
if chk==0 then return #rg>1 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end
5858
local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE)
5959
Duel.Remove(g,POS_FACEUP,REASON_COST)
6060
end
6161
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk)
62-
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
63-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
62+
local c=e:GetHandler()
63+
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
64+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
6465
end
6566
function s.hspop(e,tp,eg,ep,ev,re,r,rp)
6667
local c=e:GetHandler()
@@ -69,11 +70,11 @@ function s.hspop(e,tp,eg,ep,ev,re,r,rp)
6970
end
7071
end
7172
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
72-
return Duel.GetTurnPlayer()~=tp and e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
73+
return Duel.IsTurnPlayer(1-tp) and e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
7374
end
7475
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
7576
if chk==0 then return true end
76-
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
77+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,0)
7778
end
7879
function s.retop(e,tp,eg,ep,ev,re,r,rp)
7980
local c=e:GetHandler()
@@ -96,7 +97,8 @@ function s.tgfilter(c)
9697
return c:IsMonster() and c:IsAbleToGrave()
9798
end
9899
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
99-
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
100+
--Excluding itself for a correct interaction with "Chasmatis, Dragon Ruler of Poles"
101+
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,e:GetHandler()) end
100102
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
101103
end
102104
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
@@ -120,4 +122,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
120122
Duel.SendtoHand(g,nil,REASON_EFFECT)
121123
Duel.ConfirmCards(1-tp,g)
122124
end
123-
end
125+
end

official/c27415516.lua

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
--水征竜-ストリーム
22
--Stream, Dragon Ruler of Droplets
3-
43
local s,id=GetID()
54
function s.initial_effect(c)
65
--Special summon 1 "Tidal, Dragon Ruler of Waterfalls" from deck
@@ -13,10 +12,9 @@ function s.initial_effect(c)
1312
e1:SetCost(s.spcost)
1413
e1:SetTarget(s.sptg)
1514
e1:SetOperation(s.spop)
16-
c:RegisterEffect(e1)
15+
c:RegisterEffect(e1,false,REGISTER_FLAG_DRAGON_RULER)
1716
end
18-
s.listed_names={26400609}
19-
17+
s.listed_names={26400609} --"Tidal, Dragon Ruler of Waterfalls"
2018
function s.costfilter(c)
2119
return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_WATER)) and c:IsDiscardable()
2220
end
@@ -27,7 +25,7 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
2725
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
2826
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c)
2927
g:AddCard(c)
30-
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
28+
Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD)
3129
end
3230
function s.spfilter(c,e,tp)
3331
return c:IsCode(26400609) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
@@ -47,7 +45,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
4745
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
4846
e1:SetType(EFFECT_TYPE_SINGLE)
4947
e1:SetCode(EFFECT_CANNOT_ATTACK)
50-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
48+
e1:SetReset(RESETS_STANDARD_PHASE_END)
5149
tc:RegisterEffect(e1)
5250
end
5351
Duel.SpecialSummonComplete()

official/c53797637.lua

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
--炎征竜-バーナー
22
--Burner, Dragon Ruler of Sparks
3-
43
local s,id=GetID()
54
function s.initial_effect(c)
65
--Special summon 1 "Blaster, Dragon Ruler of Infernos" from deck
@@ -13,10 +12,9 @@ function s.initial_effect(c)
1312
e1:SetCost(s.spcost)
1413
e1:SetTarget(s.sptg)
1514
e1:SetOperation(s.spop)
16-
c:RegisterEffect(e1)
15+
c:RegisterEffect(e1,false,REGISTER_FLAG_DRAGON_RULER)
1716
end
18-
s.listed_names={53804307}
19-
17+
s.listed_names={53804307}--"Blaster, Dragon Ruler of Infernos"
2018
function s.costfilter(c)
2119
return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_FIRE)) and c:IsDiscardable()
2220
end
@@ -27,7 +25,7 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
2725
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
2826
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c)
2927
g:AddCard(c)
30-
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
28+
Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD)
3129
end
3230
function s.spfilter(c,e,tp)
3331
return c:IsCode(53804307) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
@@ -47,7 +45,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
4745
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
4846
e1:SetType(EFFECT_TYPE_SINGLE)
4947
e1:SetCode(EFFECT_CANNOT_ATTACK)
50-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
48+
e1:SetReset(RESETS_STANDARD_PHASE_END)
5149
tc:RegisterEffect(e1)
5250
end
5351
Duel.SpecialSummonComplete()

official/c53804307.lua

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
--焔征竜-ブラスター
2+
--Blaster, Dragon Ruler of Infernos
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--special summon
5+
--Special Summon this card from the hand or GY
56
local e1=Effect.CreateEffect(c)
67
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
89
e1:SetType(EFFECT_TYPE_IGNITION)
9-
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
10+
e1:SetRange(LOCATION_HAND|LOCATION_GRAVE)
1011
e1:SetCountLimit(1,id)
1112
e1:SetCost(s.hspcost)
1213
e1:SetTarget(s.hsptg)
1314
e1:SetOperation(s.hspop)
1415
c:RegisterEffect(e1)
15-
--return
16+
--Return this card to the hand
1617
local e2=Effect.CreateEffect(c)
1718
e2:SetDescription(aux.Stringid(id,1))
1819
e2:SetCategory(CATEGORY_TOHAND)
1920
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
2021
e2:SetRange(LOCATION_MZONE)
21-
e2:SetCountLimit(1,id)
2222
e2:SetCode(EVENT_PHASE+PHASE_END)
23+
e2:SetCountLimit(1,id)
2324
e2:SetCondition(s.retcon)
2425
e2:SetTarget(s.rettg)
2526
e2:SetOperation(s.retop)
2627
c:RegisterEffect(e2)
27-
--destroy
28+
--Destroy 1 card on the field
2829
local e3=Effect.CreateEffect(c)
2930
e3:SetDescription(aux.Stringid(id,2))
3031
e3:SetCategory(CATEGORY_DESTROY)
@@ -35,14 +36,14 @@ function s.initial_effect(c)
3536
e3:SetCost(s.descost)
3637
e3:SetTarget(s.destg)
3738
e3:SetOperation(s.desop)
38-
c:RegisterEffect(e3)
39-
--search
39+
c:RegisterEffect(e3,false,REGISTER_FLAG_DRAGON_RULER)
40+
--Add 1 FIRE Dragon monster from your Deck to your han
4041
local e4=Effect.CreateEffect(c)
4142
e4:SetDescription(aux.Stringid(id,3))
4243
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
4344
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
45+
e4:SetProperty(EFFECT_FLAG_DELAY)
4446
e4:SetCode(EVENT_REMOVE)
45-
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
4647
e4:SetCountLimit(1,id)
4748
e4:SetTarget(s.thtg)
4849
e4:SetOperation(s.thop)
@@ -53,15 +54,15 @@ function s.rfilter(c)
5354
and (c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c,true))
5455
end
5556
function s.hspcost(e,tp,eg,ep,ev,re,r,rp,chk)
56-
local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,e:GetHandler())
57-
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #rg>1
58-
and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end
57+
local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler())
58+
if chk==0 then return #rg>1 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end
5959
local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE)
6060
Duel.Remove(g,POS_FACEUP,REASON_COST)
6161
end
6262
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk)
63-
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
64-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
63+
local c=e:GetHandler()
64+
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
65+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
6566
end
6667
function s.hspop(e,tp,eg,ep,ev,re,r,rp)
6768
local c=e:GetHandler()
@@ -70,12 +71,11 @@ function s.hspop(e,tp,eg,ep,ev,re,r,rp)
7071
end
7172
end
7273
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
73-
return Duel.GetTurnPlayer()~=tp
74-
and e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
74+
return Duel.IsTurnPlayer(1-tp) and e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
7575
end
7676
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
7777
if chk==0 then return true end
78-
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
78+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,0)
7979
end
8080
function s.retop(e,tp,eg,ep,ev,re,r,rp)
8181
local c=e:GetHandler()
@@ -87,23 +87,24 @@ function s.dfilter(c)
8787
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
8888
end
8989
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
90-
if chk==0 then return e:GetHandler():IsDiscardable() and e:GetHandler():IsAbleToGraveAsCost()
91-
and Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
90+
local c=e:GetHandler()
91+
if chk==0 then return c:IsDiscardable() and c:IsAbleToGraveAsCost()
92+
and Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_HAND,0,1,c) end
9293
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
93-
local g=Duel.SelectMatchingCard(tp,s.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
94+
local g=Duel.SelectMatchingCard(tp,s.dfilter,tp,LOCATION_HAND,0,1,1,c)
9495
g:AddCard(e:GetHandler())
95-
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
96+
Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD)
9697
end
9798
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
9899
if chkc then return chkc:IsOnField() end
99-
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
100+
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
100101
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
101-
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
102-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
102+
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
103+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
103104
end
104105
function s.desop(e,tp,eg,ep,ev,re,r,rp)
105106
local tc=Duel.GetFirstTarget()
106-
if tc and tc:IsRelateToEffect(e) then
107+
if tc:IsRelateToEffect(e) then
107108
Duel.Destroy(tc,REASON_EFFECT)
108109
end
109110
end
@@ -121,4 +122,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
121122
Duel.SendtoHand(g,nil,REASON_EFFECT)
122123
Duel.ConfirmCards(1-tp,g)
123124
end
124-
end
125+
end

official/c89185742.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
--風征竜-ライトニング
22
--Lightning, Dragon Ruler of Drafts
3-
43
local s,id=GetID()
54
function s.initial_effect(c)
65
--Special summon 1 "Tempest, Dragon Ruler of Storms" from deck
@@ -13,9 +12,9 @@ function s.initial_effect(c)
1312
e1:SetCost(s.spcost)
1413
e1:SetTarget(s.sptg)
1514
e1:SetOperation(s.spop)
16-
c:RegisterEffect(e1)
15+
c:RegisterEffect(e1,false,REGISTER_FLAG_DRAGON_RULER)
1716
end
18-
s.listed_names={89399912}
17+
s.listed_names={89399912} --"Tempest, Dragon Ruler of Storms"
1918
function s.costfilter(c)
2019
return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_WIND)) and c:IsDiscardable()
2120
end
@@ -26,7 +25,7 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
2625
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
2726
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c)
2827
g:AddCard(c)
29-
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
28+
Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD)
3029
end
3130
function s.spfilter(c,e,tp)
3231
return c:IsCode(89399912) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
@@ -46,7 +45,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
4645
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
4746
e1:SetType(EFFECT_TYPE_SINGLE)
4847
e1:SetCode(EFFECT_CANNOT_ATTACK)
49-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
48+
e1:SetReset(RESETS_STANDARD_PHASE_END)
5049
tc:RegisterEffect(e1)
5150
end
5251
Duel.SpecialSummonComplete()

0 commit comments

Comments
 (0)