Skip to content

Commit cc0cb1f

Browse files
authored
Added new card scripts
1 parent 540e255 commit cc0cb1f

File tree

4 files changed

+402
-0
lines changed

4 files changed

+402
-0
lines changed

pre-release/c100200288.lua

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
--月輪鏡
2+
--Full Moon Mirror
3+
local s,id=GetID()
4+
local COUNTER_FULL_MOON=0x219
5+
function s.initial_effect(c)
6+
c:EnableCounterPermit(COUNTER_FULL_MOON)
7+
--Activate
8+
local e0=Effect.CreateEffect(c)
9+
e0:SetType(EFFECT_TYPE_ACTIVATE)
10+
e0:SetCode(EVENT_FREE_CHAIN)
11+
c:RegisterEffect(e0)
12+
--Each time a monster(s) is destroyed by battle or card effect, place 1 Full Moon Counter on this card for each
13+
local e1=Effect.CreateEffect(c)
14+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
15+
e1:SetCode(EVENT_DESTROYED)
16+
e1:SetRange(LOCATION_SZONE)
17+
e1:SetOperation(s.ctop)
18+
c:RegisterEffect(e1)
19+
--You can remove Full Moon Counters from this card, then activate 1 of these effects;
20+
local e2=Effect.CreateEffect(c)
21+
e2:SetDescription(aux.Stringid(id,0))
22+
e2:SetType(EFFECT_TYPE_IGNITION)
23+
e2:SetRange(LOCATION_SZONE)
24+
e2:SetCountLimit(1,id)
25+
e2:SetTarget(s.efftg)
26+
e2:SetOperation(s.effop)
27+
c:RegisterEffect(e2)
28+
end
29+
s.counter_place_list={COUNTER_FULL_MOON}
30+
function s.ctfilter(c)
31+
return ((c:IsMonster() and not c:IsPreviousLocation(LOCATION_ONFIELD)) or c:IsPreviousLocation(LOCATION_MZONE))
32+
and c:IsReason(REASON_BATTLE|REASON_EFFECT)
33+
end
34+
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
35+
local des_count=eg:FilterCount(s.ctfilter,nil)
36+
if des_count==0 then return end
37+
local c=e:GetHandler()
38+
if not Duel.IsChainSolving() then
39+
c:AddCounter(COUNTER_FULL_MOON,des_count)
40+
else
41+
--Place 1 Full Moon Counter on this card at the end of the Chain Link
42+
local e1=Effect.CreateEffect(c)
43+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
44+
e1:SetCode(EVENT_CHAIN_SOLVED)
45+
e1:SetRange(LOCATION_SZONE)
46+
e1:SetOperation(function() c:AddCounter(COUNTER_FULL_MOON,des_count) end)
47+
e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_CHAIN)
48+
c:RegisterEffect(e1)
49+
--Reset "e1" at the end of the Chain Link
50+
local e2=Effect.CreateEffect(c)
51+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
52+
e2:SetCode(EVENT_CHAIN_SOLVED)
53+
e2:SetOperation(function() e1:Reset() end)
54+
e2:SetReset(RESET_CHAIN)
55+
Duel.RegisterEffect(e2,tp)
56+
end
57+
end
58+
function s.lv6spfilter(c,e,tp)
59+
return c:IsLevelBelow(6) and c:IsRace(RACE_FIEND|RACE_FAIRY) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
60+
end
61+
function s.thfilter(c)
62+
return c:IsLevel(10) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand()
63+
end
64+
function s.lv10spfilter(c,e,tp)
65+
return c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
66+
end
67+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
68+
local c=e:GetHandler()
69+
local mmz_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
70+
--● 1: Special Summon 1 Level 6 or lower monster (Fiend or Fairy) from your hand or GY
71+
local b1=c:IsCanRemoveCounter(tp,COUNTER_FULL_MOON,1,REASON_COST) and mmz_chk
72+
and Duel.IsExistingMatchingCard(s.lv6spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp)
73+
--● 3: Add 1 Level 10 DARK monster from your Deck to your hand
74+
local b2=c:IsCanRemoveCounter(tp,COUNTER_FULL_MOON,3,REASON_COST)
75+
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
76+
--● 5: Special Summon 1 Level 10 monster from your hand or GY
77+
local b3=c:IsCanRemoveCounter(tp,COUNTER_FULL_MOON,5,REASON_COST) and mmz_chk
78+
and Duel.IsExistingMatchingCard(s.lv10spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp)
79+
if chk==0 then return b1 or b2 or b3 end
80+
local op=Duel.SelectEffect(tp,
81+
{b1,aux.Stringid(id,1)},
82+
{b2,aux.Stringid(id,2)},
83+
{b3,aux.Stringid(id,3)})
84+
e:SetLabel(op)
85+
c:RemoveCounter(tp,COUNTER_FULL_MOON,2*op-1,REASON_COST)
86+
if (op==1 or op==3) then
87+
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
88+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE)
89+
elseif op==2 then
90+
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
91+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
92+
end
93+
end
94+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
95+
local op=e:GetLabel()
96+
local mmz_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
97+
if op==1 then
98+
--● 1: Special Summon 1 Level 6 or lower monster (Fiend or Fairy) from your hand or GY
99+
if not mmz_chk then return end
100+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
101+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.lv6spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp)
102+
if #g>0 then
103+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
104+
end
105+
elseif op==2 then
106+
--● 3: Add 1 Level 10 DARK monster from your Deck to your hand
107+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
108+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
109+
if #g>0 then
110+
Duel.SendtoHand(g,nil,REASON_EFFECT)
111+
Duel.ConfirmCards(1-tp,g)
112+
end
113+
elseif op==3 then
114+
--● 5: Special Summon 1 Level 10 monster from your hand or GY
115+
if not mmz_chk then return end
116+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
117+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.lv10spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp)
118+
if #g>0 then
119+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
120+
end
121+
end
122+
end

pre-release/c100295121.lua

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
--道化の一座 ハット
2+
--Clown Crew Hat
3+
--Scripted by Eerie Code
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
Pendulum.AddProcedure(c)
7+
--During your Main Phase: You can send 1 "Clown Crew" card from your Deck to your GY, except a Pendulum Monster, and if you do, Special Summon this card, also you cannot activate the effects of monsters Special Summoned from the Deck or Extra Deck until the end of the next turn
8+
local e1=Effect.CreateEffect(c)
9+
e1:SetDescription(aux.Stringid(id,0))
10+
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
11+
e1:SetType(EFFECT_TYPE_IGNITION)
12+
e1:SetRange(LOCATION_PZONE)
13+
e1:SetTarget(s.gytg)
14+
e1:SetOperation(s.gyop)
15+
e1:SetCountLimit(1,{id,0})
16+
c:RegisterEffect(e1)
17+
--Monsters your opponent controls lose 1500 DEF while you control a Tribute Summoned monster
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetType(EFFECT_TYPE_FIELD)
20+
e2:SetCode(EFFECT_UPDATE_DEFENSE)
21+
e2:SetRange(LOCATION_MZONE)
22+
e2:SetTargetRange(0,LOCATION_MZONE)
23+
e2:SetCondition(function(e) return Duel.IsExistingMatchingCard(Card.IsTributeSummoned,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end)
24+
e2:SetValue(-1500)
25+
c:RegisterEffect(e2)
26+
--If this card is Tributed: You can activate 1 of these effects (but you can only use each of these effects of "Clown Crew Hat" once per turn);
27+
local e3=Effect.CreateEffect(c)
28+
e3:SetDescription(aux.Stringid(id,1))
29+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
30+
e3:SetProperty(EFFECT_FLAG_DELAY)
31+
e3:SetCode(EVENT_RELEASE)
32+
e3:SetTarget(s.efftg)
33+
e3:SetOperation(s.effop)
34+
c:RegisterEffect(e3)
35+
end
36+
s.listed_series={SET_CLOWN_CREW}
37+
function s.gyfilter(c)
38+
return c:IsSetCard(SET_CLOWN_CREW) and not c:IsPendulumMonster() and c:IsAbleToGrave()
39+
end
40+
function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk)
41+
local c=e:GetHandler()
42+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
43+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
44+
and Duel.IsExistingMatchingCard(s.gyfilter,tp,LOCATION_DECK,0,1,nil) end
45+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
46+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
47+
end
48+
function s.gyop(e,tp,eg,ep,ev,re,r,rp)
49+
local c=e:GetHandler()
50+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
51+
local g=Duel.SelectMatchingCard(tp,s.gyfilter,tp,LOCATION_DECK,0,1,1,nil)
52+
if #g>0 and Duel.SendtoGrave(g,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
53+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
54+
end
55+
--You cannot activate the effects of monsters Special Summoned from the Deck or Extra Deck until the end of the next turn
56+
local e1=Effect.CreateEffect(c)
57+
e1:SetDescription(aux.Stringid(id,2))
58+
e1:SetType(EFFECT_TYPE_FIELD)
59+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
60+
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
61+
e1:SetTargetRange(1,0)
62+
e1:SetValue(s.actval)
63+
e1:SetReset(RESET_PHASE|PHASE_END,2)
64+
Duel.RegisterEffect(e1,tp)
65+
end
66+
function s.actval(e,re,tp)
67+
local rc=re:GetHandler()
68+
return re:IsMonsterEffect() and rc:IsLocation(LOCATION_MZONE) and rc:IsSummonLocation(LOCATION_DECK|LOCATION_EXTRA)
69+
end
70+
function s.spfilter(c,e,tp)
71+
if c:IsLocation(LOCATION_DECK) and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
72+
if c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)<=0 then return false end
73+
return c:IsSetCard(SET_CLOWN_CREW) and not c:IsPendulumMonster() and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
74+
end
75+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
76+
local b1=not Duel.HasFlagEffect(tp,id)
77+
and Duel.IsExistingMatchingCard(aux.AND(Card.IsPendulumMonster,Card.IsFaceup,Card.IsAbleToDeck),tp,LOCATION_MZONE|LOCATION_EXTRA,LOCATION_MZONE|LOCATION_EXTRA,1,nil)
78+
local b2=not Duel.HasFlagEffect(tp,id+100)
79+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_EXTRA,0,1,nil,e,tp)
80+
if chk==0 then return b1 or b2 end
81+
local op=Duel.SelectEffect(tp,
82+
{b1,aux.Stringid(id,3)},
83+
{b2,aux.Stringid(id,4)})
84+
e:SetLabel(op)
85+
if op==1 then
86+
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1)
87+
e:SetCategory(CATEGORY_TODECK)
88+
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,PLAYER_ALL,LOCATION_MZONE|LOCATION_EXTRA)
89+
elseif op==2 then
90+
Duel.RegisterFlagEffect(tp,id+100,RESET_PHASE|PHASE_END,0,1)
91+
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
92+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_EXTRA)
93+
end
94+
end
95+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
96+
local op=e:GetLabel()
97+
if op==1 then
98+
--● Shuffle all Pendulum Monsters on the field and face-up Extra Decks into the Deck
99+
local g=Duel.GetMatchingGroup(aux.AND(Card.IsPendulumMonster,Card.IsFaceup,Card.IsAbleToDeck),tp,LOCATION_MZONE|LOCATION_EXTRA,LOCATION_MZONE|LOCATION_EXTRA,nil)
100+
if #g>0 then
101+
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
102+
end
103+
elseif op==2 then
104+
--● Special Summon 1 non-Pendulum "Clown Crew" monster from your Deck or Extra Deck, ignoring its Summoning conditions
105+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
106+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK|LOCATION_EXTRA,0,1,1,nil,e,tp)
107+
if #g>0 then
108+
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
109+
end
110+
end
111+
end

pre-release/c101305042.lua

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
--道化の一座 ドリッシュ
2+
--Clown Crew Drish
3+
--Scripted by Eerie Code
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Link Summon procedure: 2 Ritual, Fusion, Synchro, Xyz, and/or Pendulum Monsters
8+
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_RITUAL|TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ|TYPE_PENDULUM),2)
9+
--Your Tribute Summoned monsters can make a second attack during each Battle Phase
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetType(EFFECT_TYPE_FIELD)
12+
e1:SetCode(EFFECT_EXTRA_ATTACK)
13+
e1:SetRange(LOCATION_MZONE)
14+
e1:SetTargetRange(LOCATION_MZONE,0)
15+
e1:SetTarget(aux.TargetBoolFunction(Card.IsTributeSummoned))
16+
e1:SetValue(1)
17+
c:RegisterEffect(e1)
18+
--If this card is Tributed: You can activate 1 of these effects (but you can only use each of these effects of "Clown Crew Drish" once per turn);
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,0))
21+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
22+
e2:SetProperty(EFFECT_FLAG_DELAY)
23+
e2:SetCode(EVENT_RELEASE)
24+
e2:SetTarget(s.efftg)
25+
e2:SetOperation(s.effop)
26+
c:RegisterEffect(e2)
27+
end
28+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
29+
local b1=not Duel.HasFlagEffect(tp,id)
30+
and Duel.IsExistingMatchingCard(aux.AND(Card.IsLinkMonster,Card.IsFaceup,Card.IsAbleToExtra),tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,1,nil)
31+
local b2=not Duel.HasFlagEffect(tp,id+100) and ((Duel.IsPlayerCanDraw(tp)
32+
and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil))
33+
or (Duel.IsPlayerCanDraw(1-tp) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_HAND,1,nil)))
34+
if chk==0 then return b1 or b2 end
35+
local op=Duel.SelectEffect(tp,
36+
{b1,aux.Stringid(id,1)},
37+
{b2,aux.Stringid(id,2)})
38+
e:SetLabel(op)
39+
if op==1 then
40+
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1)
41+
e:SetCategory(CATEGORY_TOEXTRA)
42+
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,PLAYER_ALL,LOCATION_MZONE|LOCATION_GRAVE)
43+
elseif op==2 then
44+
Duel.RegisterFlagEffect(tp,id+100,RESET_PHASE|PHASE_END,0,1)
45+
e:SetCategory(CATEGORY_TODECK|CATEGORY_DRAW)
46+
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,PLAYER_ALL,LOCATION_HAND)
47+
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
48+
end
49+
end
50+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
51+
local op=e:GetLabel()
52+
if op==1 then
53+
--● Return all Link Monsters on the field and in the GYs to the Extra Deck
54+
local g=Duel.GetMatchingGroup(aux.AND(Card.IsLinkMonster,Card.IsFaceup,Card.IsAbleToExtra),tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,nil)
55+
if #g>0 then
56+
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
57+
end
58+
elseif op==2 then
59+
--● Each player shuffles their entire hand into the Deck, then they draw the same number of cards they shuffled
60+
local turn_player=Duel.GetTurnPlayer()
61+
local step=turn_player==0 and 1 or -1
62+
for p=turn_player,1-turn_player,step do
63+
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0)
64+
if #g>0 and Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and Duel.IsPlayerCanDraw(p) then
65+
local draw_count=Duel.GetOperatedGroup():FilterCount(Card.IsPreviousControler,nil,p)
66+
if draw_count>0 then
67+
Duel.BreakEffect()
68+
Duel.Draw(p,draw_count,REASON_EFFECT)
69+
end
70+
end
71+
end
72+
end
73+
end

0 commit comments

Comments
 (0)