22-- Misfortune
33local s ,id = GetID ()
44function s .initial_effect (c )
5- -- Activate
5+ -- Inflict damage to your opponent equal to half of the targeted monster's original ATK
66 local e1 = Effect .CreateEffect (c )
7+ e1 :SetDescription (aux .Stringid (id ,0 ))
78 e1 :SetType (EFFECT_TYPE_ACTIVATE )
89 e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
910 e1 :SetCode (EVENT_FREE_CHAIN )
@@ -22,11 +23,14 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
2223 e1 :SetReset (RESET_PHASE |PHASE_END )
2324 Duel .RegisterEffect (e1 ,tp )
2425end
26+ function s .cfilter (c )
27+ return c :GetBaseAttack ()> 0 and c :IsFaceup ()
28+ end
2529function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
26- if chkc then return chkc :IsLocation (LOCATION_MZONE ) and chkc :IsControler (1 - tp ) and chkc :IsFaceup () end
27- if chk == 0 then return Duel .IsExistingTarget (Card . IsFaceup ,tp ,0 ,LOCATION_MZONE ,1 ,nil ) end
28- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_FACEUP )
29- Duel .SelectTarget (tp ,Card . IsFaceup ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil )
30+ if chkc then return chkc :IsLocation (LOCATION_MZONE ) and chkc :IsControler (1 - tp ) and chkc :IsFaceup () and chkc : GetBaseAttack () > 0 end
31+ if chk == 0 then return Duel .IsExistingTarget (s . cfilter ,tp ,0 ,LOCATION_MZONE ,1 ,nil ) end
32+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TARGET )
33+ Duel .SelectTarget (tp ,s . cfilter ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil )
3034 Duel .SetOperationInfo (0 ,CATEGORY_DAMAGE ,nil ,0 ,1 - tp ,0 )
3135end
3236function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
0 commit comments