1+ --
2+ -- R.B. VALCan Booster
3+ -- Scripted by Hatter
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- Link Summon procedure: 2 Machine monsters
8+ Link .AddProcedure (c ,aux .FilterBoolFunctionEx (Card .IsRace ,RACE_MACHINE ),2 ,2 )
9+ -- Add 1 "R.B." Spell from your Deck to your hand
10+ local e1 = Effect .CreateEffect (c )
11+ e1 :SetDescription (aux .Stringid (id ,0 ))
12+ e1 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH )
13+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
14+ e1 :SetProperty (EFFECT_FLAG_DELAY )
15+ e1 :SetCode (EVENT_SPSUMMON_SUCCESS )
16+ e1 :SetCountLimit (1 ,id )
17+ e1 :SetCondition (function (e ) return e :GetHandler ():IsLinkSummoned () end )
18+ e1 :SetTarget (s .thtg )
19+ e1 :SetOperation (s .thop )
20+ c :RegisterEffect (e1 )
21+ -- Special Summon 1 "R.B." monster from your hand or GY in Defense Position, then you can move this card you control to another of your Main Monster Zones
22+ local e2 = Effect .CreateEffect (c )
23+ e2 :SetDescription (aux .Stringid (id ,1 ))
24+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
25+ e2 :SetType (EFFECT_TYPE_IGNITION )
26+ e2 :SetRange (LOCATION_EMZONE )
27+ e2 :SetCountLimit (1 ,{id ,1 })
28+ e2 :SetTarget (s .sptg )
29+ e2 :SetOperation (s .spop )
30+ c :RegisterEffect (e2 )
31+ end
32+ s .listed_series = {SET_RB }
33+ function s .thfilter (c )
34+ return c :IsSetCard (SET_RB ) and c :IsSpell () and c :IsAbleToHand ()
35+ end
36+ function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
37+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
38+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
39+ end
40+ function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
41+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
42+ local g = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil )
43+ if # g > 0 then
44+ Duel .SendtoHand (g ,nil ,REASON_EFFECT )
45+ Duel .ConfirmCards (1 - tp ,g )
46+ end
47+ end
48+ function s .spfilter (c ,e ,tp )
49+ return c :IsSetCard (SET_RB ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ,POS_FACEUP_DEFENSE )
50+ end
51+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
52+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
53+ and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_HAND |LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ) end
54+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_HAND |LOCATION_GRAVE )
55+ end
56+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
57+ local c = e :GetHandler ()
58+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 then
59+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
60+ local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .spfilter ),tp ,LOCATION_HAND |LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
61+ if # g > 0 and Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP_DEFENSE )> 0
62+ and c :IsRelateToEffect (e ) and c :IsControler (tp )
63+ and Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
64+ and Duel .SelectYesNo (tp ,aux .Stringid (id ,2 )) then
65+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOZONE )
66+ local seq = math.log (Duel .SelectDisableField (tp ,1 ,LOCATION_MZONE ,0 ,0 ),2 )
67+ Duel .BreakEffect ()
68+ Duel .MoveSequence (c ,seq )
69+ end
70+ end
71+ -- You cannot Special Summon from the Extra Deck for the rest of this turn, except Machine monsters with 1500 or less ATK
72+ local e1 = Effect .CreateEffect (c )
73+ e1 :SetDescription (aux .Stringid (id ,3 ))
74+ e1 :SetType (EFFECT_TYPE_FIELD )
75+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
76+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
77+ e1 :SetTargetRange (1 ,0 )
78+ e1 :SetTarget (function (e ,c ) return c :IsLocation (LOCATION_EXTRA ) and not (c :IsRace (RACE_MACHINE ) and c :IsAttackBelow (1500 )) end )
79+ e1 :SetReset (RESET_PHASE |PHASE_END )
80+ Duel .RegisterEffect (e1 ,tp )
81+ -- "Clock Lizard" check
82+ aux .addTempLizardCheck (c ,tp ,function (e ,c )
83+ local atk = c :GetTextAttack ()
84+ return not c :IsOriginalRace (RACE_MACHINE ) or atk ==- 2 or atk > 1500
85+ end )
86+ end
0 commit comments