Commit 56daa225 authored by whenmo's avatar whenmo Committed by GitHub

Update VgFuncLib.lua

parent 9f4f2f6b
...@@ -573,13 +573,19 @@ function VgF.DamageFill(val) ...@@ -573,13 +573,19 @@ function VgF.DamageFill(val)
end end
end end
function VgF.CostAnd(f1,f2) ---用于多Cost。例如 VgF.CostAnd(vgf.DamageCost(1), vgf.DisCardCost(1))。
function VgF.CostAnd(...)
funcs = {...}
return function (e,tp,eg,ep,ev,re,r,rp,chk) return function (e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
return f1(e,tp,eg,ep,ev,re,r,rp,chk) and f2(e,tp,eg,ep,ev,re,r,rp,chk) for _, func in ipairs(funcs) do
chk = chk and func(e,tp,eg,ep,ev,re,r,rp,chk)
end
return chk
end
for _, func in ipairs(funcs) do
func(e,tp,eg,ep,ev,re,r,rp)
end end
f1(e,tp,eg,ep,ev,re,r,rp,chk)
f2(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
...@@ -1388,4 +1394,4 @@ end ...@@ -1388,4 +1394,4 @@ end
function VgF.PlayerEffect(e,tp,eg,ep,ev,re,r,rp) function VgF.PlayerEffect(e,tp,eg,ep,ev,re,r,rp)
return true return true
end end
\ No newline at end of file
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