2019-08-14 16:26:23 +02:00
|
|
|
local maputils = {}
|
2021-07-03 11:17:57 +02:00
|
|
|
local STATS = require "datas.consts.stats"
|
2019-08-14 16:26:23 +02:00
|
|
|
|
|
|
|
maputils.CONST = {}
|
|
|
|
|
|
|
|
maputils.CONST.STARTX = -8
|
|
|
|
maputils.CONST.STARTY = 90
|
|
|
|
|
|
|
|
function maputils.sortBattlers(a, b)
|
2021-07-03 11:17:57 +02:00
|
|
|
local aspeed = a.fighter:getStat(STATS.SPEED) / (3 ^ (a.number-1))
|
|
|
|
local bspeed = b.fighter:getStat(STATS.SPEED) / (3 ^ (b.number-1))
|
2019-08-14 16:26:23 +02:00
|
|
|
|
|
|
|
if (aspeed == bspeed) then
|
2020-07-19 16:57:38 +02:00
|
|
|
if (a.fighter.isHero == b.fighter.isHero) then
|
2020-08-05 11:54:39 +02:00
|
|
|
return (a.fighter.id < b.fighter.id)
|
2019-08-14 16:26:23 +02:00
|
|
|
else
|
2020-07-19 16:57:38 +02:00
|
|
|
return a.fighter.isHero
|
2019-08-14 16:26:23 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
return (aspeed > bspeed)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return maputils
|