1+ -- 絢嵐たる海霊ヴァルルーン
2+ -- Radiant Typhoon Varuroon, the Sea Spirit
3+ -- Scripted by Eerie Code
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- Link Summon procedure: 2 "Radiant Typhoon" monsters
8+ Link .AddProcedure (c ,aux .FilterBoolFunctionEx (Card .IsSetCard ,SET_RADIANT_TYPHOON ),2 )
9+ -- Add 1 "Mystical Space Typhoon" from your Deck or GY to your hand
10+ local e1 = Effect .CreateEffect (c )
11+ e1 :SetDescription (aux .Stringid (id ,0 ))
12+ e1 :SetCategory (CATEGORY_SEARCH + CATEGORY_TOHAND )
13+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
14+ e1 :SetProperty (EFFECT_FLAG_DELAY )
15+ e1 :SetCode (EVENT_SPSUMMON_SUCCESS )
16+ e1 :SetCountLimit (1 ,{id ,0 })
17+ e1 :SetCondition (function (e ) return e :GetHandler ():IsLinkSummoned () end )
18+ e1 :SetTarget (s .thtg )
19+ e1 :SetOperation (s .thop )
20+ c :RegisterEffect (e1 )
21+ -- Place 2 face-up monsters on the field, including a "Radiant Typhoon" monster you control face-up in their owners' Spell & Trap Zones as Continuous Spells
22+ local e2 = Effect .CreateEffect (c )
23+ e2 :SetDescription (aux .Stringid (id ,1 ))
24+ e2 :SetType (EFFECT_TYPE_IGNITION )
25+ e2 :SetProperty (EFFECT_FLAG_CARD_TARGET )
26+ e2 :SetRange (LOCATION_MZONE )
27+ e2 :SetCountLimit (1 ,{id ,1 })
28+ e2 :SetTarget (s .monpltg )
29+ e2 :SetOperation (s .monplop )
30+ c :RegisterEffect (e2 )
31+ -- Place 1 "Radiant Typhoon" Continuous Trap from your Deck or GY face-up on your field
32+ local e3 = Effect .CreateEffect (c )
33+ e3 :SetDescription (aux .Stringid (id ,2 ))
34+ e3 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O )
35+ e3 :SetProperty (EFFECT_FLAG_DELAY )
36+ e3 :SetCode (EVENT_CHAINING )
37+ e3 :SetRange (LOCATION_MZONE )
38+ e3 :SetCountLimit (1 ,{id ,2 })
39+ e3 :SetCondition (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ) return re :IsHasType (EFFECT_TYPE_ACTIVATE ) and re :IsSpellEffect () and re :IsActiveType (TYPE_QUICKPLAY ) end )
40+ e3 :SetTarget (s .trappltg )
41+ e3 :SetOperation (s .trapplop )
42+ c :RegisterEffect (e3 )
43+ end
44+ s .listed_series = {SET_RADIANT_TYPHOON }
45+ s .listed_names = {CARD_MYSTICAL_SPACE_TYPHOON }
46+ function s .thfilter (c )
47+ return c :IsCode (CARD_MYSTICAL_SPACE_TYPHOON ) and c :IsAbleToHand ()
48+ end
49+ function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
50+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_DECK |LOCATION_GRAVE ,0 ,1 ,nil ) end
51+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK |LOCATION_GRAVE )
52+ end
53+ function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
54+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
55+ local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .thfilter ),tp ,LOCATION_DECK |LOCATION_GRAVE ,0 ,1 ,1 ,nil )
56+ if # g > 0 then
57+ Duel .SendtoHand (g ,nil ,REASON_EFFECT )
58+ Duel .ConfirmCards (1 - tp ,g )
59+ end
60+ end
61+ function s .monplfilter (c ,e )
62+ return c :IsFaceup () and not c :IsForbidden () and c :IsCanBeEffectTarget (e )
63+ end
64+ function s .rescon (sg ,e ,tp )
65+ local your_g ,opp_g = sg :Split (Card .IsOwner ,nil ,tp )
66+ return # sg == 2 and # your_g > 0 and your_g :IsExists (Card .IsSetCard ,1 ,nil ,SET_RADIANT_TYPHOON )
67+ and Duel .GetLocationCount (tp ,LOCATION_SZONE )>=# your_g
68+ and Duel .GetLocationCount (1 - tp ,LOCATION_SZONE )>=# opp_g
69+ end
70+ function s .monpltg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
71+ if chkc then return false end
72+ local g = Duel .GetMatchingGroup (s .monplfilter ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,nil ,e )
73+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_SZONE )> 0
74+ and aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,s .rescon ,0 ) end
75+ local tg = aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,s .rescon ,1 ,tp ,HINTMSG_TOFIELD )
76+ Duel .SetTargetCard (tg )
77+ end
78+ function s .monplop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
79+ local c = e :GetHandler ()
80+ local tg = Duel .GetTargetCards (e )
81+ for tc in tg :Iter () do
82+ if not tc :IsImmuneToEffect (e ) then
83+ local owner = tc :GetOwner ()
84+ if Duel .GetLocationCount (owner ,LOCATION_SZONE )<= 0 then
85+ Duel .SendtoGrave (tc ,REASON_RULE ,nil ,PLAYER_NONE )
86+ elseif Duel .MoveToField (tc ,tp ,owner ,LOCATION_SZONE ,POS_FACEUP ,tc :IsMonsterCard ()) then
87+ -- Treated as a Continuous Spell
88+ local e1 = Effect .CreateEffect (c )
89+ e1 :SetType (EFFECT_TYPE_SINGLE )
90+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
91+ e1 :SetCode (EFFECT_CHANGE_TYPE )
92+ e1 :SetValue (TYPE_SPELL |TYPE_CONTINUOUS )
93+ e1 :SetReset (RESET_EVENT |(RESETS_STANDARD &~RESET_TURN_SET ))
94+ tc :RegisterEffect (e1 )
95+ end
96+ end
97+ end
98+ end
99+ function s .trapplfilter (c ,tp )
100+ return c :IsSetCard (SET_RADIANT_TYPHOON ) and c :IsContinuousTrap () and not c :IsForbidden () and c :CheckUniqueOnField (tp )
101+ end
102+ function s .trappltg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
103+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_SZONE )> 0
104+ and Duel .IsExistingMatchingCard (s .trapplfilter ,tp ,LOCATION_DECK |LOCATION_GRAVE ,0 ,1 ,nil ,tp ) end
105+ end
106+ function s .trapplop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
107+ if Duel .GetLocationCount (tp ,LOCATION_SZONE )<= 0 then return end
108+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOFIELD )
109+ local sc = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .trapplfilter ),tp ,LOCATION_DECK |LOCATION_GRAVE ,0 ,1 ,1 ,nil ,tp ):GetFirst ()
110+ if sc then
111+ Duel .MoveToField (sc ,tp ,tp ,LOCATION_SZONE ,POS_FACEUP ,true )
112+ end
113+ end
0 commit comments