1+ -- デス・エンペラー・デーモン
2+ -- Doom Emperor Archfiend
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ Pendulum .AddProcedure (c )
8+ c :AddMustBeRitualSummoned ()
9+ -- Destroy both this card and 1 other face-up Spell/Trap on the field
10+ local e1 = Effect .CreateEffect (c )
11+ e1 :SetDescription (aux .Stringid (id ,0 ))
12+ e1 :SetCategory (CATEGORY_DESTROY )
13+ e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
14+ e1 :SetType (EFFECT_TYPE_IGNITION )
15+ e1 :SetRange (LOCATION_PZONE )
16+ e1 :SetCountLimit (1 ,id )
17+ e1 :SetTarget (s .destg )
18+ e1 :SetOperation (s .desop )
19+ c :RegisterEffect (e1 )
20+ -- Unaffected by other monsters' effects while in the Extra Monster Zone
21+ local e2 = Effect .CreateEffect (c )
22+ e2 :SetType (EFFECT_TYPE_SINGLE )
23+ e2 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
24+ e2 :SetCode (EFFECT_IMMUNE_EFFECT )
25+ e2 :SetRange (LOCATION_EMZONE )
26+ e2 :SetValue (function (e ,te ) return te :IsMonsterEffect () and te :GetOwner ()~= e :GetOwner () end )
27+ c :RegisterEffect (e2 )
28+ -- Banish all monsters on the field, except those in the Extra Monster Zone
29+ local e3 = Effect .CreateEffect (c )
30+ e3 :SetDescription (aux .Stringid (id ,1 ))
31+ e3 :SetCategory (CATEGORY_REMOVE )
32+ e3 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
33+ e3 :SetProperty (EFFECT_FLAG_DELAY )
34+ e3 :SetCode (EVENT_SPSUMMON_SUCCESS )
35+ e3 :SetCountLimit (1 ,{id ,1 })
36+ e3 :SetCondition (function (e ) local c = e :GetHandler () return c :IsRitualSummoned () and c :IsSummonLocation (LOCATION_EXTRA ) end )
37+ e3 :SetTarget (s .rmtg )
38+ e3 :SetOperation (s .rmop )
39+ c :RegisterEffect (e3 )
40+ -- Special Summon 1 Fiend monster from your hand, Deck, GY, or banishment
41+ local e4 = Effect .CreateEffect (c )
42+ e4 :SetDescription (aux .Stringid (id ,2 ))
43+ e4 :SetCategory (CATEGORY_SPECIAL_SUMMON )
44+ e4 :SetType (EFFECT_TYPE_IGNITION )
45+ e4 :SetRange (LOCATION_EMZONE )
46+ e4 :SetCountLimit (1 ,{id ,2 })
47+ e4 :SetTarget (s .sptg )
48+ e4 :SetOperation (s .spop )
49+ c :RegisterEffect (e4 )
50+ end
51+ s .listed_names = {101303059 } -- "Throne of Archfiends"
52+ function s .destg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
53+ local c = e :GetHandler ()
54+ if chkc then return c :IsOnField () and c :IsSpellTrap () and c :IsFaceup () and chkc ~= c end
55+ if chk == 0 then return Duel .IsExistingTarget (aux .FaceupFilter (Card .IsSpellTrap ),tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,c ) end
56+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESTROY )
57+ local g = Duel .SelectTarget (tp ,aux .FaceupFilter (Card .IsSpellTrap ),tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,1 ,c )
58+ Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,g + c ,2 ,tp ,0 )
59+ end
60+ function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
61+ local c = e :GetHandler ()
62+ local tc = Duel .GetFirstTarget ()
63+ if c :IsRelateToEffect (e ) and tc :IsRelateToEffect (e ) then
64+ Duel .Destroy (Group .FromCards (c ,tc ),REASON_EFFECT )
65+ end
66+ end
67+ function s .rmtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
68+ if chk == 0 then return Duel .IsExistingMatchingCard (Card .IsAbleToRemove ,tp ,LOCATION_MMZONE ,LOCATION_MMZONE ,1 ,nil ) end
69+ Duel .SetOperationInfo (0 ,CATEGORY_REMOVE ,nil ,1 ,PLAYER_ALL ,LOCATION_MMZONE )
70+ end
71+ function s .rmop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
72+ local g = Duel .GetFieldGroup (tp ,LOCATION_MMZONE ,LOCATION_MMZONE )
73+ if # g > 0 then
74+ Duel .Remove (g ,POS_FACEUP ,REASON_EFFECT )
75+ end
76+ end
77+ function s .spfilter (c ,e ,tp )
78+ return c :IsRace (RACE_FIEND ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
79+ end
80+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
81+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
82+ and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_GRAVE |LOCATION_REMOVED ,0 ,1 ,nil ,e ,tp ) end
83+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_GRAVE |LOCATION_REMOVED )
84+ end
85+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
86+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )<= 0 then return end
87+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
88+ local g = Duel .SelectMatchingCard (tp ,s .spfilter ,tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_GRAVE |LOCATION_REMOVED ,0 ,1 ,1 ,nil ,e ,tp )
89+ if # g > 0 then
90+ Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
91+ end
92+ end
0 commit comments