coghq: fix a bunch of vp crashes
This commit is contained in:
parent
19080e8754
commit
bac1d10200
7 changed files with 10 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
|
from libotp import *
|
||||||
from direct.interval.IntervalGlobal import *
|
from direct.interval.IntervalGlobal import *
|
||||||
from .BattleBase import *
|
from .BattleBase import *
|
||||||
from direct.actor import Actor
|
from direct.actor import Actor
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
|
from libotp import *
|
||||||
from direct.interval.IntervalGlobal import *
|
from direct.interval.IntervalGlobal import *
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
from toontown.hood import Place
|
from toontown.hood import Place
|
||||||
|
|
|
@ -5,6 +5,7 @@ from toontown.hood import Place
|
||||||
from toontown.building import Elevator
|
from toontown.building import Elevator
|
||||||
from toontown.toonbase import ToontownGlobals
|
from toontown.toonbase import ToontownGlobals
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
|
from libotp import *
|
||||||
from otp.distributed.TelemetryLimiter import RotationLimitToH, TLGatherAllAvs
|
from otp.distributed.TelemetryLimiter import RotationLimitToH, TLGatherAllAvs
|
||||||
|
|
||||||
class CogHQLobby(Place.Place):
|
class CogHQLobby(Place.Place):
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
|
from libotp import *
|
||||||
from direct.interval.IntervalGlobal import *
|
from direct.interval.IntervalGlobal import *
|
||||||
from direct.actor import Actor
|
from direct.actor import Actor
|
||||||
from otp.avatar import Avatar
|
from otp.avatar import Avatar
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
|
from libotp import *
|
||||||
from direct.interval.IntervalGlobal import *
|
from direct.interval.IntervalGlobal import *
|
||||||
from direct.distributed.ClockDelta import *
|
from direct.distributed.ClockDelta import *
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
|
|
|
@ -403,9 +403,9 @@ class DistributedBossCogAI(DistributedAvatarAI.DistributedAvatarAI):
|
||||||
random.shuffle(toons)
|
random.shuffle(toons)
|
||||||
numToons = min(len(toons), 8)
|
numToons = min(len(toons), 8)
|
||||||
if numToons < 4:
|
if numToons < 4:
|
||||||
numToonsB = numToons / 2
|
numToonsB = numToons // 2
|
||||||
else:
|
else:
|
||||||
numToonsB = (numToons + random.choice([0, 1])) / 2
|
numToonsB = (numToons + random.choice([0, 1])) // 2
|
||||||
teamA = toons[numToonsB:numToons]
|
teamA = toons[numToonsB:numToons]
|
||||||
teamB = toons[:numToonsB]
|
teamB = toons[:numToonsB]
|
||||||
loose = toons[numToons:]
|
loose = toons[numToons:]
|
||||||
|
@ -575,7 +575,7 @@ class DistributedBossCogAI(DistributedAvatarAI.DistributedAvatarAI):
|
||||||
|
|
||||||
joinedReserves = []
|
joinedReserves = []
|
||||||
if len(self.reserveSuits) > 0 and len(activeSuits) < 4:
|
if len(self.reserveSuits) > 0 and len(activeSuits) < 4:
|
||||||
hpPercent = 100 - totalHp / totalMaxHp * 100.0
|
hpPercent = 100 - totalHp // totalMaxHp * 100.0
|
||||||
for info in self.reserveSuits:
|
for info in self.reserveSuits:
|
||||||
if info[1] <= hpPercent and len(activeSuits) < 4:
|
if info[1] <= hpPercent and len(activeSuits) < 4:
|
||||||
suits.append(info[0])
|
suits.append(info[0])
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
|
from libotp import *
|
||||||
from direct.interval.IntervalGlobal import *
|
from direct.interval.IntervalGlobal import *
|
||||||
from toontown.battle.BattleProps import *
|
from toontown.battle.BattleProps import *
|
||||||
from direct.distributed.ClockDelta import *
|
from direct.distributed.ClockDelta import *
|
||||||
|
@ -73,7 +74,7 @@ class DistributedSellbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM):
|
||||||
global OneBossCog
|
global OneBossCog
|
||||||
DistributedBossCog.DistributedBossCog.announceGenerate(self)
|
DistributedBossCog.DistributedBossCog.announceGenerate(self)
|
||||||
self.setName(TTLocalizer.SellbotBossName)
|
self.setName(TTLocalizer.SellbotBossName)
|
||||||
nameInfo = TTLocalizer.BossCogNameWithDept % {'name': self.name,
|
nameInfo = TTLocalizer.BossCogNameWithDept % {'name': self._name,
|
||||||
'dept': SuitDNA.getDeptFullname(self.style.dept)}
|
'dept': SuitDNA.getDeptFullname(self.style.dept)}
|
||||||
self.setDisplayName(nameInfo)
|
self.setDisplayName(nameInfo)
|
||||||
self.cageDoorSfx = loader.loadSfx('phase_5/audio/sfx/CHQ_SOS_cage_door.mp3')
|
self.cageDoorSfx = loader.loadSfx('phase_5/audio/sfx/CHQ_SOS_cage_door.mp3')
|
||||||
|
|
Loading…
Reference in a new issue