Skip to content

Commit 26d7429

Browse files
authored
Added new card scripts
1 parent 85f9f44 commit 26d7429

File tree

11 files changed

+1017
-0
lines changed

11 files changed

+1017
-0
lines changed

pre-release/c100200283.lua

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
--亜空間バトル
2+
--Subspace Battle
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Apply this effect 3 times: ● Each player reveals 1 monster in their Deck, except a monster with ? ATK. Add the monster with higher ATK to the hand of the player that revealed it, also destroy the monster with lower ATK, and if you do, inflict 500 damage to the player that revealed it. If they have the same ATK, shuffle them into the Deck
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DESTROY+CATEGORY_DAMAGE)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
13+
e1:SetTarget(s.target)
14+
e1:SetOperation(s.activate)
15+
c:RegisterEffect(e1)
16+
end
17+
function s.revealfilter(c)
18+
return c:IsAttackAbove(0) and not c:IsPublic()
19+
end
20+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
21+
if chk==0 then return Duel.IsExistingMatchingCard(s.revealfilter,tp,LOCATION_DECK,0,1,nil)
22+
and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end
23+
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,PLAYER_ALL,LOCATION_DECK)
24+
Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,PLAYER_ALL,LOCATION_DECK)
25+
Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,500)
26+
end
27+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
28+
if not (Duel.IsExistingMatchingCard(s.revealfilter,tp,LOCATION_DECK,0,1,nil)
29+
and Duel.IsExistingMatchingCard(s.revealfilter,tp,0,LOCATION_DECK,1,nil)) then return end
30+
local opp=1-tp
31+
local tp_codes={}
32+
local opp_codes={}
33+
local sc1,sc2,atk1,atk2
34+
local search_card=nil
35+
local destroy_card=nil
36+
for i=1,3 do
37+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
38+
sc1=Duel.SelectMatchingCard(tp,s.revealfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
39+
Duel.Hint(HINT_SELECTMSG,opp,HINTMSG_CONFIRM)
40+
sc2=Duel.SelectMatchingCard(opp,s.revealfilter,opp,LOCATION_DECK,0,1,1,nil):GetFirst()
41+
Duel.ConfirmCards(opp,sc1)
42+
Duel.ConfirmCards(tp,sc2)
43+
table.insert(tp_codes,sc1:GetCode())
44+
table.insert(opp_codes,sc2:GetCode())
45+
atk1=sc1:GetAttack()
46+
atk2=sc2:GetAttack()
47+
if atk1>atk2 then
48+
search_card=sc1
49+
destroy_card=sc2
50+
elseif atk2>atk1 then
51+
search_card=sc2
52+
destroy_card=sc1
53+
else
54+
search_card=nil
55+
destroy_card=nil
56+
Duel.ShuffleDeck(tp)
57+
Duel.ShuffleDeck(opp)
58+
end
59+
if search_card and destroy_card then
60+
Duel.SendtoHand(search_card,nil,REASON_EFFECT)
61+
local prev_ctrl=search_card:GetPreviousControler()
62+
Duel.ConfirmCards(1-prev_ctrl,search_card)
63+
Duel.ShuffleHand(prev_ctrl)
64+
if Duel.Destroy(destroy_card,REASON_EFFECT)>0 then
65+
Duel.Damage(destroy_card:GetPreviousControler(),500,REASON_EFFECT)
66+
end
67+
end
68+
sc1:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1)
69+
sc2:RegisterFlagEffect(id+100,RESETS_STANDARD_PHASE_END,0,1)
70+
end
71+
--Each player cannot activate the effects of the monster they revealed and monsters with the same name as it for the rest of this turn
72+
local e1=Effect.CreateEffect(e:GetHandler())
73+
e1:SetDescription(aux.Stringid(id,1))
74+
e1:SetType(EFFECT_TYPE_FIELD)
75+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
76+
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
77+
e1:SetTargetRange(1,0)
78+
e1:SetValue(function(e,re,tp) local rc=re:GetHandler() return re:IsMonsterEffect() and (rc:HasFlagEffect(id) or rc:IsCode(tp_codes)) end)
79+
e1:SetReset(RESET_PHASE|PHASE_END)
80+
Duel.RegisterEffect(e1,tp)
81+
local e2=e1:Clone()
82+
e2:SetValue(function(e,re,tp) local rc=re:GetHandler() return re:IsMonsterEffect() and (rc:HasFlagEffect(id+100) or rc:IsCode(opp_codes)) end)
83+
Duel.RegisterEffect(e2,opp)
84+
end

pre-release/c101304015.lua

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
--道化の一座 ホワイトフェイス
2+
--Clown Crew Biancaviso
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--You can Tribute Summon this card face-up by Tributing 1 Ritual, Fusion, Synchro, Xyz, Pendulum, or Link Monster
7+
local e0=aux.AddNormalSummonProcedure(c,true,true,1,1,SUMMON_TYPE_TRIBUTE,aux.Stringid(id,0),s.tributefilter)
8+
--If this card is Tribute Summoned: You can activate 1 of these effects (but you can only use each of these effects of "Clown Crew Biancaviso" once per turn)
9+
local e1=Effect.CreateEffect(c)
10+
e1:SetDescription(aux.Stringid(id,1))
11+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
12+
e1:SetProperty(EFFECT_FLAG_DELAY)
13+
e1:SetCode(EVENT_SUMMON_SUCCESS)
14+
e1:SetCondition(function(e) return c:IsTributeSummoned() end)
15+
e1:SetTarget(s.efftg)
16+
e1:SetOperation(s.effop)
17+
c:RegisterEffect(e1)
18+
--Once per turn, during your opponent's Main Phase, you can (Quick Effect): Immediately after this effect resolves, Tribute Summon 1 monster
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,2))
21+
e2:SetCategory(CATEGORY_SUMMON)
22+
e2:SetType(EFFECT_TYPE_QUICK_O)
23+
e2:SetCode(EVENT_FREE_CHAIN)
24+
e2:SetRange(LOCATION_MZONE)
25+
e2:SetCountLimit(1)
26+
e2:SetCondition(function(e,tp) return Duel.IsMainPhase(1-tp) end)
27+
e2:SetTarget(s.tribsumtg)
28+
e2:SetOperation(s.tribsumop)
29+
e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
30+
c:RegisterEffect(e2)
31+
end
32+
function s.tributefilter(c,tp)
33+
return c:IsType(TYPE_RITUAL|TYPE_PENDULUM|TYPE_EXTRA) and (c:IsControler(tp) or c:IsFaceup())
34+
end
35+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
36+
local ct=e:GetHandler():GetMaterialCount()
37+
local b1=not Duel.HasFlagEffect(tp,id)
38+
and Duel.IsPlayerCanDraw(tp,ct)
39+
local b2=not Duel.HasFlagEffect(tp,id+100)
40+
and Duel.IsExistingMatchingCard(Card.IsNegatable,tp,0,LOCATION_ONFIELD,ct,nil)
41+
if chk==0 then return ct>0 and (b1 or b2) end
42+
local op=Duel.SelectEffect(tp,
43+
{b1,aux.Stringid(id,3)},
44+
{b2,aux.Stringid(id,4)})
45+
e:SetLabel(op,ct)
46+
if op==1 then
47+
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1)
48+
e:SetCategory(CATEGORY_DRAW)
49+
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
50+
elseif op==2 then
51+
Duel.RegisterFlagEffect(tp,id+100,RESET_PHASE|PHASE_END,0,1)
52+
e:SetCategory(CATEGORY_DISABLE)
53+
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,ct,1-tp,LOCATION_ONFIELD)
54+
end
55+
end
56+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
57+
local op,ct=e:GetLabel()
58+
if op==1 then
59+
--● Draw cards equal to the number of monsters Tributed for its Tribute Summon
60+
Duel.Draw(tp,ct,REASON_EFFECT)
61+
elseif op==2 then
62+
--● Negate the effects of face-up cards your opponent controls, equal to the number of monsters Tributed for its Tribute Summon
63+
local g=Duel.GetMatchingGroup(Card.IsNegatable,tp,0,LOCATION_ONFIELD,nil)
64+
if #g>=ct then
65+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE)
66+
g=g:Select(tp,ct,ct,nil)
67+
Duel.HintSelection(g)
68+
local c=e:GetHandler()
69+
for sc in g:Iter() do
70+
--Negate their effects
71+
sc:NegateEffects(c,nil,true)
72+
end
73+
end
74+
end
75+
end
76+
function s.tribsumtg(e,tp,eg,ep,ev,re,r,rp,chk)
77+
if chk==0 then return Duel.IsExistingMatchingCard(Card.CanSummonOrSet,tp,LOCATION_HAND,0,1,nil,true,nil,1) end
78+
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
79+
end
80+
function s.tribsumop(e,tp,eg,ep,ev,re,r,rp)
81+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
82+
local sc=Duel.SelectMatchingCard(tp,Card.CanSummonOrSet,tp,LOCATION_HAND,0,1,1,nil,true,nil,1):GetFirst()
83+
if sc then
84+
Duel.SummonOrSet(tp,sc,true,nil,1)
85+
end
86+
end

pre-release/c101304029.lua

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
--道化の一座 フレア
2+
--Clown Crew Flare
3+
--scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--You can reveal this card in your hand; add 1 non-Ritual "Clown Crew" card from your Deck to your hand, then discard 1 card
8+
local e1=Effect.CreateEffect(c)
9+
e1:SetDescription(aux.Stringid(id,0))
10+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES)
11+
e1:SetType(EFFECT_TYPE_IGNITION)
12+
e1:SetRange(LOCATION_HAND)
13+
e1:SetCountLimit(1,id)
14+
e1:SetCost(Cost.SelfReveal)
15+
e1:SetTarget(s.thtg)
16+
e1:SetOperation(s.thop)
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 Flare" once per turn)
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,1))
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+
s.listed_series={SET_CLOWN_CREW}
29+
function s.thfilter(c)
30+
return c:IsSetCard(SET_CLOWN_CREW) and not c:IsRitualMonster() and c:IsAbleToHand()
31+
end
32+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
33+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
34+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
35+
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
36+
end
37+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
38+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
39+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
40+
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_HAND) then
41+
Duel.ConfirmCards(1-tp,g)
42+
Duel.ShuffleHand(tp)
43+
Duel.BreakEffect()
44+
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD,nil)
45+
end
46+
end
47+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
48+
local b1=not Duel.HasFlagEffect(tp,id)
49+
and Duel.IsExistingMatchingCard(aux.AND(Card.IsRitualMonster,Card.IsFaceup,Card.IsAbleToDeck),tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,1,nil)
50+
local b2=not Duel.HasFlagEffect(tp,id+100)
51+
and Duel.IsExistingMatchingCard(aux.AND(Card.IsEffectMonster,Card.IsCanTurnSet),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
52+
if chk==0 then return b1 or b2 end
53+
local op=Duel.SelectEffect(tp,
54+
{b1,aux.Stringid(id,2)},
55+
{b2,aux.Stringid(id,3)})
56+
e:SetLabel(op)
57+
if op==1 then
58+
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1)
59+
e:SetCategory(CATEGORY_TODECK)
60+
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,PLAYER_ALL,LOCATION_MZONE|LOCATION_GRAVE)
61+
elseif op==2 then
62+
Duel.RegisterFlagEffect(tp,id+100,RESET_PHASE|PHASE_END,0,1)
63+
e:SetCategory(CATEGORY_POSITION)
64+
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,PLAYER_EITHER,POS_FACEDOWN_DEFENSE)
65+
end
66+
end
67+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
68+
local op=e:GetLabel()
69+
if op==1 then
70+
--● Shuffle all Ritual Monsters on the field and in the GYs into the Deck
71+
local g=Duel.GetMatchingGroup(aux.AND(Card.IsRitualMonster,Card.IsFaceup,Card.IsAbleToDeck),tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,nil)
72+
if #g>0 then
73+
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
74+
end
75+
elseif op==2 then
76+
--● Change 1 Effect Monster on the field to face-down Defense Position
77+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
78+
local g=Duel.SelectMatchingCard(tp,aux.AND(Card.IsEffectMonster,Card.IsCanTurnSet),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
79+
if #g>0 then
80+
Duel.HintSelection(g)
81+
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
82+
end
83+
end
84+
end

pre-release/c101304032.lua

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
--道化の一座 ディアボロ
2+
--Clown Crew Diablo
3+
--scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Fusion Materials: 2 monsters with the same Attribute but different Types
8+
Fusion.AddProcMixN(c,true,true,s.fusfilter,2)
9+
--If your Tribute Summoned monster attacks a Defense Position monster, inflict double piercing battle damage to your opponent
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetType(EFFECT_TYPE_FIELD)
12+
e1:SetCode(EFFECT_PIERCE)
13+
e1:SetRange(LOCATION_MZONE)
14+
e1:SetTargetRange(LOCATION_MZONE,0)
15+
e1:SetTarget(aux.TargetBoolFunction(Card.IsTributeSummoned))
16+
e1:SetValue(DOUBLE_DAMAGE)
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 Diablo" 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+
s.listed_series={SET_CLOWN_CREW}
29+
function s.fusfilter(c,fc,sumtype,sp,sub,mg,sg)
30+
return not sg or sg:FilterCount(aux.TRUE,c)==0
31+
or (sg:IsExists(Card.IsAttribute,1,c,c:GetAttribute(),fc,sumtype,sp) and not sg:IsExists(Card.IsRace,1,c,c:GetRace(),fc,sumtype,sp))
32+
end
33+
function s.setfilter(c)
34+
return c:IsSetCard(SET_CLOWN_CREW) and c:IsTrap() and c:IsSSetable()
35+
end
36+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
37+
local b1=not Duel.HasFlagEffect(tp,id)
38+
and Duel.IsExistingMatchingCard(aux.AND(Card.IsFusionMonster,Card.IsFaceup,Card.IsAbleToExtra),tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,1,nil)
39+
local b2=not Duel.HasFlagEffect(tp,id+100)
40+
and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
41+
if chk==0 then return b1 or b2 end
42+
local op=Duel.SelectEffect(tp,
43+
{b1,aux.Stringid(id,1)},
44+
{b2,aux.Stringid(id,2)})
45+
e:SetLabel(op)
46+
if op==1 then
47+
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1)
48+
e:SetCategory(CATEGORY_TOEXTRA)
49+
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,PLAYER_ALL,LOCATION_MZONE|LOCATION_GRAVE)
50+
elseif op==2 then
51+
Duel.RegisterFlagEffect(tp,id+100,RESET_PHASE|PHASE_END,0,1)
52+
e:SetCategory(0)
53+
end
54+
end
55+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
56+
local op=e:GetLabel()
57+
if op==1 then
58+
--● Return all Fusion Monsters on the field and in the GYs to the Extra Deck
59+
local g=Duel.GetMatchingGroup(aux.AND(Card.IsFusionMonster,Card.IsFaceup,Card.IsAbleToExtra),tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,nil)
60+
if #g>0 then
61+
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
62+
end
63+
elseif op==2 then
64+
--● Set 1 "Clown Crew" Trap from your Deck
65+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
66+
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
67+
if #g>0 then
68+
Duel.SSet(tp,g)
69+
end
70+
end
71+
end

0 commit comments

Comments
 (0)