Skip to content

Commit cae6063

Browse files
authored
Added new card scripts
1 parent 6b7b2dd commit cae6063

File tree

5 files changed

+405
-0
lines changed

5 files changed

+405
-0
lines changed

pre-release/c101304006.lua

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
--重装騎士バベルデッカー
2+
--Heavy Knight Babel Decker
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--You can Normal Summon this card without Tributing
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_SINGLE)
10+
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
11+
e1:SetCode(EFFECT_SUMMON_PROC)
12+
e1:SetCondition(s.ntcon)
13+
c:RegisterEffect(e1)
14+
--Special Summon 1 EARTH Machine monster from your hand
15+
local e2a=Effect.CreateEffect(c)
16+
e2a:SetDescription(aux.Stringid(id,1))
17+
e2a:SetCategory(CATEGORY_SPECIAL_SUMMON)
18+
e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
19+
e2a:SetProperty(EFFECT_FLAG_DELAY)
20+
e2a:SetCode(EVENT_SUMMON_SUCCESS)
21+
e2a:SetCountLimit(1,{id,0})
22+
e2a:SetTarget(s.handsptg)
23+
e2a:SetOperation(s.handspop)
24+
c:RegisterEffect(e2a)
25+
local e2b=e2a:Clone()
26+
e2b:SetCode(EVENT_SPSUMMON_SUCCESS)
27+
c:RegisterEffect(e2b)
28+
--Special Summon 1 Rank 10 EARTH Machine Xyz Monster from your Extra Deck using this card you control as material (this is treated as an Xyz Summon)
29+
local e3=Effect.CreateEffect(c)
30+
e3:SetDescription(aux.Stringid(id,2))
31+
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
32+
e3:SetType(EFFECT_TYPE_IGNITION)
33+
e3:SetRange(LOCATION_MZONE)
34+
e3:SetCountLimit(1,{id,1})
35+
e3:SetCondition(function(e,tp) return Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)>0 end)
36+
e3:SetTarget(s.extrasptg)
37+
e3:SetOperation(s.extraspop)
38+
c:RegisterEffect(e3)
39+
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,aux.FALSE)
40+
end
41+
function s.ntcon(e,c,minc)
42+
if c==nil then return true end
43+
return minc==0 and c:IsLevelAbove(4) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
44+
end
45+
function s.handspfilter(c,e,tp)
46+
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
47+
end
48+
function s.handsptg(e,tp,eg,ep,ev,re,r,rp,chk)
49+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
50+
and Duel.IsExistingMatchingCard(s.handspfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
51+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
52+
end
53+
function s.handspop(e,tp,eg,ep,ev,re,r,rp)
54+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
55+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
56+
local g=Duel.SelectMatchingCard(tp,s.handspfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
57+
if #g>0 then
58+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
59+
end
60+
end
61+
function s.extraspfilter(c,e,tp,mc)
62+
return c:IsType(TYPE_XYZ,c,SUMMON_TYPE_XYZ,tp) and c:IsRank(10) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE)
63+
and mc:IsCanBeXyzMaterial(c,tp) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
64+
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
65+
end
66+
function s.extrasptg(e,tp,eg,ep,ev,re,r,rp,chk)
67+
local c=e:GetHandler()
68+
if chk==0 then
69+
local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ)
70+
return (#pg<=0 or (#pg==1 and pg:IsContains(c)))
71+
and Duel.IsExistingMatchingCard(s.extraspfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
72+
end
73+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
74+
end
75+
function s.extraspop(e,tp,eg,ep,ev,re,r,rp)
76+
local c=e:GetHandler()
77+
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end
78+
local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ)
79+
if #pg>1 or (#pg==1 and not pg:IsContains(c)) then return end
80+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
81+
local xc=Duel.SelectMatchingCard(tp,s.extraspfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c):GetFirst()
82+
if not xc then return end
83+
xc:SetMaterial(c)
84+
Duel.Overlay(xc,c)
85+
if Duel.SpecialSummon(xc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then
86+
xc:CompleteProcedure()
87+
end
88+
end

pre-release/c101304007.lua

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
--夜光列車ブルートラベラー
2+
--Noctilucent Train Bleu Traveler
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Add 1 "Train Connection" or "Revolving Switchyard" from your Deck or GY 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,0})
13+
e1:SetCost(Cost.SelfDiscard)
14+
e1:SetTarget(s.thtg)
15+
e1:SetOperation(s.thop)
16+
c:RegisterEffect(e1)
17+
--Special Summon both 1 other EARTH Machine monster in your GY and this card, also you cannot Special Summon from the Extra Deck for the rest of this turn, except Machine monsters
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,1},EFFECT_COUNT_CODE_DUEL)
25+
e2:SetTarget(s.sptg)
26+
e2:SetOperation(s.spop)
27+
c:RegisterEffect(e2)
28+
end
29+
s.listed_names={60879050,76136345} --"Train Connection", "Revolving Switchyard"
30+
function s.thfilter(c)
31+
return c:IsCode(60879050,76136345) and c:IsAbleToHand()
32+
end
33+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
34+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil) end
35+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE)
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,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil)
40+
if #g>0 then
41+
Duel.SendtoHand(g,nil,REASON_EFFECT)
42+
Duel.ConfirmCards(1-tp,g)
43+
end
44+
end
45+
function s.spfilter(c,e,tp)
46+
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
47+
end
48+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
49+
local c=e:GetHandler()
50+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc~=c and s.spfilter(chkc,e,tp) end
51+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,0)>=2
52+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
53+
and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
54+
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) end
55+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
56+
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,c,e,tp)
57+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g+c,2,tp,0)
58+
end
59+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
60+
local c=e:GetHandler()
61+
if Duel.GetLocationCount(tp,LOCATION_MZONE,0)>=2 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then
62+
local tc=Duel.GetFirstTarget()
63+
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
64+
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
65+
Duel.SpecialSummon(Group.FromCards(c,tc),0,tp,tp,false,false,POS_FACEUP)
66+
end
67+
end
68+
--You cannot Special Summon from the Extra Deck for the rest of this turn, except Machine monsters
69+
local e1=Effect.CreateEffect(c)
70+
e1:SetDescription(aux.Stringid(id,2))
71+
e1:SetType(EFFECT_TYPE_FIELD)
72+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
73+
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
74+
e1:SetTargetRange(1,0)
75+
e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsRace(RACE_MACHINE) end)
76+
e1:SetReset(RESET_PHASE|PHASE_END)
77+
Duel.RegisterEffect(e1,tp)
78+
end

pre-release/c101304043.lua

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
--超弩級砲塔列車グスタフ・ロケット
2+
--Superdreadnought Rail Cannon Gustav Rocket
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Xyz Summon procedure: 3 Level 10 monsters, OR by discarding 1 card and using "Superdreadnought Rail Cannon Gustav Max" you control
8+
Xyz.AddProcedure(c,nil,10,3,s.ovfilter,aux.Stringid(id,0),3,s.xyzop)
9+
--Negate that effect, and if you do, destroy that monster, then inflict 1000 damage to your opponent
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,1))
12+
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY+CATEGORY_DAMAGE)
13+
e1:SetType(EFFECT_TYPE_QUICK_O)
14+
e1:SetCode(EVENT_CHAINING)
15+
e1:SetRange(LOCATION_MZONE)
16+
e1:SetCountLimit(1,id)
17+
e1:SetCondition(s.discon)
18+
e1:SetTarget(s.distg)
19+
e1:SetOperation(s.disop)
20+
c:RegisterEffect(e1)
21+
--Detach 1 material from this card or destroy it
22+
local e2=Effect.CreateEffect(c)
23+
e2:SetDescription(aux.Stringid(id,2))
24+
e2:SetCategory(CATEGORY_DESTROY)
25+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
26+
e2:SetCode(EVENT_PHASE+PHASE_END)
27+
e2:SetRange(LOCATION_MZONE)
28+
e2:SetCountLimit(1)
29+
e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
30+
e2:SetTarget(s.detachtg)
31+
e2:SetOperation(s.detachop)
32+
c:RegisterEffect(e2)
33+
end
34+
s.listed_names={id,56910167} --"Superdreadnought Rail Cannon Gustav Max"
35+
function s.ovfilter(c,tp,xyzc)
36+
return c:IsSummonCode(xyzc,SUMMON_TYPE_XYZ,tp,56910167) and c:IsFaceup()
37+
end
38+
function s.xyzop(e,tp,chk,mc)
39+
if chk==0 then return not Duel.HasFlagEffect(tp,id) and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
40+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
41+
local sc=Duel.GetMatchingGroup(Card.IsDiscardable,tp,LOCATION_HAND,0,nil):SelectUnselect(Group.CreateGroup(),tp,false,Xyz.ProcCancellable)
42+
if sc and Duel.SendtoGrave(sc,REASON_DISCARD|REASON_COST)>0 then
43+
return Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,EFFECT_FLAG_OATH,1)
44+
else
45+
return false
46+
end
47+
end
48+
function s.discon(e,tp,eg,ep,ev,re,r,rp)
49+
return rp==1-tp and re:IsMonsterEffect() and e:GetHandler():GetOverlayCount()>0 and Duel.IsChainDisablable(ev)
50+
end
51+
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
52+
if chk==0 then return true end
53+
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,tp,0)
54+
local rc=re:GetHandler()
55+
if rc:IsDestructable() and rc:IsRelateToEffect(re) then
56+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,tp,0)
57+
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
58+
end
59+
end
60+
function s.disop(e,tp,eg,ep,ev,re,r,rp)
61+
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 then
62+
Duel.BreakEffect()
63+
Duel.Damage(1-tp,1000,REASON_EFFECT)
64+
end
65+
end
66+
function s.detachtg(e,tp,eg,ep,ev,re,r,rp,chk)
67+
if chk==0 then return true end
68+
local c=e:GetHandler()
69+
if c:GetOverlayCount()==0 then
70+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,tp,0)
71+
end
72+
Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,c,1,tp,0)
73+
end
74+
function s.detachop(e,tp,eg,ep,ev,re,r,rp)
75+
local c=e:GetHandler()
76+
if not c:IsRelateToEffect(e) then return end
77+
local b1=c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT)
78+
local b2=true
79+
--Detach 1 material from this card or destroy it
80+
local op=b1 and Duel.SelectEffect(tp,
81+
{b1,aux.Stringid(id,3)},
82+
{b2,aux.Stringid(id,4)}) or 2
83+
if op==1 then
84+
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
85+
elseif op==2 then
86+
Duel.Destroy(c,REASON_EFFECT)
87+
end
88+
end

pre-release/c101304044.lua

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
--超弩級砲塔列車フライング・ランチャー
2+
--Superdreadnought Rail Cannon Flying Launcher
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Xyz Summon procedure: 2 Level 10 monsters
8+
Xyz.AddProcedure(c,nil,10,2)
9+
--You can Normal Summon 1 Machine monster during your Main Phase each turn, in addition to your Normal Summon/Set (you can only gain this effect once per turn)
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetType(EFFECT_TYPE_FIELD)
13+
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
14+
e1:SetRange(LOCATION_MZONE)
15+
e1:SetTargetRange(LOCATION_HAND|LOCATION_MZONE,0)
16+
e1:SetTarget(function(e,c) return c:IsRace(RACE_MACHINE) end)
17+
c:RegisterEffect(e1)
18+
--Add 1 EARTH Machine monster or "Barrage Blast" from your Deck to your hand
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,1))
21+
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
22+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
23+
e2:SetProperty(EFFECT_FLAG_DELAY)
24+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
25+
e2:SetCountLimit(1,{id,0})
26+
e2:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end)
27+
e2:SetTarget(s.thtg)
28+
e2:SetOperation(s.thop)
29+
c:RegisterEffect(e2)
30+
--Destroy Spells/Traps on the field equal to the number of materials detached
31+
local e3=Effect.CreateEffect(c)
32+
e3:SetDescription(aux.Stringid(id,2))
33+
e3:SetCategory(CATEGORY_DESTROY)
34+
e3:SetType(EFFECT_TYPE_IGNITION)
35+
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
36+
e3:SetRange(LOCATION_MZONE)
37+
e3:SetCountLimit(1,{id,1})
38+
e3:SetCost(Cost.DetachFromSelf(1,function(e,tp) return Duel.GetTargetCount(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) end,function(e,og) e:SetLabel(#og) end))
39+
e3:SetTarget(s.destg)
40+
e3:SetOperation(s.desop)
41+
c:RegisterEffect(e3)
42+
end
43+
s.listed_names={51369889} --"Barrage Blast"
44+
function s.thfilter(c)
45+
return ((c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE)) or c:IsCode(51369889)) and c:IsAbleToHand()
46+
end
47+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
48+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
49+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
50+
end
51+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
52+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
53+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
54+
if #g>0 then
55+
Duel.SendtoHand(g,nil,REASON_EFFECT)
56+
Duel.ConfirmCards(1-tp,g)
57+
end
58+
end
59+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
60+
if chkc then return chkc:IsOnField() and chkc:IsSpellTrap() end
61+
if chk==0 then return Duel.IsExistingTarget(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
62+
local ct=e:GetLabel()
63+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
64+
local g=Duel.SelectTarget(tp,Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,ct,nil)
65+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0)
66+
end
67+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
68+
local tg=Duel.GetTargetCards(e)
69+
if #tg>0 then
70+
Duel.Destroy(tg,REASON_EFFECT)
71+
end
72+
end

0 commit comments

Comments
 (0)