Skip to content

Commit 0f1d987

Browse files
authored
Added new card scripts
1 parent 557ba1b commit 0f1d987

File tree

4 files changed

+408
-0
lines changed

4 files changed

+408
-0
lines changed

pre-release/c100447106.lua

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
--X-セイバー ペリナ
2+
--X-Saber Perina
3+
--Scripted by the Razgriz
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Special Summon 2 "X-Saber" monsters from your Deck, except "X-Saber Perina", but destroy them during the End Phase
7+
local e1a=Effect.CreateEffect(c)
8+
e1a:SetDescription(aux.Stringid(id,0))
9+
e1a:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
10+
e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
11+
e1a:SetProperty(EFFECT_FLAG_DELAY)
12+
e1a:SetCode(EVENT_SUMMON_SUCCESS)
13+
e1a:SetCountLimit(1,id)
14+
e1a:SetCost(Cost.SelfToGrave)
15+
e1a:SetTarget(s.sptg)
16+
e1a:SetOperation(s.spop)
17+
c:RegisterEffect(e1a)
18+
local e1b=e1a:Clone()
19+
e1b:SetCode(EVENT_SPSUMMON_SUCCESS)
20+
c:RegisterEffect(e1b)
21+
--Apply an effect to the "X-Saber" Synchro Monster that used this card as material
22+
local e2=Effect.CreateEffect(c)
23+
e2:SetDescription(aux.Stringid(id,1))
24+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
25+
e2:SetProperty(EFFECT_FLAG_DELAY)
26+
e2:SetCode(EVENT_BE_MATERIAL)
27+
e2:SetCountLimit(1,{id,1})
28+
e2:SetCondition(s.effcon)
29+
e2:SetTarget(s.efftg)
30+
e2:SetOperation(s.effop)
31+
c:RegisterEffect(e2)
32+
end
33+
s.listed_series={SET_X_SABER}
34+
s.listed_names={id}
35+
function s.spfilter(c,e,tp)
36+
return c:IsSetCard(SET_X_SABER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id)
37+
end
38+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
39+
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
40+
and Duel.GetMZoneCount(tp,e:GetHandler())>=2
41+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) end
42+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
43+
Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,2,tp,LOCATION_MZONE)
44+
end
45+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
46+
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
47+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
48+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,2,2,nil,e,tp)
49+
if #g==2 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)==2 then
50+
--Destroy them during the End Phase
51+
aux.DelayedOperation(g,PHASE_END,id,e,tp,function(ag) Duel.Destroy(ag,REASON_EFFECT) end,nil,0,0,aux.Stringid(id,2))
52+
end
53+
end
54+
function s.effcon(e,tp,eg,ep,ev,re,r,rp)
55+
if not (r==REASON_SYNCHRO and (Duel.IsAbleToEnterBP() or (Duel.IsBattlePhase() and not Duel.IsEndStep()))) then return false end
56+
local c=e:GetHandler()
57+
local sync=c:GetReasonCard()
58+
if not (c:IsLocation(LOCATION_GRAVE) and sync:IsSetCard(SET_X_SABER)) then return false end
59+
e:SetLabelObject(sync)
60+
sync:RegisterFlagEffect(id,RESET_EVENT|(RESETS_STANDARD&~RESET_TURN_SET),0,1)
61+
return true
62+
end
63+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
64+
local sync=e:GetLabelObject()
65+
if chk==0 then
66+
return sync:HasFlagEffect(id) and not (sync:IsHasEffect(EFFECT_EXTRA_ATTACK) and sync:IsHasEffect(EFFECT_DIRECT_ATTACK))
67+
end
68+
sync:CreateEffectRelation(e)
69+
end
70+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
71+
local sync=e:GetLabelObject()
72+
if not sync:IsRelateToEffect(e) then return end
73+
local b1=not sync:IsHasEffect(EFFECT_EXTRA_ATTACK)
74+
local b2=not sync:IsHasEffect(EFFECT_DIRECT_ATTACK)
75+
if not (b1 or b2) then return end
76+
local op=Duel.SelectEffect(tp,
77+
{b1,aux.Stringid(id,3)},
78+
{b2,aux.Stringid(id,4)})
79+
local desc=op==1 and 3201 or 3205
80+
local eff_code=op==1 and EFFECT_EXTRA_ATTACK or EFFECT_DIRECT_ATTACK
81+
--It can make a second attack during each Battle Phase OR it can attack directly
82+
local e1=Effect.CreateEffect(e:GetHandler())
83+
e1:SetDescription(desc)
84+
e1:SetType(EFFECT_TYPE_SINGLE)
85+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
86+
e1:SetCode(eff_code)
87+
e1:SetValue(1)
88+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
89+
sync:RegisterEffect(e1)
90+
end

pre-release/c100447107.lua

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
--X-セイバー ブルノ
2+
--X-Saber Bruno
3+
--Scripted by the Razgriz
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Synchro Summon using only EARTH monsters, including this card
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
10+
e1:SetType(EFFECT_TYPE_QUICK_O)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetRange(LOCATION_MZONE)
13+
e1:SetCountLimit(1)
14+
e1:SetCondition(function(e,tp) return Duel.IsMainPhase(1-tp) or Duel.IsBattlePhase(1-tp) end)
15+
e1:SetTarget(s.synchtg)
16+
e1:SetOperation(s.synchop)
17+
e1:SetHintTiming(0,TIMING_MAIN_END|TIMING_BATTLE_END|TIMINGS_CHECK_MONSTER)
18+
c:RegisterEffect(e1)
19+
--Banish 1 other EARTH monster to Special Summon this card
20+
local e2=Effect.CreateEffect(c)
21+
e2:SetDescription(aux.Stringid(id,1))
22+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
23+
e2:SetType(EFFECT_TYPE_IGNITION)
24+
e2:SetRange(LOCATION_HAND)
25+
e2:SetCountLimit(1,id)
26+
e2:SetCost(s.spcost)
27+
e2:SetTarget(s.sptg)
28+
e2:SetOperation(s.spop)
29+
c:RegisterEffect(e2)
30+
--Add 1 "Saber" Spell/Trap Card from your Deck to your hand
31+
local e3a=Effect.CreateEffect(c)
32+
e3a:SetDescription(aux.Stringid(id,2))
33+
e3a:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
34+
e3a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
35+
e3a:SetProperty(EFFECT_FLAG_DELAY)
36+
e3a:SetCode(EVENT_SUMMON_SUCCESS)
37+
e3a:SetCountLimit(1,{id,1})
38+
e3a:SetTarget(s.thtg)
39+
e3a:SetOperation(s.thop)
40+
c:RegisterEffect(e3a)
41+
local e3b=e3a:Clone()
42+
e3b:SetCode(EVENT_SPSUMMON_SUCCESS)
43+
c:RegisterEffect(e3b)
44+
end
45+
s.listed_series={SET_X_SABER,SET_SABER}
46+
s.listed_names={id}
47+
function s.synchtg(e,tp,eg,ep,ev,re,r,rp,chk)
48+
if chk==0 then
49+
local c=e:GetHandler()
50+
local mg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_EARTH),tp,LOCATION_MZONE,0,nil)
51+
return c:IsAttribute(ATTRIBUTE_EARTH) and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,c,mg)
52+
end
53+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
54+
end
55+
function s.synchop(e,tp,eg,ep,ev,re,r,rp)
56+
local c=e:GetHandler()
57+
if not (c:IsRelateToEffect(e) and c:IsControler(tp) and c:IsFaceup() and c:IsAttribute(ATTRIBUTE_EARTH)) then return end
58+
local mg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_EARTH),tp,LOCATION_MZONE,0,nil)
59+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
60+
local sc=Duel.SelectMatchingCard(tp,Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,1,nil,c,mg):GetFirst()
61+
if sc then
62+
Duel.SynchroSummon(tp,sc,c,mg)
63+
end
64+
end
65+
function s.spcostfilter(c,tp)
66+
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToRemoveAsCost() and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
67+
and Duel.GetMZoneCount(tp,c)>0
68+
end
69+
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
70+
local c=e:GetHandler()
71+
if chk==0 then return Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,1,c,tp) end
72+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
73+
local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,1,1,c,tp)
74+
Duel.Remove(g,POS_FACEUP,REASON_COST)
75+
end
76+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
77+
local c=e:GetHandler()
78+
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
79+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
80+
end
81+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
82+
local c=e:GetHandler()
83+
if c:IsRelateToEffect(e) then
84+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
85+
end
86+
end
87+
function s.thfilter(c)
88+
return c:IsSetCard(SET_SABER) and c:IsSpellTrap() and c:IsAbleToHand()
89+
end
90+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
91+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil) end
92+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE)
93+
end
94+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
95+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
96+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil)
97+
if #g>0 then
98+
Duel.SendtoHand(g,nil,REASON_EFFECT)
99+
Duel.ConfirmCards(1-tp,g)
100+
end
101+
end

pre-release/c100447108.lua

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
--総剣司令 ソウザ
2+
--Commander Souza, Swordmaster
3+
--Scripted by the Razgriz
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Synchro Summon procedure: 1 Tuner + 1+ EARTH monsters
8+
Synchro.AddProcedure(c,nil,1,1,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_EARTH),1,99)
9+
--Multiple Tuner check
10+
local e0=Effect.CreateEffect(c)
11+
e0:SetType(EFFECT_TYPE_SINGLE)
12+
e0:SetCode(EFFECT_MATERIAL_CHECK)
13+
e0:SetValue(s.valcheck)
14+
c:RegisterEffect(e0)
15+
--Gains 200 ATK for each banished monster
16+
local e1=Effect.CreateEffect(c)
17+
e1:SetType(EFFECT_TYPE_SINGLE)
18+
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
19+
e1:SetCode(EFFECT_UPDATE_ATTACK)
20+
e1:SetRange(LOCATION_MZONE)
21+
e1:SetValue(function(e,c) return 200*Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsMonster),0,LOCATION_REMOVED,LOCATION_REMOVED,nil) end)
22+
c:RegisterEffect(e1)
23+
--Draw 1 card
24+
local e2=Effect.CreateEffect(c)
25+
e2:SetDescription(aux.Stringid(id,0))
26+
e2:SetCategory(CATEGORY_DRAW)
27+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
28+
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
29+
e2:SetCode(EVENT_BATTLE_DESTROYING)
30+
e2:SetCondition(aux.bdocon)
31+
e2:SetTarget(s.drtg)
32+
e2:SetOperation(s.drop)
33+
c:RegisterEffect(e2)
34+
--Destroy 1 card your opponent controls
35+
local e3=Effect.CreateEffect(c)
36+
e3:SetDescription(aux.Stringid(id,1))
37+
e3:SetCategory(CATEGORY_DESTROY)
38+
e3:SetType(EFFECT_TYPE_QUICK_O)
39+
e3:SetCode(EVENT_CHAINING)
40+
e3:SetRange(LOCATION_MZONE)
41+
e3:SetCountLimit(1)
42+
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ep==1-tp end)
43+
e3:SetCost(s.descost)
44+
e3:SetTarget(s.destg)
45+
e3:SetOperation(s.desop)
46+
c:RegisterEffect(e3)
47+
--If this card would be destroyed by battle or card effect, you can banish 1 "Saber" card from your GY instead
48+
local e4=Effect.CreateEffect(c)
49+
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
50+
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
51+
e4:SetCode(EFFECT_DESTROY_REPLACE)
52+
e4:SetRange(LOCATION_MZONE)
53+
e4:SetTarget(s.desreptg)
54+
c:RegisterEffect(e4)
55+
end
56+
s.listed_series={SET_X_SABER,SET_SABER}
57+
s.listed_names={id}
58+
function s.valcheck(e,c)
59+
local g=c:GetMaterial()
60+
if g:IsExists(Card.IsType,2,nil,TYPE_TUNER) then
61+
local e1=Effect.CreateEffect(c)
62+
e1:SetType(EFFECT_TYPE_SINGLE)
63+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
64+
e1:SetCode(EFFECT_MULTIPLE_TUNERS)
65+
e1:SetReset(RESET_EVENT|RESETS_STANDARD&~(RESET_TOFIELD)|RESET_PHASE|PHASE_END)
66+
c:RegisterEffect(e1)
67+
end
68+
end
69+
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
70+
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
71+
Duel.SetTargetPlayer(tp)
72+
Duel.SetTargetParam(1)
73+
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
74+
end
75+
function s.drop(e,tp,eg,ep,ev,re,r,rp)
76+
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
77+
Duel.Draw(p,d,REASON_EFFECT)
78+
end
79+
function s.descostfilter(c,tp)
80+
return c:IsSetCard(SET_X_SABER) and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,c)
81+
end
82+
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
83+
if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.descostfilter,1,false,nil,nil,tp) end
84+
local g=Duel.SelectReleaseGroupCost(tp,s.descostfilter,1,1,false,nil,nil,tp)
85+
Duel.Release(g,REASON_COST)
86+
end
87+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
88+
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
89+
if chk==0 then return #g>0 end
90+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
91+
end
92+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
93+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
94+
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
95+
if #g>0 then
96+
Duel.HintSelection(g)
97+
Duel.Destroy(g,REASON_EFFECT)
98+
end
99+
end
100+
function s.desrepfilter(c)
101+
return c:IsSetCard(SET_SABER) and c:IsAbleToRemove() and aux.SpElimFilter(c,true)
102+
end
103+
function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
104+
local c=e:GetHandler()
105+
if chk==0 then return not c:IsReason(REASON_REPLACE)
106+
and Duel.IsExistingMatchingCard(s.desrepfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,c) end
107+
if Duel.SelectEffectYesNo(tp,c) then
108+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
109+
local g=Duel.SelectMatchingCard(tp,s.desrepfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,c)
110+
return Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0
111+
end
112+
return false
113+
end

0 commit comments

Comments
 (0)