1+ -- ディパーチャー・ゾーン
2+ -- Departure Zone
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 :SetType (EFFECT_TYPE_ACTIVATE )
9+ e1 :SetCode (EVENT_FREE_CHAIN )
10+ e1 :SetCondition (s .condition )
11+ e1 :SetCost (s .cost )
12+ e1 :SetOperation (s .operation )
13+ c :RegisterEffect (e1 )
14+ -- Prevent destruction by effects
15+ local e2 = Effect .CreateEffect (c )
16+ e2 :SetType (EFFECT_TYPE_SINGLE )
17+ e2 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
18+ e2 :SetCode (EFFECT_INDESTRUCTABLE_EFFECT )
19+ e2 :SetRange (LOCATION_FZONE )
20+ e2 :SetValue (1 )
21+ c :RegisterEffect (e2 )
22+ -- Draw until 6 cards in your hand instead of until 5 cards
23+ local e3 = Effect .CreateEffect (c )
24+ e3 :SetType (EFFECT_TYPE_FIELD )
25+ e3 :SetCode (EFFECT_DRAW_COUNT )
26+ e3 :SetProperty (EFFECT_FLAG_PLAYER_TARGET )
27+ e3 :SetRange (LOCATION_FZONE )
28+ e3 :SetTargetRange (1 ,1 )
29+ local function get_draw (e ) return Duel .GetFieldGroupCount (Duel .GetTurnPlayer (),LOCATION_HAND ,0 ) end
30+ e3 :SetCondition (s .drcond )
31+ e3 :SetValue (function (e )return 6 - get_draw (e ) end )
32+ c :RegisterEffect (e3 )
33+ end
34+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
35+ return Duel .GetTurnCount ()~= 1
36+ end
37+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
38+ if chk == 0 then return Duel .IsPlayerCanDiscardDeckAsCost (tp ,2 ) end
39+ end
40+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
41+ local c = e :GetHandler ()
42+ -- Requirement
43+ Duel .DiscardDeck (tp ,2 ,REASON_COST )
44+ end
45+ function s .drcond (e )
46+ local tp = Duel .GetTurnPlayer ()
47+ return Duel .GetFieldGroupCount (tp ,LOCATION_HAND ,0 )< 6 and Duel .IsExistingMatchingCard (nil ,tp ,LOCATION_FZONE ,0 ,1 ,nil )
48+ end
0 commit comments