1+ -- ロードサーバント・フレア
2+ -- Road Servant Flare
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Special summon 1 monster from GY
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_MZONE )
12+ e1 :SetCountLimit (1 )
13+ e1 :SetCondition (s .condition )
14+ e1 :SetCost (s .cost )
15+ e1 :SetTarget (s .target )
16+ e1 :SetOperation (s .operation )
17+ c :RegisterEffect (e1 )
18+ -- Register when a player Special Summons a monster
19+ aux .GlobalCheck (s ,function ()
20+ local ge1 = Effect .CreateEffect (c )
21+ ge1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
22+ ge1 :SetCode (EVENT_SPSUMMON_SUCCESS )
23+ ge1 :SetOperation (s .checkop )
24+ Duel .RegisterEffect (ge1 ,0 )
25+ end )
26+ end
27+ s .listed_names = {160402001 ,160001039 ,160002036 }
28+ function s .checkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
29+ for tc in eg :Iter () do
30+ Duel .RegisterFlagEffect (tc :GetSummonPlayer (),id ,RESET_PHASE |PHASE_END ,0 ,1 )
31+ end
32+ end
33+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
34+ return not Duel .HasFlagEffect (tp ,id )
35+ end
36+ function s .cfilter (c )
37+ return c :IsCode (160402001 ,160001039 ,160002036 ) and not c :IsPublic ()
38+ end
39+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
40+ if chk == 0 then return Duel .IsExistingMatchingCard (s .cfilter ,tp ,LOCATION_HAND ,0 ,1 ,nil ) end
41+ end
42+ function s .filter (c ,e ,tp )
43+ return c :IsRace (RACE_SPELLCASTER ) and c :IsLevelAbove (7 ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
44+ end
45+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
46+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
47+ and Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ) end
48+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_GRAVE )
49+ end
50+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
51+ -- Requirement
52+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_CONFIRM )
53+ local tc = Duel .SelectMatchingCard (tp ,s .cfilter ,tp ,LOCATION_HAND ,0 ,1 ,1 ,nil )
54+ Duel .ConfirmCards (1 - tp ,tc )
55+ Duel .ShuffleHand (tp )
56+ -- Effect
57+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
58+ local g = Duel .SelectMatchingCard (tp ,s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
59+ if # g > 0 and Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )> 0 then
60+ Duel .BreakEffect ()
61+ Duel .SendtoHand (e :GetHandler (),nil ,REASON_EFFECT )
62+ end
63+ end
0 commit comments