1+ -- R-ACEクイック・アタッカー
2+ -- Rescue-ACE Quick Attacker
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Special Summon this card from your hand
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_HAND )
12+ e1 :SetCountLimit (1 ,id )
13+ e1 :SetCost (s .spcost )
14+ e1 :SetTarget (s .sptg )
15+ e1 :SetOperation (s .spop )
16+ c :RegisterEffect (e1 )
17+ -- Add 1 "Rescue-ACE" monster from your Deck to your hand, then you can Special Summon it if only your opponent controls a monster
18+ local e2 = Effect .CreateEffect (c )
19+ e2 :SetDescription (aux .Stringid (id ,1 ))
20+ e2 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH + CATEGORY_SPECIAL_SUMMON )
21+ e2 :SetType (EFFECT_TYPE_IGNITION )
22+ e2 :SetRange (LOCATION_MZONE )
23+ e2 :SetCountLimit (1 ,{id ,1 })
24+ e2 :SetCost (Cost .SelfTribute )
25+ e2 :SetTarget (s .thtg )
26+ e2 :SetOperation (s .thop )
27+ c :RegisterEffect (e2 )
28+ end
29+ s .listed_series = {SET_RESCUE_ACE }
30+ function s .spcostfilter (c ,tp )
31+ return c :IsSetCard (SET_RESCUE_ACE ) and c :IsAbleToDeckAsCost () and Duel .GetMZoneCount (tp ,c )> 0
32+ and (c :IsFaceup () or c :IsLocation (LOCATION_HAND ))
33+ end
34+ function s .spcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
35+ local c = e :GetHandler ()
36+ if chk == 0 then return Duel .IsExistingMatchingCard (s .spcostfilter ,tp ,LOCATION_HAND |LOCATION_ONFIELD ,0 ,1 ,c ,tp ) end
37+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TODECK )
38+ local sc = Duel .SelectMatchingCard (tp ,s .spcostfilter ,tp ,LOCATION_HAND |LOCATION_ONFIELD ,0 ,1 ,1 ,c ,tp ):GetFirst ()
39+ if sc :IsLocation (LOCATION_HAND ) then
40+ Duel .ConfirmCards (1 - tp ,sc )
41+ else
42+ Duel .HintSelection (sc )
43+ end
44+ Duel .SendtoDeck (sc ,nil ,SEQ_DECKSHUFFLE ,REASON_COST )
45+ end
46+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
47+ local c = e :GetHandler ()
48+ if chk == 0 then return c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end
49+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
50+ end
51+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
52+ local c = e :GetHandler ()
53+ if c :IsRelateToEffect (e ) then
54+ Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
55+ end
56+ end
57+ function s .thfilter (c )
58+ return c :IsSetCard (SET_RESCUE_ACE ) and c :IsMonster () and c :IsAbleToHand ()
59+ end
60+ function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
61+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
62+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
63+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_HAND )
64+ end
65+ function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
66+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
67+ local sc = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ):GetFirst ()
68+ if sc and Duel .SendtoHand (sc ,nil ,REASON_EFFECT )> 0 and sc :IsLocation (LOCATION_HAND ) then
69+ Duel .ConfirmCards (1 - tp ,sc )
70+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 and sc :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
71+ and Duel .GetFieldGroupCount (tp ,LOCATION_MZONE ,0 )== 0
72+ and Duel .GetFieldGroupCount (tp ,0 ,LOCATION_MZONE )> 0
73+ and Duel .SelectYesNo (tp ,aux .Stringid (id ,2 )) then
74+ Duel .BreakEffect ()
75+ Duel .SpecialSummon (sc ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
76+ end
77+ end
78+ local c = e :GetHandler ()
79+ -- You cannot Special Summon from the Extra Deck for the rest of this turn, except FIRE monsters
80+ local e1 = Effect .CreateEffect (c )
81+ e1 :SetDescription (aux .Stringid (id ,3 ))
82+ e1 :SetType (EFFECT_TYPE_FIELD )
83+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
84+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
85+ e1 :SetTargetRange (1 ,0 )
86+ e1 :SetTarget (function (e ,c ) return c :IsLocation (LOCATION_EXTRA ) and not c :IsAttribute (ATTRIBUTE_FIRE ) end )
87+ e1 :SetReset (RESET_PHASE |PHASE_END )
88+ Duel .RegisterEffect (e1 ,tp )
89+ -- "Clock Lizard" check
90+ aux .addTempLizardCheck (c ,tp ,function (e ,c ) return not c :IsOriginalAttribute (ATTRIBUTE_FIRE ) end )
91+ end
0 commit comments