Commit 92667f71 authored by Vee4's avatar Vee4

Fix Pendulum Ruler

parent a1085726
Pipeline #42082 failed with stages
in 1 minute and 15 seconds
......@@ -38,6 +38,7 @@ function s.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(2,id+o)
e4:SetCost(s.descost)
e4:SetTarget(s.destg)
e4:SetOperation(s.desop)
c:RegisterEffect(e4)
......@@ -83,21 +84,14 @@ end
function s.atktg(e,c)
return not (c:IsType(TYPE_PENDULUM) and c:GetLevel()==0)
end
function s.desfilter(c,rc)
return c:GetEquipTarget()~=rc and c~=rc
end
function s.costfilter(c,tp)
return Duel.IsExistingTarget(s.desfilter,tp,0,LOCATION_ONFIELD,1,c,c)
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then
if e:IsCostChecked() then
return Duel.CheckReleaseGroup(tp,s.costfilter,1,nil,tp)
else
return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil)
end
end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetTargetPlayer(1-tp)
......
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