Commit 27198681 authored by xiaoye's avatar xiaoye

update VgF.GetMatchingGroup

parent 1dbd863e
...@@ -1032,11 +1032,25 @@ end ...@@ -1032,11 +1032,25 @@ end
---loc_self 代表玩家 p 来看的自己的位置,loc_oppo 代表玩家 p 来看的对方的位置 ---loc_self 代表玩家 p 来看的自己的位置,loc_oppo 代表玩家 p 来看的对方的位置
---第6个参数开始为额外参数 ---第6个参数开始为额外参数
function VgF.GetMatchingGroup(f, p, loc_self, loc_oppo, ex, ...) function VgF.GetMatchingGroup(f, p, loc_self, loc_oppo, ex, ...)
local loc_self, loc_self_con = VgF.GetLocCondition(loc_self) function GetLocFilter()
local loc_oppo, loc_oppo_con = VgF.GetLocCondition(loc_oppo) local loc_filter = {VgF.True, VgF.True}
local g = Duel.GetMatchingGroup(loc_self_con, p, loc_self, 0, nil) for i, loc in ipairs({loc_self, loc_oppo}) do
g = g + Duel.GetMatchingGroup(loc_oppo_con, p, 0, loc_oppo, nil) if loc & LOCATION_V_CIRCLE > 0 and loc & LOCATION_R_CIRCLE > 0 then
g = g - Duel.GetMatchingGroup(Card.IsFacedown, p, LOCATION_CIRCLE, LOCATION_CIRCLE, nil) loc = (loc - LOCATION_V_CIRCLE - LOCATION_R_CIRCLE) | LOCATION_CIRCLE
elseif loc & LOCATION_V_CIRCLE > 0 then
loc = (loc - LOCATION_V_CIRCLE) | LOCATION_CIRCLE
loc_filter[i] = Card.IsVanguard
elseif loc & LOCATION_R_CIRCLE > 0 then
loc = (loc - LOCATION_R_CIRCLE) | LOCATION_CIRCLE
loc_filter[i] = Card.IsRearguard
end
end
return table.unpack(loc_filter)
end
local loc_self_filter, loc_oppo_filter = GetLocFilter()
local g = Duel.GetMatchingGroup(loc_self_filter, p, loc_self, 0, nil)
g:Merge(Duel.GetMatchingGroup(loc_oppo_filter, p, 0, loc_oppo, nil))
g:Sub(Duel.GetMatchingGroup(Card.IsFacedown, p, LOCATION_CIRCLE, LOCATION_CIRCLE, nil))
if loc_self & LOCATION_SOUL > 0 then if loc_self & LOCATION_SOUL > 0 then
g = g + VgF.GetSoulGroup(p) g = g + VgF.GetSoulGroup(p)
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