1+ -- 超戦士の閃光
2+ -- Super Soldier Radiance
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Activate
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_POSITION + CATEGORY_DESTROY )
10+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
11+ e1 :SetCode (EVENT_SUMMON_SUCCESS )
12+ e1 :SetCondition (s .condition )
13+ e1 :SetCost (s .cost )
14+ e1 :SetTarget (s .target )
15+ e1 :SetOperation (s .activate )
16+ c :RegisterEffect (e1 )
17+ local e2 = e1 :Clone ()
18+ e2 :SetCode (EVENT_SPSUMMON_SUCCESS )
19+ c :RegisterEffect (e2 )
20+ end
21+ s .listed_names = {5405694 }
22+ function s .filter1 (c ,tp )
23+ return c :IsSummonPlayer (1 - tp ) and c :IsLocation (LOCATION_MZONE )
24+ end
25+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
26+ return eg :IsExists (s .filter1 ,1 ,nil ,tp )
27+ end
28+ function s .posfilter (c )
29+ return c :IsFaceup () and c :IsCode (5405694 ) and c :IsCanChangePositionRush ()
30+ end
31+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
32+ if chk == 0 then return Duel .IsExistingMatchingCard (Card .IsAbleToDeckOrExtraAsCost ,tp ,LOCATION_HAND ,0 ,1 ,e :GetHandler ())
33+ or Duel .IsExistingMatchingCard (s .posfilter ,tp ,LOCATION_MZONE ,0 ,1 ,nil )
34+ end
35+ end
36+ function s .filter (c )
37+ return c :IsFaceup () and c :IsCanTurnSet () and c :IsCanChangePositionRush ()
38+ end
39+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
40+ if chk == 0 then return Duel .IsExistingMatchingCard (s .filter ,tp ,0 ,LOCATION_MZONE ,1 ,nil ) end
41+ Duel .SetOperationInfo (0 ,CATEGORY_POSITION ,nil ,1 ,tp ,POS_FACEDOWN_DEFENSE )
42+ end
43+ function s .cfilter (c )
44+ return c :IsFaceup () and c :IsCode (5405694 )
45+ end
46+ function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
47+ -- Requirement
48+ local b1 = Duel .IsExistingMatchingCard (Card .IsAbleToDeckOrExtraAsCost ,tp ,LOCATION_HAND ,0 ,1 ,e :GetHandler ())
49+ local b2 = Duel .IsExistingMatchingCard (s .posfilter ,tp ,LOCATION_MZONE ,0 ,1 ,nil )
50+ local op = Duel .SelectEffect (tp ,{b1 ,aux .Stringid (id ,1 )},{b2 ,aux .Stringid (id ,2 )})
51+ if op == 1 then
52+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TODECK )
53+ local td = Duel .SelectMatchingCard (tp ,Card .IsAbleToDeckOrExtraAsCost ,tp ,LOCATION_HAND ,0 ,1 ,1 ,nil )
54+ if Duel .SendtoDeck (td ,nil ,SEQ_DECKBOTTOM ,REASON_COST )< 1 then return end
55+ elseif op == 2 then
56+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_POSCHANGE )
57+ local g = Duel .SelectMatchingCard (tp ,s .posfilter ,tp ,LOCATION_MZONE ,0 ,1 ,1 ,nil )
58+ if Duel .ChangePosition (g ,POS_FACEUP_DEFENSE ,0 ,POS_FACEUP_ATTACK ,0 )< 1 then return end
59+ end
60+ -- Effect
61+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_POSCHANGE )
62+ local ct = 1
63+ if Duel .IsExistingMatchingCard (s .cfilter ,tp ,LOCATION_MZONE ,0 ,1 ,nil ) then ct = 2 end
64+ local g = Duel .SelectMatchingCard (tp ,s .filter ,tp ,0 ,LOCATION_MZONE ,1 ,ct ,nil )
65+ if # g == 0 then return end
66+ Duel .HintSelection (g )
67+ Duel .ChangePosition (g ,POS_FACEDOWN_DEFENSE )
68+ end
0 commit comments