1+ -- グレイブ・シャドウ
2+ -- Grave Shadow
3+ local s ,id = GetID ()
4+ function s .initial_effect (c )
5+ -- Special Summon
6+ local e1 = Effect .CreateEffect (c )
7+ e1 :SetDescription (aux .Stringid (id ,0 ))
8+ e1 :SetCategory (CATEGORY_DESTROY + CATEGORY_ATKCHANGE )
9+ e1 :SetType (EFFECT_TYPE_IGNITION )
10+ e1 :SetRange (LOCATION_MZONE )
11+ e1 :SetCountLimit (1 )
12+ e1 :SetCondition (s .condition )
13+ e1 :SetCost (s .cost )
14+ e1 :SetTarget (s .target )
15+ e1 :SetOperation (s .operation )
16+ c :RegisterEffect (e1 )
17+ end
18+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
19+ local c = e :GetHandler ()
20+ return c :IsSummonPhaseMain () and c :IsStatus (STATUS_SUMMON_TURN + STATUS_SPSUMMON_TURN )
21+ end
22+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
23+ if chk == 0 then return Duel .CheckLPCost (tp ,500 ) end
24+ end
25+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
26+ local cg = Duel .GetMatchingGroup (s .tdfilter ,tp ,LOCATION_GRAVE ,0 ,nil )
27+ if chk == 0 then return aux .SelectUnselectGroup (cg ,e ,tp ,1 ,5 ,s .rescon ,0 ) end
28+ Duel .SetOperationInfo (0 ,CATEGORY_TODECK ,nil ,1 ,tp ,LOCATION_GRAVE )
29+ end
30+ function s .tdfilter (c )
31+ return (c :IsCode (id ) or c :IsMonster ()) and c :IsAbleToDeck ()
32+ end
33+ function s .rescon (sg ,e ,tp ,mg )
34+ return (# sg == 1 and sg :IsExists (Card .IsCode ,1 ,nil ,id )) or sg :IsExists (Card .IsMonster ,5 ,nil )
35+ end
36+ function s .filter (c )
37+ return c :IsFaceup () and c :IsNotMaximumModeSide ()
38+ end
39+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
40+ local c = e :GetHandler ()
41+ -- Requirement
42+ Duel .PayLPCost (tp ,500 )
43+ -- Effect
44+ local cg = Duel .GetMatchingGroup (s .tdfilter ,tp ,LOCATION_GRAVE ,0 ,nil )
45+ local g = aux .SelectUnselectGroup (cg ,e ,tp ,1 ,5 ,s .rescon ,1 ,tp ,HINTMSG_TODECK ,s .rescon )
46+ Duel .HintSelection (g )
47+ if Duel .SendtoDeck (g ,nil ,SEQ_DECKSHUFFLE ,REASON_COST )< 1 then return end
48+ local g2 = Duel .SelectMatchingCard (tp ,s .filter ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil )
49+ if # g2 > 0 and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
50+ Duel .HintSelection (g )
51+ for tc in g :Iter () do
52+ local e1 = Effect .CreateEffect (c )
53+ e1 :SetType (EFFECT_TYPE_SINGLE )
54+ e1 :SetCode (EFFECT_UPDATE_ATTACK )
55+ e1 :SetValue (- 1500 )
56+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
57+ tc :RegisterEffect (e1 )
58+ local e2 = e1 :Clone ()
59+ e2 :SetCode (EFFECT_UPDATE_DEFENSE )
60+ tc :RegisterEffect (e2 )
61+ end
62+ end
63+ local e1 = Effect .CreateEffect (c )
64+ e1 :SetDescription (aux .Stringid (id ,1 ))
65+ e1 :SetType (EFFECT_TYPE_FIELD )
66+ e1 :SetCode (EFFECT_CANNOT_ACTIVATE )
67+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
68+ e1 :SetTargetRange (1 ,0 )
69+ e1 :SetValue (s .aclimit )
70+ e1 :SetReset (RESET_PHASE |PHASE_END )
71+ Duel .RegisterEffect (e1 ,tp )
72+ end
73+ function s .aclimit (e ,re ,tp )
74+ return re :GetHandler ():IsCode (id )
75+ end
0 commit comments