1+ -- トマト・パラダイス
12-- Tomato Paradise
23local s ,id = GetID ()
34function s .initial_effect (c )
@@ -6,7 +7,7 @@ function s.initial_effect(c)
67 e1 :SetType (EFFECT_TYPE_ACTIVATE )
78 e1 :SetCode (EVENT_FREE_CHAIN )
89 c :RegisterEffect (e1 )
9- -- atkup
10+ -- Plant monsters you control gain 200 ATK for each Plant monster you control
1011 local e2 = Effect .CreateEffect (c )
1112 e2 :SetType (EFFECT_TYPE_FIELD )
1213 e2 :SetCode (EFFECT_UPDATE_ATTACK )
@@ -15,41 +16,44 @@ function s.initial_effect(c)
1516 e2 :SetTarget (aux .TargetBoolFunction (Card .IsRace ,RACE_PLANT ))
1617 e2 :SetValue (s .val )
1718 c :RegisterEffect (e2 )
18- -- token
19- local e3 = Effect .CreateEffect (c )
20- e3 :SetDescription (aux .Stringid (id ,0 ))
21- e3 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O )
22- e3 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN )
23- e3 :SetRange (LOCATION_SZONE )
24- e3 :SetProperty (EFFECT_FLAG_BOTH_SIDE )
25- e3 :SetCode (EVENT_SUMMON_SUCCESS )
26- e3 :SetCondition (s .tkcon )
27- e3 :SetTarget (s .tktg )
28- e3 :SetOperation (s .tkop )
29- c :RegisterEffect (e3 )
30- local e4 = e3 :Clone ()
31- e4 :SetCode (EVENT_SPSUMMON_SUCCESS )
32- c :RegisterEffect (e4 )
19+ -- The player who Summoned a Plant monster from the hand can Special Summon 1 "Tomato Token" to their field
20+ local e3a = Effect .CreateEffect (c )
21+ e3a :SetDescription (aux .Stringid (id ,0 ))
22+ e3a :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O )
23+ e3a :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN )
24+ e3a :SetProperty (EFFECT_FLAG_BOTH_SIDE )
25+ e3a :SetCode (EVENT_SUMMON_SUCCESS )
26+ e3a :SetRange (LOCATION_FZONE )
27+ e3a :SetTarget (s .tktg )
28+ e3a :SetOperation (s .tkop )
29+ c :RegisterEffect (e3a )
30+ local e3b = e3a :Clone ()
31+ e3b :SetCode (EVENT_SPSUMMON_SUCCESS )
32+ c :RegisterEffect (e3b )
3333end
34+ s .listed_names = {511000104 } -- "Tomato Token"
3435function s .val (e ,c )
3536 return Duel .GetMatchingGroupCount (aux .FaceupFilter (Card .IsRace ,RACE_PLANT ),c :GetControler (),LOCATION_MZONE ,0 ,nil )* 200
3637end
37- function s .cfilter (c ,tp )
38- return c :IsFaceup () and c :IsRace (RACE_PLANT ) and c :GetSummonLocation ()== LOCATION_HAND and c :IsSummonPlayer (tp ) and c :IsControler (tp )
39- end
40- function s .tkcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
41- return eg :IsExists (s .cfilter ,1 ,nil ,tp )
38+ function s .cfilter (c )
39+ return c :IsFaceup () and c :IsRace (RACE_PLANT ) and c :IsSummonLocation (LOCATION_HAND )
4240end
4341function s .tktg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
44- if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
45- and Duel .IsPlayerCanSpecialSummonMonster (tp ,id + 1 ,0 ,TYPES_TOKEN ,0 ,0 ,1 ,RACE_PLANT ,ATTRIBUTE_EARTH ) end
42+ local tg = eg :Filter (s .cfilter ,nil )
43+ local b1 = tg :IsExists (Card .IsSummonPlayer ,1 ,nil ,tp )
44+ local b2 = tg :IsExists (Card .IsSummonPlayer ,1 ,nil ,1 - tp )
45+ local p = b1 and b2 and PLAYER_ALL or b1 and tp or 1 - tp
46+ if chk == 0 then return (b1 or b2 ) and Duel .GetLocationCount (p ,LOCATION_MZONE )> 0
47+ and Duel .IsPlayerCanSpecialSummonMonster (p ,id + 1 ,0 ,TYPES_TOKEN ,0 ,0 ,1 ,RACE_PLANT ,ATTRIBUTE_EARTH ) end
48+ Duel .SetTargetPlayer (p )
4649 Duel .SetOperationInfo (0 ,CATEGORY_TOKEN ,nil ,1 ,0 ,0 )
47- Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,0 )
50+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,p ,0 )
4851end
4952function s .tkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
50- if e :GetHandler ():IsRelateToEffect (e ) and Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
51- and Duel .IsPlayerCanSpecialSummonMonster (tp ,id + 1 ,0 ,TYPES_TOKEN ,0 ,0 ,1 ,RACE_PLANT ,ATTRIBUTE_EARTH ) then
52- local token = Duel .CreateToken (tp ,id + 1 )
53- Duel .SpecialSummon (token ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
53+ local p = Duel .GetChainInfo (0 ,CHAININFO_TARGET_PLAYER )
54+ if e :GetHandler ():IsRelateToEffect (e ) and Duel .GetLocationCount (p ,LOCATION_MZONE )> 0
55+ and Duel .IsPlayerCanSpecialSummonMonster (p ,id + 1 ,0 ,TYPES_TOKEN ,0 ,0 ,1 ,RACE_PLANT ,ATTRIBUTE_EARTH ) then
56+ local token = Duel .CreateToken (p ,id + 1 )
57+ Duel .SpecialSummon (token ,0 ,p ,p ,false ,false ,POS_FACEUP )
5458 end
55- end
59+ end
0 commit comments