1+ -- セッション・ドロー
12-- Session Draw
23local s ,id = GetID ()
34function s .initial_effect (c )
4- -- Activate
5+ -- Draw 1 extra card during your next Draw Phase, then Xyz Summon 1 Xyz Monster if both drawn cards are monsters with the same Level
56 local e1 = Effect .CreateEffect (c )
7+ e1 :SetCategory (CATEGORY_DRAW )
68 e1 :SetType (EFFECT_TYPE_ACTIVATE )
79 e1 :SetCode (EVENT_FREE_CHAIN )
8- e1 :SetOperation (s .activate )
10+ e1 :SetOperation (s .operation )
911 c :RegisterEffect (e1 )
1012end
11- function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
12- local ph = Duel .GetCurrentPhase ()
13+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
1314 local e1 = Effect .CreateEffect (e :GetHandler ())
1415 e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
1516 e1 :SetProperty (EFFECT_FLAG_DELAY )
1617 e1 :SetCode (EVENT_DRAW )
1718 e1 :SetCountLimit (1 )
18- if Duel .IsTurnPlayer (tp ) and ph == PHASE_DRAW then
19+ if Duel .IsTurnPlayer (tp ) and Duel . IsPhase ( PHASE_DRAW ) then
1920 e1 :SetLabel (Duel .GetTurnCount ())
20- e1 :SetCondition (s . con )
21- e1 :SetReset (RESET_PHASE + PHASE_DRAW + RESET_SELF_TURN ,2 )
21+ e1 :SetCondition (function ( e ) return Duel . GetTurnCount () ~= e : GetLabel () end )
22+ e1 :SetReset (RESET_PHASE | PHASE_DRAW | RESET_SELF_TURN ,2 )
2223 else
23- e1 :SetReset (RESET_PHASE + PHASE_DRAW + RESET_SELF_TURN ,1 )
24+ e1 :SetReset (RESET_PHASE | PHASE_DRAW | RESET_SELF_TURN ,1 )
2425 end
25- e1 :SetOperation (s .op )
26+ e1 :SetOperation (s .drawxyzop )
2627 Duel .RegisterEffect (e1 ,tp )
2728end
28- function s .con (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
29- return Duel .GetTurnCount ()~= e :GetLabel ()
30- end
3129function s .xyzfilter (c ,mg )
3230 return c :IsXyzSummonable (nil ,mg ,2 ,2 )
3331end
34- function s .op (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
35- if ep ~= tp or Duel .GetCurrentPhase () ~= PHASE_DRAW or Duel .GetTurnPlayer () ~= tp
32+ function s .drawxyzop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
33+ if ep ~= tp or not Duel .IsPhase ( PHASE_DRAW ) or not Duel .IsTurnPlayer ( tp )
3634 or (r &REASON_RULE )== 0 then return end
3735 Duel .Hint (HINT_CARD ,0 ,id )
3836 local tc1 = eg :GetFirst ()
3937 local tc2 = Duel .GetDecktopGroup (tp ,1 ):GetFirst ()
4038 Duel .Draw (tp ,1 ,REASON_EFFECT )
4139 if tc1 and tc2 then
42- local g = Group .FromCards (tc1 ,tc2 )
43- Duel .ConfirmCards (1 - tp ,g )
40+ local mg = Group .FromCards (tc1 ,tc2 )
41+ Duel .ConfirmCards (1 - tp ,mg )
4442 if tc1 :IsMonster () and tc2 :IsMonster () and tc1 :GetLevel ()== tc2 :GetLevel () then
45- local xyzg = Duel .GetMatchingGroup (s .xyzfilter ,tp ,LOCATION_EXTRA ,0 ,nil ,g )
43+ local xyzg = Duel .GetMatchingGroup (s .xyzfilter ,tp ,LOCATION_EXTRA ,0 ,nil ,mg )
4644 if # xyzg > 0 then
4745 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
4846 local xyz = xyzg :Select (tp ,1 ,1 ,nil ):GetFirst ()
49- Duel .XyzSummon (tp ,xyz ,g , nil ,2 ,2 )
47+ Duel .XyzSummon (tp ,xyz ,mg , mg ,2 ,2 )
5048 end
5149 end
5250 end
5351 Duel .ShuffleHand (tp )
54- end
52+ end
0 commit comments