1+ -- 神風のドラグニティ
2+ -- Dragunity Divine Wind
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ local CARD_DRAGON_RAVINE = 62265044
6+ function s .initial_effect (c )
7+ -- Activate
8+ local e0 = Effect .CreateEffect (c )
9+ e0 :SetType (EFFECT_TYPE_ACTIVATE )
10+ e0 :SetCode (EVENT_FREE_CHAIN )
11+ c :RegisterEffect (e0 )
12+ -- Apply 1 of these effects, or if "Dragon Ravine" is in your GY, you can apply any of them, in sequence
13+ local e1 = Effect .CreateEffect (c )
14+ e1 :SetDescription (aux .Stringid (id ,0 ))
15+ e1 :SetCategory (CATEGORY_TOHAND + CATEGORY_SPECIAL_SUMMON + CATEGORY_EQUIP )
16+ e1 :SetType (EFFECT_TYPE_IGNITION )
17+ e1 :SetRange (LOCATION_FZONE )
18+ e1 :SetCountLimit (1 ,id )
19+ e1 :SetTarget (s .efftg )
20+ e1 :SetOperation (s .effop )
21+ c :RegisterEffect (e1 )
22+ end
23+ s .listed_names = {CARD_DRAGON_RAVINE }
24+ s .listed_series = {SET_DRAGUNITY }
25+ function s .thfilter (c )
26+ return c :IsRace (RACE_DRAGON |RACE_WINGEDBEAST ) and c :IsAbleToHand ()
27+ end
28+ function s .spfilter (c ,e ,tp )
29+ return c :IsSetCard (SET_DRAGUNITY ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
30+ end
31+ function s .efftg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
32+ if chk == 0 then
33+ local b1 = Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil )
34+ local b2 = Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
35+ and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_HAND ,0 ,1 ,nil ,e ,tp )
36+ return b1 or b2
37+ end
38+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_GRAVE )
39+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_HAND )
40+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_EQUIP ,nil ,1 ,tp ,LOCATION_DECK )
41+ end
42+ function s .eqfilter (c ,tp )
43+ return c :IsRace (RACE_DRAGON ) and c :IsSetCard (SET_DRAGUNITY ) and c :CheckUniqueOnField (tp ) and not c :IsForbidden ()
44+ end
45+ function s .effop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
46+ local b1 = Duel .IsExistingMatchingCard (aux .NecroValleyFilter (s .thfilter ),tp ,LOCATION_GRAVE ,0 ,1 ,nil )
47+ local b2 = Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
48+ and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_HAND ,0 ,1 ,nil ,e ,tp )
49+ local ravine_chk = Duel .IsExistingMatchingCard (Card .IsCode ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,CARD_DRAGON_RAVINE )
50+ local op = nil
51+ if not ravine_chk then
52+ op = Duel .SelectEffect (tp ,
53+ {b1 ,aux .Stringid (id ,1 )},
54+ {b2 ,aux .Stringid (id ,2 )})
55+ end
56+ local breakeffect = false
57+ if (op and op == 1 ) or (ravine_chk and b1 and (not b2 or Duel .SelectYesNo (tp ,aux .Stringid (id ,3 )))) then
58+ -- Add 1 Dragon or Winged Beast monster from your GY to your hand
59+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
60+ local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .thfilter ),tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil )
61+ if # g > 0 then
62+ Duel .HintSelection (g )
63+ Duel .SendtoHand (g ,nil ,REASON_EFFECT )
64+ Duel .ShuffleHand (tp )
65+ b2 = Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
66+ and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_HAND ,0 ,1 ,nil ,e ,tp )
67+ end
68+ breakeffect = true
69+ end
70+ if (op and op == 2 ) or (ravine_chk and b2 and (not breakeffect or Duel .SelectYesNo (tp ,aux .Stringid (id ,4 )))) then
71+ -- Special Summon 1 "Dragunity" monster from your hand, then you can equip 1 Dragon "Dragunity" monster from your Deck to it as an Equip Spell
72+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )<= 0 then return end
73+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
74+ local sc = Duel .SelectMatchingCard (tp ,s .spfilter ,tp ,LOCATION_HAND ,0 ,1 ,1 ,nil ,e ,tp ):GetFirst ()
75+ if sc then
76+ if breakeffect then Duel .BreakEffect () end
77+ if Duel .SpecialSummon (sc ,0 ,tp ,tp ,false ,false ,POS_FACEUP )> 0 and Duel .GetLocationCount (tp ,LOCATION_SZONE )> 0
78+ and Duel .IsExistingMatchingCard (s .eqfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ,tp )
79+ and Duel .SelectYesNo (tp ,aux .Stringid (id ,5 )) then
80+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_EQUIP )
81+ local ec = Duel .SelectMatchingCard (tp ,s .eqfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ,tp ):GetFirst ()
82+ if not ec then return end
83+ Duel .BreakEffect ()
84+ if Duel .Equip (tp ,ec ,sc ) then
85+ -- Equip limit
86+ local e0 = Effect .CreateEffect (e :GetHandler ())
87+ e0 :SetType (EFFECT_TYPE_SINGLE )
88+ e0 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
89+ e0 :SetCode (EFFECT_EQUIP_LIMIT )
90+ e0 :SetValue (function (e ,c ) return c == sc end )
91+ e0 :SetReset (RESET_EVENT |RESETS_STANDARD )
92+ ec :RegisterEffect (e0 )
93+ end
94+ end
95+ end
96+ end
97+ end
0 commit comments