1+ -- スパークハーツ・ファミリア
2+ -- Sparkhearts Familiar
3+ local s ,id = GetID ()
4+ function s .initial_effect (c )
5+ local e1 = Effect .CreateEffect (c )
6+ e1 :SetDescription (aux .Stringid (id ,0 ))
7+ e1 :SetCategory (CATEGORY_TOGRAVE + CATEGORY_DRAW )
8+ e1 :SetType (EFFECT_TYPE_IGNITION )
9+ e1 :SetRange (LOCATION_MZONE )
10+ e1 :SetCountLimit (1 )
11+ e1 :SetCondition (s .condition )
12+ e1 :SetTarget (s .target )
13+ e1 :SetOperation (s .operation )
14+ c :RegisterEffect (e1 )
15+ end
16+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
17+ return e :GetHandler ():IsStatus (STATUS_SUMMON_TURN ) and Duel .GetFieldGroupCount (tp ,LOCATION_DECK ,0 )>= 10
18+ end
19+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
20+ if chk == 0 then return Duel .IsExistingMatchingCard (Card .IsAbleToGrave ,tp ,LOCATION_HAND |LOCATION_ONFIELD ,0 ,2 ,e :GetHandler ()) end
21+ Duel .SetOperationInfo (0 ,CATEGORY_TOGRAVE ,nil ,2 ,tp ,LOCATION_HAND |LOCATION_ONFIELD )
22+ end
23+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
24+ local c = e :GetHandler ()
25+ -- Effect
26+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
27+ local g = Duel .SelectMatchingCard (tp ,Card .IsAbleToGrave ,tp ,LOCATION_HAND |LOCATION_ONFIELD ,0 ,2 ,2 ,c )
28+ if Duel .SendtoGrave (g ,REASON_EFFECT )== 0 then return end
29+ if Duel .IsExistingMatchingCard (Card .IsCode ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,76103675 ,160301014 ,160003014 )
30+ and Duel .IsPlayerCanDraw (tp ,2 ) and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
31+ Duel .BreakEffect ()
32+ Duel .Draw (tp ,2 ,REASON_EFFECT )
33+ end
34+ -- Prevent non-FIRE Spellcasters from attacking
35+ local e1 = Effect .CreateEffect (e :GetHandler ())
36+ e1 :SetType (EFFECT_TYPE_FIELD )
37+ e1 :SetCode (EFFECT_CANNOT_ATTACK )
38+ e1 :SetProperty (EFFECT_FLAG_OATH )
39+ e1 :SetTargetRange (LOCATION_MZONE ,0 )
40+ e1 :SetTarget (s .ftarget )
41+ e1 :SetReset (RESET_PHASE |PHASE_END )
42+ Duel .RegisterEffect (e1 ,tp )
43+ end
44+ function s .ftarget (e ,c )
45+ return not c :IsRace (RACE_SPELLCASTER ) or not c :IsAttribute (ATTRIBUTE_FIRE )
46+ end
0 commit comments