1+ -- 天羽々斬之巳剣
2+ -- Ame no Habakiri no Mitsurugi
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- Monsters your opponent controls lose 800 ATK
8+ local e1 = Effect .CreateEffect (c )
9+ e1 :SetType (EFFECT_TYPE_FIELD )
10+ e1 :SetCode (EFFECT_UPDATE_ATTACK )
11+ e1 :SetRange (LOCATION_MZONE )
12+ e1 :SetTargetRange (0 ,LOCATION_MZONE )
13+ e1 :SetValue (- 800 )
14+ c :RegisterEffect (e1 )
15+ -- Special Summon 1 "Mitsurugi" monster from your Deck, then Tribute 1 monster you control
16+ local e2 = Effect .CreateEffect (c )
17+ e2 :SetDescription (aux .Stringid (id ,0 ))
18+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_RELEASE )
19+ e2 :SetType (EFFECT_TYPE_IGNITION )
20+ e2 :SetRange (LOCATION_HAND )
21+ e2 :SetCountLimit (1 ,id ,EFFECT_COUNT_CODE_DUEL )
22+ e2 :SetCost (Cost .SelfReveal )
23+ e2 :SetTarget (s .sptg )
24+ e2 :SetOperation (s .spop )
25+ c :RegisterEffect (e2 )
26+ -- Add 1 "Mitsurugi" card from your Deck to your hand then you can Special Summon this card
27+ local e3 = Effect .CreateEffect (c )
28+ e3 :SetDescription (aux .Stringid (id ,1 ))
29+ e3 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH + CATEGORY_SPECIAL_SUMMON )
30+ e3 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
31+ e3 :SetProperty (EFFECT_FLAG_DELAY )
32+ e3 :SetCode (EVENT_RELEASE )
33+ e3 :SetCountLimit (1 ,{id ,1 })
34+ e3 :SetTarget (s .thtg )
35+ e3 :SetOperation (s .thop )
36+ c :RegisterEffect (e3 )
37+ end
38+ s .listed_series = {SET_MITSURUGI }
39+ s .listed_names = {id ,81560239 } -- "Mitsurugi Ritual"
40+ function s .spfilter (c ,e ,tp )
41+ return c :IsSetCard (SET_MITSURUGI ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
42+ end
43+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
44+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 and Duel .IsPlayerCanRelease (tp )
45+ and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ,e ,tp ) end
46+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_DECK )
47+ Duel .SetOperationInfo (0 ,CATEGORY_RELEASE ,nil ,1 ,tp ,LOCATION_MZONE )
48+ end
49+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
50+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )<= 0 then return end
51+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
52+ local sg = Duel .SelectMatchingCard (tp ,s .spfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ,e ,tp )
53+ if # sg > 0 and Duel .SpecialSummon (sg ,0 ,tp ,tp ,false ,false ,POS_FACEUP )> 0 then
54+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RELEASE )
55+ local rg = Duel .SelectMatchingCard (tp ,Card .IsReleasableByEffect ,tp ,LOCATION_MZONE ,0 ,1 ,1 ,nil )
56+ if # rg > 0 then
57+ Duel .HintSelection (rg )
58+ Duel .BreakEffect ()
59+ Duel .Release (rg ,REASON_EFFECT )
60+ end
61+ end
62+ end
63+ function s .thfilter (c )
64+ return c :IsSetCard (SET_MITSURUGI ) and c :IsAbleToHand () and not c :IsCode (id )
65+ end
66+ function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
67+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
68+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
69+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,e :GetHandler (),1 ,tp ,0 )
70+ end
71+ function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
72+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
73+ local g = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil )
74+ if # g == 0 or Duel .SendtoHand (g ,nil ,REASON_EFFECT )== 0 then return end
75+ Duel .ConfirmCards (1 - tp ,g )
76+ local c = e :GetHandler ()
77+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 and c :IsRelateToEffect (e ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
78+ and Duel .SelectYesNo (tp ,aux .Stringid (id ,2 )) then
79+ Duel .BreakEffect ()
80+ Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
81+ end
82+ end
0 commit comments