Commit e9093f7d authored by VanillaSalt's avatar VanillaSalt

Merge pull request #813 from salix5/patch

fix: attacker
parents d2f13209 e6442318
...@@ -7,6 +7,7 @@ function c21501505.initial_effect(c) ...@@ -7,6 +7,7 @@ function c21501505.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21501505,0)) e1:SetDescription(aux.Stringid(21501505,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c21501505.condition) e1:SetCondition(c21501505.condition)
......
...@@ -15,7 +15,7 @@ function c41510920.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -15,7 +15,7 @@ function c41510920.condition(e,tp,eg,ep,ev,re,r,rp)
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev) return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end end
function c41510920.cfilter(c) function c41510920.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x9c) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsSetCard(0x9c) and c:IsAbleToGraveAsCost() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end end
function c41510920.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c41510920.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c41510920.cfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c41510920.cfilter,tp,LOCATION_MZONE,0,1,nil) end
......
...@@ -16,14 +16,13 @@ end ...@@ -16,14 +16,13 @@ end
function c60080151.target(e,tp,eg,ep,ev,re,r,rp,chk) function c60080151.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetAttacker() local tg=Duel.GetAttacker()
if chk==0 then return tg:IsOnField() and tg:IsAbleToRemove() end if chk==0 then return tg:IsOnField() and tg:IsAbleToRemove() end
Duel.SetTargetCard(tg)
local dam=tg:GetAttack() local dam=tg:GetAttack()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,dam) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,dam)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,1,0,0)
end end
function c60080151.activate(e,tp,eg,ep,ev,re,r,rp) function c60080151.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetAttacker()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then if tc and tc:IsAttackable() and not tc:IsStatus(STATUS_ATTACK_CANCELED) then
local dam=tc:GetAttack() local dam=tc:GetAttack()
if Duel.Damage(tp,dam,REASON_EFFECT)>0 and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then if Duel.Damage(tp,dam,REASON_EFFECT)>0 and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
...@@ -40,6 +40,7 @@ function c64726269.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,6 +40,7 @@ function c64726269.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=sg:Select(tp,1,1,nil) local tg=sg:Select(tp,1,1,nil)
Duel.HintSelection(tg)
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT) Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
end end
end end
......
...@@ -14,14 +14,15 @@ function c79997591.cbcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -14,14 +14,15 @@ function c79997591.cbcon(e,tp,eg,ep,ev,re,r,rp)
return bt and bt:IsPosition(POS_FACEUP_ATTACK) and bt:IsControler(tp) return bt and bt:IsPosition(POS_FACEUP_ATTACK) and bt:IsControler(tp)
end end
function c79997591.cbop(e,tp,eg,ep,ev,re,r,rp) function c79997591.cbop(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
local bt=Duel.GetAttackTarget() local bt=Duel.GetAttackTarget()
Duel.ChangeAttackTarget(nil) if not (bt:IsRelateToBattle() and bt:IsControler(tp)) then return end
if bt:IsRelateToBattle() and bt:IsControler(tp) then if at:IsAttackable() and not at:IsStatus(STATUS_ATTACK_CANCELED) and Duel.Damage(1-tp,bt:GetAttack(),REASON_EFFECT)>0 then
Duel.Damage(1-tp,bt:GetAttack(),REASON_EFFECT) Duel.ChangeAttackTarget(nil)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END+RESET_SELF_TURN)
bt:RegisterEffect(e1)
end end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END+RESET_SELF_TURN)
bt:RegisterEffect(e1)
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment