新增队伍系统,攻击不会打给同队,剩一队时游戏就结束(目前允许0~6,0号为自由队,每个人分别算一队)

添加/group命令来选择队伍
This commit is contained in:
MrZ_26
2022-10-26 01:26:04 +08:00
parent bd428f355a
commit 7d44396b03
9 changed files with 84 additions and 34 deletions

View File

@@ -188,12 +188,22 @@ end
-- Royale mode
function randomTarget(P)-- Return a random opponent for P
if #PLY_ALIVE>1 then
local R
repeat
R=PLY_ALIVE[rnd(#PLY_ALIVE)]
until R~=P
return R
local l=TABLE.shift(PLY_ALIVE,0)
local count=0
for i=1,#l do
if P.group==0 and l[i]~=P or P.group~=l[i].group then
count=count+1
end
end
if count==0 then return end
count=rnd(count)
for i=1,#l do
if P.group==0 and l[i]~=P or P.group~=l[i].group then
count=count-1
if count==0 then
return l[i]
end
end
end
end
function freshMostDangerous()