Skip to content

Commit 46d1429

Browse files
committed
"Misfortune" fix
It should not be able to target a monster with 0 original ATK
1 parent 461a0a3 commit 46d1429

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

official/c1036974.lua

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
--Misfortune
33
local s,id=GetID()
44
function 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)
2425
end
26+
function s.cfilter(c)
27+
return c:GetBaseAttack()>0 and c:IsFaceup()
28+
end
2529
function 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)
3135
end
3236
function s.activate(e,tp,eg,ep,ev,re,r,rp)

0 commit comments

Comments
 (0)