1+ -- 禁じられた聖冠
2+ -- Forbidden Crown
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Apply these effects to 1 face-up monster on the field, until the end of this turn
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_DISABLE )
10+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
11+ e1 :SetCode (EVENT_FREE_CHAIN )
12+ e1 :SetCountLimit (1 ,id ,EFFECT_COUNT_CODE_OATH )
13+ e1 :SetTarget (s .target )
14+ e1 :SetOperation (s .activate )
15+ e1 :SetHintTiming (0 ,TIMING_STANDBY_PHASE |TIMING_MAIN_END |TIMINGS_CHECK_MONSTER_E )
16+ c :RegisterEffect (e1 )
17+ end
18+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
19+ if chk == 0 then return Duel .IsExistingMatchingCard (aux .FaceupFilter (aux .NOT (Card .HasFlagEffect ),id ),tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,nil ) end
20+ Duel .SetChainLimit (function (te ) return not te :IsMonsterEffect () end )
21+ Duel .SetOperationInfo (0 ,CATEGORY_DISABLE ,nil ,1 ,PLAYER_EITHER ,LOCATION_MZONE )
22+ end
23+ function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
24+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_APPLYTO )
25+ local sc = Duel .SelectMatchingCard (tp ,aux .FaceupFilter (aux .NOT (Card .HasFlagEffect ),id ),tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,1 ,nil ):GetFirst ()
26+ if sc then
27+ Duel .HintSelection (sc )
28+ local c = e :GetHandler ()
29+ sc :RegisterFlagEffect (id ,RESETS_STANDARD_PHASE_END ,EFFECT_FLAG_CLIENT_HINT ,1 ,0 ,aux .Stringid (id ,1 ))
30+ -- Its effects are negated
31+ sc :NegateEffects (c ,RESETS_STANDARD_PHASE_END )
32+ -- It cannot attack
33+ local e1 = Effect .CreateEffect (c )
34+ e1 :SetType (EFFECT_TYPE_SINGLE )
35+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
36+ e1 :SetCode (EFFECT_CANNOT_ATTACK )
37+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
38+ sc :RegisterEffect (e1 )
39+ -- It cannot be destroyed by battle or card effects
40+ local e2 = e1 :Clone ()
41+ e2 :SetCode (EFFECT_INDESTRUCTABLE_BATTLE )
42+ e2 :SetValue (1 )
43+ sc :RegisterEffect (e2 )
44+ local e3 = e2 :Clone ()
45+ e3 :SetCode (EFFECT_INDESTRUCTABLE_EFFECT )
46+ sc :RegisterEffect (e3 )
47+ -- It is unaffected by other cards' activated effects, except its own
48+ local e4 = e1 :Clone ()
49+ e4 :SetCode (EFFECT_IMMUNE_EFFECT )
50+ e4 :SetValue (function (e ,re ) return re :IsActivated () and e :GetHandler ()~= re :GetOwner () end )
51+ sc :RegisterEffect (e4 )
52+ -- It cannot be Tributed
53+ local e5 = e2 :Clone ()
54+ e5 :SetCode (EFFECT_UNRELEASABLE_SUM )
55+ sc :RegisterEffect (e5 )
56+ local e6 = e2 :Clone ()
57+ e6 :SetCode (EFFECT_UNRELEASABLE_NONSUM )
58+ sc :RegisterEffect (e6 )
59+ -- It cannot be used as material for a Fusion, Synchro, Xyz, or Link Summon
60+ local e7 = e1 :Clone ()
61+ e7 :SetCode (EFFECT_CANNOT_BE_MATERIAL )
62+ e7 :SetValue (aux .cannotmatfilter (SUMMON_TYPE_FUSION ,SUMMON_TYPE_SYNCHRO ,SUMMON_TYPE_XYZ ,SUMMON_TYPE_LINK ))
63+ sc :RegisterEffect (e7 )
64+ end
65+ end
0 commit comments