Commit 247d3b90 authored by Chen Bill's avatar Chen Bill

update 結束 UNITY

parent 5df0a361
...@@ -13,23 +13,19 @@ function c14731897.initial_effect(c) ...@@ -13,23 +13,19 @@ function c14731897.initial_effect(c)
e1:SetOperation(c14731897.activate) e1:SetOperation(c14731897.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c14731897.sumfilter(c)
return c:IsFaceup() and c:IsDefenseAbove(0)
end
function c14731897.filter(c,def) function c14731897.filter(c,def)
return c:IsFaceup() and c:IsDefenseAbove(0) and not c:IsDefense(def) return c:IsFaceup() and c:IsDefenseAbove(0) and not c:IsDefense(def)
end end
function c14731897.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c14731897.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c14731897.sumfilter,tp,LOCATION_MZONE,0,nil)
local def=0 local sum=g:GetSum(Card.GetBaseDefense)
local sc=g:GetFirst() if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c14731897.filter(chkc,sum) end
while sc do if chk==0 then return Duel.IsExistingTarget(c14731897.filter,tp,LOCATION_MZONE,0,1,nil,sum) end
local cdef=sc:GetBaseDefense()
if cdef<0 then cdef=0 end
def=def+cdef
sc=g:GetNext()
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c14731897.filter(chkc,def) end
if chk==0 then return Duel.IsExistingTarget(c14731897.filter,tp,LOCATION_MZONE,0,1,nil,def) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c14731897.filter,tp,LOCATION_MZONE,0,1,1,nil,def) Duel.SelectTarget(tp,c14731897.filter,tp,LOCATION_MZONE,0,1,1,nil,sum)
end end
function c14731897.activate(e,tp,eg,ep,ev,re,r,rp) function c14731897.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
......
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