1+ -- スカブ・ブラスト
12-- Scab Blast
23-- scripted by Keddy
34local s ,id = GetID ()
5+ local COUNTER_SCAB = 0x109a
46function s .initial_effect (c )
5- -- Activate
7+ -- Inflict 200 damage to your opponent for each Scab Counter on the field.
68 local e1 = Effect .CreateEffect (c )
79 e1 :SetCategory (CATEGORY_DAMAGE )
810 e1 :SetType (EFFECT_TYPE_ACTIVATE )
9- e1 :SetCode (EVENT_FREE_CHAIN )
1011 e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET )
12+ e1 :SetCode (EVENT_FREE_CHAIN )
1113 e1 :SetTarget (s .target )
1214 e1 :SetOperation (s .activate )
1315 c :RegisterEffect (e1 )
14- --
16+ -- If this card is in the Graveyard, you can add it to your hand instead of conducting your normal draw during your Draw Phase.
1517 local e2 = Effect .CreateEffect (c )
1618 e2 :SetDescription (aux .Stringid (45950291 ,0 ))
1719 e2 :SetCategory (CATEGORY_TOHAND )
@@ -23,41 +25,41 @@ function s.initial_effect(c)
2325 e2 :SetOperation (s .thop )
2426 c :RegisterEffect (e2 )
2527end
26- function s .filter (c )
27- return c :IsFaceup () and c :GetCounter (0x109a )> 0
28- end
28+ s .counter_list = {COUNTER_SCAB }
2929function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
30- if chk == 0 then return Duel .IsExistingMatchingCard ( s . filter , tp , LOCATION_MZONE , 0 ,1 ,nil ) end
31- local dam = Duel .GetMatchingGroupCount ( s . filter , tp , LOCATION_MZONE , 0 , nil )* 200
30+ if chk == 0 then return Duel .GetCounter ( 0 ,1 ,1 , COUNTER_SCAB ) > 0 end
31+ local dam = Duel .GetCounter ( 0 , 1 , 1 , COUNTER_SCAB )* 200
3232 Duel .SetTargetPlayer (1 - tp )
3333 Duel .SetTargetParam (dam )
34- if dam > 0 then Duel .SetOperationInfo (0 ,CATEGORY_DAMAGE ,nil ,0 ,1 - tp ,dam ) end
34+ if dam > 0 then
35+ Duel .SetOperationInfo (0 ,CATEGORY_DAMAGE ,nil ,0 ,1 - tp ,dam )
36+ end
3537end
3638function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
37- local p = Duel .GetChainInfo (0 ,CHAININFO_TARGET_PLAYER )
38- local dam = Duel .GetMatchingGroupCount (s .filter ,tp ,LOCATION_MZONE ,0 ,nil )* 200
39+ local p ,dam = Duel .GetChainInfo (0 ,CHAININFO_TARGET_PLAYER ,CHAININFO_TARGET_PARAM )
3940 Duel .Damage (p ,dam ,REASON_EFFECT )
4041end
4142function s .thcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
4243 return tp == Duel .GetTurnPlayer () and Duel .GetFieldGroupCount (tp ,LOCATION_DECK ,0 )> 0
4344 and Duel .GetDrawCount (tp )> 0
4445end
4546function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
46- if chk == 0 then return e :GetHandler ():IsAbleToHand () end
47+ local c = e :GetHanderl ()
48+ if chk == 0 then return c :IsAbleToHand () end
4749 local dt = Duel .GetDrawCount (tp )
4850 if dt ~= 0 then
4951 _replace_count = 0
5052 _replace_max = dt
51- local e1 = Effect .CreateEffect (e : GetHandler () )
53+ local e1 = Effect .CreateEffect (c )
5254 e1 :SetType (EFFECT_TYPE_FIELD )
5355 e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET )
5456 e1 :SetCode (EFFECT_DRAW_COUNT )
5557 e1 :SetTargetRange (1 ,0 )
56- e1 :SetReset (RESET_PHASE + PHASE_DRAW )
58+ e1 :SetReset (RESET_PHASE | PHASE_DRAW )
5759 e1 :SetValue (0 )
5860 Duel .RegisterEffect (e1 ,tp )
5961 end
60- Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,e : GetHandler () ,1 ,0 ,0 )
62+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,c ,1 ,0 ,0 )
6163end
6264function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
6365 local c = e :GetHandler ()
@@ -66,4 +68,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
6668 Duel .SendtoHand (c ,nil ,REASON_EFFECT )
6769 Duel .ConfirmCards (1 - tp ,c )
6870 end
69- end
71+ end
0 commit comments