Files
Techmino/parts/eventsets/checkTurn_7.lua
MrZ626 653debbbc2 回合制模式使用玩家sid处理回合顺序
本地玩家也有sid了(跟id相同)
2021-09-26 11:37:49 +08:00

19 lines
543 B
Lua

return{
dropPiece=function(P)
if P.stat.piece%7==0 and #PLY_ALIVE>1 then
P.control=false
local id1=P.sid
local minMaxID,minID=1e99,1e99
for i=1,#PLY_ALIVE do
local id2=PLY_ALIVE[i].sid
if id2>id1 then
minMaxID=math.min(minMaxID,id2)
else
minID=math.min(minID,id2)
end
end
PLY_ALIVE[minMaxID==1e99 and minID or minMaxID].control=true
end
end
}