1+ -- 黒智天至イリスフィール
2+ -- Cherubidamn Irisfiel
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- Xyz Summon procedure: 2 Level 8 monsters, OR 1 Xyz Monster you control that has not activated its effect in the Monster Zone this turn
8+ Xyz .AddProcedure (c ,nil ,8 ,2 ,s .ovfilter ,aux .Stringid (id ,0 ),2 ,s .xyzop )
9+ -- Keep track of Xyz Monsters that have activated their effect in the Monster Zone each turn
10+ aux .GlobalCheck (s ,function ()
11+ local ge1 = Effect .CreateEffect (c )
12+ ge1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
13+ ge1 :SetCode (EVENT_CHAIN_SOLVED )
14+ ge1 :SetOperation (s .checkop )
15+ Duel .RegisterEffect (ge1 ,0 )
16+ end )
17+ -- If this card is Xyz Summoned: You can activate this effect; this turn, Xyz Monsters you control gain ATK equal to their own Rank x 100 during the Battle Phase only
18+ local e1 = Effect .CreateEffect (c )
19+ e1 :SetDescription (aux .Stringid (id ,1 ))
20+ e1 :SetCategory (CATEGORY_ATKCHANGE )
21+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
22+ e1 :SetProperty (EFFECT_FLAG_DELAY )
23+ e1 :SetCode (EVENT_SPSUMMON_SUCCESS )
24+ e1 :SetCondition (function (e ) return e :GetHandler ():IsXyzSummoned () end )
25+ e1 :SetOperation (s .atkop )
26+ c :RegisterEffect (e1 )
27+ -- If this card would be destroyed by battle or card effect, you can detach 1 material from a monster you control instead
28+ local e2 = Effect .CreateEffect (c )
29+ e2 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS )
30+ e2 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
31+ e2 :SetCode (EFFECT_DESTROY_REPLACE )
32+ e2 :SetRange (LOCATION_MZONE )
33+ e2 :SetCountLimit (1 ,id )
34+ e2 :SetTarget (s .reptg )
35+ c :RegisterEffect (e2 )
36+ end
37+ s .listed_names = {id }
38+ function s .ovfilter (c ,tp ,xyzc )
39+ return c :IsXyzMonster () and not c :HasFlagEffect (id ) and c :IsFaceup ()
40+ end
41+ function s .xyzop (e ,tp ,chk )
42+ if chk == 0 then return not Duel .HasFlagEffect (tp ,id ) end
43+ return Duel .RegisterFlagEffect (tp ,id ,RESET_PHASE |PHASE_END ,EFFECT_FLAG_OATH ,1 )
44+ end
45+ function s .checkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
46+ local rc = re :GetHandler ()
47+ if re :IsMonsterEffect () and rc :IsXyzMonster () and rc :IsRelateToEffect (re )
48+ and Duel .GetChainInfo (ev ,CHAININFO_TRIGGERING_LOCATION )== LOCATION_MZONE then
49+ rc :RegisterFlagEffect (id ,RESETS_STANDARD_PHASE_END ,0 ,1 )
50+ end
51+ end
52+ function s .atkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
53+ local c = e :GetHandler ()
54+ aux .RegisterClientHint (c ,nil ,tp ,1 ,0 ,aux .Stringid (id ,2 ))
55+ -- This turn, Xyz Monsters you control gain ATK equal to their own Rank x 100 during the Battle Phase only
56+ local e1 = Effect .CreateEffect (c )
57+ e1 :SetType (EFFECT_TYPE_FIELD )
58+ e1 :SetCode (EFFECT_UPDATE_ATTACK )
59+ e1 :SetTarget (function (e ,c ) return c :IsXyzMonster () end )
60+ e1 :SetTargetRange (LOCATION_MZONE ,0 )
61+ e1 :SetCondition (function () return Duel .IsBattlePhase () end )
62+ e1 :SetValue (function (e ,c ) return c :GetRank ()* 100 end )
63+ e1 :SetReset (RESET_PHASE |PHASE_END )
64+ Duel .RegisterEffect (e1 ,tp )
65+ end
66+ function s .reptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
67+ local c = e :GetHandler ()
68+ if chk == 0 then return c :IsReason (REASON_BATTLE |REASON_EFFECT ) and not c :IsReason (REASON_REPLACE )
69+ and Duel .CheckRemoveOverlayCard (tp ,1 ,0 ,1 ,REASON_EFFECT ) end
70+ return Duel .SelectEffectYesNo (tp ,c ,96 ) and Duel .RemoveOverlayCard (tp ,1 ,0 ,1 ,1 ,REASON_EFFECT )> 0
71+ end
0 commit comments