11-- Action Field Functions
22if not ActionDuel then
33
4+ function Card .IsActionCard (c )
5+ return c :IsType (TYPE_ACTION ) and not c .af
6+ end
7+
8+ function Card .IsActionField (c )
9+ return c :IsType (TYPE_ACTION ) and c .af
10+ end
11+
12+ local tableActionGeneric = {
13+ 150000024 ,150000033 ,
14+ 150000047 ,150000042 ,
15+ 150000011 ,150000044 ,
16+ 150000022 ,150000020
17+ }
18+
419 ActionDuel = {}
520
621 local function ActionDuelRules ()
@@ -39,14 +54,14 @@ if not ActionDuel then
3954 e6 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_IGNORE_RANGE + EFFECT_FLAG_IGNORE_IMMUNE )
4055 e6 :SetCode (EFFECT_QP_ACT_IN_NTPHAND )
4156 e6 :SetTargetRange (0xff ,0xff )
42- e6 :SetTarget (function ( e , c ) return c : IsActionCard () end )
57+ e6 :SetTarget (aux . TargetBoolFunction ( Card . IsActionCard ) )
4358 Duel .RegisterEffect (e6 ,0 )
4459 local e7 = Effect .GlobalEffect ()
4560 e7 :SetType (EFFECT_TYPE_FIELD )
4661 e7 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_IGNORE_RANGE + EFFECT_FLAG_IGNORE_IMMUNE )
4762 e7 :SetCode (EFFECT_BECOME_QUICK )
4863 e7 :SetTargetRange (0xff ,0xff )
49- e7 :SetTarget (function ( e , c ) return c : IsActionCard () end )
64+ e7 :SetTarget (aux . TargetBoolFunction ( Card . IsActionCard ) )
5065 Duel .RegisterEffect (e7 ,0 )
5166 local e7 = Effect .GlobalEffect ()
5267 e7 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
@@ -125,7 +140,6 @@ if not ActionDuel then
125140 ee :SetCode (EFFECT_INDESTRUCTABLE_EFFECT )
126141 ee :SetValue (1 )
127142 tc :RegisterEffect (ee )
128- if not tc .tableAction then tc .tableAction = tableActionGeneric end
129143 -- add ability Yell when Vanilla mode activated
130144 if Duel .IsExistingMatchingCard (Card .IsCode ,tp ,0xff ,0xff ,1 ,nil ,CARD_VANILLA_MODE ) then
131145 table.insert (tc .tableAction ,CARD_POTENTIAL_YELL )
@@ -147,16 +161,12 @@ if not ActionDuel then
147161 end
148162 end
149163 ---- --------------------------------------------------------------------------
150- -- Add Action Card
151- function ActionDuel .acfilter (c )
152- return c :IsActionCard () and c :IsType (TYPE_SPELL )
153- end
154164 -- Check whether tp already has an Action Card in hand
155165 function ActionDuel .handcheck (tp )
156166 if Duel .IsPlayerAffectedByEffect (tp ,CARD_EARTHBOUND_TUNDRA ) then
157- return Duel .IsExistingMatchingCard (ActionDuel . acfilter ,tp ,LOCATION_HAND ,0 ,2 ,nil )
167+ return Duel .IsExistingMatchingCard (Card . IsActionCard ,tp ,LOCATION_HAND ,0 ,2 ,nil )
158168 else
159- return Duel .IsExistingMatchingCard (ActionDuel . acfilter ,tp ,LOCATION_HAND ,0 ,1 ,nil )
169+ return Duel .IsExistingMatchingCard (Card . IsActionCard ,tp ,LOCATION_HAND ,0 ,1 ,nil )
160170 end
161171 end
162172 function ActionDuel .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
@@ -168,7 +178,7 @@ if not ActionDuel then
168178 function ActionDuel .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
169179 local c = e :GetHandler ()
170180 local originalField = e :GetLabelObject ():GetLabelObject ()
171- local t = string.find (originalField .af ,' m' ) and originalField .tableAction or (c .tableAction and c .tableAction or originalField .tableAction )
181+ local t = string.find (originalField .af ,' m' ) and originalField .tableAction or (c .tableAction and c .tableAction or ( originalField .tableAction and originalField . tableAction or tableActionGeneric ) )
172182 if chk == 0 then return # t > 0 end
173183 ac = Duel .GetRandomNumber (1 ,# t )
174184 e :SetLabel (t [ac ])
@@ -202,7 +212,7 @@ if not ActionDuel then
202212 Duel .RegisterFlagEffect (1 - tp ,320 ,RESET_PHASE + PHASE_END ,0 ,1 )
203213 end
204214 end
205- if Duel .IsExistingMatchingCard (ActionDuel . acfilter ,tokenp ,LOCATION_HAND ,0 ,2 ,nil )
215+ if Duel .IsExistingMatchingCard (Card . IsActionCard ,tokenp ,LOCATION_HAND ,0 ,2 ,nil )
206216 and Duel .Remove (token ,POS_FACEUP ,REASON_EFFECT ) then
207217 local g = Duel .SelectMatchingCard (tokenp ,Card .IsFaceup ,tokenp ,0 ,LOCATION_MZONE ,1 ,1 ,nil )
208218 local e1 = Effect .CreateEffect (e :GetHandler ())
@@ -246,14 +256,6 @@ if not ActionDuel then
246256 end
247257
248258 ActionDuelRules ()
249-
250- Card .IsActionCard = function (c )
251- return c :IsType (TYPE_ACTION ) and not c .af
252- end
253-
254- Card .IsActionField = function (c )
255- return c :IsType (TYPE_ACTION ) and c .af
256- end
257259
258260 COVER_ACTION = 301
259261 CARD_VANILLA_MODE = 511004400
0 commit comments