1+ -- 黒炎の剣士-ブラック・フレア・ソードマン-
2+ -- Dark Flare Swordsman
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- You take no damage from battles involving this card
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetType (EFFECT_TYPE_SINGLE )
9+ e1 :SetCode (EFFECT_AVOID_BATTLE_DAMAGE )
10+ e1 :SetValue (1 )
11+ c :RegisterEffect (e1 )
12+ -- Special Summon this card from your hand
13+ local e2 = Effect .CreateEffect (c )
14+ e2 :SetDescription (aux .Stringid (id ,0 ))
15+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
16+ e2 :SetType (EFFECT_TYPE_IGNITION )
17+ e2 :SetRange (LOCATION_HAND )
18+ e2 :SetCountLimit (1 ,id )
19+ e2 :SetCost (s .selfspcost )
20+ e2 :SetTarget (s .selfsptg )
21+ e2 :SetOperation (s .selfspop )
22+ c :RegisterEffect (e2 )
23+ -- Special Summon 1 monster that mentions "Flame Swordsman" from your Deck, except a Level 6 monster
24+ local e3 = Effect .CreateEffect (c )
25+ e3 :SetDescription (aux .Stringid (id ,1 ))
26+ e3 :SetCategory (CATEGORY_SPECIAL_SUMMON )
27+ e3 :SetType (EFFECT_TYPE_QUICK_O )
28+ e3 :SetCode (EVENT_FREE_CHAIN )
29+ e3 :SetRange (LOCATION_MZONE )
30+ e3 :SetHintTiming (0 ,TIMING_STANDBY_PHASE |TIMING_MAIN_END |TIMINGS_CHECK_MONSTER_E )
31+ e3 :SetCountLimit (1 ,{id ,1 })
32+ e3 :SetCost (Cost .SelfTribute )
33+ e3 :SetTarget (s .decksptg )
34+ e3 :SetOperation (s .deckspop )
35+ c :RegisterEffect (e3 )
36+ end
37+ s .listed_names = {CARD_FLAME_SWORDSMAN }
38+ function s .selfcostfilter (c ,tp )
39+ return (c :IsCode (CARD_FLAME_SWORDSMAN ) or c :ListsCode (CARD_FLAME_SWORDSMAN )) and c :IsAbleToGraveAsCost ()
40+ end
41+ function s .selfspcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
42+ if chk == 0 then return Duel .IsExistingMatchingCard (s .selfcostfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,nil ) end
43+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
44+ local g = Duel .SelectMatchingCard (tp ,s .selfcostfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,1 ,nil )
45+ Duel .SendtoGrave (g ,REASON_COST )
46+ end
47+ function s .selfsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
48+ local c = e :GetHandler ()
49+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
50+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end
51+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
52+ end
53+ function s .selfspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
54+ local c = e :GetHandler ()
55+ if c :IsRelateToEffect (e ) then
56+ Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
57+ end
58+ -- You cannot declare attacks for the rest of this turn, except with Warrior monsters
59+ local e1 = Effect .CreateEffect (c )
60+ e1 :SetType (EFFECT_TYPE_FIELD )
61+ e1 :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE )
62+ e1 :SetCode (EFFECT_CANNOT_ATTACK_ANNOUNCE )
63+ e1 :SetTargetRange (LOCATION_MZONE ,0 )
64+ e1 :SetTarget (function (e ,c ) return not c :IsRace (RACE_WARRIOR ) end )
65+ e1 :SetReset (RESET_PHASE |PHASE_END )
66+ Duel .RegisterEffect (e1 ,tp )
67+ aux .RegisterClientHint (c ,nil ,tp ,1 ,0 ,aux .Stringid (id ,2 ))
68+ end
69+ function s .deckspfilter (c ,e ,tp )
70+ return c :ListsCode (CARD_FLAME_SWORDSMAN ) and not c :IsLevel (6 ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
71+ end
72+ function s .decksptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
73+ if chk == 0 then return Duel .GetMZoneCount (tp ,e :GetHandler ())> 0
74+ and Duel .IsExistingMatchingCard (s .deckspfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ,e ,tp ) end
75+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_DECK )
76+ end
77+ function s .deckspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
78+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )<= 0 then return end
79+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
80+ local g = Duel .SelectMatchingCard (tp ,s .deckspfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ,e ,tp )
81+ if # g > 0 then
82+ Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
83+ end
84+ end
0 commit comments