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)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21501505,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c21501505.condition)
......
......@@ -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)
end
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
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
......
......@@ -16,14 +16,13 @@ end
function c60080151.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetAttacker()
if chk==0 then return tg:IsOnField() and tg:IsAbleToRemove() end
Duel.SetTargetCard(tg)
local dam=tg:GetAttack()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,dam)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,1,0,0)
end
function c60080151.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local tc=Duel.GetAttacker()
if tc and tc:IsAttackable() and not tc:IsStatus(STATUS_ATTACK_CANCELED) then
local dam=tc:GetAttack()
if Duel.Damage(tp,dam,REASON_EFFECT)>0 and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -40,6 +40,7 @@ function c64726269.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=sg:Select(tp,1,1,nil)
Duel.HintSelection(tg)
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
end
end
......
......@@ -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)
end
function c79997591.cbop(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
local bt=Duel.GetAttackTarget()
if not (bt:IsRelateToBattle() and bt:IsControler(tp)) then return end
if at:IsAttackable() and not at:IsStatus(STATUS_ATTACK_CANCELED) and Duel.Damage(1-tp,bt:GetAttack(),REASON_EFFECT)>0 then
Duel.ChangeAttackTarget(nil)
if bt:IsRelateToBattle() and bt:IsControler(tp) then
Duel.Damage(1-tp,bt:GetAttack(),REASON_EFFECT)
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