Battles dont take forever to join

This commit is contained in:
John 2015-07-09 16:47:39 +03:00
parent 7b953dcb0e
commit f6744b92d2

View file

@ -229,6 +229,8 @@ class BattleBase:
posA]
suitSpeed = 4.8
toonSpeed = 8.0
maxTimeToon = 10.0
maxTimeSuit = 11.0
def __init__(self):
self.pos = Point3(0, 0, 0)
@ -256,15 +258,15 @@ class BattleBase:
facing.normalize()
suitdest = Point3(centerpos - Point3(facing * 6.0))
dist = Vec3(suitdest - suitpos).length()
return dist / BattleBase.suitSpeed
return min(dist / BattleBase.suitSpeed, BattleBase.maxTimeSuit)
def calcSuitMoveTime(self, pos0, pos1):
dist = Vec3(pos0 - pos1).length()
return dist / BattleBase.suitSpeed
return min(dist / BattleBase.suitSpeed, BattleBase.maxTimeSuit)
def calcToonMoveTime(self, pos0, pos1):
dist = Vec3(pos0 - pos1).length()
return dist / BattleBase.toonSpeed
return min(dist / BattleBase.toonSpeed, BattleBase.maxTimeToon)
def buildJoinPointList(self, avPos, destPos, toon = 0):
minDist = 999999.0