1+ -- ワイルド・ハーフ
12-- Wild Half
23local s ,id = GetID ()
34function s .initial_effect (c )
@@ -7,57 +8,46 @@ function s.initial_effect(c)
78 e1 :SetType (EFFECT_TYPE_ACTIVATE )
89 e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
910 e1 :SetCode (EVENT_FREE_CHAIN )
10- e1 :SetCondition (s . condition )
11+ e1 :SetCondition (function ( e ) return Duel . IsExistingMatchingCard ( aux . FaceupFilter ( Card . IsCode , 86188410 ), e : GetHandlerPlayer (), LOCATION_ONFIELD , 0 , 1 , nil ) end )
1112 e1 :SetTarget (s .target )
1213 e1 :SetOperation (s .activate )
1314 c :RegisterEffect (e1 )
1415end
15- s .listed_names = {86188410 }
16- function s .cfilter (c )
17- return c :IsFaceup () and c :IsCode (86188410 )
18- end
19- function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
20- return Duel .IsExistingMatchingCard (s .cfilter ,tp ,LOCATION_ONFIELD ,0 ,1 ,nil )
21- end
22- function s .filter (c ,tp )
23- return c :IsFaceup () and c :GetLevel ()> 0
24- and Duel .IsPlayerCanSpecialSummonMonster (tp ,id + 1 ,0 ,TYPES_TOKEN ,c :GetAttack (),c :GetDefense (),c :GetLevel (),c :GetRace (),c :GetAttribute (),
25- POS_FACEUP ,1 - tp )
16+ s .listed_names = {86188410 ,id + 1 } -- "Elemental HERO Wildheart","Half Token"
17+ function s .tknspfilter (c ,tp )
18+ return c :IsFaceup () and c :HasLevel ()
19+ and Duel .IsPlayerCanSpecialSummonMonster (tp ,id + 1 ,0 ,TYPES_TOKEN ,c :GetAttack (),c :GetDefense (),c :GetLevel (),c :GetRace (),c :GetAttribute (),POS_FACEUP ,1 - tp )
2620end
2721function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
2822 if chkc then return chkc :IsLocation (LOCATION_MZONE ) and chkc :IsControler (1 - tp ) and s .filter (chkc ,tp ) end
2923 if chk == 0 then return Duel .GetLocationCount (1 - tp ,LOCATION_MZONE )> 0
30- and Duel .IsExistingTarget (s .filter ,tp ,0 ,LOCATION_MZONE ,1 ,nil ,tp ) end
24+ and Duel .IsExistingTarget (s .tknspfilter ,tp ,0 ,LOCATION_MZONE ,1 ,nil ,tp ) end
3125 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TARGET )
32- Duel .SelectTarget (tp ,s .filter ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil ,tp )
26+ Duel .SelectTarget (tp ,s .tknspfilter ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil ,tp )
3327 Duel .SetOperationInfo (0 ,CATEGORY_TOKEN ,nil ,1 ,0 ,0 )
3428 Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,0 )
3529end
3630function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
31+ local c = e :GetHandler ()
3732 local tc = Duel .GetFirstTarget ()
3833 if not tc or not tc :IsRelateToEffect (e ) or tc :IsFacedown () then return end
39- local ea = Effect .CreateEffect (e :GetHandler ())
40- ea :SetType (EFFECT_TYPE_SINGLE )
41- ea :SetCode (EFFECT_SET_BASE_ATTACK )
42- ea :SetReset (RESET_EVENT + 0x1fe000 )
43- ea :SetValue (tc :GetBaseAttack ()/ 2 )
44- tc :RegisterEffect (ea )
45- local ed = Effect .CreateEffect (e :GetHandler ())
46- ed :SetType (EFFECT_TYPE_SINGLE )
47- ed :SetCode (EFFECT_SET_BASE_DEFENSE )
48- ed :SetReset (RESET_EVENT + 0x1fe000 )
49- ed :SetValue (tc :GetBaseDefense ()/ 2 )
50- tc :RegisterEffect (ed )
51- if tc :IsImmuneToEffect (ea ) or tc :IsImmuneToEffect (ed ) or Duel .GetLocationCount (1 - tp ,LOCATION_MZONE )<= 0
34+ local e0 = Effect .CreateEffect (c )
35+ e0 :SetType (EFFECT_TYPE_SINGLE )
36+ e0 :SetCode (EFFECT_SET_ATTACK_FINAL )
37+ e0 :SetReset (RESET_EVENT |RESETS_STANDARD )
38+ e0 :SetValue (math.ceil (tc :GetAttack ()/ 2 ))
39+ tc :RegisterEffect (e0 )
40+ if tc :IsImmuneToEffect (e0 ) or not tc :HasLevel () or Duel .GetLocationCount (1 - tp ,LOCATION_MZONE )<= 0
5241 or not Duel .IsPlayerCanSpecialSummonMonster (tp ,id + 1 ,0 ,TYPES_TOKEN ,tc :GetAttack (),tc :GetDefense (),
5342 tc :GetLevel (),tc :GetRace (),tc :GetAttribute (),POS_FACEUP ,1 - tp ) then return end
5443 Duel .BreakEffect ()
5544 local token = Duel .CreateToken (tp ,id + 1 )
56- local e1 = Effect .CreateEffect (e :GetHandler ())
45+ -- Add monster properties
46+ local e1 = Effect .CreateEffect (c )
5747 e1 :SetType (EFFECT_TYPE_SINGLE )
5848 e1 :SetCode (EFFECT_SET_BASE_ATTACK )
5949 e1 :SetValue (tc :GetAttack ())
60- e1 :SetReset (RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD )
50+ e1 :SetReset (RESET_EVENT | RESETS_STANDARD &~ RESET_TOFIELD )
6151 token :RegisterEffect (e1 )
6252 local e2 = e1 :Clone ()
6353 e2 :SetCode (EFFECT_SET_BASE_DEFENSE )
@@ -75,8 +65,17 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
7565 e5 :SetCode (EFFECT_CHANGE_ATTRIBUTE )
7666 e5 :SetValue (tc :GetAttribute ())
7767 token :RegisterEffect (e5 )
78- Duel .SpecialSummon (token ,0 ,tp ,1 - tp ,false ,false ,POS_FACEUP )
79- if not tc :IsType (TYPE_TRAPMONSTER ) then
80- token :CopyEffect (tc :GetCode (),RESET_EVENT + RESETS_STANDARD ,1 )
68+ if Duel .SpecialSummonStep (token ,0 ,tp ,1 - tp ,false ,false ,POS_FACEUP ) then
69+ -- This token gains the effects of the targeted monster
70+ if tc :IsOriginalType (TYPE_EFFECT ) then
71+ token :CopyEffect (tc :GetOriginalCode (),RESET_EVENT |RESETS_STANDARD )
72+ local e6 = Effect .CreateEffect (c )
73+ e6 :SetType (EFFECT_TYPE_SINGLE )
74+ e6 :SetCode (EFFECT_ADD_TYPE )
75+ e6 :SetValue (TYPE_EFFECT )
76+ e6 :SetReset (RESET_EVENT |RESETS_STANDARD )
77+ token :RegisterEffect (e6 )
78+ end
8179 end
80+ Duel .SpecialSummonComplete ()
8281end
0 commit comments