Skip to content

Commit 5619821

Browse files
authored
Added new card scripts
1 parent a8992d2 commit 5619821

File tree

7 files changed

+518
-0
lines changed

7 files changed

+518
-0
lines changed

pre-release/c101302090.lua

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
--
2+
--R.B. Lambda Cannon
3+
--Scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Add 1 "R.B." monster from your GY to your hand, except "R.B. Lambda Cannon"
7+
local e1a=Effect.CreateEffect(c)
8+
e1a:SetDescription(aux.Stringid(id,0))
9+
e1a:SetCategory(CATEGORY_TOHAND)
10+
e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
11+
e1a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
12+
e1a:SetCode(EVENT_SUMMON_SUCCESS)
13+
e1a:SetCountLimit(1,id)
14+
e1a:SetTarget(s.thtg)
15+
e1a:SetOperation(s.thop)
16+
c:RegisterEffect(e1a)
17+
local e1b=e1a:Clone()
18+
e1b:SetCode(EVENT_SPSUMMON_SUCCESS)
19+
c:RegisterEffect(e1b)
20+
--Destroy this card, and if you do, look at your opponent's hand, then you can Special Summon 1 monster from it to their field, but negate its effects
21+
local e2=Effect.CreateEffect(c)
22+
e2:SetDescription(aux.Stringid(id,1))
23+
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
24+
e2:SetType(EFFECT_TYPE_IGNITION)
25+
e2:SetRange(LOCATION_MZONE)
26+
e2:SetCountLimit(1,{id,1})
27+
e2:SetCondition(s.descon)
28+
e2:SetCost(Cost.PayLP(1200))
29+
e2:SetTarget(s.destg)
30+
e2:SetOperation(s.desop)
31+
c:RegisterEffect(e2)
32+
end
33+
s.listed_names={id}
34+
s.listed_series={SET_RB}
35+
function s.thfilter(c)
36+
return c:IsSetCard(SET_RB) and c:IsMonster() and c:IsAbleToHand() and not c:IsCode(id)
37+
end
38+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
39+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.thfilter(chkc) end
40+
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
41+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
42+
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
43+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0)
44+
end
45+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
46+
local tc=Duel.GetFirstTarget()
47+
if tc:IsRelateToEffect(e) then
48+
Duel.SendtoHand(tc,tp,REASON_EFFECT)
49+
end
50+
end
51+
function s.desconfilter(c,ec,lg)
52+
return c:IsSetCard(SET_RB) and c:IsLinkMonster() and c:IsFaceup() and (lg:IsContains(c) or c:GetLinkedGroup():IsContains(ec))
53+
end
54+
function s.descon(e,tp,eg,ep,ev,re,r,rp)
55+
local c=e:GetHandler()
56+
return Duel.IsExistingMatchingCard(s.desconfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c,c:GetLinkedGroup())
57+
end
58+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
59+
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
60+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,tp,0)
61+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,1-tp,LOCATION_HAND)
62+
end
63+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
64+
local c=e:GetHandler()
65+
if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 then return end
66+
local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
67+
if #hg==0 then return end
68+
Duel.ConfirmCards(tp,hg)
69+
local sg=hg:Filter(Card.IsCanBeSpecialSummoned,nil,e,0,tp,false,false,POS_FACEUP,1-tp)
70+
if #sg==0 or Duel.GetLocationCount(1-tp,LOCATION_MZONE)==0 or not Duel.SelectYesNo(tp,aux.Stringid(id,2)) then return Duel.ShuffleHand(1-tp) end
71+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
72+
local sc=sg:Select(tp,1,1,nil):GetFirst()
73+
if not sc then return end
74+
Duel.BreakEffect()
75+
if Duel.SpecialSummonStep(sc,0,tp,1-tp,false,false,POS_FACEUP) then
76+
--Negate its effects
77+
sc:NegateEffects(c)
78+
end
79+
Duel.SpecialSummonComplete()
80+
Duel.ShuffleHand(1-tp)
81+
end

pre-release/c101302091.lua

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
--
2+
--R.B. Lambda Blade
3+
--Scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Send 1 "R.B." card from your Deck to the GY, except "R.B. Lambda Blade"
7+
local e1a=Effect.CreateEffect(c)
8+
e1a:SetDescription(aux.Stringid(id,0))
9+
e1a:SetCategory(CATEGORY_TOGRAVE)
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:SetTarget(s.tgtg)
15+
e1a:SetOperation(s.tgop)
16+
c:RegisterEffect(e1a)
17+
local e1b=e1a:Clone()
18+
e1b:SetCode(EVENT_SPSUMMON_SUCCESS)
19+
c:RegisterEffect(e1b)
20+
--Destroy this card, and if you do, take control of an opponent's monster, but destroy it during the End Phase card
21+
local e2=Effect.CreateEffect(c)
22+
e2:SetDescription(aux.Stringid(id,1))
23+
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_CONTROL)
24+
e2:SetType(EFFECT_TYPE_QUICK_O)
25+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
26+
e2:SetCode(EVENT_FREE_CHAIN)
27+
e2:SetRange(LOCATION_MZONE)
28+
e2:SetCountLimit(1,{id,1})
29+
e2:SetCondition(s.descon)
30+
e2:SetCost(Cost.PayLP(1400))
31+
e2:SetTarget(s.destg)
32+
e2:SetOperation(s.desop)
33+
e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
34+
c:RegisterEffect(e2)
35+
end
36+
s.listed_names={id}
37+
s.listed_series={SET_RB}
38+
function s.tgfilter(c)
39+
return c:IsSetCard(SET_RB) and c:IsAbleToGrave() and not c:IsCode(id)
40+
end
41+
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
42+
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
43+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
44+
end
45+
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
46+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
47+
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
48+
if #g>0 then
49+
Duel.SendtoGrave(g,REASON_EFFECT)
50+
end
51+
end
52+
function s.desconfilter(c,ec,lg)
53+
return c:IsSetCard(SET_RB) and c:IsLinkMonster() and c:IsFaceup() and (lg:IsContains(c) or c:GetLinkedGroup():IsContains(ec))
54+
end
55+
function s.descon(e,tp,eg,ep,ev,re,r,rp)
56+
local c=e:GetHandler()
57+
return Duel.IsMainPhase(1-tp) and Duel.IsExistingMatchingCard(s.desconfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c,c:GetLinkedGroup())
58+
end
59+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
60+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToChangeControler() end
61+
local c=e:GetHandler()
62+
if chk==0 then return Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0
63+
and Duel.IsExistingTarget(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil) end
64+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
65+
local g=Duel.SelectTarget(tp,Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,1,nil)
66+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,tp,0)
67+
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,tp,0)
68+
end
69+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
70+
local c=e:GetHandler()
71+
local tc=Duel.GetFirstTarget()
72+
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0
73+
and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e)
74+
and tc:IsControler(1-tp) and Duel.GetControl(tc,tp) then
75+
--Destroy it during the End Phase
76+
aux.DelayedOperation(tc,PHASE_END,id,e,tp,function(ag) Duel.Destroy(ag,REASON_EFFECT) end,nil,0,0,aux.Stringid(id,2))
77+
end
78+
end

pre-release/c101302092.lua

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
--JP name
2+
--R.B. Ga10 Pile Bunker
3+
--Scripted by The Razgriz
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--If you control no face-up monsters, or the only face-up monsters you control are "R.B." monsters, you can Special Summon this card (from your hand)
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_FIELD)
10+
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
11+
e1:SetCode(EFFECT_SPSUMMON_PROC)
12+
e1:SetRange(LOCATION_HAND)
13+
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
14+
e1:SetCondition(s.spcon)
15+
c:RegisterEffect(e1)
16+
--Destroy all cards your opponent controls and this card
17+
local e2=Effect.CreateEffect(c)
18+
e2:SetDescription(aux.Stringid(id,1))
19+
e2:SetCategory(CATEGORY_DESTROY)
20+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
21+
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
22+
e2:SetRange(LOCATION_MZONE)
23+
e2:SetCountLimit(1,{id,1})
24+
e2:SetCondition(s.descon)
25+
e2:SetCost(Cost.PayLP(1500))
26+
e2:SetTarget(s.destg)
27+
e2:SetOperation(s.desop)
28+
c:RegisterEffect(e2)
29+
end
30+
s.listed_series={SET_RB}
31+
s.listed_names={32216688} --"R.B. The Brute Blues"
32+
function s.spcon(e,c)
33+
if c==nil then return true end
34+
local tp=e:GetHandlerPlayer()
35+
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
36+
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
37+
and (#g==0 or g:FilterCount(Card.IsSetCard,nil,SET_RB)==#g)
38+
end
39+
function s.descon(e,tp,eg,ep,ev,re,r,rp)
40+
local bc,oc=Duel.GetBattleMonster(tp)
41+
return bc and oc and bc:IsCode(32216688) and bc:GetLinkedGroup():IsContains(e:GetHandler())
42+
end
43+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
44+
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
45+
if chk==0 then return #g>0 end
46+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g+e:GetHandler(),#g,tp,0)
47+
end
48+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
49+
local c=e:GetHandler()
50+
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
51+
if c:IsRelateToEffect(e) and #g>0 then
52+
g:AddCard(c)
53+
Duel.Destroy(g,REASON_EFFECT)
54+
end
55+
end

pre-release/c101302093.lua

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
--JP name
2+
--R.B. Shepherd's Crook
3+
--Scripted by The Razgriz
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Link Summon procedure: 2+ monsters, including an "R.B." monster
8+
Link.AddProcedure(c,nil,2,3,s.linkmatcheck)
9+
--Gains 500 ATK for each monster you control, except this card
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetType(EFFECT_TYPE_SINGLE)
12+
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
13+
e1:SetCode(EFFECT_UPDATE_ATTACK)
14+
e1:SetRange(LOCATION_MZONE)
15+
e1:SetValue(function(e,c) return 500*Duel.GetMatchingGroupCount(nil,c:GetControler(),LOCATION_MZONE,0,e:GetHandler()) end)
16+
c:RegisterEffect(e1)
17+
--Set 1 "R.B." Spell/Trap from your Deck or GY
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,0))
20+
e2:SetCategory(CATEGORY_LEAVE_GRAVE)
21+
e2:SetType(EFFECT_TYPE_IGNITION)
22+
e2:SetRange(LOCATION_MZONE)
23+
e2:SetCountLimit(1,id)
24+
e2:SetTarget(s.settg)
25+
e2:SetOperation(s.setop)
26+
c:RegisterEffect(e2)
27+
--Target 3 Level 3 or higher "R.B." monsters; place 2 on the bottom of the Deck in any order, Special Summon the third
28+
local e3=Effect.CreateEffect(c)
29+
e3:SetDescription(aux.Stringid(id,1))
30+
e3:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
31+
e3:SetType(EFFECT_TYPE_QUICK_O)
32+
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
33+
e3:SetCode(EVENT_FREE_CHAIN)
34+
e3:SetRange(LOCATION_MZONE)
35+
e3:SetCountLimit(1,{id,1})
36+
e3:SetCondition(function(e,tp) return Duel.IsMainPhase(1-tp) end)
37+
e3:SetTarget(s.tdsptg)
38+
e3:SetOperation(s.tdspop)
39+
e3:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
40+
c:RegisterEffect(e3)
41+
end
42+
s.listed_series={SET_RB}
43+
s.material_setcode=SET_RB
44+
function s.linkmatcheck(g,lc,sumtype,tp)
45+
return g:IsExists(Card.IsSetCard,1,nil,SET_RB,lc,sumtype,tp)
46+
end
47+
function s.setfilter(c)
48+
return c:IsSetCard(SET_RB) and c:IsTrap() and c:IsSSetable()
49+
end
50+
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
51+
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil) end
52+
Duel.SetPossibleOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE)
53+
end
54+
function s.setop(e,tp,eg,ep,ev,re,r,rp)
55+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
56+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil)
57+
if #g>0 then
58+
Duel.SSet(tp,g)
59+
end
60+
end
61+
function s.tdspfilter(c,e,tp)
62+
return c:IsLevelAbove(3) and c:IsSetCard(SET_RB) and c:IsCanBeEffectTarget(e)
63+
and (c:IsAbleToDeck() or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE))
64+
end
65+
function s.rescon(sg,e,tp,mg)
66+
return sg:IsExists(s.spcheck,1,nil,e,tp,sg)
67+
end
68+
function s.spcheck(c,e,tp,sg)
69+
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and sg:IsExists(Card.IsAbleToDeck,2,c)
70+
end
71+
function s.tdsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
72+
if chkc then return false end
73+
local g=Duel.GetMatchingGroup(s.tdspfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
74+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
75+
and #g>=3 and aux.SelectUnselectGroup(g,e,tp,3,3,s.rescon,0) end
76+
local tg=aux.SelectUnselectGroup(g,e,tp,3,3,s.rescon,1,tp,HINTMSG_TARGET)
77+
Duel.SetTargetCard(tg)
78+
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,2,tp,0)
79+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,1,tp,0)
80+
end
81+
function s.tdrescon(sg,e,tp,mg)
82+
return mg:IsExists(s.spcheck,1,sg,e,tp,sg)
83+
end
84+
function s.tdspop(e,tp,eg,ep,ev,re,r,rp)
85+
local tg=Duel.GetTargetCards(e)
86+
if #tg<2 then return end
87+
if #tg==2 and Duel.SendtoDeck(tg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 then
88+
local ct=tg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)
89+
if ct>0 then Duel.SortDeckbottom(tp,tp,ct) end
90+
return
91+
end
92+
local dg=aux.SelectUnselectGroup(tg,e,tp,2,2,s.tdrescon,1,tp,HINTMSG_TODECK)
93+
if #dg~=2 then return end
94+
Duel.HintSelection(dg)
95+
if Duel.SendtoDeck(dg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 and dg:FilterCount(Card.IsLocation,nil,LOCATION_DECK|LOCATION_EXTRA)==2 then
96+
local ct=dg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)
97+
if ct>0 then Duel.SortDeckbottom(tp,tp,ct) end
98+
local sg=tg-dg
99+
if #sg>0 then
100+
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
101+
end
102+
end
103+
end

0 commit comments

Comments
 (0)