1+ -- 命王の螺旋
2+ -- Dominus Spiral
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- If your opponent activated a monster effect in the hand or GY this turn, you can activate this card from your hand
7+ local e0 = Effect .CreateEffect (c )
8+ e0 :SetDescription (aux .Stringid (id ,0 ))
9+ e0 :SetType (EFFECT_TYPE_SINGLE )
10+ e0 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
11+ e0 :SetCode (EFFECT_TRAP_ACT_IN_HAND )
12+ e0 :SetCondition (function (e ) return Duel .GetCustomActivityCount (id ,1 - e :GetHandlerPlayer (),ACTIVITY_CHAIN )> 0 end )
13+ c :RegisterEffect (e0 )
14+ Duel .AddCustomActivityCounter (id ,ACTIVITY_CHAIN ,s .chainfilter )
15+ -- Return 1 monster your opponent controls to the hand/Extra Deck, then if you have no Traps in your GY, they can Special Summon 1 monster from their GY
16+ local e1 = Effect .CreateEffect (c )
17+ e1 :SetDescription (aux .Stringid (id ,1 ))
18+ e1 :SetCategory (CATEGORY_TOHAND + CATEGORY_TOEXTRA + CATEGORY_SPECIAL_SUMMON )
19+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
20+ e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
21+ e1 :SetCode (EVENT_FREE_CHAIN )
22+ e1 :SetCountLimit (1 ,id ,EFFECT_COUNT_CODE_OATH )
23+ e1 :SetHintTiming (0 ,TIMING_STANDBY_PHASE |TIMING_MAIN_END |TIMINGS_CHECK_MONSTER_E )
24+ e1 :SetTarget (s .target )
25+ e1 :SetOperation (s .operation )
26+ c :RegisterEffect (e1 )
27+ end
28+ function s .chainfilter (re ,tp ,cid )
29+ return not (re :IsMonsterEffect () and re :GetActivateLocation ()&(LOCATION_HAND |LOCATION_GRAVE )> 0 )
30+ end
31+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
32+ if chkc then return chkc :IsLocation (LOCATION_MZONE ) and chkc :IsAbleToHand () and chkc :IsControler (1 - tp ) end
33+ if chk == 0 then return Duel .IsExistingTarget (Card .IsAbleToHand ,tp ,0 ,LOCATION_MZONE ,1 ,nil ) end
34+ local act_from_hand_chk = e :IsHasType (EFFECT_TYPE_ACTIVATE ) and e :GetHandler ():IsStatus (STATUS_ACT_FROM_HAND ) and 1 or 0
35+ e :SetLabel (act_from_hand_chk )
36+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RTOHAND )
37+ local g = Duel .SelectTarget (tp ,Card .IsAbleToHand ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil )
38+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,g ,1 ,tp ,0 )
39+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,1 - tp ,LOCATION_GRAVE )
40+ end
41+ function s .spfilter (c ,e ,tp )
42+ return c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
43+ end
44+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
45+ local tc = Duel .GetFirstTarget ()
46+ if tc :IsRelateToEffect (e ) and Duel .SendtoHand (tc ,nil ,REASON_EFFECT )> 0 and tc :IsLocation (LOCATION_HAND |LOCATION_EXTRA )
47+ and not Duel .IsExistingMatchingCard (Card .IsTrap ,tp ,LOCATION_GRAVE ,0 ,1 ,nil )
48+ and Duel .GetLocationCount (1 - tp ,LOCATION_MZONE ,1 - tp )> 0
49+ and Duel .IsExistingMatchingCard (aux .NecroValleyFilter (s .spfilter ),tp ,0 ,LOCATION_GRAVE ,1 ,nil ,e ,1 - tp )
50+ and Duel .SelectYesNo (1 - tp ,aux .Stringid (id ,2 )) then
51+ Duel .Hint (HINT_SELECTMSG ,1 - tp ,HINTMSG_SPSUMMON )
52+ local g = Duel .SelectMatchingCard (1 - tp ,s .spfilter ,tp ,0 ,LOCATION_GRAVE ,1 ,1 ,nil ,e ,1 - tp )
53+ if # g > 0 then
54+ Duel .BreakEffect ()
55+ Duel .SpecialSummon (g ,0 ,1 - tp ,1 - tp ,false ,false ,POS_FACEUP )
56+ end
57+ end
58+ if e :IsHasType (EFFECT_TYPE_ACTIVATE ) and e :GetLabel ()== 1 then
59+ -- If you activated this card from your hand, you cannot activate the effects of LIGHT and DARK monsters for the rest of this Duel
60+ local e1 = Effect .CreateEffect (e :GetHandler ())
61+ e1 :SetDescription (aux .Stringid (id ,3 ))
62+ e1 :SetType (EFFECT_TYPE_FIELD )
63+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
64+ e1 :SetCode (EFFECT_CANNOT_ACTIVATE )
65+ e1 :SetTargetRange (1 ,0 )
66+ e1 :SetValue (function (e ,re ) return re :IsMonsterEffect () and re :GetHandler ():IsAttribute (ATTRIBUTE_LIGHT |ATTRIBUTE_DARK ) end )
67+ Duel .RegisterEffect (e1 ,tp )
68+ end
69+ end
0 commit comments