toontown: initial work on python 3.x support

This commit is contained in:
John Cote 2019-12-30 01:07:56 -05:00
parent cd932aa66e
commit 3c14c14623
927 changed files with 3703 additions and 3700 deletions

View file

@ -1,10 +1,10 @@
import __builtin__
import builtins
class game:
name = 'toontown'
process = 'server'
__builtin__.game = game
builtins.game = game
from panda3d.core import *
@ -38,5 +38,5 @@ except SystemExit:
raise
except Exception:
from otp.otpbase import PythonUtil
print PythonUtil.describeException()
print(PythonUtil.describeException())
raise

View file

@ -1,7 +1,7 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
import HolidayDecorator
from . import HolidayDecorator
from toontown.toonbase import ToontownGlobals
from pandac.PandaModules import Vec4, CSDefault, TransformState, NodePath, TransparencyAttrib
from libtoontown import loadDNAFile

View file

@ -1,5 +1,5 @@
from pandac.PandaModules import *
from ToontownAIMsgTypes import *
from .ToontownAIMsgTypes import *
from direct.directnotify.DirectNotifyGlobal import *
from toontown.toon import DistributedToonAI
from direct.distributed.PyDatagram import PyDatagram
@ -61,7 +61,7 @@ class DatabaseObject:
if fields != None:
values = {}
for field in fields:
if self.values.has_key(field):
if field in self.values:
values[field] = self.values[field]
else:
self.notify.warning('Field %s not defined.' % field)
@ -128,7 +128,7 @@ class DatabaseObject:
dg.addServerHeader(DBSERVER_ID, self.air.ourChannel, DBSERVER_SET_STORED_VALUES)
dg.addUint32(self.doId)
dg.addUint16(len(values))
items = values.items()
items = list(values.items())
for field, value in items:
dg.addString(field)
@ -150,7 +150,7 @@ class DatabaseObject:
def fillin(self, do, dclass):
do.doId = self.doId
for field, value in self.values.items():
for field, value in list(self.values.items()):
if field == 'setZonesVisited' and value.getLength() == 1:
self.notify.warning('Ignoring broken setZonesVisited')
else:
@ -172,7 +172,7 @@ class DatabaseObject:
def createObject(self, objectType):
values = {}
for key, value in values.items():
for key, value in list(values.items()):
values[key] = PyDatagram(str(value))
context = self.air.dbObjContext
@ -185,10 +185,10 @@ class DatabaseObject:
dg.addString('')
dg.addUint16(objectType)
dg.addUint16(len(values))
for field in values.keys():
for field in list(values.keys()):
dg.addString(field)
for value in values.values():
for value in list(values.values()):
dg.addString(value.getMessage())
self.air.send(dg)
@ -209,5 +209,5 @@ class DatabaseObject:
dg = PyDatagram()
dg.addServerHeader(DBSERVER_ID, self.air.ourChannel, DBSERVER_DELETE_STORED_OBJECT)
dg.addUint32(self.doId)
dg.addUint32(3735928559L)
dg.addUint32(3735928559)
self.air.send(dg)

View file

@ -1,7 +1,7 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from otp.speedchat import SpeedChatGlobals
import DistributedScavengerHuntTarget
from . import DistributedScavengerHuntTarget
class DistributedTrickOrTreatTarget(DistributedScavengerHuntTarget.DistributedScavengerHuntTarget):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedTrickOrTreatTarget')

View file

@ -1,7 +1,7 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from toontown.speedchat.TTSCIndexedTerminal import TTSCIndexedMsgEvent
import DistributedScavengerHuntTarget
from . import DistributedScavengerHuntTarget
class DistributedWinterCarolingTarget(DistributedScavengerHuntTarget.DistributedScavengerHuntTarget):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedWinterCarolingTarget')

View file

@ -1,7 +1,7 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
import HolidayDecorator
from . import HolidayDecorator
from toontown.toonbase import ToontownGlobals
from toontown.safezone import Playground
from toontown.town import Street

View file

@ -62,7 +62,7 @@ class HolidayDecorator:
index = int(np.getTag('transformIndex'))
transform = loader.holidayPropTransforms.get(index, TransformState.makeIdentity())
newNP.setTransform(NodePath(), transform)
newNP.setTag('transformIndex', `index`)
newNP.setTag('transformIndex', repr(index))
s = Sequence(Wait(wait), np.colorScaleInterval(tFadeOut, Vec4(1, 1, 1, 0), startColorScale=Vec4(1, 1, 1, 1), blendType='easeInOut'), Func(np.detachNode), Func(np.clearTransparency), newNP.colorScaleInterval(tFadeOut, Vec4(1, 1, 1, 1), startColorScale=Vec4(1, 1, 1, 0), blendType='easeInOut'), Func(newNP.clearTransparency), Func(newNP.clearColorScale))
p.append(s)

View file

@ -5,9 +5,9 @@ from toontown.toonbase import ToontownGlobals
from toontown.toonbase import ToontownBattleGlobals
from toontown.battle import SuitBattleGlobals
from toontown.toonbase import TTLocalizer
import HolidayDecorator
import HalloweenHolidayDecorator
import CrashedLeaderBoardDecorator
from . import HolidayDecorator
from . import HalloweenHolidayDecorator
from . import CrashedLeaderBoardDecorator
from direct.interval.IntervalGlobal import *
import calendar
from copy import deepcopy
@ -323,11 +323,11 @@ class NewsManager(DistributedObject.DistributedObject):
def isStarting(id):
return id not in self.holidayIdList
toEnd = filter(isEnding, self.holidayIdList)
toEnd = list(filter(isEnding, self.holidayIdList))
for endingHolidayId in toEnd:
self.endHoliday(endingHolidayId)
toStart = filter(isStarting, holidayIdList)
toStart = list(filter(isStarting, holidayIdList))
for startingHolidayId in toStart:
self.startHoliday(startingHolidayId)
@ -461,11 +461,11 @@ class NewsManager(DistributedObject.DistributedObject):
def setSpookyBlackCatHolidayStart(self):
base.localAvatar.setSystemMessage(0, TTLocalizer.SpookyBlackCatHolidayStart)
for currToon in base.cr.toons.values():
for currToon in list(base.cr.toons.values()):
currToon.setDNA(currToon.style.clone())
def setSpookyBlackCatHolidayEnd(self):
for currToon in base.cr.toons.values():
for currToon in list(base.cr.toons.values()):
currToon.setDNA(currToon.style.clone())
def setTopToonsMarathonStart(self):

View file

@ -59,7 +59,7 @@ class ServerEventMultiAccumulator(ServerEventBuffer):
if not len(self.events):
return
msg = ''
eventNames = self.events.keys()
eventNames = list(self.events.keys())
eventNames.sort()
for eventName in eventNames:
msg += '%s:%s' % (eventName, self.events[eventName])

View file

@ -6,10 +6,10 @@ TTAIMsgName2Id = {'DBSERVER_GET_ESTATE': 1040,
'WHITELIST_MANAGER_UD_TO_ALL_AI': 1044}
TTAIMsgId2Names = invertDictLossless(TTAIMsgName2Id)
if not isClient():
print 'EXECWARNING ToontownAIMsgTypes: %s' % TTAIMsgName2Id
print('EXECWARNING ToontownAIMsgTypes: %s' % TTAIMsgName2Id)
printStack()
for name, value in TTAIMsgName2Id.items():
exec '%s = %s' % (name, value)
for name, value in list(TTAIMsgName2Id.items()):
exec('%s = %s' % (name, value))
del name
del value

View file

@ -226,7 +226,7 @@ class ToontownAIRepository(ToontownInternalRepository):
self.welcomeValleyManager.createWelcomeValleyZones()
# Assign the initial suit buildings.
for suitPlanner in self.suitPlanners.values():
for suitPlanner in list(self.suitPlanners.values()):
suitPlanner.assignInitialSuitBuildings()
def genDNAFileName(self, zoneId):
@ -258,7 +258,7 @@ class ToontownAIRepository(ToontownInternalRepository):
found = vfs.resolveFilename(filename, searchPath)
if not found:
self.notify.warning('lookupDNAFileName - %s not found on:' % dnaFileName)
print searchPath
print(searchPath)
else:
return filename.getFullpath()
@ -287,7 +287,7 @@ class ToontownAIRepository(ToontownInternalRepository):
kartPads.append(viewPad)
kartPadGroups.append(dnaData)
for i in xrange(dnaData.getNumChildren()):
for i in range(dnaData.getNumChildren()):
foundKartPads, foundKartPadGroups = self.findRacingPads(dnaData.at(i), zoneId, area, type, overrideDNAZone)
kartPads.extend(foundKartPads)
kartPadGroups.extend(foundKartPadGroups)
@ -306,7 +306,7 @@ class ToontownAIRepository(ToontownInternalRepository):
leaderBoard.generateWithRequired(zoneId)
leaderBoards.append(leaderBoard)
for i in xrange(dnaData.getNumChildren()):
for i in range(dnaData.getNumChildren()):
foundLeaderBoards = self.findLeaderBoards(dnaData.at(i), zoneId)
leaderBoards.extend(foundLeaderBoards)

View file

@ -104,10 +104,10 @@ class ToontownMagicWordManager(MagicWordManager.MagicWordManager):
go = Fanfare.makeFanfareWithMessageImage(0, base.localAvatar, 1, "You just did a ~fanfare. Here's a rake.", Vec2(0, 0.2), 0.08, base.localAvatar.inventory.buttonLookup(1, 1), Vec3(0, 0, 0), 4)
Sequence(go[0], Func(go[1].show), LerpColorScaleInterval(go[1], duration=0.5, startColorScale=Vec4(1, 1, 1, 0), colorScale=Vec4(1, 1, 1, 1)), Wait(2), LerpColorScaleInterval(go[1], duration=0.5, startColorScale=Vec4(1, 1, 1, 1), colorScale=Vec4(1, 1, 1, 0)), Func(go[1].remove)).start()
elif wordIs('~endgame'):
print 'Requesting minigame abort...'
print('Requesting minigame abort...')
messenger.send('minigameAbort')
elif wordIs('~wingame'):
print 'Requesting minigame victory...'
print('Requesting minigame victory...')
messenger.send('minigameVictory')
elif wordIs('~walk'):
try:
@ -139,7 +139,7 @@ class ToontownMagicWordManager(MagicWordManager.MagicWordManager):
self.rogues.animate()
self.acceptOnce('mouse1', self.exit_rogues)
elif wordIs('~showPaths'):
for obj in self.cr.doId2do.values():
for obj in list(self.cr.doId2do.values()):
if isinstance(obj, DistributedSuitPlanner.DistributedSuitPlanner):
obj.showPaths()
@ -147,7 +147,7 @@ class ToontownMagicWordManager(MagicWordManager.MagicWordManager):
if hasattr(place, 'showPaths'):
place.showPaths()
elif wordIs('~hidePaths'):
for obj in self.cr.doId2do.values():
for obj in list(self.cr.doId2do.values()):
if isinstance(obj, DistributedSuitPlanner.DistributedSuitPlanner):
obj.hidePaths()
@ -221,7 +221,7 @@ class ToontownMagicWordManager(MagicWordManager.MagicWordManager):
if not camParent.isEmpty():
myCam.wrtReparentTo(camParent)
self.setMagicWordResponse(response)
print response
print(response)
elif wordIs('~sync'):
tm = base.cr.timeManager
if tm == None:
@ -581,7 +581,7 @@ class ToontownMagicWordManager(MagicWordManager.MagicWordManager):
hoodId = ToontownGlobals.PartyHood
ToontownDistrictStats.refresh('shardInfoUpdated')
curShardTuples = base.cr.listActiveShards()
lowestPop = 100000000000000000L
lowestPop = 100000000000000000
shardId = None
for shardInfo in curShardTuples:
pop = shardInfo[2]
@ -680,7 +680,7 @@ class ToontownMagicWordManager(MagicWordManager.MagicWordManager):
def identifyDistributedObjects(self, name):
result = []
lowerName = string.lower(name)
for obj in base.cr.doId2do.values():
for obj in list(base.cr.doId2do.values()):
className = obj.__class__.__name__
try:
name = obj.getName()
@ -741,7 +741,7 @@ class ToontownMagicWordManager(MagicWordManager.MagicWordManager):
def doBossBattle(self, word):
args = word.split()
bossCog = None
for distObj in self.cr.doId2do.values():
for distObj in list(self.cr.doId2do.values()):
if isinstance(distObj, DistributedBossCog.DistributedBossCog):
bossCog = distObj
break

View file

@ -133,7 +133,7 @@ def getDefaultSuitAttack():
def findToonAttack(toons, attacks, track):
foundAttacks = []
for t in toons:
if attacks.has_key(t):
if t in attacks:
attack = attacks[t]
local_track = attack[TOON_TRACK_COL]
if track != NPCSOS and attack[TOON_TRACK_COL] == NPCSOS:

View file

@ -1,9 +1,9 @@
from BattleBase import *
from DistributedBattleAI import *
from .BattleBase import *
from .DistributedBattleAI import *
from toontown.toonbase.ToontownBattleGlobals import *
import random
from toontown.suit import DistributedSuitBaseAI
import SuitBattleGlobals, BattleExperienceAI
from . import SuitBattleGlobals, BattleExperienceAI
from toontown.toon import NPCToons
from toontown.pets import PetTricks, DistributedPetProxyAI
from direct.showbase.PythonUtil import lerp
@ -166,7 +166,7 @@ class BattleCalculatorAI:
prevAttack = self.battle.toonAttacks[prevAtkId]
prevAtkTrack = self.__getActualTrack(prevAttack)
lure = atkTrack == LURE and (not attackAffectsGroup(atkTrack, atkLevel,
attack[TOON_TRACK_COL]) and self.successfulLures.has_key(attack[TOON_TGT_COL]) or attackAffectsGroup(atkTrack, atkLevel, attack[TOON_TRACK_COL]))
attack[TOON_TRACK_COL]) and attack[TOON_TGT_COL] in self.successfulLures or attackAffectsGroup(atkTrack, atkLevel, attack[TOON_TRACK_COL]))
if atkTrack == prevAtkTrack and (attack[TOON_TGT_COL] == prevAttack[TOON_TGT_COL] or lure):
if prevAttack[TOON_ACCBONUS_COL] == 1:
if debug:
@ -280,7 +280,7 @@ class BattleCalculatorAI:
return NO_ATTACK
def getSuitTrapType(self, suitId):
if self.traps.has_key(suitId):
if suitId in self.traps:
if self.traps[suitId][0] == self.TRAP_CONFLICT:
return NO_TRAP
else:
@ -289,7 +289,7 @@ class BattleCalculatorAI:
return NO_TRAP
def __suitTrapDamage(self, suitId):
if self.traps.has_key(suitId):
if suitId in self.traps:
return self.traps[suitId][2]
else:
return 0
@ -297,7 +297,7 @@ class BattleCalculatorAI:
def addTrainTrapForJoiningSuit(self, suitId):
self.notify.debug('addTrainTrapForJoiningSuit suit=%d self.traps=%s' % (suitId, self.traps))
trapInfoToUse = None
for trapInfo in self.traps.values():
for trapInfo in list(self.traps.values()):
if trapInfo[0] == UBER_GAG_LEVEL_INDEX:
trapInfoToUse = trapInfo
break
@ -310,14 +310,14 @@ class BattleCalculatorAI:
def __addSuitGroupTrap(self, suitId, trapLvl, attackerId, allSuits, npcDamage=0):
if npcDamage == 0:
if self.traps.has_key(suitId):
if suitId in self.traps:
if self.traps[suitId][0] == self.TRAP_CONFLICT:
pass
else:
self.traps[suitId][0] = self.TRAP_CONFLICT
for suit in allSuits:
id = suit.doId
if self.traps.has_key(id):
if id in self.traps:
self.traps[id][0] = self.TRAP_CONFLICT
else:
self.traps[id] = [
@ -336,7 +336,7 @@ class BattleCalculatorAI:
self.notify.debug('calling __addLuredSuitsDelayed')
self.__addLuredSuitsDelayed(attackerId, targetId=-1, ignoreDamageCheck=True)
else:
if self.traps.has_key(suitId):
if suitId in self.traps:
if self.traps[suitId][0] == self.TRAP_CONFLICT:
self.traps[suitId] = [
trapLvl, 0, npcDamage]
@ -347,7 +347,7 @@ class BattleCalculatorAI:
def __addSuitTrap(self, suitId, trapLvl, attackerId, npcDamage=0):
if npcDamage == 0:
if self.traps.has_key(suitId):
if suitId in self.traps:
if self.traps[suitId][0] == self.TRAP_CONFLICT:
pass
else:
@ -363,7 +363,7 @@ class BattleCalculatorAI:
else:
self.traps[suitId] = [trapLvl, 0, damage]
else:
if self.traps.has_key(suitId):
if suitId in self.traps:
if self.traps[suitId][0] == self.TRAP_CONFLICT:
self.traps[suitId] = [
trapLvl, 0, npcDamage]
@ -373,28 +373,28 @@ class BattleCalculatorAI:
trapLvl, 0, npcDamage]
def __removeSuitTrap(self, suitId):
if self.traps.has_key(suitId):
if suitId in self.traps:
del self.traps[suitId]
def __clearTrapCreator(self, creatorId, suitId=None):
if suitId == None:
for currTrap in self.traps.keys():
for currTrap in list(self.traps.keys()):
if creatorId == self.traps[currTrap][1]:
self.traps[currTrap][1] = 0
elif self.traps.has_key(suitId):
elif suitId in self.traps:
self.traps[suitId][1] = 0
return
def __trapCreator(self, suitId):
if self.traps.has_key(suitId):
if suitId in self.traps:
return self.traps[suitId][1]
else:
return 0
def __initTraps(self):
self.trainTrapTriggered = False
keysList = self.traps.keys()
keysList = list(self.traps.keys())
for currTrap in keysList:
if self.traps[currTrap][0] == self.TRAP_CONFLICT:
del self.traps[currTrap]
@ -437,7 +437,7 @@ class BattleCalculatorAI:
targetLured = 1
else:
attackTrack = TRAP
if self.traps.has_key(targetId):
if targetId in self.traps:
trapInfo = self.traps[targetId]
attackLevel = trapInfo[0]
else:
@ -467,7 +467,7 @@ class BattleCalculatorAI:
targetLured = 1
if attackLevel != -1:
self.__addLuredSuitsDelayed(toonId, targetId)
if targetLured and (not self.successfulLures.has_key(targetId) or self.successfulLures.has_key(targetId) and self.successfulLures[targetId][1] < atkLevel):
if targetLured and (targetId not in self.successfulLures or targetId in self.successfulLures and self.successfulLures[targetId][1] < atkLevel):
self.notify.debug('Adding target ' + str(targetId) + ' to successfulLures list')
self.successfulLures[targetId] = [toonId,
atkLevel,
@ -510,7 +510,7 @@ class BattleCalculatorAI:
simbase.air.writeServerEvent('suspicious', toonId, commentStr)
dislId = toon.DISLid
simbase.air.banManager.ban(toonId, dislId, commentStr)
print 'Not enough PinkSlips to fire cog - print a warning here'
print('Not enough PinkSlips to fire cog - print a warning here')
else:
suit.skeleRevives = 0
attackDamage = suit.getHP()
@ -554,7 +554,7 @@ class BattleCalculatorAI:
result = result / len(targetList)
if self.notify.getDebug():
self.notify.debug('Splitting heal among ' + str(len(targetList)) + ' targets')
if self.successfulLures.has_key(targetId) and atkTrack == LURE:
if targetId in self.successfulLures and atkTrack == LURE:
self.notify.debug('Updating lure damage to ' + str(result))
self.successfulLures[targetId][3] = result
else:
@ -756,14 +756,14 @@ class BattleCalculatorAI:
attack = self.battle.toonAttacks[attackerId]
track = self.__getActualTrack(attack)
if hp:
if self.hpBonuses[tgtPos].has_key(track):
if track in self.hpBonuses[tgtPos]:
self.hpBonuses[tgtPos][track].append([attackIndex, dmg])
else:
self.hpBonuses[tgtPos][track] = [
[
attackIndex, dmg]]
elif self.__suitIsLured(currTgt.getDoId()):
if self.kbBonuses[tgtPos].has_key(track):
if track in self.kbBonuses[tgtPos]:
self.kbBonuses[tgtPos][track].append([attackIndex, dmg])
else:
self.kbBonuses[tgtPos][track] = [
@ -795,7 +795,7 @@ class BattleCalculatorAI:
self.notify.debug('Processing kbBonuses: ' + repr(self.kbBonuses))
tgtPos = 0
for currTgt in bonusList:
for currAtkType in currTgt.keys():
for currAtkType in list(currTgt.keys()):
if len(currTgt[currAtkType]) > 1 or not hp and len(currTgt[currAtkType]) > 0:
totalDmgs = 0
for currDmg in currTgt[currAtkType]:
@ -855,10 +855,10 @@ class BattleCalculatorAI:
self.notify.warning('__clearAttack not implemented for suits!')
def __rememberToonAttack(self, suitId, toonId, damage):
if not self.SuitAttackers.has_key(suitId):
if suitId not in self.SuitAttackers:
self.SuitAttackers[suitId] = {toonId: damage}
else:
if not self.SuitAttackers[suitId].has_key(toonId):
if toonId not in self.SuitAttackers[suitId]:
self.SuitAttackers[suitId][toonId] = damage
else:
if self.SuitAttackers[suitId][toonId] <= damage:
@ -882,7 +882,7 @@ class BattleCalculatorAI:
if damageDone > 0:
self.__rememberToonAttack(currTgt.getDoId(), attack[TOON_ID_COL], damageDone)
if atkTrack == TRAP:
if self.traps.has_key(currTgt.doId):
if currTgt.doId in self.traps:
trapInfo = self.traps[currTgt.doId]
currTgt.battleTrap = trapInfo[0]
targetDead = 0
@ -895,13 +895,13 @@ class BattleCalculatorAI:
self.__clearTgtDied(currTgt, currLastAtk, attack)
tgtId = currTgt.getDoId()
if self.successfulLures.has_key(tgtId) and atkTrack == LURE:
if tgtId in self.successfulLures and atkTrack == LURE:
lureInfo = self.successfulLures[tgtId]
self.notify.debug('applying lure data: ' + repr(lureInfo))
toonId = lureInfo[0]
lureAtk = self.battle.toonAttacks[toonId]
tgtPos = self.battle.activeSuits.index(currTgt)
if self.traps.has_key(currTgt.doId):
if currTgt.doId in self.traps:
trapInfo = self.traps[currTgt.doId]
if trapInfo[0] == UBER_GAG_LEVEL_INDEX:
self.notify.debug('train trap triggered for %d' % currTgt.doId)
@ -1073,20 +1073,20 @@ class BattleCalculatorAI:
def __calcSuitTarget(self, attackIndex):
attack = self.battle.suitAttacks[attackIndex]
suitId = attack[SUIT_ID_COL]
if self.SuitAttackers.has_key(suitId) and random.randint(0, 99) < 75:
if suitId in self.SuitAttackers and random.randint(0, 99) < 75:
totalDamage = 0
for currToon in self.SuitAttackers[suitId].keys():
for currToon in list(self.SuitAttackers[suitId].keys()):
totalDamage += self.SuitAttackers[suitId][currToon]
dmgs = []
for currToon in self.SuitAttackers[suitId].keys():
for currToon in list(self.SuitAttackers[suitId].keys()):
dmgs.append(self.SuitAttackers[suitId][currToon] / totalDamage * 100)
dmgIdx = SuitBattleGlobals.pickFromFreqList(dmgs)
if dmgIdx == None:
toonId = self.__pickRandomToon(suitId)
else:
toonId = self.SuitAttackers[suitId].keys()[dmgIdx]
toonId = list(self.SuitAttackers[suitId].keys())[dmgIdx]
if toonId == -1 or toonId not in self.battle.activeToons:
return -1
self.notify.debug('Suit attacking back at toon ' + str(toonId))
@ -1177,7 +1177,7 @@ class BattleCalculatorAI:
def __getToonHp(self, toonDoId):
handle = self.battle.getToon(toonDoId)
if handle != None and self.toonHPAdjusts.has_key(toonDoId):
if handle != None and toonDoId in self.toonHPAdjusts:
return handle.hp + self.toonHPAdjusts[toonDoId]
else:
return 0
@ -1215,14 +1215,14 @@ class BattleCalculatorAI:
return 1
def __updateSuitAtkStat(self, toonId):
if self.suitAtkStats.has_key(toonId):
if toonId in self.suitAtkStats:
self.suitAtkStats[toonId] += 1
else:
self.suitAtkStats[toonId] = 1
def __printSuitAtkStats(self):
self.notify.debug('Suit Atk Stats:')
for currTgt in self.suitAtkStats.keys():
for currTgt in list(self.suitAtkStats.keys()):
if currTgt not in self.battle.activeToons:
continue
tgtPos = self.battle.activeToons.index(currTgt)
@ -1283,7 +1283,7 @@ class BattleCalculatorAI:
self.notify.debug('__updateLureTimeouts()')
self.notify.debug('Lured suits: ' + str(self.currentlyLuredSuits))
noLongerLured = []
for currLuredSuit in self.currentlyLuredSuits.keys():
for currLuredSuit in list(self.currentlyLuredSuits.keys()):
self.__incLuredCurrRound(currLuredSuit)
if self.__luredMaxRoundsReached(currLuredSuit) or self.__luredWakeupTime(currLuredSuit):
noLongerLured.append(currLuredSuit)
@ -1392,14 +1392,14 @@ class BattleCalculatorAI:
def toonLeftBattle(self, toonId):
if self.notify.getDebug():
self.notify.debug('toonLeftBattle()' + str(toonId))
if self.toonSkillPtsGained.has_key(toonId):
if toonId in self.toonSkillPtsGained:
del self.toonSkillPtsGained[toonId]
if self.suitAtkStats.has_key(toonId):
if toonId in self.suitAtkStats:
del self.suitAtkStats[toonId]
if not self.CLEAR_SUIT_ATTACKERS:
oldSuitIds = []
for s in self.SuitAttackers.keys():
if self.SuitAttackers[s].has_key(toonId):
for s in list(self.SuitAttackers.keys()):
if toonId in self.SuitAttackers[s]:
del self.SuitAttackers[s][toonId]
if len(self.SuitAttackers[s]) == 0:
oldSuitIds.append(s)
@ -1414,7 +1414,7 @@ class BattleCalculatorAI:
if self.notify.getDebug():
self.notify.debug('suitLeftBattle(): ' + str(suitId))
self.__removeLured(suitId)
if self.SuitAttackers.has_key(suitId):
if suitId in self.SuitAttackers:
del self.SuitAttackers[suitId]
self.__removeSuitTrap(suitId)
@ -1423,8 +1423,8 @@ class BattleCalculatorAI:
self.notify.debug('updateActiveToons()')
if not self.CLEAR_SUIT_ATTACKERS:
oldSuitIds = []
for s in self.SuitAttackers.keys():
for t in self.SuitAttackers[s].keys():
for s in list(self.SuitAttackers.keys()):
for t in list(self.SuitAttackers[s].keys()):
if t not in self.battle.activeToons:
del self.SuitAttackers[s][t]
if len(self.SuitAttackers[s]) == 0:
@ -1433,7 +1433,7 @@ class BattleCalculatorAI:
for oldSuitId in oldSuitIds:
del self.SuitAttackers[oldSuitId]
for trap in self.traps.keys():
for trap in list(self.traps.keys()):
if self.traps[trap][1] not in self.battle.activeToons:
self.notify.debug('Trap for toon ' + str(self.traps[trap][1]) + ' will no longer give exp')
self.traps[trap][1] = 0
@ -1442,22 +1442,22 @@ class BattleCalculatorAI:
return BattleExperienceAI.getSkillGained(self.toonSkillPtsGained, toonId, track)
def getLuredSuits(self):
luredSuits = self.currentlyLuredSuits.keys()
luredSuits = list(self.currentlyLuredSuits.keys())
self.notify.debug('Lured suits reported to battle: ' + repr(luredSuits))
return luredSuits
def __suitIsLured(self, suitId, prevRound=0):
inList = self.currentlyLuredSuits.has_key(suitId)
inList = suitId in self.currentlyLuredSuits
if prevRound:
return inList and self.currentlyLuredSuits[suitId][0] != -1
return inList
def __findAvailLureId(self, lurerId):
luredSuits = self.currentlyLuredSuits.keys()
luredSuits = list(self.currentlyLuredSuits.keys())
lureIds = []
for currLured in luredSuits:
lurerInfo = self.currentlyLuredSuits[currLured][3]
lurers = lurerInfo.keys()
lurers = list(lurerInfo.keys())
for currLurer in lurers:
currId = lurerInfo[currLurer][1]
if currLurer == lurerId and currId not in lureIds:
@ -1481,9 +1481,9 @@ class BattleCalculatorAI:
credit = 0
else:
credit = self.itemIsCredit(LURE, lureLvl)
if self.currentlyLuredSuits.has_key(suitId):
if suitId in self.currentlyLuredSuits:
lureInfo = self.currentlyLuredSuits[suitId]
if not lureInfo[3].has_key(lurer):
if lurer not in lureInfo[3]:
lureInfo[1] += maxRounds
if wakeChance < lureInfo[2]:
lureInfo[2] = wakeChance
@ -1498,7 +1498,7 @@ class BattleCalculatorAI:
def __getLurers(self, suitId):
if self.__suitIsLured(suitId):
return self.currentlyLuredSuits[suitId][3].keys()
return list(self.currentlyLuredSuits[suitId][3].keys())
return []
def __getLuredExpInfo(self, suitId):
@ -1513,10 +1513,10 @@ class BattleCalculatorAI:
return returnInfo
def __clearLurer(self, lurerId, lureId=-1):
luredSuits = self.currentlyLuredSuits.keys()
luredSuits = list(self.currentlyLuredSuits.keys())
for currLured in luredSuits:
lurerInfo = self.currentlyLuredSuits[currLured][3]
lurers = lurerInfo.keys()
lurers = list(lurerInfo.keys())
for currLurer in lurers:
if currLurer == lurerId and (lureId == -1 or lureId == lurerInfo[currLurer][1]):
del lurerInfo[currLurer]
@ -1581,7 +1581,7 @@ class BattleCalculatorAI:
trickId = toonAttack[TOON_LVL_COL]
healRange = PetTricks.TrickHeals[trickId]
hp = 0
if simbase.air.doId2do.has_key(petProxyId):
if petProxyId in simbase.air.doId2do:
petProxy = simbase.air.doId2do[petProxyId]
if trickId < len(petProxy.trickAptitudes):
aptitude = petProxy.trickAptitudes[trickId]
@ -1594,7 +1594,7 @@ class BattleCalculatorAI:
def __calculatePetTrickSuccess(self, toonAttack):
petProxyId = toonAttack[TOON_TGT_COL]
if not simbase.air.doId2do.has_key(petProxyId):
if petProxyId not in simbase.air.doId2do:
self.notify.warning('pet proxy %d not in doId2do!' % petProxyId)
toonAttack[TOON_ACCBONUS_COL] = 1
return (0, 0)

View file

@ -1,4 +1,4 @@
import DistributedBattleAI
from . import DistributedBattleAI
from direct.directnotify import DirectNotifyGlobal
class BattleManagerAI:
@ -10,15 +10,15 @@ class BattleManagerAI:
self.battleConstructor = DistributedBattleAI.DistributedBattleAI
def cellHasBattle(self, cellId):
return self.cellId2battle.has_key(cellId)
return cellId in self.cellId2battle
def getBattle(self, cellId):
if self.cellId2battle.has_key(cellId):
if cellId in self.cellId2battle:
return self.cellId2battle[cellId]
return None
def newBattle(self, cellId, zoneId, pos, suit, toonId, finishCallback=None, maxSuits=4, interactivePropTrackBonus=-1):
if self.cellId2battle.has_key(cellId):
if cellId in self.cellId2battle:
self.notify.info("A battle is already present in the suit's zone!")
if not self.requestBattleAddSuit(cellId, suit):
suit.flyAwayNow()

View file

@ -263,7 +263,7 @@ class PropPool:
self.propStrings[propName] = (self.getPath(5, 'half-windsor'),)
self.propTypes[propName] = 'model'
splatAnimFileName = self.getPath(3.5, 'splat-chan')
for splat in Splats.keys():
for splat in list(Splats.keys()):
propName = 'splat-' + splat
self.propStrings[propName] = (self.getPath(3.5, 'splat-mod'), splatAnimFileName)
self.propTypes[propName] = 'actor'
@ -376,7 +376,7 @@ class PropPool:
self.props[name] = self.props[name].find('**/trolley_car')
def unloadProps(self):
for p in self.props.values():
for p in list(self.props.values()):
if type(p) != type(()):
self.__delProp(p)
@ -388,7 +388,7 @@ class PropPool:
def __getPropCopy(self, name):
if self.propTypes[name] == 'actor':
if not self.props.has_key(name):
if name not in self.props:
prop = Actor.Actor()
prop.loadModel(self.propStrings[name][0])
animDict = {}
@ -400,7 +400,7 @@ class PropPool:
self.makeVariant(name)
return Actor.Actor(other=self.props[name])
else:
if not self.props.has_key(name):
if name not in self.props:
prop = loader.loadModel(self.propStrings[name][0])
prop.setName(name)
self.storeProp(name, prop)

View file

@ -47,7 +47,7 @@ class BattleSounds:
found = vfs.resolveFilename(filename, self.sfxSearchPath)
if not found:
self.notify.warning('%s not found on:' % name)
print self.sfxSearchPath
print(self.sfxSearchPath)
else:
return self.mgr.getSound(filename.getFullpath())
return self.mgr.getNullSound()

View file

@ -1,17 +1,17 @@
from pandac.PandaModules import *
from libotp import *
from direct.interval.IntervalGlobal import *
from BattleBase import *
from .BattleBase import *
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import ToontownBattleGlobals
import DistributedBattleBase
from . import DistributedBattleBase
from direct.directnotify import DirectNotifyGlobal
import MovieUtil
from . import MovieUtil
from toontown.suit import Suit
from direct.actor import Actor
from toontown.toon import TTEmote
from otp.avatar import Emote
import SuitBattleGlobals
from . import SuitBattleGlobals
from toontown.distributed import DelayDelete
import random

View file

@ -1,9 +1,9 @@
from otp.ai.AIBase import *
from BattleBase import *
from BattleCalculatorAI import *
from .BattleBase import *
from .BattleCalculatorAI import *
from toontown.toonbase.ToontownBattleGlobals import *
from SuitBattleGlobals import *
import DistributedBattleBaseAI
from .SuitBattleGlobals import *
from . import DistributedBattleBaseAI
from direct.task import Task
from direct.directnotify import DirectNotifyGlobal
import random

View file

@ -1,7 +1,7 @@
from pandac.PandaModules import *
from toontown.toonbase.ToonBaseGlobal import *
from direct.interval.IntervalGlobal import *
from BattleBase import *
from .BattleBase import *
from direct.distributed.ClockDelta import *
from toontown.toonbase import ToontownBattleGlobals
from direct.distributed import DistributedNode
@ -9,13 +9,13 @@ from direct.fsm import ClassicFSM, State
from direct.fsm import State
from direct.task.Task import Task
from direct.directnotify import DirectNotifyGlobal
import Movie
import MovieUtil
from . import Movie
from . import MovieUtil
from toontown.suit import Suit
from direct.actor import Actor
import BattleProps
from . import BattleProps
from direct.particles import ParticleEffect
import BattleParticles
from . import BattleParticles
from toontown.hood import ZoneUtil
from toontown.distributed import DelayDelete
from toontown.toon import TTEmote
@ -99,28 +99,28 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
self.activeIntervals[name] = interval
def __cleanupIntervals(self):
for interval in self.activeIntervals.values():
for interval in list(self.activeIntervals.values()):
interval.finish()
DelayDelete.cleanupDelayDeletes(interval)
self.activeIntervals = {}
def clearInterval(self, name, finish = 0):
if self.activeIntervals.has_key(name):
if name in self.activeIntervals:
ival = self.activeIntervals[name]
if finish:
ival.finish()
else:
ival.pause()
if self.activeIntervals.has_key(name):
if name in self.activeIntervals:
DelayDelete.cleanupDelayDeletes(ival)
if self.activeIntervals.has_key(name):
if name in self.activeIntervals:
del self.activeIntervals[name]
else:
self.notify.debug('interval: %s already cleared' % name)
def finishInterval(self, name):
if self.activeIntervals.has_key(name):
if name in self.activeIntervals:
interval = self.activeIntervals[name]
interval.finish()
@ -361,7 +361,7 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
self.suits = []
suitGone = 0
for s in suits:
if self.cr.doId2do.has_key(s):
if s in self.cr.doId2do:
suit = self.cr.doId2do[s]
suit.setState('Battle')
self.suits.append(suit)
@ -940,7 +940,7 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
self.storeInterval(runMTrack, runName)
def getToon(self, toonId):
if self.cr.doId2do.has_key(toonId):
if toonId in self.cr.doId2do:
return self.cr.doId2do[toonId]
else:
self.notify.warning('getToon() - toon: %d not in repository!' % toonId)
@ -1135,7 +1135,7 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
elif mode == 'PETSOSINFO':
petProxyId = response['id']
self.notify.debug('got a PETSOSINFO for pet: %d' % petProxyId)
if base.cr.doId2do.has_key(petProxyId):
if petProxyId in base.cr.doId2do:
self.notify.debug('pet: %d was already in the repository' % petProxyId)
proxyGenerateMessage = 'petProxy-%d-generated' % petProxyId
messenger.send(proxyGenerateMessage)

View file

@ -1,11 +1,11 @@
from otp.ai.AIBase import *
from direct.distributed.ClockDelta import *
from BattleBase import *
import BattleCalculatorAI
from .BattleBase import *
from . import BattleCalculatorAI
from toontown.toonbase.ToontownBattleGlobals import *
from SuitBattleGlobals import *
from .SuitBattleGlobals import *
from pandac.PandaModules import *
import BattleExperienceAI
from . import BattleExperienceAI
from direct.distributed import DistributedObjectAI
from direct.fsm import ClassicFSM, State
from direct.fsm import State
@ -144,7 +144,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
del suit.battleTrap
del self.finishCallback
for petProxy in self.pets.values():
for petProxy in list(self.pets.values()):
petProxy.requestDelete()
DistributedObjectAI.DistributedObjectAI.delete(self)
@ -319,7 +319,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
p.append(self.activeToons)
p.append(suitIds)
for t in self.activeToons:
if self.toonAttacks.has_key(t):
if t in self.toonAttacks:
ta = self.toonAttacks[t]
index = -1
id = ta[TOON_ID_COL]
@ -387,7 +387,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
levels = []
targets = []
for t in self.activeToons:
if self.toonAttacks.has_key(t):
if t in self.toonAttacks:
ta = self.toonAttacks[t]
else:
ta = getToonAttack(t)
@ -481,7 +481,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
return 0
def addToon(self, avId):
print 'DBB-addToon %s' % avId
print('DBB-addToon %s' % avId)
self.notify.debug('addToon(%d)' % avId)
toon = self.getToon(avId)
if toon == None:
@ -682,7 +682,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
self.notify.warning('removeToon() - toon: %d was adjusting!' % toonId)
self.adjustingToons.remove(toonId)
self.toonGone = 1
if self.pets.has_key(toonId):
if toonId in self.pets:
self.pets[toonId].requestDelete()
del self.pets[toonId]
self.__removeResponse(toonId)
@ -721,7 +721,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
return
def getToon(self, toonId):
if self.air.doId2do.has_key(toonId):
if toonId in self.air.doId2do:
return self.air.doId2do[toonId]
else:
self.notify.warning('getToon() - toon: %d not in repository!' % toonId)
@ -741,7 +741,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
self.notify.warning('toon tried to run, but not found in activeToons: %d' % toonId)
return
for toon in self.activeToons:
if self.toonAttacks.has_key(toon):
if toon in self.toonAttacks:
ta = self.toonAttacks[toon]
track = ta[TOON_TRACK_COL]
level = ta[TOON_LVL_COL]
@ -851,7 +851,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
return 1
def __removeAdjustingResponse(self, toonId):
if self.adjustingResponses.has_key(toonId):
if toonId in self.adjustingResponses:
del self.adjustingResponses[toonId]
if self.ignoreAdjustingResponses == 0 and len(self.toons) > 0:
if self.__allAdjustingToonsResponded():
@ -859,7 +859,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
def __addJoinResponse(self, avId, taskName, toon=0):
if toon == 1:
for jr in self.joinResponses.values():
for jr in list(self.joinResponses.values()):
jr[avId] = 0
self.joinResponses[avId] = {}
@ -871,8 +871,8 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
def __removeJoinResponses(self, avId):
self.__removeJoinResponse(avId)
removedOne = 0
for j in self.joinResponses.values():
if j.has_key(avId):
for j in list(self.joinResponses.values()):
if avId in j:
del j[avId]
removedOne = 1
@ -882,7 +882,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
self.__makeAvPending(t)
def __removeJoinResponse(self, avId):
if self.joinResponses.has_key(avId):
if avId in self.joinResponses:
taskMgr.remove(self.joinResponses[avId]['taskName'])
del self.joinResponses[avId]
@ -895,7 +895,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
return 1
def __cleanupJoinResponses(self):
for jr in self.joinResponses.values():
for jr in list(self.joinResponses.values()):
taskMgr.remove(jr['taskName'])
del jr
@ -993,11 +993,11 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
if self.toons.count(toonId) == 0:
self.notify.warning('joinDone() - toon: %d not in toon list' % toonId)
return
if not self.joinResponses.has_key(avId):
if avId not in self.joinResponses:
self.notify.debug('joinDone() - no entry for: %d - ignoring: %d' % (avId, toonId))
return
jr = self.joinResponses[avId]
if jr.has_key(toonId):
if toonId in jr:
jr[toonId] += 1
self.notify.debug('client with localToon: %d done joining av: %d' % (toonId, avId))
if self.__allToonsRespondedJoin(avId):
@ -1037,9 +1037,9 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
toon = self.getToon(toonId)
if toon == None:
return
if toon.NPCFriendsDict.has_key(av):
if av in toon.NPCFriendsDict:
npcCollision = 0
if self.npcAttacks.has_key(av):
if av in self.npcAttacks:
callingToon = self.npcAttacks[av]
if self.activeToons.count(callingToon) == 1:
self.toonAttacks[toonId] = getToonAttack(toonId, track=PASS)
@ -1060,7 +1060,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
elif track == UN_ATTACK:
self.notify.debug('toon: %d changed its mind' % toonId)
self.toonAttacks[toonId] = getToonAttack(toonId, track=UN_ATTACK)
if self.responses.has_key(toonId):
if toonId in self.responses:
self.responses[toonId] = 0
validResponse = 0
elif track == PASS:
@ -1115,7 +1115,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
petId = toon.getPetId()
zoneId = self.zoneId
if petId == av:
if not self.pets.has_key(toonId):
if toonId not in self.pets:
def handleGetPetProxy(success, petProxy, petId=petId, zoneId=zoneId, toonId=toonId):
if success:
@ -1178,7 +1178,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
self.movieHasPlayed = 0
self.rewardHasPlayed = 0
for t in self.activeToons:
if not self.toonAttacks.has_key(t):
if t not in self.toonAttacks:
self.toonAttacks[t] = getToonAttack(t)
attack = self.toonAttacks[t]
if attack[TOON_TRACK_COL] == PASS or attack[TOON_TRACK_COL] == UN_ATTACK:
@ -1322,7 +1322,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
suitsLuredOntoTraps = []
npcTrapAttacks = []
for activeToon in self.activeToons + self.exitedToons:
if self.toonAttacks.has_key(activeToon):
if activeToon in self.toonAttacks:
attack = self.toonAttacks[activeToon]
track = attack[TOON_TRACK_COL]
npc_level = None
@ -1428,13 +1428,13 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
pass
suit.battleTrap = NO_TRAP
needUpdate = 1
if trapDict.has_key(suit.doId):
if suit.doId in trapDict:
del trapDict[suit.doId]
if suitsLuredOntoTraps.count(suit) == 0:
suitsLuredOntoTraps.append(suit)
if track == TRAP:
targetId = suit.doId
if trapDict.has_key(targetId):
if targetId in trapDict:
trapDict[targetId].append(attack)
else:
trapDict[targetId] = [attack]
@ -1458,7 +1458,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
else:
hp = hps[targetIndex]
if track == TRAP:
if trapDict.has_key(targetId):
if targetId in trapDict:
trapDict[targetId].append(attack)
else:
trapDict[targetId] = [attack]
@ -1468,7 +1468,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
pass
target.battleTrap = NO_TRAP
needUpdate = 1
if trapDict.has_key(target.doId):
if target.doId in trapDict:
del trapDict[target.doId]
if suitsLuredOntoTraps.count(target) == 0:
suitsLuredOntoTraps.append(target)
@ -1476,7 +1476,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
for otherSuit in self.activeSuits:
if not otherSuit == target:
otherSuit.battleTrap = NO_TRAP
if trapDict.has_key(otherSuit.doId):
if otherSuit.doId in trapDict:
del trapDict[otherSuit.doId]
died = attack[SUIT_DIED_COL] & 1 << targetIndex
@ -1485,7 +1485,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
deadSuits.append(target)
self.exitedToons = []
for suitKey in trapDict.keys():
for suitKey in list(trapDict.keys()):
attackList = trapDict[suitKey]
attack = attackList[0]
target = self.findSuit(attack[TOON_TGT_COL])
@ -1674,13 +1674,13 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
msgName = '%s%s' % (cog, level)
if encounter['isSkelecog']:
msgName += '+'
if eventMsg.has_key(msgName):
if msgName in eventMsg:
eventMsg[msgName] += 1
else:
eventMsg[msgName] = 1
msgText = ''
for msgName, count in eventMsg.items():
for msgName, count in list(eventMsg.items()):
if msgText != '':
msgText += ','
msgText += '%s%s' % (count, msgName)

View file

@ -1,18 +1,18 @@
from pandac.PandaModules import *
from libotp import *
from direct.interval.IntervalGlobal import *
from BattleBase import *
from .BattleBase import *
from direct.actor import Actor
from toontown.suit import SuitDNA
from direct.directnotify import DirectNotifyGlobal
import DistributedBattleBase
from . import DistributedBattleBase
from toontown.toon import TTEmote
from otp.avatar import Emote
from toontown.toonbase import TTLocalizer
import MovieUtil
from . import MovieUtil
from direct.fsm import State
from toontown.suit import Suit
import SuitBattleGlobals
from . import SuitBattleGlobals
import random
from toontown.toonbase import ToontownGlobals

View file

@ -1,11 +1,11 @@
from otp.ai.AIBase import *
from direct.distributed.ClockDelta import *
from BattleBase import *
from BattleCalculatorAI import *
from .BattleBase import *
from .BattleCalculatorAI import *
from toontown.toonbase.ToontownBattleGlobals import *
from SuitBattleGlobals import *
from .SuitBattleGlobals import *
from direct.showbase.PythonUtil import addListsByValue
import DistributedBattleBaseAI
from . import DistributedBattleBaseAI
from direct.task import Task
from direct.directnotify import DirectNotifyGlobal
import random

View file

@ -40,7 +40,7 @@ class DistributedBattleDiners(DistributedBattleFinal.DistributedBattleFinal):
def moveSuitsToInitialPos(self):
battlePts = self.suitPoints[len(self.suitPendingPoints) - 1]
for i in xrange(len(self.suits)):
for i in range(len(self.suits)):
suit = self.suits[i]
suit.reparentTo(self)
destPos, destHpr = self.getActorPosHpr(suit, self.suits)

View file

@ -1,13 +1,13 @@
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from BattleBase import *
from .BattleBase import *
from direct.actor import Actor
from toontown.distributed import DelayDelete
from direct.directnotify import DirectNotifyGlobal
import DistributedBattleBase
import MovieUtil
from . import DistributedBattleBase
from . import MovieUtil
from toontown.suit import Suit
import SuitBattleGlobals
from . import SuitBattleGlobals
from toontown.toonbase import ToontownBattleGlobals
from toontown.toonbase import ToontownGlobals
from direct.fsm import State
@ -49,7 +49,7 @@ class DistributedBattleFinal(DistributedBattleBase.DistributedBattleBase):
def setBossCogId(self, bossCogId):
self.bossCogId = bossCogId
if base.cr.doId2do.has_key(bossCogId):
if bossCogId in base.cr.doId2do:
tempBossCog = base.cr.doId2do[bossCogId]
self.__gotBossCog([tempBossCog])
else:

View file

@ -1,9 +1,9 @@
from otp.ai.AIBase import *
from BattleBase import *
from BattleCalculatorAI import *
from .BattleBase import *
from .BattleCalculatorAI import *
from toontown.toonbase.ToontownBattleGlobals import *
from SuitBattleGlobals import *
import DistributedBattleBaseAI
from .SuitBattleGlobals import *
from . import DistributedBattleBaseAI
from direct.task import Task
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import State

View file

@ -43,7 +43,7 @@ class DistributedBattleWaiters(DistributedBattleFinal.DistributedBattleFinal):
def moveSuitsToInitialPos(self):
battlePts = self.suitPoints[len(self.suitPendingPoints) - 1]
for i in xrange(len(self.suits)):
for i in range(len(self.suits)):
suit = self.suits[i]
suit.reparentTo(self)
destPos, destHpr = self.getActorPosHpr(suit, self.suits)

View file

@ -1,18 +1,18 @@
from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from BattleSounds import *
from .BattleBase import *
from .BattleProps import *
from .BattleSounds import *
from toontown.toon.ToonDNA import *
from toontown.suit.SuitDNA import *
from direct.particles.ParticleEffect import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
import MovieUtil
import MovieCamera
from . import MovieUtil
from . import MovieCamera
from direct.directnotify import DirectNotifyGlobal
import BattleParticles
from . import BattleParticles
from toontown.toonbase import ToontownGlobals
import RewardPanel
from . import RewardPanel
notify = DirectNotifyGlobal.directNotify.newCategory('Fanfare')
def makePanel(toon, showToonName):

View file

@ -1,29 +1,29 @@
from toontown.toonbase.ToontownBattleGlobals import *
from BattleBase import *
from .BattleBase import *
from direct.interval.IntervalGlobal import *
from direct.showbase import DirectObject
import MovieFire
import MovieSOS
import MovieNPCSOS
import MoviePetSOS
import MovieHeal
import MovieTrap
import MovieLure
import MovieSound
import MovieThrow
import MovieSquirt
import MovieDrop
import MovieSuitAttacks
import MovieToonVictory
import PlayByPlayText
import BattleParticles
from . import MovieFire
from . import MovieSOS
from . import MovieNPCSOS
from . import MoviePetSOS
from . import MovieHeal
from . import MovieTrap
from . import MovieLure
from . import MovieSound
from . import MovieThrow
from . import MovieSquirt
from . import MovieDrop
from . import MovieSuitAttacks
from . import MovieToonVictory
from . import PlayByPlayText
from . import BattleParticles
from toontown.distributed import DelayDelete
import BattleExperience
from SuitBattleGlobals import *
from . import BattleExperience
from .SuitBattleGlobals import *
from direct.directnotify import DirectNotifyGlobal
import RewardPanel
from . import RewardPanel
import random
import MovieUtil
from . import MovieUtil
from toontown.toon import Toon
from toontown.toonbase import ToontownGlobals
from toontown.toontowngui import TTDialog
@ -760,7 +760,7 @@ class Movie(DirectObject.DirectObject):
adict['target'] = sdict
adict['hpbonus'] = ta[TOON_HPBONUS_COL]
adict['sidestep'] = ta[TOON_ACCBONUS_COL]
if adict.has_key('npcId'):
if 'npcId' in adict:
adict['sidestep'] = 0
adict['battle'] = self.battle
adict['playByPlayText'] = self.playByPlayText
@ -785,7 +785,7 @@ class Movie(DirectObject.DirectObject):
setCapture = 0
tp = []
for ta in self.toonAttackDicts:
if ta['track'] == track or track == NPCSOS and ta.has_key('special'):
if ta['track'] == track or track == NPCSOS and 'special' in ta:
tp.append(ta)
if track == SQUIRT:
setCapture = 1
@ -793,11 +793,11 @@ class Movie(DirectObject.DirectObject):
if track == TRAP:
sortedTraps = []
for attack in tp:
if not attack.has_key('npcId'):
if 'npcId' not in attack:
sortedTraps.append(attack)
for attack in tp:
if attack.has_key('npcId'):
if 'npcId' in attack:
sortedTraps.append(attack)
tp = sortedTraps

View file

@ -1,12 +1,12 @@
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from .BattleBase import *
from .BattleProps import *
from toontown.toonbase.ToontownBattleGlobals import *
from SuitBattleGlobals import *
from .SuitBattleGlobals import *
from direct.directnotify import DirectNotifyGlobal
import random
import MovieUtil
from . import MovieUtil
notify = DirectNotifyGlobal.directNotify.newCategory('MovieCamera')
def chooseHealShot(heals, attackDuration):
@ -16,7 +16,7 @@ def chooseHealShot(heals, attackDuration):
isUber = 1
if isUber:
print 'is uber'
print('is uber')
openShot = chooseHealOpenShot(heals, attackDuration, isUber)
openDuration = openShot.getDuration()
openName = openShot.getName()
@ -38,7 +38,7 @@ def chooseHealOpenShot(heals, attackDuration, isUber = 0):
if isUber:
duration = 5.0
shotChoices = [toonGroupShot]
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -49,7 +49,7 @@ def chooseHealMidShot(heals, attackDuration, isUber = 0):
if isUber:
duration = 2.1
shotChoices = [toonGroupHighShot]
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -59,7 +59,7 @@ def chooseHealCloseShot(heals, openDuration, openName, attackDuration, isUber =
shotChoices = [toonGroupShot]
if isUber:
shotChoices = [allGroupLowShot]
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -79,7 +79,7 @@ def chooseTrapOpenShot(traps, attackDuration):
av = None
duration = 3.0
shotChoices = [allGroupLowShot]
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -87,7 +87,7 @@ def chooseTrapCloseShot(traps, openDuration, openName, attackDuration):
av = None
duration = attackDuration - openDuration
shotChoices = [allGroupLowShot]
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -107,7 +107,7 @@ def chooseLureOpenShot(lures, attackDuration):
av = None
duration = 3.0
shotChoices = [allGroupLowShot]
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -125,7 +125,7 @@ def chooseLureCloseShot(lures, openDuration, openName, attackDuration):
av = lures[0]['toon']
else:
shotChoices = [allGroupLowShot]
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -160,7 +160,7 @@ def chooseSoundOpenShot(sounds, targets, attackDuration):
shotChoices = [allGroupLowShot, suitGroupThreeQuarterLeftBehindShot]
else:
notify.error('Bad number of sounds: %s' % numSounds)
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -178,7 +178,7 @@ def chooseSoundCloseShot(sounds, targets, openDuration, openName, attackDuration
shotChoices = [allGroupLowShot, suitGroupThreeQuarterLeftBehindShot]
else:
notify.error('Bad number of suits: %s' % numSuits)
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -206,7 +206,7 @@ def chooseThrowOpenShot(throws, suitThrowsDict, attackDuration):
shotChoices = [allGroupLowShot, suitGroupThreeQuarterLeftBehindShot]
else:
notify.error('Bad number of throws: %s' % numThrows)
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -215,7 +215,7 @@ def chooseThrowCloseShot(throws, suitThrowsDict, openDuration, openName, attackD
av = None
duration = attackDuration - openDuration
if numSuits == 1:
av = base.cr.doId2do[suitThrowsDict.keys()[0]]
av = base.cr.doId2do[list(suitThrowsDict.keys())[0]]
shotChoices = [avatarCloseUpThrowShot,
avatarCloseUpThreeQuarterLeftShot,
allGroupLowShot,
@ -224,7 +224,7 @@ def chooseThrowCloseShot(throws, suitThrowsDict, openDuration, openName, attackD
shotChoices = [allGroupLowShot, suitGroupThreeQuarterLeftBehindShot]
else:
notify.error('Bad number of suits: %s' % numSuits)
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -252,7 +252,7 @@ def chooseSquirtOpenShot(squirts, suitSquirtsDict, attackDuration):
shotChoices = [allGroupLowShot, suitGroupThreeQuarterLeftBehindShot]
else:
notify.error('Bad number of squirts: %s' % numSquirts)
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -261,7 +261,7 @@ def chooseSquirtCloseShot(squirts, suitSquirtsDict, openDuration, openName, atta
av = None
duration = attackDuration - openDuration
if numSuits == 1:
av = base.cr.doId2do[suitSquirtsDict.keys()[0]]
av = base.cr.doId2do[list(suitSquirtsDict.keys())[0]]
shotChoices = [avatarCloseUpThrowShot,
avatarCloseUpThreeQuarterLeftShot,
allGroupLowShot,
@ -270,7 +270,7 @@ def chooseSquirtCloseShot(squirts, suitSquirtsDict, openDuration, openName, atta
shotChoices = [allGroupLowShot, suitGroupThreeQuarterLeftBehindShot]
else:
notify.error('Bad number of suits: %s' % numSuits)
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -300,7 +300,7 @@ def chooseDropOpenShot(drops, suitDropsDict, attackDuration):
shotChoices = [allGroupLowShot, suitGroupThreeQuarterLeftBehindShot]
else:
notify.error('Bad number of drops: %s' % numDrops)
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -309,7 +309,7 @@ def chooseDropCloseShot(drops, suitDropsDict, openDuration, openName, attackDura
av = None
duration = attackDuration - openDuration
if numSuits == 1:
av = base.cr.doId2do[suitDropsDict.keys()[0]]
av = base.cr.doId2do[list(suitDropsDict.keys())[0]]
shotChoices = [avatarCloseUpThrowShot,
avatarCloseUpThreeQuarterLeftShot,
allGroupLowShot,
@ -327,7 +327,7 @@ def chooseNPCEnterShot(enters, entersDuration):
av = None
duration = entersDuration
shotChoices = [toonGroupShot]
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -335,7 +335,7 @@ def chooseNPCExitShot(exits, exitsDuration):
av = None
duration = exitsDuration
shotChoices = [toonGroupShot]
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -522,7 +522,7 @@ def chooseSuitCloseShot(attack, openDuration, openName, attackDuration):
diedTrack = pbpText.getToonsDiedInterval(diedTextList, duration)
else:
notify.error('Bad groupStatus: %s' % groupStatus)
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
if diedTrack == None:
return track
else:
@ -568,7 +568,7 @@ def chooseSOSShot(av, duration):
avatarBehindShot,
avatarBehindHighShot,
suitGroupThreeQuarterLeftBehindShot]
track = apply(random.choice(shotChoices), [av, duration])
track = random.choice(shotChoices)(*[av, duration])
return track
@ -894,7 +894,7 @@ def randomCameraSelection(suit, attack, attackDuration, openShotDuration):
if openShotDuration > attackDuration:
openShotDuration = attackDuration
closeShotDuration = attackDuration - openShotDuration
openShot = apply(random.choice(shotChoices), [suit, openShotDuration])
openShot = random.choice(shotChoices)(*[suit, openShotDuration])
closeShot = chooseSuitCloseShot(attack, closeShotDuration, openShot.getName(), attackDuration)
return Sequence(openShot, closeShot)
@ -946,8 +946,8 @@ def chooseFireOpenShot(throws, suitThrowsDict, attackDuration):
else:
notify.error('Bad number of throws: %s' % numThrows)
shotChoice = random.choice(shotChoices)
track = apply(shotChoice, [av, duration])
print 'chooseFireOpenShot %s' % shotChoice
track = shotChoice(*[av, duration])
print('chooseFireOpenShot %s' % shotChoice)
return track
@ -956,7 +956,7 @@ def chooseFireCloseShot(throws, suitThrowsDict, openDuration, openName, attackDu
av = None
duration = attackDuration - openDuration
if numSuits == 1:
av = base.cr.doId2do[suitThrowsDict.keys()[0]]
av = base.cr.doId2do[list(suitThrowsDict.keys())[0]]
shotChoices = [avatarCloseUpFireShot,
avatarCloseUpThreeQuarterLeftFireShot,
allGroupLowShot,
@ -966,8 +966,8 @@ def chooseFireCloseShot(throws, suitThrowsDict, openDuration, openName, attackDu
else:
notify.error('Bad number of suits: %s' % numSuits)
shotChoice = random.choice(shotChoices)
track = apply(shotChoice, [av, duration])
print 'chooseFireOpenShot %s' % shotChoice
track = shotChoice(*[av, duration])
print('chooseFireOpenShot %s' % shotChoice)
return track

View file

@ -1,12 +1,12 @@
from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from BattleSounds import *
import MovieCamera
from .BattleBase import *
from .BattleProps import *
from .BattleSounds import *
from . import MovieCamera
from direct.directnotify import DirectNotifyGlobal
import MovieUtil
import MovieNPCSOS
from MovieUtil import calcAvgSuitPos
from . import MovieUtil
from . import MovieNPCSOS
from .MovieUtil import calcAvgSuitPos
from direct.showutil import Effects
notify = DirectNotifyGlobal.directNotify.newCategory('MovieDrop')
hitSoundFiles = ('AA_drop_flowerpot.mp3', 'AA_drop_sandbag.mp3', 'AA_drop_anvil.mp3', 'AA_drop_bigweight.mp3', 'AA_drop_safe.mp3', 'AA_drop_piano.mp3', 'AA_drop_boat.mp3')
@ -38,7 +38,7 @@ def doDrops(drops):
targets = drop['target']
if len(targets) == 1:
suitId = targets[0]['suit'].doId
if suitDropsDict.has_key(suitId):
if suitId in suitDropsDict:
suitDropsDict[suitId].append((drop, targets[0]))
else:
suitDropsDict[suitId] = [(drop, targets[0])]
@ -47,7 +47,7 @@ def doDrops(drops):
else:
for target in targets:
suitId = target['suit'].doId
if suitDropsDict.has_key(suitId):
if suitId in suitDropsDict:
otherDrops = suitDropsDict[suitId]
alreadyInList = 0
for oDrop in otherDrops:
@ -59,7 +59,7 @@ def doDrops(drops):
else:
suitDropsDict[suitId] = [(drop, target)]
suitDrops = suitDropsDict.values()
suitDrops = list(suitDropsDict.values())
def compFunc(a, b):
if len(a) > len(b):
@ -217,9 +217,9 @@ def __dropObject(drop, delay, objName, level, alreadyDodged, alreadyTeased, npcs
toon = drop['toon']
repeatNPC = 0
battle = drop['battle']
if drop.has_key('npc'):
if 'npc' in drop:
toon = drop['npc']
if npcDrops.has_key(toon):
if toon in npcDrops:
repeatNPC = 1
else:
npcDrops[toon] = 1
@ -379,7 +379,7 @@ def __dropObject(drop, delay, objName, level, alreadyDodged, alreadyTeased, npcs
def __createSuitTrack(drop, delay, level, alreadyDodged, alreadyTeased, target, npcs):
toon = drop['toon']
if drop.has_key('npc'):
if 'npc' in drop:
toon = drop['npc']
battle = drop['battle']
majorObject = level >= 3

View file

@ -1,15 +1,15 @@
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from BattleSounds import *
from .BattleBase import *
from .BattleProps import *
from .BattleSounds import *
from toontown.toon.ToonDNA import *
from toontown.suit.SuitDNA import *
from direct.directnotify import DirectNotifyGlobal
import random
import MovieCamera
import MovieUtil
from MovieUtil import calcAvgSuitPos
from . import MovieCamera
from . import MovieUtil
from .MovieUtil import calcAvgSuitPos
notify = DirectNotifyGlobal.directNotify.newCategory('MovieThrow')
hitSoundFiles = ('AA_tart_only.mp3', 'AA_slice_only.mp3', 'AA_slice_only.mp3', 'AA_slice_only.mp3', 'AA_slice_only.mp3', 'AA_wholepie_only.mp3', 'AA_wholepie_only.mp3')
tPieLeavesHand = 2.7
@ -20,7 +20,7 @@ tPieShrink = 0.7
pieFlyTaskName = 'MovieThrow-pieFly'
def addHit(dict, suitId, hitCount):
if dict.has_key(suitId):
if suitId in dict:
dict[suitId] += hitCount
else:
dict[suitId] = hitCount
@ -33,12 +33,12 @@ def doFires(fires):
suitFiresDict = {}
for fire in fires:
suitId = fire['target']['suit'].doId
if suitFiresDict.has_key(suitId):
if suitId in suitFiresDict:
suitFiresDict[suitId].append(fire)
else:
suitFiresDict[suitId] = [fire]
suitFires = suitFiresDict.values()
suitFires = list(suitFiresDict.values())
def compFunc(a, b):
if len(a) > len(b):
return 1

View file

@ -1,17 +1,17 @@
from direct.interval.IntervalGlobal import *
from BattleProps import *
from BattleSounds import *
from BattleBase import *
from .BattleProps import *
from .BattleSounds import *
from .BattleBase import *
from direct.directnotify import DirectNotifyGlobal
import MovieCamera
from . import MovieCamera
import random
import MovieUtil
import BattleParticles
import HealJokes
from . import MovieUtil
from . import BattleParticles
from . import HealJokes
from toontown.toonbase import TTLocalizer
from toontown.toonbase.ToontownBattleGlobals import AvPropDamage
from toontown.toon import NPCToons
import MovieNPCSOS
from . import MovieNPCSOS
from toontown.effects import Splash
from direct.task import Task
notify = DirectNotifyGlobal.directNotify.newCategory('MovieHeal')
@ -166,7 +166,7 @@ def __healTickle(heal, hasInteractivePropHealBonus):
def __healJoke(heal, hasInteractivePropHealBonus):
npcId = 0
if heal.has_key('npcId'):
if 'npcId' in heal:
npcId = heal['npcId']
toon = NPCToons.createLocalNPC(npcId)
if toon == None:
@ -257,7 +257,7 @@ def __healSmooch(heal, hasInteractivePropHealBonus):
def __healDance(heal, hasInteractivePropHealBonus):
npcId = 0
if heal.has_key('npcId'):
if 'npcId' in heal:
npcId = heal['npcId']
toon = NPCToons.createLocalNPC(npcId)
if toon == None:
@ -340,7 +340,7 @@ def __healSprinkle(heal, hasInteractivePropHealBonus):
def __healJuggle(heal, hasInteractivePropHealBonus):
npcId = 0
if heal.has_key('npcId'):
if 'npcId' in heal:
npcId = heal['npcId']
toon = NPCToons.createLocalNPC(npcId)
if toon == None:
@ -388,7 +388,7 @@ def __healDive(heal, hasInteractivePropHealBonus):
splash = Splash.Splash(render)
splash.reparentTo(render)
npcId = 0
if heal.has_key('npcId'):
if 'npcId' in heal:
npcId = heal['npcId']
toon = NPCToons.createLocalNPC(npcId)
if toon == None:

View file

@ -1,16 +1,16 @@
from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from .BattleBase import *
from .BattleProps import *
from toontown.suit.SuitBase import *
from toontown.toon.ToonDNA import *
from BattleSounds import *
import MovieCamera
from .BattleSounds import *
from . import MovieCamera
from direct.directnotify import DirectNotifyGlobal
import MovieUtil
from . import MovieUtil
from toontown.toonbase import ToontownBattleGlobals
import BattleParticles
import BattleProps
import MovieNPCSOS
from . import BattleParticles
from . import BattleProps
from . import MovieNPCSOS
notify = DirectNotifyGlobal.directNotify.newCategory('MovieLures')
def safeWrtReparentTo(nodePath, parent):
@ -129,7 +129,7 @@ def __createFishingPoleMultiTrack(lure, dollar, dollarName):
def __createMagnetMultiTrack(lure, magnet, pos, hpr, scale, isSmallMagnet = 1, npcs = []):
toon = lure['toon']
if lure.has_key('npc'):
if 'npc' in lure:
toon = lure['npc']
battle = lure['battle']
sidestep = lure['sidestep']
@ -189,7 +189,7 @@ def __createMagnetMultiTrack(lure, magnet, pos, hpr, scale, isSmallMagnet = 1, n
def __createHypnoGogglesMultiTrack(lure, npcs = []):
toon = lure['toon']
if lure.has_key('npc'):
if 'npc' in lure:
toon = lure['npc']
targets = lure['target']
battle = lure['battle']

View file

@ -1,12 +1,12 @@
from direct.interval.IntervalGlobal import *
from BattleProps import *
from BattleSounds import *
from .BattleProps import *
from .BattleSounds import *
from direct.directnotify import DirectNotifyGlobal
import MovieCamera
from . import MovieCamera
import random
import MovieUtil
import BattleParticles
import HealJokes
from . import MovieUtil
from . import BattleParticles
from . import HealJokes
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownBattleGlobals
from toontown.toon import NPCToons
@ -241,7 +241,7 @@ def doNPCTeleports(attacks):
arrivals = Sequence()
departures = Parallel()
for attack in attacks:
if attack.has_key('npcId'):
if 'npcId' in attack:
npcId = attack['npcId']
npc = NPCToons.createLocalNPC(npcId)
if npc != None:

View file

@ -1,12 +1,12 @@
from direct.interval.IntervalGlobal import *
from BattleProps import *
from BattleSounds import *
from .BattleProps import *
from .BattleSounds import *
from direct.directnotify import DirectNotifyGlobal
import MovieCamera
from . import MovieCamera
import random
import MovieUtil
import BattleParticles
import HealJokes
from . import MovieUtil
from . import BattleParticles
from . import HealJokes
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownBattleGlobals
from toontown.pets import Pet, PetTricks
@ -89,7 +89,7 @@ def __healJuggle(heal):
petProxyId = heal['petId']
pet = Pet.Pet()
gender = 0
if base.cr.doId2do.has_key(petProxyId):
if petProxyId in base.cr.doId2do:
petProxy = base.cr.doId2do[petProxyId]
if petProxy == None:
return

View file

@ -1,5 +1,5 @@
from direct.interval.IntervalGlobal import *
import MovieCamera
from . import MovieCamera
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import TTLocalizer
from pandac.PandaModules import *

View file

@ -1,13 +1,13 @@
from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from BattleSounds import *
import BattleParticles
from RewardPanel import *
import MovieCamera
from .BattleBase import *
from .BattleProps import *
from .BattleSounds import *
from . import BattleParticles
from .RewardPanel import *
from . import MovieCamera
from direct.directnotify import DirectNotifyGlobal
import MovieUtil
import MovieNPCSOS
from . import MovieUtil
from . import MovieNPCSOS
from toontown.toonbase import ToontownBattleGlobals
notify = DirectNotifyGlobal.directNotify.newCategory('MovieSound')
soundFiles = ('AA_sound_bikehorn.mp3', 'AA_sound_whistle.mp3', 'AA_sound_bugle.mp3', 'AA_sound_aoogah.mp3', 'AA_sound_elephant.mp3', 'SZ_DD_foghorn.mp3', 'AA_sound_Opera_Singer.mp3')
@ -129,7 +129,7 @@ def __doSoundsLevel(sounds, delay, hitCount, npcs):
deathTracks = Parallel()
for sound in sounds:
toon = sound['toon']
if sound.has_key('npc'):
if 'npc' in sound:
toon = sound['npc']
level = sound['level']
targets = sound['target']

View file

@ -1,13 +1,13 @@
from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from BattleSounds import *
from .BattleBase import *
from .BattleProps import *
from .BattleSounds import *
from toontown.toon.ToonDNA import *
from toontown.suit.SuitDNA import *
import MovieUtil
import MovieCamera
from . import MovieUtil
from . import MovieCamera
from direct.directnotify import DirectNotifyGlobal
import BattleParticles
from . import BattleParticles
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import ToontownBattleGlobals
import random
@ -38,18 +38,18 @@ def doSquirts(squirts):
if 1:
target = squirt['target'][0]
suitId = target['suit'].doId
if suitSquirtsDict.has_key(suitId):
if suitId in suitSquirtsDict:
suitSquirtsDict[suitId].append(squirt)
else:
suitSquirtsDict[suitId] = [squirt]
else:
suitId = squirt['target']['suit'].doId
if suitSquirtsDict.has_key(suitId):
if suitId in suitSquirtsDict:
suitSquirtsDict[suitId].append(squirt)
else:
suitSquirtsDict[suitId] = [squirt]
suitSquirts = suitSquirtsDict.values()
suitSquirts = list(suitSquirtsDict.values())
def compFunc(a, b):
if len(a) > len(b):
@ -221,7 +221,7 @@ def __getSuitTrack(suit, tContact, tDodge, hp, hpbonus, kbbonus, anim, died, lef
def say(statement):
print statement
print(statement)
def __getSoundTrack(level, hitSuit, delay, node = None):

View file

@ -1,17 +1,17 @@
from libotp import *
from toontown.toonbase.ToontownGlobals import *
from SuitBattleGlobals import *
from .SuitBattleGlobals import *
from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from .BattleBase import *
from .BattleProps import *
from toontown.suit.SuitDNA import *
from BattleBase import *
from BattleSounds import *
import MovieCamera
from .BattleBase import *
from .BattleSounds import *
from . import MovieCamera
from direct.directnotify import DirectNotifyGlobal
import MovieUtil
from . import MovieUtil
from direct.particles import ParticleEffect
import BattleParticles
from . import BattleParticles
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
notify = DirectNotifyGlobal.directNotify.newCategory('MovieSuitAttacks')
@ -1592,8 +1592,8 @@ def doReOrg(attack):
partTrack = getPartTrack(sprayEffect, 1.0, 1.9, [sprayEffect, suit, 0])
if dmg > 0:
headParts = toon.getHeadParts()
print '***********headParts pos=', headParts[0].getPos()
print '***********headParts hpr=', headParts[0].getHpr()
print('***********headParts pos=', headParts[0].getPos())
print('***********headParts hpr=', headParts[0].getHpr())
headTracks = Parallel()
for partNum in range(0, headParts.getNumPaths()):
part = headParts.getPath(partNum)
@ -1613,7 +1613,7 @@ def doReOrg(attack):
arms = toon.findAllMatches('**/arms')
sleeves = toon.findAllMatches('**/sleeves')
hands = toon.findAllMatches('**/hands')
print '*************arms hpr=', arms[0].getHpr()
print('*************arms hpr=', arms[0].getHpr())
for partNum in range(0, arms.getNumPaths()):
chestTracks.append(getChestTrack(arms.getPath(partNum)))
chestTracks.append(getChestTrack(sleeves.getPath(partNum)))

View file

@ -1,15 +1,15 @@
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from BattleSounds import *
from .BattleBase import *
from .BattleProps import *
from .BattleSounds import *
from toontown.toon.ToonDNA import *
from toontown.suit.SuitDNA import *
from direct.directnotify import DirectNotifyGlobal
import random
import MovieCamera
import MovieUtil
from MovieUtil import calcAvgSuitPos
from . import MovieCamera
from . import MovieUtil
from .MovieUtil import calcAvgSuitPos
notify = DirectNotifyGlobal.directNotify.newCategory('MovieThrow')
hitSoundFiles = ('AA_tart_only.mp3', 'AA_slice_only.mp3', 'AA_slice_only.mp3', 'AA_slice_only.mp3', 'AA_slice_only.mp3', 'AA_wholepie_only.mp3', 'AA_wholepie_only.mp3')
tPieLeavesHand = 2.7
@ -20,7 +20,7 @@ tPieShrink = 0.7
pieFlyTaskName = 'MovieThrow-pieFly'
def addHit(dict, suitId, hitCount):
if dict.has_key(suitId):
if suitId in dict:
dict[suitId] += hitCount
else:
dict[suitId] = hitCount
@ -35,12 +35,12 @@ def doThrows(throws):
pass
else:
suitId = throw['target']['suit'].doId
if suitThrowsDict.has_key(suitId):
if suitId in suitThrowsDict:
suitThrowsDict[suitId].append(throw)
else:
suitThrowsDict[suitId] = [throw]
suitThrows = suitThrowsDict.values()
suitThrows = list(suitThrowsDict.values())
def compFunc(a, b):
if len(a) > len(b):
@ -574,7 +574,7 @@ def __throwGroupPie(throw, delay, groupHitDict):
singleSuitResponseTrack.append(Func(suit.loop, 'neutral'))
singleSuitResponseTrack = Parallel(singleSuitResponseTrack, bonusTrack)
else:
groupHitValues = groupHitDict.values()
groupHitValues = list(groupHitDict.values())
if groupHitValues.count(0) == len(groupHitValues):
singleSuitResponseTrack = MovieUtil.createSuitDodgeMultitrack(delay + tSuitDodges, suit, leftSuits, rightSuits)
else:

View file

@ -1,9 +1,9 @@
from libotp import *
from direct.interval.IntervalGlobal import *
from direct.showbase.DirectObject import DirectObject
from RewardPanel import *
from BattleSounds import *
import MovieCamera
from .RewardPanel import *
from .BattleSounds import *
from . import MovieCamera
from direct.directnotify import DirectNotifyGlobal
import types
notify = DirectNotifyGlobal.directNotify.newCategory('MovieToonVictory')
@ -84,7 +84,7 @@ def doToonVictory(localToonActive, toons, rewardToonIds, rewardDicts, deathList,
countToons = 0
uberListNew = []
for t in toons:
if isinstance(t, types.IntType):
if isinstance(t, int):
t = base.cr.doId2do.get(t)
if t:
toonList.append(t)

View file

@ -1,17 +1,17 @@
from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from BattleSounds import *
import MovieUtil
import MovieCamera
from .BattleBase import *
from .BattleProps import *
from .BattleSounds import *
from . import MovieUtil
from . import MovieCamera
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownBattleGlobals
from direct.actor import Actor
from direct.particles import ParticleEffect
import BattleParticles
import BattleProps
import MovieNPCSOS
from MovieSound import createSuitResetPosTrack
from . import BattleParticles
from . import BattleProps
from . import MovieNPCSOS
from .MovieSound import createSuitResetPosTrack
notify = DirectNotifyGlobal.directNotify.newCategory('MovieTrap')
def doTraps(traps):
@ -24,14 +24,14 @@ def doTraps(traps):
targets = trap['target']
if len(targets) == 1:
suitId = targets[0]['suit'].doId
if suitTrapsDict.has_key(suitId):
if suitId in suitTrapsDict:
suitTrapsDict[suitId].append(trap)
else:
suitTrapsDict[suitId] = [trap]
else:
for target in targets:
suitId = target['suit'].doId
if not suitTrapsDict.has_key(suitId):
if suitId not in suitTrapsDict:
suitTrapsDict[suitId] = [trap]
break
@ -43,7 +43,7 @@ def doTraps(traps):
if suit.battleTrap != NO_TRAP:
hasUberTrapConflict = True
suitTrapLists = suitTrapsDict.values()
suitTrapLists = list(suitTrapsDict.values())
mtrack = Parallel()
for trapList in suitTrapLists:
trapPropList = []
@ -280,7 +280,7 @@ def __createThrownTrapMultiTrack(trap, propList, propName, propPos = None, propH
def __createPlacedTrapMultiTrack(trap, prop, propName, propPos = None, propHpr = None, explode = 0, visibleOnlyForThisSuitId = None):
toon = trap['toon']
if trap.has_key('npc'):
if 'npc' in trap:
toon = trap['npc']
level = trap['level']
battle = trap['battle']
@ -387,7 +387,7 @@ def __trapQuicksand(trap, trapProps, explode):
def __trapTrapdoor(trap, trapProps, explode):
toon = trap['toon']
if trap.has_key('npc'):
if 'npc' in trap:
toon = trap['npc']
targets = trap['target']
for target in targets:
@ -408,7 +408,7 @@ def __trapTNT(trap, trapProps, explode):
def __trapTrain(trap, trapProps, explode):
toon = trap['toon']
if trap.has_key('npc'):
if 'npc' in trap:
toon = trap['npc']
targets = trap['target']
battle = trap['battle']
@ -477,7 +477,7 @@ def createCartoonExplosionTrack(parent, animName, explosionPoint = None):
def __createPlacedGroupTrapTrack(trap, prop, propName, centerSuit, propPos = None, propHpr = None, explode = 0):
toon = trap['toon']
if trap.has_key('npc'):
if 'npc' in trap:
toon = trap['npc']
level = trap['level']
battle = trap['battle']

View file

@ -1,11 +1,11 @@
from direct.interval.IntervalGlobal import *
from BattleBase import *
from BattleProps import *
from .BattleBase import *
from .BattleProps import *
from direct.directnotify import DirectNotifyGlobal
import random
from direct.particles import ParticleEffect
import BattleParticles
import BattleProps
from . import BattleParticles
from . import BattleProps
from toontown.toonbase import TTLocalizer
notify = DirectNotifyGlobal.directNotify.newCategory('MovieUtil')
SUIT_LOSE_DURATION = 6.0

View file

@ -2,12 +2,12 @@ from pandac.PandaModules import *
from toontown.toonbase import TTLocalizer
from toontown.toonbase.ToontownBattleGlobals import *
from toontown.toonbase.ToontownGlobals import *
from SuitBattleGlobals import *
from .SuitBattleGlobals import *
from direct.interval.IntervalGlobal import *
from direct.directnotify import DirectNotifyGlobal
import string
from direct.gui import OnscreenText
import BattleBase
from . import BattleBase
class PlayByPlayText(OnscreenText.OnscreenText):
notify = DirectNotifyGlobal.directNotify.newCategory('PlayByPlayText')

View file

@ -3,7 +3,7 @@ from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from toontown.toonbase import ToontownBattleGlobals
import BattleBase
from . import BattleBase
from direct.directnotify import DirectNotifyGlobal
import random
import string
@ -16,7 +16,7 @@ from toontown.toon import NPCToons
import math
from toontown.coghq import CogDisguiseGlobals
from toontown.shtiker import DisguisePage
import Fanfare
from . import Fanfare
from otp.otpbase import OTPGlobals
class RewardPanel(DirectFrame):
@ -303,7 +303,7 @@ class RewardPanel(DirectFrame):
def getRandomCongratsPair(self, toon):
congratsStrings = TTLocalizer.RewardPanelCongratsStrings
numStrings = len(congratsStrings)
indexList = range(numStrings)
indexList = list(range(numStrings))
index1 = random.choice(indexList)
indexList.remove(index1)
index2 = random.choice(indexList)
@ -445,7 +445,7 @@ class RewardPanel(DirectFrame):
def getTrackIntervalList(self, toon, track, origSkill, earnedSkill, hasUber, guestWaste = 0):
if hasUber < 0:
print (toon.doId, 'Reward Panel received an invalid hasUber from an uberList')
print((toon.doId, 'Reward Panel received an invalid hasUber from an uberList'))
tickDelay = 1.0 / 60
intervalList = []
if origSkill + earnedSkill >= ToontownBattleGlobals.UnpaidMaxSkills[track] and toon.getGameAccess() != OTPGlobals.AccessFull:

View file

@ -1,4 +1,4 @@
from BattleBase import *
from .BattleBase import *
import random
from direct.directnotify import DirectNotifyGlobal
from otp.otpbase import OTPLocalizer
@ -77,7 +77,7 @@ def pickSuitAttack(attacks, suitLevel):
return attackNum
elif configAttackName == 'sequence':
for i in range(len(attacks)):
if not debugAttackSequence.has_key(attacks[i]):
if attacks[i] not in debugAttackSequence:
debugAttackSequence[attacks[i]] = 1
return i
@ -101,7 +101,7 @@ def getSuitAttack(suitName, suitLevel, attackNum = -1):
adict['suitName'] = suitName
name = attack[0]
adict['name'] = name
adict['id'] = SuitAttacks.keys().index(name)
adict['id'] = list(SuitAttacks.keys()).index(name)
adict['animName'] = SuitAttacks[name][0]
adict['hp'] = attack[1][suitLevel]
adict['acc'] = attack[2][suitLevel]
@ -2953,76 +2953,76 @@ SuitAttacks = {'Audit': ('phone', ATK_TGT_SINGLE),
'Watercooler': ('watercooler', ATK_TGT_SINGLE),
'Withdrawal': ('magic1', ATK_TGT_SINGLE),
'WriteOff': ('hold-pencil', ATK_TGT_SINGLE)}
AUDIT = SuitAttacks.keys().index('Audit')
BITE = SuitAttacks.keys().index('Bite')
BOUNCE_CHECK = SuitAttacks.keys().index('BounceCheck')
BRAIN_STORM = SuitAttacks.keys().index('BrainStorm')
BUZZ_WORD = SuitAttacks.keys().index('BuzzWord')
CALCULATE = SuitAttacks.keys().index('Calculate')
CANNED = SuitAttacks.keys().index('Canned')
CHOMP = SuitAttacks.keys().index('Chomp')
CIGAR_SMOKE = SuitAttacks.keys().index('CigarSmoke')
CLIPON_TIE = SuitAttacks.keys().index('ClipOnTie')
CRUNCH = SuitAttacks.keys().index('Crunch')
DEMOTION = SuitAttacks.keys().index('Demotion')
DOWNSIZE = SuitAttacks.keys().index('Downsize')
DOUBLE_TALK = SuitAttacks.keys().index('DoubleTalk')
EVICTION_NOTICE = SuitAttacks.keys().index('EvictionNotice')
EVIL_EYE = SuitAttacks.keys().index('EvilEye')
FILIBUSTER = SuitAttacks.keys().index('Filibuster')
FILL_WITH_LEAD = SuitAttacks.keys().index('FillWithLead')
FINGER_WAG = SuitAttacks.keys().index('FingerWag')
FIRED = SuitAttacks.keys().index('Fired')
FIVE_O_CLOCK_SHADOW = SuitAttacks.keys().index('FiveOClockShadow')
FLOOD_THE_MARKET = SuitAttacks.keys().index('FloodTheMarket')
FOUNTAIN_PEN = SuitAttacks.keys().index('FountainPen')
FREEZE_ASSETS = SuitAttacks.keys().index('FreezeAssets')
GAVEL = SuitAttacks.keys().index('Gavel')
GLOWER_POWER = SuitAttacks.keys().index('GlowerPower')
GUILT_TRIP = SuitAttacks.keys().index('GuiltTrip')
HALF_WINDSOR = SuitAttacks.keys().index('HalfWindsor')
HANG_UP = SuitAttacks.keys().index('HangUp')
HEAD_SHRINK = SuitAttacks.keys().index('HeadShrink')
HOT_AIR = SuitAttacks.keys().index('HotAir')
JARGON = SuitAttacks.keys().index('Jargon')
LEGALESE = SuitAttacks.keys().index('Legalese')
LIQUIDATE = SuitAttacks.keys().index('Liquidate')
MARKET_CRASH = SuitAttacks.keys().index('MarketCrash')
MUMBO_JUMBO = SuitAttacks.keys().index('MumboJumbo')
PARADIGM_SHIFT = SuitAttacks.keys().index('ParadigmShift')
PECKING_ORDER = SuitAttacks.keys().index('PeckingOrder')
PICK_POCKET = SuitAttacks.keys().index('PickPocket')
PINK_SLIP = SuitAttacks.keys().index('PinkSlip')
PLAY_HARDBALL = SuitAttacks.keys().index('PlayHardball')
POUND_KEY = SuitAttacks.keys().index('PoundKey')
POWER_TIE = SuitAttacks.keys().index('PowerTie')
POWER_TRIP = SuitAttacks.keys().index('PowerTrip')
QUAKE = SuitAttacks.keys().index('Quake')
RAZZLE_DAZZLE = SuitAttacks.keys().index('RazzleDazzle')
RED_TAPE = SuitAttacks.keys().index('RedTape')
RE_ORG = SuitAttacks.keys().index('ReOrg')
RESTRAINING_ORDER = SuitAttacks.keys().index('RestrainingOrder')
ROLODEX = SuitAttacks.keys().index('Rolodex')
RUBBER_STAMP = SuitAttacks.keys().index('RubberStamp')
RUB_OUT = SuitAttacks.keys().index('RubOut')
SACKED = SuitAttacks.keys().index('Sacked')
SANDTRAP = SuitAttacks.keys().index('SandTrap')
SCHMOOZE = SuitAttacks.keys().index('Schmooze')
SHAKE = SuitAttacks.keys().index('Shake')
SHRED = SuitAttacks.keys().index('Shred')
SONG_AND_DANCE = SuitAttacks.keys().index('SongAndDance')
SPIN = SuitAttacks.keys().index('Spin')
SYNERGY = SuitAttacks.keys().index('Synergy')
TABULATE = SuitAttacks.keys().index('Tabulate')
TEE_OFF = SuitAttacks.keys().index('TeeOff')
THROW_BOOK = SuitAttacks.keys().index('ThrowBook')
TREMOR = SuitAttacks.keys().index('Tremor')
WATERCOOLER = SuitAttacks.keys().index('Watercooler')
WITHDRAWAL = SuitAttacks.keys().index('Withdrawal')
WRITE_OFF = SuitAttacks.keys().index('WriteOff')
AUDIT = list(SuitAttacks.keys()).index('Audit')
BITE = list(SuitAttacks.keys()).index('Bite')
BOUNCE_CHECK = list(SuitAttacks.keys()).index('BounceCheck')
BRAIN_STORM = list(SuitAttacks.keys()).index('BrainStorm')
BUZZ_WORD = list(SuitAttacks.keys()).index('BuzzWord')
CALCULATE = list(SuitAttacks.keys()).index('Calculate')
CANNED = list(SuitAttacks.keys()).index('Canned')
CHOMP = list(SuitAttacks.keys()).index('Chomp')
CIGAR_SMOKE = list(SuitAttacks.keys()).index('CigarSmoke')
CLIPON_TIE = list(SuitAttacks.keys()).index('ClipOnTie')
CRUNCH = list(SuitAttacks.keys()).index('Crunch')
DEMOTION = list(SuitAttacks.keys()).index('Demotion')
DOWNSIZE = list(SuitAttacks.keys()).index('Downsize')
DOUBLE_TALK = list(SuitAttacks.keys()).index('DoubleTalk')
EVICTION_NOTICE = list(SuitAttacks.keys()).index('EvictionNotice')
EVIL_EYE = list(SuitAttacks.keys()).index('EvilEye')
FILIBUSTER = list(SuitAttacks.keys()).index('Filibuster')
FILL_WITH_LEAD = list(SuitAttacks.keys()).index('FillWithLead')
FINGER_WAG = list(SuitAttacks.keys()).index('FingerWag')
FIRED = list(SuitAttacks.keys()).index('Fired')
FIVE_O_CLOCK_SHADOW = list(SuitAttacks.keys()).index('FiveOClockShadow')
FLOOD_THE_MARKET = list(SuitAttacks.keys()).index('FloodTheMarket')
FOUNTAIN_PEN = list(SuitAttacks.keys()).index('FountainPen')
FREEZE_ASSETS = list(SuitAttacks.keys()).index('FreezeAssets')
GAVEL = list(SuitAttacks.keys()).index('Gavel')
GLOWER_POWER = list(SuitAttacks.keys()).index('GlowerPower')
GUILT_TRIP = list(SuitAttacks.keys()).index('GuiltTrip')
HALF_WINDSOR = list(SuitAttacks.keys()).index('HalfWindsor')
HANG_UP = list(SuitAttacks.keys()).index('HangUp')
HEAD_SHRINK = list(SuitAttacks.keys()).index('HeadShrink')
HOT_AIR = list(SuitAttacks.keys()).index('HotAir')
JARGON = list(SuitAttacks.keys()).index('Jargon')
LEGALESE = list(SuitAttacks.keys()).index('Legalese')
LIQUIDATE = list(SuitAttacks.keys()).index('Liquidate')
MARKET_CRASH = list(SuitAttacks.keys()).index('MarketCrash')
MUMBO_JUMBO = list(SuitAttacks.keys()).index('MumboJumbo')
PARADIGM_SHIFT = list(SuitAttacks.keys()).index('ParadigmShift')
PECKING_ORDER = list(SuitAttacks.keys()).index('PeckingOrder')
PICK_POCKET = list(SuitAttacks.keys()).index('PickPocket')
PINK_SLIP = list(SuitAttacks.keys()).index('PinkSlip')
PLAY_HARDBALL = list(SuitAttacks.keys()).index('PlayHardball')
POUND_KEY = list(SuitAttacks.keys()).index('PoundKey')
POWER_TIE = list(SuitAttacks.keys()).index('PowerTie')
POWER_TRIP = list(SuitAttacks.keys()).index('PowerTrip')
QUAKE = list(SuitAttacks.keys()).index('Quake')
RAZZLE_DAZZLE = list(SuitAttacks.keys()).index('RazzleDazzle')
RED_TAPE = list(SuitAttacks.keys()).index('RedTape')
RE_ORG = list(SuitAttacks.keys()).index('ReOrg')
RESTRAINING_ORDER = list(SuitAttacks.keys()).index('RestrainingOrder')
ROLODEX = list(SuitAttacks.keys()).index('Rolodex')
RUBBER_STAMP = list(SuitAttacks.keys()).index('RubberStamp')
RUB_OUT = list(SuitAttacks.keys()).index('RubOut')
SACKED = list(SuitAttacks.keys()).index('Sacked')
SANDTRAP = list(SuitAttacks.keys()).index('SandTrap')
SCHMOOZE = list(SuitAttacks.keys()).index('Schmooze')
SHAKE = list(SuitAttacks.keys()).index('Shake')
SHRED = list(SuitAttacks.keys()).index('Shred')
SONG_AND_DANCE = list(SuitAttacks.keys()).index('SongAndDance')
SPIN = list(SuitAttacks.keys()).index('Spin')
SYNERGY = list(SuitAttacks.keys()).index('Synergy')
TABULATE = list(SuitAttacks.keys()).index('Tabulate')
TEE_OFF = list(SuitAttacks.keys()).index('TeeOff')
THROW_BOOK = list(SuitAttacks.keys()).index('ThrowBook')
TREMOR = list(SuitAttacks.keys()).index('Tremor')
WATERCOOLER = list(SuitAttacks.keys()).index('Watercooler')
WITHDRAWAL = list(SuitAttacks.keys()).index('Withdrawal')
WRITE_OFF = list(SuitAttacks.keys()).index('WriteOff')
def getFaceoffTaunt(suitName, doId):
if SuitFaceoffTaunts.has_key(suitName):
if suitName in SuitFaceoffTaunts:
taunts = SuitFaceoffTaunts[suitName]
else:
taunts = TTLocalizer.SuitFaceoffDefaultTaunts
@ -3037,7 +3037,7 @@ def getAttackTauntIndexFromIndex(suit, attackIndex):
def getAttackTauntIndex(attackName):
if SuitAttackTaunts.has_key(attackName):
if attackName in SuitAttackTaunts:
taunts = SuitAttackTaunts[attackName]
return random.randint(0, len(taunts) - 1)
else:
@ -3045,7 +3045,7 @@ def getAttackTauntIndex(attackName):
def getAttackTaunt(attackName, index = None):
if SuitAttackTaunts.has_key(attackName):
if attackName in SuitAttackTaunts:
taunts = SuitAttackTaunts[attackName]
else:
taunts = TTLocalizer.SuitAttackDefaultTaunts

View file

@ -179,7 +179,7 @@ class BoardingGroupShow:
base.cTrav.traverse(render)
queue.sortEntries()
if queue.getNumEntries():
for entryNum in xrange(queue.getNumEntries()):
for entryNum in range(queue.getNumEntries()):
entry = queue.getEntry(entryNum)
hitObject = entry.getIntoNodePath()
if hitObject.getNetTag('pieCode') != '3':

View file

@ -30,7 +30,7 @@ class BoardingPartyBase:
self.maxSize = groupSize
def getGroupLeader(self, avatarId):
if self.avIdDict.has_key(avatarId):
if avatarId in self.avIdDict:
leaderId = self.avIdDict[avatarId]
return leaderId
else:
@ -45,7 +45,7 @@ class BoardingPartyBase:
return False
def getGroupMemberList(self, avatarId):
if self.avIdDict.has_key(avatarId):
if avatarId in self.avIdDict:
leaderId = self.avIdDict[avatarId]
group = self.groupListDict.get(leaderId)
if group:
@ -56,7 +56,7 @@ class BoardingPartyBase:
return []
def getGroupInviteList(self, avatarId):
if self.avIdDict.has_key(avatarId):
if avatarId in self.avIdDict:
leaderId = self.avIdDict[avatarId]
group = self.groupListDict.get(leaderId)
if group:
@ -67,7 +67,7 @@ class BoardingPartyBase:
return []
def getGroupKickList(self, avatarId):
if self.avIdDict.has_key(avatarId):
if avatarId in self.avIdDict:
leaderId = self.avIdDict[avatarId]
group = self.groupListDict.get(leaderId)
if group:
@ -86,7 +86,7 @@ class BoardingPartyBase:
def hasPendingInvite(self, avatarId):
pendingInvite = False
if self.avIdDict.has_key(avatarId):
if avatarId in self.avIdDict:
leaderId = self.avIdDict[avatarId]
leaderInviteList = self.getGroupInviteList(leaderId)
if leaderId == avatarId:

View file

@ -13,7 +13,7 @@ class DistributedAnimDoor(DistributedDoor.DistributedDoor):
base.animDoor = self
def getBuilding(self):
if not self.__dict__.has_key('building'):
if 'building' not in self.__dict__:
if self.doorType == DoorTypes.EXT_ANIM_STANDARD:
searchStr = '**/??' + str(self.block) + ':animated_building_*_DNARoot;+s'
self.notify.debug('searchStr=%s' % searchStr)
@ -52,7 +52,7 @@ class DistributedAnimDoor(DistributedDoor.DistributedDoor):
self.notify.error('setTriggerName doorTYpe=%s' % self.doorType)
def getAnimBuilding(self):
if not self.__dict__.has_key('animBuilding'):
if 'animBuilding' not in self.__dict__:
if self.doorType == DoorTypes.EXT_ANIM_STANDARD:
bldg = self.getBuilding()
key = bldg.getParent().getParent()

View file

@ -1,6 +1,6 @@
import DistributedElevator
import DistributedBossElevator
from ElevatorConstants import *
from . import DistributedElevator
from . import DistributedBossElevator
from .ElevatorConstants import *
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import TTLocalizer

View file

@ -1,5 +1,5 @@
from ElevatorConstants import *
import DistributedBossElevatorAI
from .ElevatorConstants import *
from . import DistributedBossElevatorAI
class DistributedBBElevatorAI(DistributedBossElevatorAI.DistributedBossElevatorAI):

View file

@ -12,7 +12,7 @@ from toontown.toontowngui import TTDialog
from toontown.hood import ZoneUtil
from toontown.toontowngui import TeaserPanel
from direct.interval.IntervalGlobal import *
import BoardingGroupShow
from . import BoardingGroupShow
class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPartyBase.BoardingPartyBase):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedBoardingParty')
@ -74,7 +74,7 @@ class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPart
self.notify.debug('postgroupInfo')
isMyGroup = 0
removedMemberIdList = []
if self.groupListDict.has_key(leaderId):
if leaderId in self.groupListDict:
oldGroupEntry = self.groupListDict[leaderId]
else:
oldGroupEntry = [[], [], []]
@ -100,7 +100,7 @@ class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPart
if newGroupEntry[0] == [0] or not newGroupEntry[0]:
dgroup = self.groupListDict.pop(leaderId)
for memberId in dgroup[0]:
if self.avIdDict.has_key(memberId):
if memberId in self.avIdDict:
self.avIdDict.pop(memberId)
if isMyGroup:
@ -335,16 +335,16 @@ class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPart
isMyGroup = 0
if localAvatar.doId == quitterId or localAvatar.doId == leaderId:
isMyGroup = 1
if self.groupListDict.has_key(leaderId):
if leaderId in self.groupListDict:
if leaderId == localAvatar.doId:
isMyGroup = 1
if self.avIdDict.has_key(leaderId):
if leaderId in self.avIdDict:
self.avIdDict.pop(leaderId)
dgroup = self.groupListDict.pop(leaderId)
for memberId in memberList:
if memberId == localAvatar.doId:
isMyGroup = 1
if self.avIdDict.has_key(memberId):
if memberId in self.avIdDict:
self.avIdDict.pop(memberId)
if isMyGroup:
@ -427,7 +427,7 @@ class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPart
place = base.cr.playGame.getPlace()
if place:
if not place.getState() == 'elevator':
if self.avIdDict.has_key(localAvatar.doId):
if localAvatar.doId in self.avIdDict:
leaderId = self.avIdDict[localAvatar.doId]
self.sendUpdate('requestLeave', [leaderId])

View file

@ -2,7 +2,7 @@ from otp.otpbase import OTPGlobals
from otp.ai.AIBase import *
from toontown.toonbase import ToontownGlobals
from direct.distributed.ClockDelta import *
from ElevatorConstants import *
from .ElevatorConstants import *
from direct.distributed import DistributedObjectAI
from direct.fsm import ClassicFSM, State
from direct.fsm import State
@ -142,7 +142,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
reason = BoardingPartyBase.BOARDCODE_PROMOTION
self.sendUpdateToAvatarId(inviterId, 'postInviteNotQualify', [inviterId, reason, self.elevatorIdList[0]])
return
if self.avIdDict.has_key(inviterId):
if inviterId in self.avIdDict:
self.notify.debug('old group')
leaderId = self.avIdDict[inviterId]
groupList = self.groupListDict.get(leaderId)
@ -157,7 +157,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
if inviteeId not in groupList[1]:
groupList[1].append(inviteeId)
self.groupListDict[leaderId] = groupList
if self.avIdDict.has_key(inviteeId):
if inviteeId in self.avIdDict:
self.notify.warning('inviter %s tried to invite %s who already exists in the avIdDict.' % (inviterId, inviteeId))
self.air.writeServerEvent('suspicious: inviter', inviterId, ' tried to invite %s who already exists in the avIdDict.' % inviteeId)
self.avIdDict[inviteeId] = leaderId
@ -169,7 +169,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
elif inviterId in groupList[2]:
self.sendUpdate('postKickReject', [leaderId, inviterId, inviteeId])
else:
if self.avIdDict.has_key(inviteeId):
if inviteeId in self.avIdDict:
self.notify.warning('inviter %s tried to invite %s who already exists in avIdDict.' % (inviterId, inviteeId))
self.air.writeServerEvent('suspicious: inviter', inviterId, ' tried to invite %s who already exists in the avIdDict.' % inviteeId)
self.notify.debug('new group')
@ -182,7 +182,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
def requestCancelInvite(self, inviteeId):
inviterId = self.air.getAvatarIdFromSender()
if self.avIdDict.has_key(inviterId):
if inviterId in self.avIdDict:
leaderId = self.avIdDict[inviterId]
groupList = self.groupListDict.get(leaderId)
if groupList:
@ -192,11 +192,11 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
def requestAcceptInvite(self, leaderId, inviterId):
inviteeId = self.air.getAvatarIdFromSender()
self.notify.debug('requestAcceptInvite leader%s inviter%s invitee%s' % (leaderId, inviterId, inviteeId))
if self.avIdDict.has_key(inviteeId):
if inviteeId in self.avIdDict:
if self.hasActiveGroup(inviteeId):
self.sendUpdateToAvatarId(inviteeId, 'postAlreadyInGroup', [])
return
if not self.avIdDict.has_key(leaderId) or not self.isInGroup(inviteeId, leaderId):
if leaderId not in self.avIdDict or not self.isInGroup(inviteeId, leaderId):
self.sendUpdateToAvatarId(inviteeId, 'postSomethingMissing', [])
return
memberList = self.getGroupMemberList(leaderId)
@ -225,14 +225,14 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
def requestKick(self, kickId):
leaderId = self.air.getAvatarIdFromSender()
if self.avIdDict.has_key(kickId):
if kickId in self.avIdDict:
if self.avIdDict[kickId] == leaderId:
self.removeFromGroup(leaderId, kickId, kick=1)
self.sendUpdateToAvatarId(kickId, 'postKick', [leaderId])
def requestLeave(self, leaderId):
memberId = self.air.getAvatarIdFromSender()
if self.avIdDict.has_key(memberId):
if memberId in self.avIdDict:
if leaderId == self.avIdDict[memberId]:
self.removeFromGroup(leaderId, memberId)
@ -254,7 +254,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
if elevatorId in self.elevatorIdList:
elevator = simbase.air.doId2do.get(elevatorId)
if elevator:
if self.avIdDict.has_key(leaderId):
if leaderId in self.avIdDict:
if leaderId == self.avIdDict[leaderId]:
boardOkay = BoardingPartyBase.BOARDCODE_OKAY
for avId in self.getGroupMemberList(leaderId):
@ -294,7 +294,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
if elevatorId in self.elevatorIdList:
elevator = simbase.air.doId2do.get(elevatorId)
if elevator:
if self.avIdDict.has_key(leaderId):
if leaderId in self.avIdDict:
if leaderId == self.avIdDict[leaderId]:
group = self.groupListDict.get(leaderId)
if group:
@ -319,7 +319,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
return
def testGoButtonRequirements(self, leaderId, elevatorId):
if self.avIdDict.has_key(leaderId):
if leaderId in self.avIdDict:
if leaderId == self.avIdDict[leaderId]:
if elevatorId in self.elevatorIdList:
elevator = simbase.air.doId2do.get(elevatorId)
@ -374,7 +374,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
def handleAvatarDisco(self, avId):
self.notify.debug('handleAvatarDisco %s' % avId)
if self.avIdDict.has_key(avId):
if avId in self.avIdDict:
leaderId = self.avIdDict[avId]
self.removeFromGroup(leaderId, avId)
@ -383,12 +383,12 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
if zoneNew in self.visibleZones:
self.toonInZone(avId)
else:
if self.avIdDict.has_key(avId):
if avId in self.avIdDict:
leaderId = self.avIdDict[avId]
self.removeFromGroup(leaderId, avId)
def toonInZone(self, avId):
if self.avIdDict.has_key(avId):
if avId in self.avIdDict:
leaderId = self.avIdDict[avId]
group = self.groupListDict.get(leaderId)
if leaderId and group:
@ -415,9 +415,9 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
self.notify.debug('removeFromGroup leaderId %s memberId %s' % (leaderId, memberId))
self.notify.debug('Groups %s' % self.groupListDict)
self.notify.debug('avDict %s' % self.avIdDict)
if not self.avIdDict.has_key(leaderId):
if leaderId not in self.avIdDict:
self.sendUpdate('postGroupDissolve', [memberId, leaderId, [], kick])
if self.avIdDict.has_key(memberId):
if memberId in self.avIdDict:
self.avIdDict.pop(memberId)
return
self.removeWacthAvStatus(memberId)
@ -434,16 +434,16 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
else:
return
if memberId == leaderId or len(group[0]) < 2:
if self.avIdDict.has_key(leaderId):
if leaderId in self.avIdDict:
self.avIdDict.pop(leaderId)
for inviteeId in group[1]:
if self.avIdDict.has_key(inviteeId):
if inviteeId in self.avIdDict:
self.avIdDict.pop(inviteeId)
self.sendUpdateToAvatarId(inviteeId, 'postInviteCanceled', [])
dgroup = self.groupListDict.pop(leaderId)
for dMemberId in dgroup[0]:
if self.avIdDict.has_key(dMemberId):
if dMemberId in self.avIdDict:
self.avIdDict.pop(dMemberId)
self.notify.debug('postGroupDissolve')
@ -454,7 +454,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
if post:
self.notify.debug('Calling postGroupInfo from removeFromGroup')
self.sendUpdate('postGroupInfo', [leaderId, group[0], group[1], group[2]])
if self.avIdDict.has_key(memberId):
if memberId in self.avIdDict:
self.avIdDict.pop(memberId)
self.notify.debug('Remove from group END')
self.notify.debug('Groups %s' % self.groupListDict)

View file

@ -1,10 +1,10 @@
from pandac.PandaModules import *
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from ElevatorConstants import *
from ElevatorUtils import *
import DistributedElevator
import DistributedElevatorExt
from .ElevatorConstants import *
from .ElevatorUtils import *
from . import DistributedElevator
from . import DistributedElevatorExt
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM

View file

@ -1,8 +1,8 @@
from otp.ai.AIBase import *
from toontown.toonbase import ToontownGlobals
from direct.distributed.ClockDelta import *
from ElevatorConstants import *
import DistributedElevatorAI, DistributedElevatorExtAI
from .ElevatorConstants import *
from . import DistributedElevatorAI, DistributedElevatorExtAI
from direct.fsm import ClassicFSM
from direct.fsm import State
from direct.task import Task

View file

@ -2,9 +2,9 @@ from pandac.PandaModules import *
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from direct.directtools.DirectGeometry import *
from ElevatorConstants import *
from ElevatorUtils import *
from SuitBuildingGlobals import *
from .ElevatorConstants import *
from .ElevatorUtils import *
from .SuitBuildingGlobals import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from toontown.toonbase import ToontownGlobals
@ -710,7 +710,7 @@ class DistributedBuilding(DistributedObject.DistributedObject):
def plantVictorsOutsideBldg(self):
retVal = 0
for victor in self.victorList:
if victor != 0 and self.cr.doId2do.has_key(victor):
if victor != 0 and victor in self.cr.doId2do:
toon = self.cr.doId2do[victor]
toon.setPosHpr(self.elevatorModel, 0, -10, 0, 0, 0, 0)
toon.startSmooth()
@ -725,12 +725,12 @@ class DistributedBuilding(DistributedObject.DistributedObject):
delayDeletes = []
i = 0
for victor in self.victorList:
if victor != 0 and self.cr.doId2do.has_key(victor):
if victor != 0 and victor in self.cr.doId2do:
toon = self.cr.doId2do[victor]
delayDeletes.append(DelayDelete.DelayDelete(toon, 'getVictoryRunTrack'))
toon.stopSmooth()
toon.setParent(ToontownGlobals.SPHidden)
origPosTrack.append(Func(toon.setPosHpr, self.elevatorNodePath, apply(Point3, ElevatorPoints[i]), Point3(180, 0, 0)))
origPosTrack.append(Func(toon.setPosHpr, self.elevatorNodePath, Point3(*ElevatorPoints[i]), Point3(180, 0, 0)))
origPosTrack.append(Func(toon.setParent, ToontownGlobals.SPRender))
i += 1
@ -740,7 +740,7 @@ class DistributedBuilding(DistributedObject.DistributedObject):
runOutAll = Parallel()
i = 0
for victor in self.victorList:
if victor != 0 and self.cr.doId2do.has_key(victor):
if victor != 0 and victor in self.cr.doId2do:
toon = self.cr.doId2do[victor]
p0 = Point3(0, 0, 0)
p1 = Point3(ElevatorPoints[i][0], ElevatorPoints[i][1] - 5.0, ElevatorPoints[i][2])

View file

@ -7,7 +7,7 @@ from direct.distributed import DistributedObjectAI
from direct.fsm import State
from direct.fsm import ClassicFSM, State
from toontown.toonbase.ToontownGlobals import ToonHall
import DistributedToonInteriorAI, DistributedToonHallInteriorAI, DistributedSuitInteriorAI, DistributedDoorAI, DoorTypes, DistributedElevatorExtAI, DistributedKnockKnockDoorAI, SuitPlannerInteriorAI, SuitBuildingGlobals, FADoorCodes
from . import DistributedToonInteriorAI, DistributedToonHallInteriorAI, DistributedSuitInteriorAI, DistributedDoorAI, DoorTypes, DistributedElevatorExtAI, DistributedKnockKnockDoorAI, SuitPlannerInteriorAI, SuitBuildingGlobals, FADoorCodes
from toontown.hood import ZoneUtil
import random, time
from toontown.cogdominium.DistributedCogdoInteriorAI import DistributedCogdoInteriorAI
@ -244,7 +244,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
return
def setVictorExited(self, avId):
print 'victor %d exited unexpectedly for bldg %d' % (avId, self.doId)
print('victor %d exited unexpectedly for bldg %d' % (avId, self.doId))
self.recordVictorResponse(avId)
if self.allVictorsResponded():
self.toonTakeOver()
@ -276,7 +276,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
pass
def getToon(self, toonId):
if self.air.doId2do.has_key(toonId):
if toonId in self.air.doId2do:
return self.air.doId2do[toonId]
else:
self.notify.warning('getToon() - toon: %d not in repository!' % toonId)
@ -313,7 +313,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
for i in range(0, 4):
victor = victorList[i]
if victor == None or not self.air.doId2do.has_key(victor):
if victor == None or victor not in self.air.doId2do:
victorList[i] = 0
else:
event = self.air.getAvatarExitEvent(victor)
@ -355,7 +355,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
for i in range(0, 4):
victor = victorList[i]
if victor == None or not self.air.doId2do.has_key(victor):
if victor == None or victor not in self.air.doId2do:
victorList[i] = 0
else:
event = self.air.getAvatarExitEvent(victor)

View file

@ -1,8 +1,8 @@
import os
from direct.task.Task import Task
import cPickle
import pickle
from otp.ai.AIBaseGlobal import *
import DistributedBuildingAI, HQBuildingAI, GagshopBuildingAI, PetshopBuildingAI
from . import DistributedBuildingAI, HQBuildingAI, GagshopBuildingAI, PetshopBuildingAI
from toontown.building.KartShopBuildingAI import KartShopBuildingAI
from toontown.building import DistributedAnimBuildingAI
from direct.directnotify import DirectNotifyGlobal
@ -28,13 +28,13 @@ class DistributedBuildingMgrAI:
def cleanup(self):
taskMgr.remove(str(self.branchID) + '_delayed_save-timer')
for building in self.__buildings.values():
for building in list(self.__buildings.values()):
building.cleanup()
self.__buildings = {}
def isValidBlockNumber(self, blockNumber):
return self.__buildings.has_key(blockNumber)
return blockNumber in self.__buildings
def delayedSaveTask(self, task):
self.save()
@ -46,7 +46,7 @@ class DistributedBuildingMgrAI:
def getSuitBlocks(self):
blocks = []
for i in self.__buildings.values():
for i in list(self.__buildings.values()):
if i.isSuitBlock():
blocks.append(i.getBlock()[0])
@ -57,7 +57,7 @@ class DistributedBuildingMgrAI:
def getCogdoBlocks(self):
blocks = []
for i in self.__buildings.values():
for i in list(self.__buildings.values()):
if i.isCogdo():
blocks.append(i.getBlock()[0])
@ -65,7 +65,7 @@ class DistributedBuildingMgrAI:
def getEstablishedSuitBlocks(self):
blocks = []
for i in self.__buildings.values():
for i in list(self.__buildings.values()):
if i.isEstablishedSuitBlock():
blocks.append(i.getBlock()[0])
@ -73,7 +73,7 @@ class DistributedBuildingMgrAI:
def getToonBlocks(self):
blocks = []
for i in self.__buildings.values():
for i in list(self.__buildings.values()):
if isinstance(i, HQBuildingAI.HQBuildingAI):
continue
if not i.isSuitBlock():
@ -82,7 +82,7 @@ class DistributedBuildingMgrAI:
return blocks
def getBuildings(self):
return self.__buildings.values()
return list(self.__buildings.values())
def getFrontDoorPoint(self, blockNumber):
return self.__buildings[blockNumber].getFrontDoorPoint()
@ -237,13 +237,13 @@ class DistributedBuildingMgrAI:
def saveTo(self, file, block=None):
if block:
pickleData = block.getPickleData()
cPickle.dump(pickleData, file)
pickle.dump(pickleData, file)
else:
for i in self.__buildings.values():
for i in list(self.__buildings.values()):
if isinstance(i, HQBuildingAI.HQBuildingAI):
continue
pickleData = i.getPickleData()
cPickle.dump(pickleData, file)
pickle.dump(pickleData, file)
def fastSave(self, block):
return
@ -280,7 +280,7 @@ class DistributedBuildingMgrAI:
blocks = {}
try:
while 1:
pickleData = cPickle.load(file)
pickleData = pickle.load(file)
blocks[int(pickleData['block'])] = pickleData
except EOFError:

View file

@ -1,6 +1,6 @@
import DistributedElevator
import DistributedBossElevator
from ElevatorConstants import *
from . import DistributedElevator
from . import DistributedBossElevator
from .ElevatorConstants import *
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import TTLocalizer

View file

@ -1,5 +1,5 @@
from ElevatorConstants import *
import DistributedBossElevatorAI
from .ElevatorConstants import *
from . import DistributedBossElevatorAI
class DistributedCFOElevatorAI(DistributedBossElevatorAI.DistributedBossElevatorAI):

View file

@ -1,6 +1,6 @@
import DistributedElevator
import DistributedBossElevator
from ElevatorConstants import *
from . import DistributedElevator
from . import DistributedBossElevator
from .ElevatorConstants import *
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import TTLocalizer

View file

@ -1,5 +1,5 @@
from ElevatorConstants import *
import DistributedBossElevatorAI
from .ElevatorConstants import *
from . import DistributedBossElevatorAI
class DistributedCJElevatorAI(DistributedBossElevatorAI.DistributedBossElevatorAI):

View file

@ -307,7 +307,7 @@ class DistributedClubElevator(DistributedElevatorFSM.DistributedElevatorFSM):
def kickEveryoneOut(self):
bailFlag = 0
for avId, slot in self.boardedAvIds.items():
for avId, slot in list(self.boardedAvIds.items()):
self.emptySlot(slot, avId, bailFlag, globalClockDelta.getRealNetworkTime())
if avId == base.localAvatar.doId:
pass
@ -380,7 +380,7 @@ class DistributedClubElevator(DistributedElevatorFSM.DistributedElevatorFSM):
del self.toonRequests[index]
if avId == 0:
pass
elif not self.cr.doId2do.has_key(avId):
elif avId not in self.cr.doId2do:
func = PythonUtil.Functor(self.gotToon, index, avId)
self.toonRequests[index] = self.cr.relatedObjectMgr.requestObjects([avId], allCallback=func)
elif not self.isSetup:
@ -460,7 +460,7 @@ class DistributedClubElevator(DistributedElevatorFSM.DistributedElevatorFSM):
newSlots.append(slot)
self.deferredSlots = newSlots
elif self.cr.doId2do.has_key(avId):
elif avId in self.cr.doId2do:
if bailFlag == 1 and hasattr(self, 'clockNode'):
if timestamp < self.countdownTime and timestamp >= 0:
self.countdown(self.countdownTime - timestamp)
@ -527,5 +527,5 @@ class DistributedClubElevator(DistributedElevatorFSM.DistributedElevatorFSM):
keyList.append(key)
for key in keyList:
if self.__toonTracks.has_key(key):
if key in self.__toonTracks:
self.clearToonTrack(key)

View file

@ -129,7 +129,7 @@ class DistributedClubElevatorAI(DistributedElevatorFSMAI.DistributedElevatorFSMA
for i in range(len(self.seats)):
self.seats[i] = None
print self.seats
print(self.seats)
if self.wantState == 'closed':
self.demand('Closing')
else:

View file

@ -9,9 +9,9 @@ from direct.distributed import DistributedObject
from toontown.hood import ZoneUtil
from toontown.suit import Suit
from toontown.distributed import DelayDelete
import FADoorCodes
from . import FADoorCodes
from direct.task.Task import Task
import DoorTypes
from . import DoorTypes
from toontown.toontowngui import TTDialog
from toontown.toonbase import TTLocalizer
from toontown.toontowngui import TeaserPanel
@ -70,7 +70,7 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
self.ignore('clearOutToonInterior')
self.fsm.request('off')
self.exitDoorFSM.request('off')
if self.__dict__.has_key('building'):
if 'building' in self.__dict__:
del self.building
self.finishAllTracks()
self.avatarIDList = []
@ -116,7 +116,7 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
return
def getTriggerName(self):
if self.doorType == DoorTypes.INT_HQ or self.specialDoorTypes.has_key(self.doorType):
if self.doorType == DoorTypes.INT_HQ or self.doorType in self.specialDoorTypes:
return 'door_trigger_' + str(self.block) + '_' + str(self.doorIndex)
else:
return 'door_trigger_' + str(self.block)
@ -132,7 +132,7 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
return 'exit' + self.getTriggerName()
def hideDoorParts(self):
if self.specialDoorTypes.has_key(self.doorType):
if self.doorType in self.specialDoorTypes:
self.hideIfHasFlat(self.findDoorNode('rightDoor'))
self.hideIfHasFlat(self.findDoorNode('leftDoor'))
self.findDoorNode('doorFrameHoleRight').hide()
@ -141,7 +141,7 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
return
def setTriggerName(self):
if self.specialDoorTypes.has_key(self.doorType):
if self.doorType in self.specialDoorTypes:
building = self.getBuilding()
doorTrigger = building.find('**/door_' + str(self.doorIndex) + '/**/door_trigger*')
doorTrigger.node().setName(self.getTriggerName())
@ -200,7 +200,7 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
self.setupNametag()
def getBuilding(self):
if not self.__dict__.has_key('building'):
if 'building' not in self.__dict__:
if self.doorType == DoorTypes.INT_STANDARD:
door = render.find('**/leftDoor;+s')
self.building = door.getParent()
@ -220,12 +220,12 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
return self.building
def getBuilding_wip(self):
if not self.__dict__.has_key('building'):
if self.__dict__.has_key('block'):
if 'building' not in self.__dict__:
if 'block' in self.__dict__:
self.building = self.cr.playGame.hood.loader.geom.find('**/??' + str(self.block) + ':*_landmark_*_DNARoot;+s')
else:
self.building = self.cr.playGame.hood.loader.geom
print '---------------- door is interior -------'
print('---------------- door is interior -------')
return self.building
def readyToExit(self):
@ -400,7 +400,7 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
otherNP.setPos(posHpr.getPos())
otherNP.setHpr(posHpr.getHpr())
self.tempDoorNodePath = otherNP
elif self.specialDoorTypes.has_key(self.doorType):
elif self.doorType in self.specialDoorTypes:
building = self.getBuilding()
otherNP = building.find('**/door_origin_' + str(self.doorIndex))
elif self.doorType == DoorTypes.INT_HQ:

View file

@ -123,7 +123,7 @@ class DistributedDoorAI(DistributedObjectAI.DistributedObjectAI):
self.otherDoor.getZoneId(), self.otherDoor.getDoId()])
def enqueueAvatarIdEnter(self, avatarID):
if not self.avatarsWhoAreEntering.has_key(avatarID):
if avatarID not in self.avatarsWhoAreEntering:
self.avatarsWhoAreEntering[avatarID] = 1
self.sendUpdate('avatarEnter', [avatarID])
self.openDoor(self.fsm)
@ -142,10 +142,10 @@ class DistributedDoorAI(DistributedObjectAI.DistributedObjectAI):
self.enqueueAvatarIdExit(avatarID)
def enqueueAvatarIdExit(self, avatarID):
if self.avatarsWhoAreEntering.has_key(avatarID):
if avatarID in self.avatarsWhoAreEntering:
del self.avatarsWhoAreEntering[avatarID]
else:
if not self.avatarsWhoAreExiting.has_key(avatarID):
if avatarID not in self.avatarsWhoAreExiting:
self.avatarsWhoAreExiting[avatarID] = 1
self.openDoor(self.exitDoorFSM)

View file

@ -1,8 +1,8 @@
from pandac.PandaModules import *
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from ElevatorConstants import *
from ElevatorUtils import *
from .ElevatorConstants import *
from .ElevatorUtils import *
from direct.showbase import PythonUtil
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
@ -88,7 +88,7 @@ class DistributedElevator(DistributedObject.DistributedObject):
if self.bldgRequest:
self.cr.relatedObjectMgr.abortRequest(self.bldgRequest)
self.bldgRequest = None
for request in self.toonRequests.values():
for request in list(self.toonRequests.values()):
self.cr.relatedObjectMgr.abortRequest(request)
self.toonRequests = {}
@ -186,7 +186,7 @@ class DistributedElevator(DistributedObject.DistributedObject):
del self.toonRequests[index]
if avId == 0:
pass
elif not self.cr.doId2do.has_key(avId):
elif avId not in self.cr.doId2do:
func = PythonUtil.Functor(self.gotToon, index, avId)
self.toonRequests[index] = self.cr.relatedObjectMgr.requestObjects([avId], allCallback=func)
elif not self.isSetup:
@ -226,8 +226,8 @@ class DistributedElevator(DistributedObject.DistributedObject):
else:
animInFunc = Sequence(Func(toon.setAnimState, 'run', 1.0))
animFunc = Func(toon.setAnimState, 'neutral', 1.0)
toon.headsUp(self.getElevatorModel(), apply(Point3, self.elevatorPoints[index]))
track = Sequence(animInFunc, LerpPosInterval(toon, TOON_BOARD_ELEVATOR_TIME * 0.75, apply(Point3, self.elevatorPoints[index]), other=self.getElevatorModel()), LerpHprInterval(toon, TOON_BOARD_ELEVATOR_TIME * 0.25, Point3(180, 0, 0), other=self.getElevatorModel()), Func(self.clearToonTrack, avId), animFunc, name=toon.uniqueName('fillElevator'), autoPause=1)
toon.headsUp(self.getElevatorModel(), Point3(*self.elevatorPoints[index]))
track = Sequence(animInFunc, LerpPosInterval(toon, TOON_BOARD_ELEVATOR_TIME * 0.75, Point3(*self.elevatorPoints[index]), other=self.getElevatorModel()), LerpHprInterval(toon, TOON_BOARD_ELEVATOR_TIME * 0.25, Point3(180, 0, 0), other=self.getElevatorModel()), Func(self.clearToonTrack, avId), animFunc, name=toon.uniqueName('fillElevator'), autoPause=1)
if wantBoardingShow:
boardingTrack, boardingTrackType = self.getBoardingTrack(toon, index, False)
track = Sequence(boardingTrack, track)
@ -301,7 +301,7 @@ class DistributedElevator(DistributedObject.DistributedObject):
timeToSet = self.countdownTime
if timeSent > 0:
timeToSet = timeSent
if self.cr.doId2do.has_key(avId):
if avId in self.cr.doId2do:
if bailFlag == 1 and hasattr(self, 'clockNode'):
if timestamp < timeToSet and timestamp >= 0:
self.countdown(timeToSet - timestamp)
@ -362,7 +362,7 @@ class DistributedElevator(DistributedObject.DistributedObject):
place.fsm.request('walk')
def rejectBoard(self, avId, reason = 0):
print 'rejectBoard %s' % reason
print('rejectBoard %s' % reason)
if hasattr(base.localAvatar, 'elevatorNotifier'):
if reason == REJECT_SHUFFLE:
base.localAvatar.elevatorNotifier.showMe(TTLocalizer.ElevatorHoppedOff)
@ -423,7 +423,7 @@ class DistributedElevator(DistributedObject.DistributedObject):
pass
def onDoorCloseFinish(self):
for avId in self.boardedAvIds.keys():
for avId in list(self.boardedAvIds.keys()):
av = self.cr.doId2do.get(avId)
if av is not None:
if av.getParent().compareTo(self.getElevatorModel()) == 0:
@ -543,7 +543,7 @@ class DistributedElevator(DistributedObject.DistributedObject):
keyList.append(key)
for key in keyList:
if self.__toonTracks.has_key(key):
if key in self.__toonTracks:
self.clearToonTrack(key)
def getDestName(self):
@ -553,11 +553,11 @@ class DistributedElevator(DistributedObject.DistributedObject):
return self.JumpOutOffsets[seatIndex]
def getOffsetPosWrtToonParent(self, toon, seatIndex = 0):
self.offsetNP.setPos(apply(Point3, self.getOffsetPos(seatIndex)))
self.offsetNP.setPos(Point3(*self.getOffsetPos(seatIndex)))
return self.offsetNP.getPos(toon.getParent())
def getOffsetPosWrtRender(self, seatIndex = 0):
self.offsetNP.setPos(apply(Point3, self.getOffsetPos(seatIndex)))
self.offsetNP.setPos(Point3(*self.getOffsetPos(seatIndex)))
return self.offsetNP.getPos(render)
def canHideBoardingQuitBtn(self, avId):

View file

@ -1,7 +1,7 @@
from otp.ai.AIBase import *
from toontown.toonbase import ToontownGlobals
from direct.distributed.ClockDelta import *
from ElevatorConstants import *
from .ElevatorConstants import *
from direct.distributed import DistributedObjectAI
from direct.fsm import ClassicFSM, State
from direct.fsm import State
@ -258,7 +258,7 @@ class DistributedElevatorAI(DistributedObjectAI.DistributedObjectAI):
self.accepting = 1
def exitWaitCountdown(self):
print 'exit wait countdown'
print('exit wait countdown')
self.accepting = 0
taskMgr.remove(self.uniqueName('countdown-timer'))
self.newTrip()

View file

@ -2,9 +2,9 @@ from pandac.PandaModules import *
from libotp import *
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from ElevatorConstants import *
from ElevatorUtils import *
import DistributedElevator
from .ElevatorConstants import *
from .ElevatorUtils import *
from . import DistributedElevator
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM

View file

@ -1,8 +1,8 @@
from otp.ai.AIBase import *
from toontown.toonbase import ToontownGlobals
from direct.distributed.ClockDelta import *
from ElevatorConstants import *
import DistributedElevatorAI
from .ElevatorConstants import *
from . import DistributedElevatorAI
from direct.fsm import ClassicFSM
from direct.fsm import State
from direct.task import Task

View file

@ -1,8 +1,8 @@
from pandac.PandaModules import *
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from ElevatorConstants import *
from ElevatorUtils import *
from .ElevatorConstants import *
from .ElevatorUtils import *
from direct.showbase import PythonUtil
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM
@ -102,7 +102,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM):
if self.bldgRequest:
self.cr.relatedObjectMgr.abortRequest(self.bldgRequest)
self.bldgRequest = None
for request in self.toonRequests.values():
for request in list(self.toonRequests.values()):
self.cr.relatedObjectMgr.abortRequest(request)
self.toonRequests = {}
@ -197,7 +197,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM):
del self.toonRequests[index]
if avId == 0:
pass
elif not self.cr.doId2do.has_key(avId):
elif avId not in self.cr.doId2do:
func = PythonUtil.Functor(self.gotToon, index, avId)
self.toonRequests[index] = self.cr.relatedObjectMgr.requestObjects([avId], allCallback=func)
elif not self.isSetup:
@ -218,8 +218,8 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM):
else:
toon.setAnimState('run', 1.0)
animFunc = Func(toon.setAnimState, 'neutral', 1.0)
toon.headsUp(self.getElevatorModel(), apply(Point3, self.getScaledPoint(index)))
track = Sequence(LerpPosInterval(toon, TOON_BOARD_ELEVATOR_TIME * 0.75, apply(Point3, self.getScaledPoint(index)), other=self.getElevatorModel()), LerpHprInterval(toon, TOON_BOARD_ELEVATOR_TIME * 0.25, Point3(180, 0, 0), other=self.getElevatorModel()), animFunc, name=toon.uniqueName('fillElevator'), autoPause=1)
toon.headsUp(self.getElevatorModel(), Point3(*self.getScaledPoint(index)))
track = Sequence(LerpPosInterval(toon, TOON_BOARD_ELEVATOR_TIME * 0.75, Point3(*self.getScaledPoint(index)), other=self.getElevatorModel()), LerpHprInterval(toon, TOON_BOARD_ELEVATOR_TIME * 0.25, Point3(180, 0, 0), other=self.getElevatorModel()), animFunc, name=toon.uniqueName('fillElevator'), autoPause=1)
track.start()
self.boardedAvIds[avId] = index
@ -251,7 +251,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM):
if self.cr:
toon.setAnimState('neutral', 1.0)
if toon == base.localAvatar:
print 'moving the local toon off the elevator'
print('moving the local toon off the elevator')
doneStatus = {'where': 'exit'}
elevator = self.getPlaceElevator()
elevator.signalDone(doneStatus)
@ -261,7 +261,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM):
return
def emptySlot(self, index, avId, bailFlag, timestamp):
print 'Emptying slot: %d for %d' % (index, avId)
print('Emptying slot: %d for %d' % (index, avId))
if avId == 0:
pass
elif not self.isSetup:
@ -271,7 +271,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM):
newSlots.append(slot)
self.deferredSlots = newSlots
elif self.cr.doId2do.has_key(avId):
elif avId in self.cr.doId2do:
if bailFlag == 1 and hasattr(self, 'clockNode'):
if timestamp < self.countdownTime and timestamp >= 0:
self.countdown(self.countdownTime - timestamp)
@ -289,7 +289,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM):
if self.offTrack[index].isPlaying():
self.offTrack[index].finish()
self.offTrack[index] = None
self.offTrack[index] = Sequence(LerpPosInterval(toon, TOON_EXIT_ELEVATOR_TIME, Point3(0, -ElevatorData[self.type]['collRadius'], 0), startPos=apply(Point3, self.getScaledPoint(index)), other=self.getElevatorModel()), animFunc, Func(self.notifyToonOffElevator, toon), name=toon.uniqueName('emptyElevator'), autoPause=1)
self.offTrack[index] = Sequence(LerpPosInterval(toon, TOON_EXIT_ELEVATOR_TIME, Point3(0, -ElevatorData[self.type]['collRadius'], 0), startPos=Point3(*self.getScaledPoint(index)), other=self.getElevatorModel()), animFunc, Func(self.notifyToonOffElevator, toon), name=toon.uniqueName('emptyElevator'), autoPause=1)
if avId == base.localAvatar.getDoId():
messenger.send('exitElevator')
scale = base.localAvatar.getScale()
@ -303,7 +303,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM):
def handleEnterSphere(self, collEntry):
self.notify.debug('Entering Elevator Sphere....')
print 'FSMhandleEnterSphere elevator%s avatar%s' % (self.elevatorTripId, localAvatar.lastElevatorLeft)
print('FSMhandleEnterSphere elevator%s avatar%s' % (self.elevatorTripId, localAvatar.lastElevatorLeft))
if self.elevatorTripId and localAvatar.lastElevatorLeft == self.elevatorTripId:
self.rejectBoard(base.localAvatar.doId, REJECT_SHUFFLE)
elif base.localAvatar.hp > 0:
@ -312,7 +312,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM):
self.sendUpdate('requestBoard', [])
def rejectBoard(self, avId, reason = 0):
print 'rejectBoard %s' % reason
print('rejectBoard %s' % reason)
if hasattr(base.localAvatar, 'elevatorNotifier'):
if reason == REJECT_SHUFFLE:
base.localAvatar.elevatorNotifier.showMe(TTLocalizer.ElevatorHoppedOff)
@ -378,7 +378,7 @@ class DistributedElevatorFSM(DistributedObject.DistributedObject, FSM):
pass
def onDoorCloseFinish(self):
for avId in self.boardedAvIds.keys():
for avId in list(self.boardedAvIds.keys()):
av = self.cr.doId2do.get(avId)
if av is not None:
if av.getParent().compareTo(self.getElevatorModel()) == 0:

View file

@ -1,7 +1,7 @@
from otp.ai.AIBase import *
from toontown.toonbase import ToontownGlobals
from direct.distributed.ClockDelta import *
from ElevatorConstants import *
from .ElevatorConstants import *
from direct.distributed import DistributedObjectAI
from direct.task import Task
from direct.directnotify import DirectNotifyGlobal
@ -210,7 +210,7 @@ class DistributedElevatorFSMAI(DistributedObjectAI.DistributedObjectAI, FSM):
self.accepting = 1
def exitWaitCountdown(self):
print 'exit wait countdown'
print('exit wait countdown')
self.accepting = 0
taskMgr.remove(self.uniqueName('countdown-timer'))
self.newTrip()
@ -232,7 +232,7 @@ class DistributedElevatorFSMAI(DistributedObjectAI.DistributedObjectAI, FSM):
def enterClosed(self):
if hasattr(self, 'doId'):
print self.doId
print(self.doId)
self.d_setState('Closed')
def exitClosed(self):
@ -242,7 +242,7 @@ class DistributedElevatorFSMAI(DistributedObjectAI.DistributedObjectAI, FSM):
for i in range(len(self.seats)):
self.seats[i] = None
print self.seats
print(self.seats)
self.d_setState('WaitEmpty')
self.accepting = 1
return

View file

@ -1,9 +1,9 @@
from pandac.PandaModules import *
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from ElevatorConstants import *
from ElevatorUtils import *
import DistributedElevatorFSM
from .ElevatorConstants import *
from .ElevatorUtils import *
from . import DistributedElevatorFSM
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM
@ -265,7 +265,7 @@ class DistributedElevatorFloor(DistributedElevatorFSM.DistributedElevatorFSM):
def kickEveryoneOut(self):
bailFlag = 0
for avId, slot in self.boardedAvIds.items():
for avId, slot in list(self.boardedAvIds.items()):
self.emptySlot(slot, avId, bailFlag, globalClockDelta.getRealNetworkTime())
if avId == base.localAvatar.doId:
pass

View file

@ -1,8 +1,8 @@
from otp.ai.AIBase import *
from toontown.toonbase import ToontownGlobals
from direct.distributed.ClockDelta import *
from ElevatorConstants import *
import DistributedElevatorFSMAI
from .ElevatorConstants import *
from . import DistributedElevatorFSMAI
from direct.task import Task
from direct.directnotify import DirectNotifyGlobal
from direct.fsm.FSM import FSM
@ -128,7 +128,7 @@ class DistributedElevatorFloorAI(DistributedElevatorFSMAI.DistributedElevatorFSM
for i in range(len(self.seats)):
self.seats[i] = None
print self.seats
print(self.seats)
if self.wantState == 'closed':
self.demand('Closing')
else:

View file

@ -1,9 +1,9 @@
from pandac.PandaModules import *
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from ElevatorConstants import *
from ElevatorUtils import *
import DistributedElevator
from .ElevatorConstants import *
from .ElevatorUtils import *
from . import DistributedElevator
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM

View file

@ -1,7 +1,7 @@
from otp.ai.AIBase import *
from toontown.toonbase import ToontownGlobals
from direct.distributed.ClockDelta import *
from ElevatorConstants import *
from .ElevatorConstants import *
import copy, DistributedElevatorAI
from direct.fsm import ClassicFSM
from direct.fsm import State

View file

@ -5,7 +5,7 @@ from toontown.toonbase.ToontownGlobals import *
import random
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
import ToonInteriorColors
from . import ToonInteriorColors
from toontown.hood import ZoneUtil
class DistributedGagshopInterior(DistributedObject.DistributedObject):

View file

@ -6,8 +6,8 @@ import random
from direct.task.Task import Task
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
import ToonInteriorColors
import cPickle
from . import ToonInteriorColors
import pickle
from toontown.toonbase import TTLocalizer
class DistributedHQInterior(DistributedObject.DistributedObject):
@ -122,7 +122,7 @@ class DistributedHQInterior(DistributedObject.DistributedObject):
trophyStar)
def setLeaderBoard(self, leaderData):
avIds, names, scores = cPickle.loads(leaderData)
avIds, names, scores = pickle.loads(leaderData)
self.notify.debug('setLeaderBoard: avIds: %s, names: %s, scores: %s' % (avIds, names, scores))
self.leaderAvIds = avIds
self.leaderNames = names

View file

@ -1,6 +1,6 @@
from direct.distributed import DistributedObjectAI
from direct.directnotify import DirectNotifyGlobal
import cPickle
import pickle
class DistributedHQInteriorAI(DistributedObjectAI.DistributedObjectAI):
@ -35,10 +35,10 @@ class DistributedHQInteriorAI(DistributedObjectAI.DistributedObjectAI):
def sendNewLeaderBoard(self):
if self.air:
self.isDirty = False
self.sendUpdate('setLeaderBoard', [cPickle.dumps(self.air.trophyMgr.getLeaderInfo(), 1)])
self.sendUpdate('setLeaderBoard', [pickle.dumps(self.air.trophyMgr.getLeaderInfo(), 1)])
def getLeaderBoard(self):
return cPickle.dumps(self.air.trophyMgr.getLeaderInfo(), 1)
return pickle.dumps(self.air.trophyMgr.getLeaderInfo(), 1)
def getTutorial(self):
return self.tutorial

View file

@ -2,11 +2,11 @@ from pandac.PandaModules import *
from libotp import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from KnockKnockJokes import *
from .KnockKnockJokes import *
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM
import DistributedAnimatedProp
from . import DistributedAnimatedProp
from toontown.distributed import DelayDelete
from toontown.toonbase import TTLocalizer
from toontown.hood import ZoneUtil
@ -71,13 +71,13 @@ class DistributedKnockKnockDoor(DistributedAnimatedProp.DistributedAnimatedProp)
if self.propId == 44:
joke = KnockKnockContestJokes[ToontownGlobals.SillyStreet]
elif branch == ToontownGlobals.LoopyLane:
if self.propId in KnockKnockContestJokes[ToontownGlobals.LoopyLane].keys():
if self.propId in list(KnockKnockContestJokes[ToontownGlobals.LoopyLane].keys()):
joke = KnockKnockContestJokes[ToontownGlobals.LoopyLane][self.propId]
elif branch == ToontownGlobals.PunchlinePlace:
if self.propId == 1:
joke = KnockKnockContestJokes[ToontownGlobals.PunchlinePlace]
elif branch == ToontownGlobals.PolarPlace:
if self.propId in KnockKnockContestJokes[ToontownGlobals.PolarPlace].keys():
if self.propId in list(KnockKnockContestJokes[ToontownGlobals.PolarPlace].keys()):
joke = KnockKnockContestJokes[ToontownGlobals.PolarPlace][self.propId]
self.nametag = None
self.nametagNP = None

View file

@ -2,7 +2,7 @@ from otp.ai.AIBaseGlobal import *
from direct.distributed.ClockDelta import *
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM
import DistributedAnimatedPropAI
from . import DistributedAnimatedPropAI
from direct.task.Task import Task
from direct.fsm import State

View file

@ -6,7 +6,7 @@ import random
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from direct.actor import Actor
import ToonInteriorColors
from . import ToonInteriorColors
from toontown.hood import ZoneUtil
class DistributedPetshopInterior(DistributedObject.DistributedObject):

View file

@ -1,7 +1,7 @@
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from ElevatorConstants import *
import ElevatorUtils
from .ElevatorConstants import *
from . import ElevatorUtils
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import ToontownBattleGlobals
from direct.directnotify import DirectNotifyGlobal
@ -142,13 +142,13 @@ class DistributedSuitInterior(DistributedObject.DistributedObject):
self.ignore(toon.uniqueName('disable'))
def __finishInterval(self, name):
if self.activeIntervals.has_key(name):
if name in self.activeIntervals:
interval = self.activeIntervals[name]
if interval.isPlaying():
interval.finish()
def __cleanupIntervals(self):
for interval in self.activeIntervals.values():
for interval in list(self.activeIntervals.values()):
interval.finish()
self.activeIntervals = {}
@ -184,7 +184,7 @@ class DistributedSuitInterior(DistributedObject.DistributedObject):
self.toons = []
for toonId in toonIds:
if toonId != 0:
if self.cr.doId2do.has_key(toonId):
if toonId in self.cr.doId2do:
toon = self.cr.doId2do[toonId]
toon.stopSmooth()
self.toons.append(toon)
@ -202,7 +202,7 @@ class DistributedSuitInterior(DistributedObject.DistributedObject):
self.suits = []
self.joiningReserves = []
for suitId in suitIds:
if self.cr.doId2do.has_key(suitId):
if suitId in self.cr.doId2do:
suit = self.cr.doId2do[suitId]
self.suits.append(suit)
suit.fsm.request('Battle')
@ -216,7 +216,7 @@ class DistributedSuitInterior(DistributedObject.DistributedObject):
self.reserveSuits = []
for index in range(len(reserveIds)):
suitId = reserveIds[index]
if self.cr.doId2do.has_key(suitId):
if suitId in self.cr.doId2do:
suit = self.cr.doId2do[suitId]
self.reserveSuits.append((suit, values[index]))
else:

View file

@ -1,7 +1,7 @@
from toontown.toonbase.ToontownBattleGlobals import *
from otp.ai.AIBaseGlobal import *
from direct.distributed.ClockDelta import *
from ElevatorConstants import *
from .ElevatorConstants import *
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.distributed import DistributedObjectAI
@ -97,7 +97,7 @@ class DistributedSuitInteriorAI(DistributedObjectAI.DistributedObjectAI):
return
def __addToon(self, toonId):
if not self.air.doId2do.has_key(toonId):
if toonId not in self.air.doId2do:
self.notify.warning('addToon() - no toon for doId: %d' % toonId)
return
event = self.air.getAvatarExitEvent(toonId)
@ -111,7 +111,7 @@ class DistributedSuitInteriorAI(DistributedObjectAI.DistributedObjectAI):
self.toons.remove(toonId)
if self.toonIds.count(toonId):
self.toonIds[self.toonIds.index(toonId)] = None
if self.responses.has_key(toonId):
if toonId in self.responses:
del self.responses[toonId]
event = self.air.getAvatarExitEvent(toonId)
if self.avatarExitEvents.count(event):

View file

@ -4,8 +4,8 @@ from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from direct.showbase import Audio3DManager
from toontown.toonbase import ToontownGlobals
import cPickle
from DistributedToonInterior import DistributedToonInterior
import pickle
from .DistributedToonInterior import DistributedToonInterior
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.distributed import DistributedObject
@ -13,7 +13,7 @@ from direct.fsm import State
from direct.actor import Actor
import random
import time
import ToonInteriorColors
from . import ToonInteriorColors
from toontown.hood import ZoneUtil
from toontown.toon import ToonDNA
from toontown.toon import ToonHead

View file

@ -1,4 +1,4 @@
from DistributedToonInteriorAI import *
from .DistributedToonInteriorAI import *
from toontown.toonbase import ToontownGlobals
class DistributedToonHallInteriorAI(DistributedToonInteriorAI):

View file

@ -4,14 +4,14 @@ from libtoontown import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from toontown.toonbase import ToontownGlobals
import cPickle
import ToonInterior
import pickle
from . import ToonInterior
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.distributed import DistributedObject
from direct.fsm import State
import random
import ToonInteriorColors
from . import ToonInteriorColors
from toontown.hood import ZoneUtil
from toontown.toon import ToonDNA
from toontown.toon import ToonHead
@ -138,7 +138,7 @@ class DistributedToonInterior(DistributedObject.DistributedObject):
self.block = block
def setToonData(self, toonData):
savedBy = cPickle.loads(toonData)
savedBy = pickle.loads(toonData)
self.savedBy = savedBy
def buildTrophy(self):
@ -158,7 +158,7 @@ class DistributedToonInterior(DistributedObject.DistributedObject):
def buildFrame(self, name, dnaTuple):
frame = loader.loadModel('phase_3.5/models/modules/trophy_frame')
dna = ToonDNA.ToonDNA()
apply(dna.newToonFromProperties, dnaTuple)
dna.newToonFromProperties(*dnaTuple)
head = ToonHead.ToonHead()
head.setupHead(dna)
head.setPosHprScale(0, -0.05, -0.05, 180, 0, 0, 0.55, 0.02, 0.55)

View file

@ -1,7 +1,7 @@
from toontown.toonbase.ToontownGlobals import *
from otp.ai.AIBaseGlobal import *
from direct.distributed.ClockDelta import *
import cPickle
import pickle
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.distributed import DistributedObjectAI
@ -39,7 +39,7 @@ class DistributedToonInteriorAI(DistributedObjectAI.DistributedObjectAI):
return r
def getToonData(self):
return cPickle.dumps(self.building.savedBy, 1)
return pickle.dumps(self.building.savedBy, 1)
def getState(self):
r = [

View file

@ -3,11 +3,11 @@ from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from toontown.toonbase import ToontownGlobals
import ToonInterior
from . import ToonInterior
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
import random
import ToonInteriorColors
from . import ToonInteriorColors
from toontown.hood import ZoneUtil
from toontown.char import Char
from toontown.suit import SuitDNA
@ -123,7 +123,7 @@ class DistributedTutorialInterior(DistributedObject.DistributedObject):
del self.dnaStore
del self.randomGenerator
self.interior.flattenMedium()
npcOrigin = self.interior.find('**/npc_origin_' + `(self.npc.posIndex)`)
npcOrigin = self.interior.find('**/npc_origin_' + repr((self.npc.posIndex)))
if not npcOrigin.isEmpty():
self.npc.reparentTo(npcOrigin)
self.npc.clearMat()

View file

@ -1,6 +1,6 @@
import DistributedElevator
import DistributedBossElevator
from ElevatorConstants import *
from . import DistributedElevator
from . import DistributedBossElevator
from .ElevatorConstants import *
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import TTLocalizer

View file

@ -1,5 +1,5 @@
from ElevatorConstants import *
import DistributedBossElevatorAI
from .ElevatorConstants import *
from . import DistributedBossElevatorAI
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals

View file

@ -1,6 +1,6 @@
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from ElevatorConstants import *
from .ElevatorConstants import *
def getLeftClosePoint(type):
width = ElevatorData[type]['width']

View file

@ -1,6 +1,6 @@
from pandac.PandaModules import *
from direct.directnotify import DirectNotifyGlobal
import DistributedDoorAI, DistributedGagshopInteriorAI, FADoorCodes, DoorTypes
from . import DistributedDoorAI, DistributedGagshopInteriorAI, FADoorCodes, DoorTypes
from toontown.toon import NPCToons
from toontown.quest import Quests

View file

@ -1,6 +1,6 @@
from pandac.PandaModules import *
from direct.directnotify import DirectNotifyGlobal
import DistributedDoorAI, DistributedHQInteriorAI, FADoorCodes, DoorTypes
from . import DistributedDoorAI, DistributedHQInteriorAI, FADoorCodes, DoorTypes
from toontown.toon import NPCToons
from toontown.quest import Quests

View file

@ -1,6 +1,6 @@
from pandac.PandaModules import *
from direct.directnotify import DirectNotifyGlobal
import DistributedDoorAI, DistributedPetshopInteriorAI, FADoorCodes, DoorTypes
from . import DistributedDoorAI, DistributedPetshopInteriorAI, FADoorCodes, DoorTypes
from toontown.toon import NPCToons
from toontown.toonbase import ToontownGlobals
from toontown.quest import Quests

View file

@ -1,4 +1,4 @@
from ElevatorConstants import *
from .ElevatorConstants import *
SuitBuildingInfo = (((1, 1),
(1, 3),
(4, 4),

View file

@ -8,7 +8,7 @@ from direct.fsm import ClassicFSM, State
from direct.fsm import State
from toontown.town import TownBattle
from toontown.suit import Suit
import Elevator
from . import Elevator
from direct.task.Task import Task
from otp.distributed.TelemetryLimiter import RotationLimitToH, TLGatherAllAvs
from toontown.toonbase import ToontownGlobals

View file

@ -20,7 +20,7 @@ class SuitPlannerInteriorAI:
self.dbg_defaultSuitType = None
else:
self.dbg_defaultSuitType = SuitDNA.getSuitType(dbg_defaultSuitName)
if isinstance(bldgLevel, types.StringType):
if isinstance(bldgLevel, bytes):
self.notify.warning('bldgLevel is a string!')
bldgLevel = int(bldgLevel)
self._genSuitInfos(numFloors, bldgLevel, bldgTrack)

View file

@ -130,7 +130,7 @@ class ToonInterior(Place.Place):
elif ds == 'incomplete':
self.fsm.request('DFAReject')
else:
self.notify.error('Unknown done status for DownloadForceAcknowledge: ' + `doneStatus`)
self.notify.error('Unknown done status for DownloadForceAcknowledge: ' + repr(doneStatus))
def enterNPCFA(self, requestStatus):
self.acceptOnce(self.npcfaDoneEvent, self.enterNPCFACallback, [requestStatus])
@ -151,7 +151,7 @@ class ToonInterior(Place.Place):
elif doneStatus['mode'] == 'incomplete':
self.fsm.request('NPCFAReject')
else:
self.notify.error('Unknown done status for NPCForceAcknowledge: ' + `doneStatus`)
self.notify.error('Unknown done status for NPCForceAcknowledge: ' + repr(doneStatus))
def enterNPCFAReject(self):
self.fsm.request('walk')
@ -178,7 +178,7 @@ class ToonInterior(Place.Place):
elif doneStatus['mode'] == 'incomplete':
self.fsm.request('HFAReject')
else:
self.notify.error('Unknown done status for HealthForceAcknowledge: ' + `doneStatus`)
self.notify.error('Unknown done status for HealthForceAcknowledge: ' + repr(doneStatus))
def enterHFAReject(self):
self.fsm.request('walk')

Some files were not shown because too many files have changed in this diff Show more