11-- Benkei Guard
2- function c150000007 .initial_effect (c )
2+ local s ,id = GetID ()
3+ function s .initial_effect (c )
34 -- Activate
45 local e1 = Effect .CreateEffect (c )
56 e1 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN )
67 e1 :SetType (EFFECT_TYPE_ACTIVATE )
78 e1 :SetCode (EVENT_FREE_CHAIN )
8- e1 :SetTarget (c150000007 .target )
9- e1 :SetOperation (c150000007 .activate )
9+ e1 :SetTarget (s .target )
10+ e1 :SetOperation (s .activate )
1011 c :RegisterEffect (e1 )
1112 -- become action card
1213 local e2 = Effect .CreateEffect (c )
@@ -19,46 +20,47 @@ function c150000007.initial_effect(c)
1920 e3 :SetValue (TYPE_QUICKPLAY )
2021 c :RegisterEffect (e3 )
2122end
22- function c150000007 .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
23+ s .listed_names = {id + 1 }
24+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
2325 if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
24- and Duel .IsPlayerCanSpecialSummonMonster (tp ,150000008 ,0 ,0x4011 ,1000 ,0 ,1 ,RACE_MACHINE ,ATTRIBUTE_EARTH ) end
26+ and Duel .IsPlayerCanSpecialSummonMonster (tp ,id + 1 ,0 ,TYPES_TOKEN ,1000 ,0 ,1 ,RACE_MACHINE ,ATTRIBUTE_EARTH ) end
2527 Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,0 )
2628 Duel .SetOperationInfo (0 ,CATEGORY_TOKEN ,nil ,1 ,tp ,0 )
2729end
28- function c150000007 .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
30+ function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
2931 if Duel .GetLocationCount (tp ,LOCATION_MZONE ,tp )<= 0
30- or not Duel .IsPlayerCanSpecialSummonMonster (tp ,150000008 ,0 ,0x4011 ,1000 ,0 ,1 ,RACE_MACHINE ,ATTRIBUTE_EARTH ) then return end
31- local token = Duel .CreateToken (tp ,150000008 )
32+ or not Duel .IsPlayerCanSpecialSummonMonster (tp ,id + 1 ,0 ,TYPES_TOKEN ,1000 ,0 ,1 ,RACE_MACHINE ,ATTRIBUTE_EARTH ) then return end
33+ local token = Duel .CreateToken (tp ,id + 1 )
3234 Duel .SpecialSummon (token ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
3335 local e1 = Effect .CreateEffect (e :GetHandler ())
3436 e1 :SetType (EFFECT_TYPE_SINGLE )
3537 e1 :SetCode (EFFECT_INDESTRUCTABLE_BATTLE )
3638 e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
3739 e1 :SetValue (1 )
38- e1 :SetReset (RESET_EVENT + 0x1fe0000 )
40+ e1 :SetReset (RESET_EVENT + RESETS_STANDARD )
3941 token :RegisterEffect (e1 )
4042 -- indes
4143 local e2 = Effect .CreateEffect (e :GetHandler ())
4244 e2 :SetType (EFFECT_TYPE_SINGLE )
4345 e2 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
4446 e2 :SetRange (LOCATION_MZONE )
4547 e2 :SetCode (EFFECT_INDESTRUCTABLE_EFFECT )
46- e2 :SetReset (RESET_EVENT + 0x1fe0000 )
47- e2 :SetValue (c150000007 .indesval )
48+ e2 :SetReset (RESET_EVENT + RESETS_STANDARD )
49+ e2 :SetValue (s .indesval )
4850 c :RegisterEffect (e2 )
4951 local e3 = Effect .CreateEffect (e :GetHandler ())
5052 e3 :SetType (EFFECT_TYPE_FIELD )
5153 e3 :SetCode (EFFECT_MUST_BE_ATTACKED )
5254 e3 :SetRange (LOCATION_MZONE )
5355 e3 :SetTargetRange (LOCATION_MZONE ,0 )
54- e3 :SetTarget (c150000007 .attg )
55- e3 :SetReset (RESET_EVENT + 0x1fe0000 )
56+ e3 :SetTarget (s .attg )
57+ e3 :SetReset (RESET_EVENT + RESETS_STANDARD )
5658 e3 :SetValue (1 )
5759 c :RegisterEffect (e3 )
5860end
59- function c150000007 .indesval (e ,re )
61+ function s .indesval (e ,re )
6062 return re :IsActiveType (TYPE_MONSTER )
6163end
62- function c150000007 .attg (e ,c )
63- return c :IsCode (150000008 )
64+ function s .attg (e ,c )
65+ return c :IsCode (id + 1 )
6466end
0 commit comments