1+ -- 破滅と終焉の支配者
2+ -- End of the World Ruler
3+ -- Scripted by The Razgriz
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- This card's name becomes "Demise, King of Armageddon" while in the hand or field
8+ local e1 = Effect .CreateEffect (c )
9+ e1 :SetType (EFFECT_TYPE_SINGLE )
10+ e1 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
11+ e1 :SetCode (EFFECT_CHANGE_CODE )
12+ e1 :SetRange (LOCATION_HAND |LOCATION_MZONE )
13+ e1 :SetValue (72426662 )
14+ c :RegisterEffect (e1 )
15+ -- Apply the effect of a Ritual Spell that Ritual Summons
16+ local e2 = Effect .CreateEffect (c )
17+ e2 :SetDescription (aux .Stringid (id ,0 ))
18+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
19+ e2 :SetType (EFFECT_TYPE_IGNITION )
20+ e2 :SetRange (LOCATION_HAND )
21+ e2 :SetCountLimit (1 ,id )
22+ e2 :SetCost (Cost .AND (Cost .SelfReveal ,Cost .PayLP (2000 ),s .applycost ))
23+ e2 :SetTarget (s .applytg )
24+ e2 :SetOperation (s .applyop )
25+ c :RegisterEffect (e2 )
26+ -- Destroy as many other cards on the field as possible, then this card gains 2900 ATK
27+ local e3 = Effect .CreateEffect (c )
28+ e3 :SetDescription (aux .Stringid (id ,1 ))
29+ e3 :SetCategory (CATEGORY_DESTROY + CATEGORY_ATKCHANGE )
30+ e3 :SetType (EFFECT_TYPE_IGNITION )
31+ e3 :SetRange (LOCATION_MZONE )
32+ e3 :SetCountLimit (1 ,{id ,1 })
33+ e3 :SetCost (Cost .PayLP (2000 ))
34+ e3 :SetTarget (s .destg )
35+ e3 :SetOperation (s .desop )
36+ c :RegisterEffect (e3 )
37+ end
38+ s .listed_series = {SET_END_OF_THE_WORLD }
39+ s .listed_names = {72426662 } -- "Demise, King of Armageddon"
40+ function s .applyfilter (c )
41+ return c :IsRitualSpell () and c :IsAbleToRemoveAsCost () and c :CheckActivateEffect (true ,true ,false )~= nil
42+ end
43+ function s .applycost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
44+ if chk == 0 then return Duel .IsExistingMatchingCard (s .applyfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
45+ end
46+ function s .applytg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
47+ if chkc then
48+ local te = e :GetLabelObject ()
49+ return tg and tg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 ,chkc )
50+ end
51+ if chk == 0 then return Duel .IsExistingMatchingCard (s .applyfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
52+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_REMOVE )
53+ local g = Duel .SelectMatchingCard (tp ,s .applyfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil )
54+ Duel .Remove (g ,POS_FACEUP ,REASON_COST )
55+ local te = g :GetFirst ():CheckActivateEffect (true ,true ,false )
56+ e :SetLabel (te :GetLabel ())
57+ e :SetLabelObject (te :GetLabelObject ())
58+ local tg = te :GetTarget ()
59+ e :SetProperty (te :GetProperty ())
60+ if tg then
61+ tg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,1 )
62+ end
63+ te :SetLabel (e :GetLabel ())
64+ te :SetLabelObject (e :GetLabelObject ())
65+ e :SetLabelObject (te )
66+ Duel .ClearOperationInfo (0 )
67+ end
68+ function s .applyop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
69+ local te = e :GetLabelObject ()
70+ if te then
71+ e :SetLabel (te :GetLabel ())
72+ e :SetLabelObject (te :GetLabelObject ())
73+ local op = te :GetOperation ()
74+ if op then op (e ,tp ,eg ,ep ,ev ,re ,r ,rp ) end
75+ te :SetLabel (e :GetLabel ())
76+ te :SetLabelObject (e :GetLabelObject ())
77+ end
78+ end
79+ function s .destg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
80+ local g = Duel .GetMatchingGroup (nil ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,e :GetHandler ())
81+ if chk == 0 then return # g > 0 end
82+ Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,g ,# g ,tp ,0 )
83+ end
84+ function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
85+ local c = e :GetHandler ()
86+ local exc = c :IsRelateToEffect (e ) and c or nil
87+ local g = Duel .GetMatchingGroup (nil ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,exc )
88+ if # g > 0 and Duel .Destroy (g ,REASON_EFFECT )> 0 and c :IsRelateToEffect (e ) and c :IsFaceup () then
89+ Duel .BreakEffect ()
90+ -- This card gains 2900 ATK
91+ c :UpdateAttack (2900 )
92+ end
93+ end
0 commit comments