Skip to content

Commit 80a9113

Browse files
authored
Added new card scripts
1 parent aded6c5 commit 80a9113

File tree

6 files changed

+545
-0
lines changed

6 files changed

+545
-0
lines changed

pre-release/c101208018.lua

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
--光征竜-スペクトル
2+
--Spector, Dragon Ruler of Rays
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Add 2 "Dragon Ruler" monsters from your Deck to your hand
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
10+
e1:SetType(EFFECT_TYPE_IGNITION)
11+
e1:SetRange(LOCATION_HAND)
12+
e1:SetCountLimit(1,id)
13+
e1:SetCost(s.thcost)
14+
e1:SetTarget(s.thtg)
15+
e1:SetOperation(s.thop)
16+
c:RegisterEffect(e1,false,REGISTER_FLAG_DRAGON_RULER)
17+
--Special Summon 1 "Chasmatis, Dragon Ruler of Auroras" from your GY
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
21+
e2:SetType(EFFECT_TYPE_IGNITION)
22+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
23+
e2:SetRange(LOCATION_GRAVE)
24+
e2:SetCountLimit(1,id)
25+
e2:SetCost(s.spcost)
26+
e2:SetTarget(s.sptg)
27+
e2:SetOperation(s.spop)
28+
c:RegisterEffect(e2)
29+
end
30+
s.listed_series={SET_DRAGON_RULER}
31+
s.listed_names={id,101208047} --"Chasmatis, Dragon Ruler of Auroras"
32+
function s.thcostfilter(c)
33+
return (c:IsAttribute(ATTRIBUTE_LIGHT) or c:IsRace(RACE_DRAGON)) and c:IsDiscardable()
34+
end
35+
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
36+
local c=e:GetHandler()
37+
if chk==0 then return c:IsDiscardable() and Duel.IsExistingMatchingCard(s.thcostfilter,tp,LOCATION_HAND,0,1,c) end
38+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
39+
local g=Duel.SelectMatchingCard(tp,s.thcostfilter,tp,LOCATION_HAND,0,1,1,c)
40+
g:AddCard(c)
41+
Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD)
42+
end
43+
function s.thfilter(c)
44+
return c:IsSetCard(SET_DRAGON_RULER) and c:IsMonster() and c:IsAbleToHand() and not c:IsCode(id)
45+
end
46+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
47+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,2,nil) end
48+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
49+
end
50+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
51+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
52+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,2,2,nil)
53+
if #g>0 then
54+
Duel.SendtoHand(g,nil,REASON_EFFECT)
55+
Duel.ConfirmCards(1-tp,g)
56+
end
57+
end
58+
function s.spcostfilter(c,e,tp)
59+
return (c:IsAttribute(ATTRIBUTE_LIGHT) or c:IsRace(RACE_DRAGON)) and c:IsAbleToRemoveAsCost()
60+
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp)
61+
end
62+
function s.spfilter(c,e,tp)
63+
return c:IsCode(101208047) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
64+
end
65+
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
66+
local c=e:GetHandler()
67+
if chk==0 then return c:IsAbleToRemoveAsCost()
68+
and Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) end
69+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
70+
local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_GRAVE,0,1,1,c,e,tp)
71+
g:AddCard(c)
72+
Duel.Remove(g,POS_FACEUP,REASON_COST)
73+
end
74+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
75+
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
76+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
77+
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
78+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
79+
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
80+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
81+
end
82+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
83+
local tc=Duel.GetFirstTarget()
84+
if tc:IsRelateToEffect(e) then
85+
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
86+
end
87+
end

pre-release/c101208019.lua

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
--闇征竜-ネビュラス
2+
--Nebulous, Dragon Ruler of Shadows
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Special Summon 2 of your banished "Dragon Ruler" monsters with different Attributes
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
10+
e1:SetType(EFFECT_TYPE_IGNITION)
11+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
12+
e1:SetRange(LOCATION_HAND)
13+
e1:SetCountLimit(1,id)
14+
e1:SetCost(s.rmspcost)
15+
e1:SetTarget(s.rmsptg)
16+
e1:SetOperation(s.rmspop)
17+
c:RegisterEffect(e1,false,REGISTER_FLAG_DRAGON_RULER)
18+
--Special Summon 1 "Eclepsis, Dragon Ruler of Woes" from your GY
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,1))
21+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
22+
e2:SetType(EFFECT_TYPE_IGNITION)
23+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
24+
e2:SetRange(LOCATION_GRAVE)
25+
e2:SetCountLimit(1,id)
26+
e2:SetCost(s.gyspcost)
27+
e2:SetTarget(s.gysptg)
28+
e2:SetOperation(s.gyspop)
29+
c:RegisterEffect(e2)
30+
end
31+
s.listed_series={SET_DRAGON_RULER}
32+
s.listed_names={id,101208048} --"Eclepsis, Dragon Ruler of Woes"
33+
function s.rmcostfilter(c)
34+
return (c:IsAttribute(ATTRIBUTE_DARK) or c:IsRace(RACE_DRAGON)) and c:IsDiscardable()
35+
end
36+
function s.rmspcost(e,tp,eg,ep,ev,re,r,rp,chk)
37+
local c=e:GetHandler()
38+
if chk==0 then return c:IsDiscardable() and Duel.IsExistingMatchingCard(s.rmcostfilter,tp,LOCATION_HAND,0,1,c) end
39+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
40+
local g=Duel.SelectMatchingCard(tp,s.rmcostfilter,tp,LOCATION_HAND,0,1,1,c)
41+
g:AddCard(c)
42+
Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD)
43+
end
44+
function s.rmspfilter(c,e,tp)
45+
return c:IsSetCard(SET_DRAGON_RULER) and c:IsFaceup() and c:IsCanBeEffectTarget(e) and not c:IsCode(id)
46+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
47+
end
48+
function s.rmsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
49+
if chkc then return false end
50+
local g=Duel.GetMatchingGroup(s.rmspfilter,tp,LOCATION_REMOVED,0,nil,e,tp)
51+
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
52+
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2
53+
and g:GetClassCount(Card.GetAttribute)>=2 end
54+
local tg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dpcheck(Card.GetAttribute),1,tp,HINTMSG_SPSUMMON)
55+
Duel.SetTargetCard(tg)
56+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,2,tp,0)
57+
end
58+
function s.rmspop(e,tp,eg,ep,ev,re,r,rp)
59+
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
60+
if ft<=0 then return end
61+
local tg=Duel.GetTargetCards(e)
62+
if #tg==0 then return end
63+
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and #tg>1 then return end
64+
if #tg>ft then
65+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
66+
tg=tg:Select(tp,ft,ft,nil)
67+
end
68+
local c=e:GetHandler()
69+
for tc in tg:Iter() do
70+
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
71+
--It cannot attack this turn
72+
local e1=Effect.CreateEffect(c)
73+
e1:SetDescription(3206)
74+
e1:SetType(EFFECT_TYPE_SINGLE)
75+
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
76+
e1:SetCode(EFFECT_CANNOT_ATTACK)
77+
e1:SetReset(RESETS_STANDARD_PHASE_END)
78+
tc:RegisterEffect(e1)
79+
end
80+
end
81+
Duel.SpecialSummonComplete()
82+
end
83+
function s.gyspcostfilter(c,e,tp)
84+
return (c:IsAttribute(ATTRIBUTE_DARK) or c:IsRace(RACE_DRAGON)) and c:IsAbleToRemoveAsCost()
85+
and Duel.IsExistingTarget(s.gyspfilter,tp,LOCATION_GRAVE,0,1,c,e,tp)
86+
end
87+
function s.gyspfilter(c,e,tp)
88+
return c:IsCode(101208048) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
89+
end
90+
function s.gyspcost(e,tp,eg,ep,ev,re,r,rp,chk)
91+
local c=e:GetHandler()
92+
if chk==0 then return c:IsAbleToRemoveAsCost()
93+
and Duel.IsExistingMatchingCard(s.gyspcostfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) end
94+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
95+
local g=Duel.SelectMatchingCard(tp,s.gyspcostfilter,tp,LOCATION_GRAVE,0,1,1,c,e,tp)
96+
g:AddCard(c)
97+
Duel.Remove(g,POS_FACEUP,REASON_COST)
98+
end
99+
function s.gysptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
100+
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.gyspfilter(chkc,e,tp) end
101+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
102+
and Duel.IsExistingTarget(s.gyspfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) end
103+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
104+
local g=Duel.SelectTarget(tp,s.gyspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
105+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
106+
end
107+
function s.gyspop(e,tp,eg,ep,ev,re,r,rp)
108+
local tc=Duel.GetFirstTarget()
109+
if tc:IsRelateToEffect(e) then
110+
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
111+
end
112+
end

pre-release/c101208047.lua

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
--極征竜-シャスマティス
2+
--Chasmatis, Dragon Ruler of Auroras
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Xyz Summon procedure: 2 Level 7 Dragon monsters
8+
Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),7,2)
9+
--This effect becomes the effect of a Level 7 "Dragon Ruler" monster that activates by discarding itself
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetType(EFFECT_TYPE_QUICK_O)
13+
e1:SetCode(EVENT_FREE_CHAIN)
14+
e1:SetRange(LOCATION_MZONE)
15+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
16+
e1:SetCountLimit(1,id)
17+
e1:SetCost(s.applycost)
18+
e1:SetTarget(s.applytg)
19+
e1:SetOperation(s.applyop)
20+
c:RegisterEffect(e1)
21+
--Special Summon 1 Level 7 "Dragon Ruler" from your GY or banishment
22+
local e2=Effect.CreateEffect(c)
23+
e2:SetDescription(aux.Stringid(id,1))
24+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
25+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
26+
e2:SetProperty(EFFECT_FLAG_DELAY)
27+
e2:SetCode(EVENT_DESTROYED)
28+
e2:SetCountLimit(1,{id,1})
29+
e2:SetCondition(s.spcon)
30+
e2:SetTarget(s.sptg)
31+
e2:SetOperation(s.spop)
32+
c:RegisterEffect(e2)
33+
end
34+
s.listed_series={SET_DRAGON_RULER}
35+
function s.tgfilter(c,tp)
36+
if not (c:IsSetCard(SET_DRAGON_RULER) and c:IsLevel(7) and c:IsAbleToGraveAsCost() and c:IsHasEffect(id)) then
37+
return false
38+
end
39+
local eff=c:GetCardEffect(id)
40+
local te=eff:GetLabelObject()
41+
local con=te:GetCondition()
42+
local tg=te:GetTarget()
43+
if (not con or con(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0))
44+
and (not tg or tg(te,tp,Group.CreateGroup(),PLAYER_NONE,0,eff,REASON_EFFECT,PLAYER_NONE,0)) then
45+
return true
46+
end
47+
return false
48+
end
49+
function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk)
50+
local c=e:GetHandler()
51+
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST)
52+
and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,tp) end
53+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
54+
local sc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
55+
Duel.SendtoGrave(sc,REASON_COST)
56+
sc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_CHAIN,0,1)
57+
e:SetLabelObject(sc:GetCardEffect(id):GetLabelObject())
58+
c:RemoveOverlayCard(tp,1,1,REASON_COST)
59+
end
60+
function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
61+
local te=e:GetLabelObject()
62+
local tg=te and te:GetTarget() or nil
63+
if chkc then return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end
64+
if chk==0 then return true end
65+
e:SetLabel(te:GetLabel())
66+
e:SetLabelObject(te:GetLabelObject())
67+
e:SetProperty(te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0)
68+
if tg then
69+
tg(e,tp,eg,ep,ev,re,r,rp,1)
70+
end
71+
e:SetLabelObject(te)
72+
Duel.ClearOperationInfo(0)
73+
end
74+
function s.applyop(e,tp,eg,ep,ev,re,r,rp)
75+
local te=e:GetLabelObject()
76+
if not te then return end
77+
local sc=te:GetHandler()
78+
if sc:GetFlagEffect(id)==0 then
79+
e:SetLabel(0)
80+
e:SetLabelObject(nil)
81+
return
82+
end
83+
e:SetLabel(te:GetLabel())
84+
e:SetLabelObject(te:GetLabelObject())
85+
local op=te:GetOperation()
86+
if op then
87+
op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE)
88+
end
89+
e:SetLabel(0)
90+
e:SetLabelObject(nil)
91+
end
92+
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
93+
local c=e:GetHandler()
94+
return c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp))
95+
end
96+
function s.spfilter(c,e,tp)
97+
return c:IsSetCard(SET_DRAGON_RULER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsFaceup()
98+
end
99+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
100+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
101+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end
102+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE|LOCATION_REMOVED)
103+
end
104+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
105+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
106+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
107+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp)
108+
if #g>0 then
109+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
110+
end
111+
end

0 commit comments

Comments
 (0)