1+ -- 召喚獣マギストス・セリオン
2+ -- Invoked Magistus Omega
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- Fusion Materials: "Aleister the Invoker" + 1 Fusion, Synchro, Xyz, or Link Monster
8+ Fusion .AddProcMix (c ,true ,true ,86120751 ,aux .FilterBoolFunctionEx (Card .IsType ,TYPE_EXTRA ))
9+ -- Banish 1 Fusion, Synchro, Xyz, or Link Monster from your GY and 1 monster on the field
10+ local e1 = Effect .CreateEffect (c )
11+ e1 :SetDescription (aux .Stringid (id ,0 ))
12+ e1 :SetCategory (CATEGORY_REMOVE )
13+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
14+ e1 :SetProperty (EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY )
15+ e1 :SetCode (EVENT_SPSUMMON_SUCCESS )
16+ e1 :SetCountLimit (1 ,id )
17+ e1 :SetTarget (s .rmtg )
18+ e1 :SetOperation (s .rmop )
19+ c :RegisterEffect (e1 )
20+ -- Special Summon 1 Level 4 Spellcaster monster from your Deck, then you can equip this card to it
21+ local e2 = Effect .CreateEffect (c )
22+ e2 :SetDescription (aux .Stringid (id ,1 ))
23+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_EQUIP )
24+ e2 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
25+ e2 :SetProperty (EFFECT_FLAG_DELAY )
26+ e2 :SetCode (EVENT_DESTROYED )
27+ e2 :SetCountLimit (1 ,{id ,1 })
28+ e2 :SetCondition (s .spcon )
29+ e2 :SetTarget (s .sptg )
30+ e2 :SetOperation (s .spop )
31+ c :RegisterEffect (e2 )
32+ end
33+ s .listed_names = {86120751 } -- "Aleister the Invoker"
34+ s .miracle_synchro_fusion = true
35+ function s .rmfilter (c ,e )
36+ return c :IsCanBeEffectTarget (e ) and c :IsAbleToRemove () and (c :IsType (TYPE_EXTRA ) or c :IsLocation (LOCATION_MZONE ))
37+ end
38+ function s .rmrescon (sg ,e ,tp ,mg )
39+ return sg :FilterCount (Card .IsLocation ,nil ,LOCATION_GRAVE )== 1
40+ end
41+ function s .rmtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
42+ if chkc then return false end
43+ local g = Duel .GetMatchingGroup (s .rmfilter ,tp ,LOCATION_GRAVE |LOCATION_MZONE ,LOCATION_MZONE ,nil ,e )
44+ if chk == 0 then return aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,s .rmrescon ,0 ) end
45+ local sg = aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,s .rmrescon ,1 ,tp ,HINTMSG_REMOVE )
46+ Duel .SetTargetCard (sg )
47+ Duel .SetOperationInfo (0 ,CATEGORY_REMOVE ,sg ,2 ,tp ,0 )
48+ end
49+ function s .rmop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
50+ local tg = Duel .GetTargetCards (e ):Match (Card .IsMonster ,nil )
51+ if # tg > 0 then
52+ Duel .Remove (tg ,POS_FACEUP ,REASON_EFFECT )
53+ end
54+ end
55+ function s .spcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
56+ local c = e :GetHandler ()
57+ return c :IsFusionSummoned () and c :IsReason (REASON_BATTLE |REASON_EFFECT ) and c :IsPreviousLocation (LOCATION_MZONE )
58+ end
59+ function s .spfilter (c ,e ,tp )
60+ return c :IsLevel (4 ) and c :IsRace (RACE_SPELLCASTER ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
61+ end
62+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
63+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
64+ and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ,e ,tp ) end
65+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_DECK )
66+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_EQUIP ,e :GetHandler (),1 ,tp ,0 )
67+ end
68+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
69+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )< 1 then return end
70+ local c = e :GetHandler ()
71+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
72+ local sc = Duel .SelectMatchingCard (tp ,s .spfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ,e ,tp ):GetFirst ()
73+ if sc and Duel .SpecialSummon (sc ,0 ,tp ,tp ,false ,false ,POS_FACEUP )> 0
74+ and c :IsRelateToEffect (e ) and Duel .GetLocationCount (tp ,LOCATION_SZONE )> 0
75+ and Duel .SelectYesNo (tp ,aux .Stringid (id ,2 )) then
76+ Duel .BreakEffect ()
77+ if Duel .Equip (tp ,c ,sc ) then
78+ -- Equip limit registration
79+ local e0 = Effect .CreateEffect (c )
80+ e0 :SetType (EFFECT_TYPE_SINGLE )
81+ e0 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
82+ e0 :SetCode (EFFECT_EQUIP_LIMIT )
83+ e0 :SetValue (function (e ,c ) return c == sc end )
84+ e0 :SetReset (RESET_EVENT |RESETS_STANDARD )
85+ c :RegisterEffect (e0 )
86+ -- The equipped monster gains 1000 ATK
87+ local e1 = Effect .CreateEffect (c )
88+ e1 :SetType (EFFECT_TYPE_EQUIP )
89+ e1 :SetCode (EFFECT_UPDATE_ATTACK )
90+ e1 :SetValue (1000 )
91+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD )
92+ c :RegisterEffect (e1 )
93+ end
94+ end
95+ end
0 commit comments