1+ -- 封拳のキョシー
2+ -- Kyoshee of the Forbidden Fist
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Reduce Level
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_MZONE )
12+ e1 :SetCountLimit (1 )
13+ e1 :SetCost (s .cost )
14+ e1 :SetTarget (s .target )
15+ e1 :SetOperation (s .operation )
16+ c :RegisterEffect (e1 )
17+ end
18+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
19+ if chk == 0 then return Duel .IsPlayerCanDiscardDeck (tp ,1 ) end
20+ end
21+ function s .cfilter (c )
22+ return c :IsFaceup () and c :IsLevelAbove (3 ) and not c :IsMaximumModeSide ()
23+ end
24+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
25+ if chk == 0 then return Duel .IsExistingMatchingCard (s .cfilter ,tp ,0 ,LOCATION_MZONE ,1 ,nil ) end
26+ end
27+ function s .spfilter (c ,e ,tp )
28+ return c :IsCode (id ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ,POS_FACEUP_DEFENSE )
29+ end
30+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
31+ -- Requirement
32+ local c = e :GetHandler ()
33+ if Duel .DiscardDeck (tp ,1 ,REASON_COST )< 0 then return end
34+ -- Effect
35+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_FACEUP )
36+ local g = Duel .SelectMatchingCard (tp ,s .cfilter ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil )
37+ if # g > 0 then
38+ Duel .HintSelection (g )
39+ local tc = g :GetFirst ()
40+ -- decrease level by 2
41+ tc :UpdateLevel (- 2 ,RESETS_STANDARD_PHASE_END ,c )
42+ local g2 = Duel .GetMatchingGroup (aux .NecroValleyFilter (s .spfilter ),tp ,LOCATION_GRAVE ,0 ,nil ,e ,tp )
43+ if c :IsAttackPos () and # g2 > 0 and Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
44+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
45+ local sg = Duel .SelectMatchingCard (tp ,s .spfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
46+ if # sg > 0 then
47+ Duel .BreakEffect ()
48+ Duel .SpecialSummon (sg ,0 ,tp ,tp ,false ,false ,POS_FACEUP_DEFENSE )
49+ end
50+ end
51+ end
52+ end
0 commit comments