Commit 71fbf178 authored by mercury233's avatar mercury233 Committed by GitHub

fix 生贄の祭壇

parent 14358ac1
......@@ -11,26 +11,22 @@ function c21070956.initial_effect(c)
e1:SetOperation(c21070956.activate)
c:RegisterEffect(e1)
end
function c21070956.filter(c)
return c:IsAbleToGraveAsCost() and c:GetTextAttack()>0
end
function c21070956.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c21070956.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,1,1,nil);
local g=Duel.SelectMatchingCard(tp,c21070956.filter,tp,LOCATION_MZONE,0,1,1,nil);
local atk=g:GetFirst():GetTextAttack()
if atk<0 then atk=0 end
e:SetLabel(atk)
Duel.SendtoGrave(g,REASON_COST)
end
function c21070956.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local res=e:GetLabel()~=0
e:SetLabel(0)
return res
end
if chk==0 then return e:IsCostChecked() end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,e:GetLabel())
e:SetLabel(0)
end
function c21070956.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
......
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