1+ -- なほいとをかしまいひめ
2+ -- Ever-Grace Princess Mai
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Ritual
7+ c :EnableReviveLimit ()
8+ -- This card cannot be destroyed by card effects
9+ local e1 = Effect .CreateEffect (c )
10+ e1 :SetDescription (aux .Stringid (id ,0 ))
11+ e1 :SetCategory (CATEGORY_DESTROY )
12+ e1 :SetType (EFFECT_TYPE_IGNITION )
13+ e1 :SetRange (LOCATION_MZONE )
14+ e1 :SetCountLimit (1 )
15+ e1 :SetCondition (function (e ) return e :GetHandler ():IsStatus (STATUS_SPSUMMON_TURN ) end )
16+ e1 :SetCost (s .cost )
17+ e1 :SetTarget (s .target )
18+ e1 :SetOperation (s .operation )
19+ c :RegisterEffect (e1 )
20+ end
21+ s .listed_names = {160004013 }
22+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
23+ if chk == 0 then return Duel .IsPlayerCanDiscardDeckAsCost (tp ,1 ) end
24+ end
25+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
26+ if chk == 0 then return true end
27+ local g = Duel .GetMatchingGroup (nil ,tp ,0 ,LOCATION_ONFIELD ,nil )
28+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_DESTROY ,g ,1 ,0 ,0 )
29+ end
30+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
31+ local c = e :GetHandler ()
32+ -- Requirement
33+ if Duel .DiscardDeck (tp ,1 ,REASON_COST )< 1 then return end
34+ -- Effect
35+ local e1 = Effect .CreateEffect (c )
36+ e1 :SetType (EFFECT_TYPE_SINGLE )
37+ e1 :SetCode (EFFECT_INDESTRUCTABLE_EFFECT )
38+ e1 :SetDescription (3001 )
39+ e1 :SetProperty (EFFECT_FLAG_SINGLE_RANGE |EFFECT_FLAG_CANNOT_DISABLE |EFFECT_FLAG_CLIENT_HINT )
40+ e1 :SetRange (LOCATION_MZONE )
41+ e1 :SetReset (RESETS_STANDARD_PHASE_END ,2 )
42+ e1 :SetValue (1 )
43+ c :RegisterEffect (e1 )
44+ local sg = Duel .GetMatchingGroup (aux .FilterMaximumSideFunctionEx (Card .IsMonster ),tp ,0 ,LOCATION_MZONE ,nil )
45+ if Duel .IsExistingMatchingCard (Card .IsCode ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,160004013 ) and # sg > 0 and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
46+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESTROY )
47+ local tg = Duel .SelectMatchingCard (tp ,aux .FilterMaximumSideFunctionEx (Card .IsMonster ),tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil )
48+ local tg2 = tg :AddMaximumCheck ()
49+ Duel .HintSelection (tg2 )
50+ if Duel .Destroy (tg ,REASON_EFFECT )> 0 then
51+ -- Cannot attack directly
52+ local e2 = Effect .CreateEffect (c )
53+ e2 :SetDescription (3207 )
54+ e2 :SetType (EFFECT_TYPE_SINGLE )
55+ e2 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CLIENT_HINT )
56+ e2 :SetCode (EFFECT_CANNOT_DIRECT_ATTACK )
57+ e2 :SetReset (RESETS_STANDARD_PHASE_END )
58+ c :RegisterEffect (e2 )
59+ end
60+ end
61+ end
0 commit comments