mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Battles dont take forever to join
This commit is contained in:
parent
7b953dcb0e
commit
f6744b92d2
1 changed files with 5 additions and 3 deletions
|
@ -229,6 +229,8 @@ class BattleBase:
|
||||||
posA]
|
posA]
|
||||||
suitSpeed = 4.8
|
suitSpeed = 4.8
|
||||||
toonSpeed = 8.0
|
toonSpeed = 8.0
|
||||||
|
maxTimeToon = 10.0
|
||||||
|
maxTimeSuit = 11.0
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.pos = Point3(0, 0, 0)
|
self.pos = Point3(0, 0, 0)
|
||||||
|
@ -256,15 +258,15 @@ class BattleBase:
|
||||||
facing.normalize()
|
facing.normalize()
|
||||||
suitdest = Point3(centerpos - Point3(facing * 6.0))
|
suitdest = Point3(centerpos - Point3(facing * 6.0))
|
||||||
dist = Vec3(suitdest - suitpos).length()
|
dist = Vec3(suitdest - suitpos).length()
|
||||||
return dist / BattleBase.suitSpeed
|
return min(dist / BattleBase.suitSpeed, BattleBase.maxTimeSuit)
|
||||||
|
|
||||||
def calcSuitMoveTime(self, pos0, pos1):
|
def calcSuitMoveTime(self, pos0, pos1):
|
||||||
dist = Vec3(pos0 - pos1).length()
|
dist = Vec3(pos0 - pos1).length()
|
||||||
return dist / BattleBase.suitSpeed
|
return min(dist / BattleBase.suitSpeed, BattleBase.maxTimeSuit)
|
||||||
|
|
||||||
def calcToonMoveTime(self, pos0, pos1):
|
def calcToonMoveTime(self, pos0, pos1):
|
||||||
dist = Vec3(pos0 - pos1).length()
|
dist = Vec3(pos0 - pos1).length()
|
||||||
return dist / BattleBase.toonSpeed
|
return min(dist / BattleBase.toonSpeed, BattleBase.maxTimeToon)
|
||||||
|
|
||||||
def buildJoinPointList(self, avPos, destPos, toon = 0):
|
def buildJoinPointList(self, avPos, destPos, toon = 0):
|
||||||
minDist = 999999.0
|
minDist = 999999.0
|
||||||
|
|
Loading…
Reference in a new issue