1+ -- ライゼオル・マスドライバー
2+ -- Ryzeal Mass Driver
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Apply the following effect then you can attach this card to a Rank 4 Xyz Monster you control as material
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_ATKCHANGE )
10+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
11+ e1 :SetProperty (EFFECT_FLAG_DAMAGE_STEP )
12+ e1 :SetCode (EVENT_FREE_CHAIN )
13+ e1 :SetCountLimit (1 ,id )
14+ e1 :SetHintTiming (TIMING_DAMAGE_STEP ,TIMING_DAMAGE_STEP |TIMING_STANDBY_PHASE |TIMING_MAIN_END |TIMINGS_CHECK_MONSTER_E )
15+ e1 :SetCondition (function () return not (Duel .IsPhase (PHASE_DAMAGE ) and Duel .IsDamageCalculated ()) end )
16+ e1 :SetTarget (s .atktg )
17+ e1 :SetOperation (s .atkop )
18+ c :RegisterEffect (e1 )
19+ -- Banish 1 card from your opponent's GY
20+ local e2 = Effect .CreateEffect (c )
21+ e2 :SetDescription (aux .Stringid (id ,1 ))
22+ e2 :SetCategory (CATEGORY_REMOVE )
23+ e2 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
24+ e2 :SetProperty (EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET )
25+ e2 :SetCode (EVENT_TO_GRAVE )
26+ e2 :SetCountLimit (1 ,{id ,1 })
27+ e2 :SetCondition (function (e ) return not e :GetHandler ():IsPreviousLocation (LOCATION_ONFIELD ) end )
28+ e2 :SetTarget (s .rmvtg )
29+ e2 :SetOperation (s .rmvop )
30+ c :RegisterEffect (e2 )
31+ end
32+ s .listed_series = {SET_RYZEAL }
33+ function s .atktg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
34+ if chk == 0 then return true end
35+ local g = Duel .GetMatchingGroup (aux .FaceupFilter (Card .IsSetCard ,SET_RYZEAL ),tp ,LOCATION_MZONE ,0 ,nil )
36+ Duel .SetOperationInfo (0 ,CATEGORY_ATKCHANGE ,g ,# g ,tp ,1000 )
37+ end
38+ function s .xyzfilter (c ,mc ,tp )
39+ return c :IsType (TYPE_XYZ ) and c :IsRank (4 ) and c :IsFaceup () and mc :IsCanBeXyzMaterial (c ,tp ,REASON_EFFECT )
40+ end
41+ function s .atkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
42+ local c = e :GetHandler ()
43+ -- "Ryzeal" monsters you control will gain 1000 ATK for the rest of this turn
44+ local e1 = Effect .CreateEffect (c )
45+ e1 :SetType (EFFECT_TYPE_FIELD )
46+ e1 :SetCode (EFFECT_UPDATE_ATTACK )
47+ e1 :SetTargetRange (LOCATION_MZONE ,0 )
48+ e1 :SetTarget (function (e ,c ) return c :IsSetCard (SET_RYZEAL ) end )
49+ e1 :SetValue (1000 )
50+ e1 :SetReset (RESET_PHASE |PHASE_END )
51+ Duel .RegisterEffect (e1 ,tp )
52+ aux .RegisterClientHint (c ,0 ,tp ,1 ,0 ,aux .Stringid (id ,2 ))
53+ if c :IsRelateToEffect (e ) and Duel .IsExistingMatchingCard (s .xyzfilter ,tp ,LOCATION_MZONE ,0 ,1 ,nil ,c ,tp )
54+ and Duel .SelectYesNo (tp ,aux .Stringid (id ,3 )) then
55+ c :CancelToGrave ()
56+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_FACEUP )
57+ local tc = Duel .SelectMatchingCard (tp ,s .xyzfilter ,tp ,LOCATION_MZONE ,0 ,1 ,1 ,nil ,c ,tp ):GetFirst ()
58+ if tc then
59+ Duel .HintSelection (tc )
60+ Duel .BreakEffect ()
61+ if tc :IsImmuneToEffect (e ) then return end
62+ Duel .Overlay (tc ,c )
63+ end
64+ end
65+ end
66+ function s .rmvtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
67+ if chkc then return chkc :IsLocation (LOCATION_GRAVE ) and chkc :IsControler (1 - tp ) and chkc :IsAbleToRemove () end
68+ if chk == 0 then return Duel .IsExistingTarget (Card .IsAbleToRemove ,tp ,0 ,LOCATION_GRAVE ,1 ,nil ) end
69+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_REMOVE )
70+ local g = Duel .SelectTarget (tp ,Card .IsAbleToRemove ,tp ,0 ,LOCATION_GRAVE ,1 ,1 ,nil )
71+ Duel .SetOperationInfo (0 ,CATEGORY_REMOVE ,g ,1 ,tp ,0 )
72+ end
73+ function s .rmvop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
74+ local tc = Duel .GetFirstTarget ()
75+ if tc :IsRelateToEffect (e ) then
76+ Duel .Remove (tc ,POS_FACEUP ,REASON_EFFECT )
77+ end
78+ end
0 commit comments