coghq: factory almost loads

This commit is contained in:
John Cote 2020-01-08 17:47:17 -05:00
parent 7c58614aa7
commit f73eb9eb84
4 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,5 @@
from direct.showbase.DirectObject import DirectObject
from direct.showbase.PythonUtil import lineInfo
import string
from direct.directnotify import DirectNotifyGlobal
class Entity(DirectObject):
@ -60,7 +59,7 @@ class Entity(DirectObject):
return self.getZoneEntity().getNodePath()
def privGetSetter(self, attrib):
setFuncName = 'set%s%s' % (string.upper(attrib[0]), attrib[1:])
setFuncName = 'set%s%s' % (attrib[0].upper(), attrib[1:])
if hasattr(self, setFuncName):
return getattr(self, setFuncName)
return None

View file

@ -1,4 +1,3 @@
import string
from direct.interval.IntervalGlobal import *
from .Entity import Entity
from pandac.PandaModules import Vec3
@ -22,7 +21,7 @@ class PropSpinner(Entity):
nameParts = name.split('_')
axis = nameParts[2]
rate = 0
neg = string.upper(nameParts[3][0]) == 'N'
neg = nameParts[3][0].upper() == 'N'
if neg:
nameParts[3] = nameParts[3][1:]
try:

View file

@ -3,6 +3,7 @@ from toontown.battle import BattlePlace
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from pandac.PandaModules import *
from libotp import *
from otp.distributed.TelemetryLimiter import RotationLimitToH, TLGatherAllAvs
from toontown.toon import Toon
from toontown.toonbase import ToontownGlobals

View file

@ -4,6 +4,7 @@ from toontown.suit import SuitDNA
from direct.directnotify import DirectNotifyGlobal
from toontown.coghq import LevelBattleManagerAI
import random
import functools
class LevelSuitPlannerAI(DirectObject.DirectObject):
notify = DirectNotifyGlobal.directNotify.newCategory('LevelSuitPlannerAI')
@ -39,7 +40,7 @@ class LevelSuitPlannerAI(DirectObject.DirectObject):
for currChance in range(num):
joinChances.append(random.randint(1, 100))
joinChances.sort(cmp)
joinChances.sort(key=functools.cmp_to_key(cmp))
return joinChances
def __genSuitInfos(self, level, track):