1+ -- Japanese name
2+ -- Ame no Murakumo no Mitsurugi
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- Destroy all monsters your opponent controls
8+ local e1 = Effect .CreateEffect (c )
9+ e1 :SetDescription (aux .Stringid (id ,0 ))
10+ e1 :SetCategory (CATEGORY_DESTROY )
11+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
12+ e1 :SetProperty (EFFECT_FLAG_DELAY )
13+ e1 :SetCode (EVENT_SPSUMMON_SUCCESS )
14+ e1 :SetCountLimit (1 ,id )
15+ e1 :SetTarget (s .destg )
16+ e1 :SetOperation (s .desop )
17+ c :RegisterEffect (e1 )
18+ -- Negate an opponent's activated effect
19+ local e2 = Effect .CreateEffect (c )
20+ e2 :SetDescription (aux .Stringid (id ,1 ))
21+ e2 :SetCategory (CATEGORY_DISABLE + CATEGORY_HANDES )
22+ e2 :SetType (EFFECT_TYPE_QUICK_O )
23+ e2 :SetCode (EVENT_CHAINING )
24+ e2 :SetRange (LOCATION_MZONE )
25+ e2 :SetCountLimit (1 ,{id ,1 })
26+ e2 :SetCondition (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ) return rp == 1 - tp and (Duel .IsExistingMatchingCard (Card .IsDiscardable ,tp ,0 ,LOCATION_HAND ,1 ,nil ,REASON_EFFECT ,1 - tp ) or Duel .IsChainDisablable (ev )) end )
27+ e2 :SetTarget (s .distg )
28+ e2 :SetOperation (s .disop )
29+ c :RegisterEffect (e2 )
30+ -- Add 1 "Mitsurugi" card from your Deck to your hand then you can Special Summon this card
31+ local e3 = Effect .CreateEffect (c )
32+ e3 :SetDescription (aux .Stringid (id ,2 ))
33+ e3 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH + CATEGORY_SPECIAL_SUMMON )
34+ e3 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
35+ e3 :SetProperty (EFFECT_FLAG_DELAY )
36+ e3 :SetCode (EVENT_RELEASE )
37+ e3 :SetCountLimit (1 ,{id ,2 })
38+ e3 :SetTarget (s .thtg )
39+ e3 :SetOperation (s .thop )
40+ c :RegisterEffect (e3 )
41+ end
42+ s .listed_series = {SET_MITSURUGI }
43+ s .listed_names = {id ,101207095 } -- "Mitsurugi Ritual"
44+ function s .destg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
45+ local g = Duel .GetMatchingGroup (nil ,tp ,0 ,LOCATION_MZONE ,nil )
46+ if chk == 0 then return # g > 0 end
47+ Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,g ,# g ,tp ,0 )
48+ end
49+ function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
50+ local g = Duel .GetMatchingGroup (nil ,tp ,0 ,LOCATION_MZONE ,nil )
51+ if # g > 0 then
52+ Duel .Destroy (g ,REASON_EFFECT )
53+ end
54+ end
55+ function s .distg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
56+ if chk == 0 then return true end
57+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_DISABLE ,eg ,1 ,0 ,0 )
58+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_HANDES ,nil ,1 ,1 - tp ,1 )
59+ end
60+ function s .disop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
61+ local b1 = Duel .IsExistingMatchingCard (Card .IsDiscardable ,tp ,0 ,LOCATION_HAND ,1 ,nil ,REASON_EFFECT ,1 - tp )
62+ local b2 = Duel .IsChainDisablable (ev )
63+ local op = nil
64+ if b1 and b2 then
65+ op = Duel .SelectEffect (1 - tp ,
66+ {b1 ,aux .Stringid (id ,3 )},
67+ {b2 ,aux .Stringid (id ,4 )})
68+ else
69+ op = (b1 and 1 ) or (b2 and 2 )
70+ end
71+ if op == 1 then
72+ Duel .DiscardHand (1 - tp ,nil ,1 ,1 ,REASON_EFFECT |REASON_DISCARD ,nil )
73+ elseif op == 2 then
74+ Duel .NegateEffect (ev )
75+ end
76+ end
77+ function s .thfilter (c )
78+ return c :IsSetCard (SET_MITSURUGI ) and c :IsAbleToHand () and not c :IsCode (id )
79+ end
80+ function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
81+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
82+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
83+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,e :GetHandler (),1 ,tp ,0 )
84+ end
85+ function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
86+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
87+ local g = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil )
88+ if # g == 0 or Duel .SendtoHand (g ,nil ,REASON_EFFECT )== 0 then return end
89+ Duel .ConfirmCards (1 - tp ,g )
90+ local c = e :GetHandler ()
91+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 and c :IsRelateToEffect (e ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
92+ and Duel .SelectYesNo (tp ,aux .Stringid (id ,5 )) then
93+ Duel .BreakEffect ()
94+ Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
95+ end
96+ end
0 commit comments