@@ -36,77 +36,89 @@ if not ActionDuel then
3636 -- act ac in hand
3737 local e6 = Effect .GlobalEffect ()
3838 e6 :SetType (EFFECT_TYPE_FIELD )
39- e6 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE )
39+ e6 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_IGNORE_RANGE + EFFECT_FLAG_IGNORE_IMMUNE )
4040 e6 :SetCode (EFFECT_QP_ACT_IN_NTPHAND )
41- e6 :SetTargetRange (LOCATION_HAND , LOCATION_HAND )
42- e6 :SetTarget (function (e ,c ) return c :IsType ( TYPE_ACTION ) and c :IsType (TYPE_SPELL ) end )
41+ e6 :SetTargetRange (0xff , 0xff )
42+ e6 :SetTarget (function (e ,c ) return c :IsActionCard ( ) and not c :IsType (TYPE_FIELD ) end )
4343 Duel .RegisterEffect (e6 ,0 )
44+ local e7 = Effect .GlobalEffect ()
45+ e7 :SetType (EFFECT_TYPE_FIELD )
46+ e7 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_IGNORE_RANGE + EFFECT_FLAG_IGNORE_IMMUNE )
47+ e7 :SetCode (EFFECT_BECOME_QUICK )
48+ e7 :SetTargetRange (0xff ,0xff )
49+ e7 :SetTarget (function (e ,c ) return c :IsActionCard () and not c :IsType (TYPE_FIELD ) end )
50+ Duel .RegisterEffect (e7 ,0 )
4451 end
4552
4653 function ActionDuel .op (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
47- local draw = {0 ,0 }
48- -- local ag={Duel.GetMatchingGroup(function(c) return c.af end,tp,0xff,0,nil),Duel.GetMatchingGroup(function(c) return c.af end,tp,0,0xff,nil)}
49- local g = Duel .GetMatchingGroup (function (c ) return c .af end ,tp ,0xff ,0xff ,nil )
50- Duel .DisableShuffleCheck ()
51- for c in aux .Next (g ) do
52- if c :IsLocation (LOCATION_HAND ) then
53- draw [1 + c :GetOwner ()] = draw [1 + c :GetOwner ()] + 1
54- end
55- if not e :GetLabelObject () then
56- e :SetLabelObject (c )
57- for _ ,tc in ipairs ({c ,Duel .CreateToken (1 - tp ,c :GetOriginalCode ())}) do
58- -- redirect
59- local e1 = Effect .CreateEffect (tc )
60- e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS )
61- e1 :SetCode (EVENT_LEAVE_FIELD )
62- e1 :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE )
63- e1 :SetOperation (function (e ) Duel .SendtoDeck (e :GetHandler (),nil ,- 2 ,REASON_RULE ) end )
64- tc :RegisterEffect (e1 )
65- local e2 = Effect .CreateEffect (c )
66- e2 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
67- e2 :SetCode (EVENT_CHAIN_END )
68- e2 :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE )
69- e2 :SetLabelObject (tc )
70- e2 :SetOperation (ActionDuel .returnop )
71- Duel .RegisterEffect (e2 ,0 )
72- -- unaffectable
73- local ea = Effect .CreateEffect (tc )
74- ea :SetType (EFFECT_TYPE_SINGLE )
75- ea :SetCode (EFFECT_CANNOT_TO_DECK )
76- ea :SetRange (LOCATION_SZONE )
77- ea :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE )
78- tc :RegisterEffect (ea )
79- local eb = ea :Clone ()
80- eb :SetCode (EFFECT_CANNOT_REMOVE )
81- tc :RegisterEffect (eb )
82- local ec = ea :Clone ()
83- ec :SetCode (EFFECT_CANNOT_TO_HAND )
84- tc :RegisterEffect (ec )
85- local ed = ea :Clone ()
86- ed :SetCode (EFFECT_CANNOT_TO_GRAVE )
87- tc :RegisterEffect (ed )
88- local ee = ea :Clone ()
89- ee :SetCode (EFFECT_INDESTRUCTABLE_EFFECT )
90- ee :SetValue (1 )
91- tc :RegisterEffect (ee )
92- -- add ability Yell when Vanilla mode activated
93- if Duel .IsExistingMatchingCard (Card .IsCode ,tp ,0xff ,0xff ,1 ,nil ,CARD_VANILLA_MODE ) then
94- table.insert (tc .tableAction ,CARD_POTENTIAL_YELL )
95- table.insert (tc .tableAction ,CARD_ABILITY_YELL )
96- end
97- -- move to field
98- if Duel .CheckLocation (tc :GetOwner (),LOCATION_FZONE ,0 ) then
99- Duel .MoveToField (tc ,tc :GetOwner (),tc :GetOwner (),LOCATION_SZONE ,POS_FACEUP ,true )
100- else
101- Duel .SendtoDeck (tc ,nil ,- 2 ,REASON_RULE )
102- end
54+ local actionFieldToBeUsed = {}
55+ local announceFilter = {TYPE_ACTION ,OPCODE_ISTYPE ,TYPE_FIELD ,OPCODE_ISTYPE ,OPCODE_AND }
56+ while # actionFieldToBeUsed == 0 do
57+ for p = 0 ,1 do
58+ if Duel .SelectYesNo (p ,aux .Stringid (301 ,3 )) then
59+ Duel .Hint (HINT_SELECTMSG ,tp ,aux .Stringid (301 ,4 ))
60+ local af = Duel .AnnounceCard (p ,table.unpack (announceFilter ))
61+ table.insert (actionFieldToBeUsed ,af )
10362 end
104- else
105- Duel .SendtoDeck (c ,nil ,- 2 ,REASON_RULE )
10663 end
64+ if # actionFieldToBeUsed > 0 then break
65+ else Duel .Hint (HINT_MESSAGE ,0 ,aux .Stringid (301 ,5 )) Duel .Hint (HINT_MESSAGE ,1 ,aux .Stringid (301 ,5 )) end
66+ end
67+ if # actionFieldToBeUsed > 1 then
68+ Duel .Hint (HINT_MESSAGE ,0 ,aux .Stringid (301 ,6 ))
69+ Duel .Hint (HINT_MESSAGE ,1 ,aux .Stringid (301 ,6 ))
70+ local coin = Duel .TossCoin (0 ,1 )
71+ table.remove (actionFieldToBeUsed ,coin + 1 )
10772 end
73+ Duel .Hint (HINT_CARD ,0 ,actionFieldToBeUsed [1 ])
10874 for p = 0 ,1 do
109- if draw [1 + p ]> 0 then Duel .Draw (p ,draw [1 + p ],REASON_RULE ) end
75+ local tc = Duel .CreateToken (p ,actionFieldToBeUsed [1 ])
76+ e :SetLabelObject (tc )
77+ -- redirect
78+ local e1 = Effect .CreateEffect (tc )
79+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS )
80+ e1 :SetCode (EVENT_LEAVE_FIELD )
81+ e1 :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE )
82+ e1 :SetOperation (function (e ) Duel .SendtoDeck (e :GetHandler (),nil ,- 2 ,REASON_RULE ) end )
83+ tc :RegisterEffect (e1 )
84+ local e2 = Effect .CreateEffect (tc )
85+ e2 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
86+ e2 :SetCode (EVENT_CHAIN_END )
87+ e2 :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE )
88+ e2 :SetLabelObject (tc )
89+ e2 :SetOperation (ActionDuel .returnop )
90+ Duel .RegisterEffect (e2 ,0 )
91+ -- unaffectable
92+ local ea = Effect .CreateEffect (tc )
93+ ea :SetType (EFFECT_TYPE_SINGLE )
94+ ea :SetCode (EFFECT_CANNOT_TO_DECK )
95+ ea :SetRange (LOCATION_SZONE )
96+ ea :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE )
97+ tc :RegisterEffect (ea )
98+ local eb = ea :Clone ()
99+ eb :SetCode (EFFECT_CANNOT_REMOVE )
100+ tc :RegisterEffect (eb )
101+ local ec = ea :Clone ()
102+ ec :SetCode (EFFECT_CANNOT_TO_HAND )
103+ tc :RegisterEffect (ec )
104+ local ed = ea :Clone ()
105+ ed :SetCode (EFFECT_CANNOT_TO_GRAVE )
106+ tc :RegisterEffect (ed )
107+ local ee = ea :Clone ()
108+ ee :SetCode (EFFECT_INDESTRUCTABLE_EFFECT )
109+ ee :SetValue (1 )
110+ tc :RegisterEffect (ee )
111+ -- add ability Yell when Vanilla mode activated
112+ if Duel .IsExistingMatchingCard (Card .IsCode ,tp ,0xff ,0xff ,1 ,nil ,CARD_VANILLA_MODE ) then
113+ table.insert (tc .tableAction ,CARD_POTENTIAL_YELL )
114+ table.insert (tc .tableAction ,CARD_ABILITY_YELL )
115+ end
116+ -- move to field
117+ if Duel .CheckLocation (tc :GetOwner (),LOCATION_FZONE ,0 ) then
118+ Duel .MoveToField (tc ,tc :GetOwner (),tc :GetOwner (),LOCATION_SZONE ,POS_FACEUP ,true )
119+ else
120+ Duel .SendtoDeck (tc ,nil ,- 2 ,REASON_RULE )
121+ end
110122 end
111123 end
112124 function ActionDuel .returnop (e )
@@ -119,7 +131,7 @@ if not ActionDuel then
119131 ---- --------------------------------------------------------------------------
120132 -- Add Action Card
121133 function ActionDuel .acfilter (c )
122- return c :IsType ( TYPE_ACTION ) and c :IsType (TYPE_SPELL )
134+ return c :IsActionCard ( ) and c :IsType (TYPE_SPELL )
123135 end
124136 -- Check whether tp already has an Action Card in hand
125137 function ActionDuel .handcheck (tp )
0 commit comments