A few fixes.

This commit is contained in:
Loudrob 2015-08-22 18:33:08 -04:00
parent a31c46f29a
commit 64a87dff1b
5 changed files with 32 additions and 21 deletions

View file

@ -115,9 +115,16 @@ class AIBase:
self.taskMgr.add(self.__resetPrevTransform, 'resetPrevTransform', priority=-51) self.taskMgr.add(self.__resetPrevTransform, 'resetPrevTransform', priority=-51)
self.taskMgr.add(self.__ivalLoop, 'ivalLoop', priority=20) self.taskMgr.add(self.__ivalLoop, 'ivalLoop', priority=20)
self.taskMgr.add(self.__igLoop, 'igLoop', priority=50) self.taskMgr.add(self.__igLoop, 'igLoop', priority=50)
if self.config.GetBool('garbage-collect-states', 1):
self.taskMgr.add(self.__garbageCollectStates, 'garbageCollectStates', priority=46)
if self.AISleep >= 0 and (not self.AIRunningNetYield or self.AIForceSleep): if self.AISleep >= 0 and (not self.AIRunningNetYield or self.AIForceSleep):
self.taskMgr.add(self.__sleepCycleTask, 'aiSleep', priority=55) self.taskMgr.add(self.__sleepCycleTask, 'aiSleep', priority=55)
self.eventMgr.restart() self.eventMgr.restart()
def __garbageCollectStates(self, state):
TransformState.garbageCollect()
RenderState.garbageCollect()
return Task.cont
def getRepository(self): def getRepository(self):
return self.air return self.air

View file

@ -62,9 +62,10 @@ if ':' in host:
port = int(port) port = int(port)
simbase.air.connect(host, port) simbase.air.connect(host, port)
gc.enable()
try: try:
run() run()
gc.enable()
except SystemExit: except SystemExit:
raise raise
except Exception: except Exception:

View file

@ -434,10 +434,10 @@ class RewardPanel(DirectFrame):
def getTrackIntervalList(self, toon, track, origSkill, earnedSkill, hasUber): def getTrackIntervalList(self, toon, track, origSkill, earnedSkill, hasUber):
if hasUber < 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 tickDelay = 0.1
intervalList = [] intervalList = []
intervalList.append(Func(self.showTrackIncLabel, track, earnedSkill)) intervalList.append(Func(self.showTrackIncLabel, track, earnedSkill))
barTime = 0.5 barTime = math.log(earnedSkill + 0.5)
numTicks = int(math.ceil(barTime / tickDelay)) numTicks = int(math.ceil(barTime / tickDelay))
for i in xrange(numTicks): for i in xrange(numTicks):
t = (i + 1) / float(numTicks) t = (i + 1) / float(numTicks)
@ -463,9 +463,9 @@ class RewardPanel(DirectFrame):
uberSkill = ToontownBattleGlobals.UberSkill + ToontownBattleGlobals.Levels[track][ToontownBattleGlobals.LAST_REGULAR_GAG_LEVEL + 1] uberSkill = ToontownBattleGlobals.UberSkill + ToontownBattleGlobals.Levels[track][ToontownBattleGlobals.LAST_REGULAR_GAG_LEVEL + 1]
if currentSkill >= uberSkill and not hasUber > 0: if currentSkill >= uberSkill and not hasUber > 0:
intervalList += self.getUberGagIntervalList(toon, track, ToontownBattleGlobals.LAST_REGULAR_GAG_LEVEL + 1) intervalList += self.getUberGagIntervalList(toon, track, ToontownBattleGlobals.LAST_REGULAR_GAG_LEVEL + 1)
intervalList.append(Wait(0.1)) intervalList.append(Wait(0.3))
skillDiff = currentSkill - ToontownBattleGlobals.Levels[track][ToontownBattleGlobals.LAST_REGULAR_GAG_LEVEL + 1] skillDiff = currentSkill - ToontownBattleGlobals.Levels[track][ToontownBattleGlobals.LAST_REGULAR_GAG_LEVEL + 1]
barTime = math.log(skillDiff + 1) barTime = math.log(skillDiff + 0.5)
numTicks = int(math.ceil(barTime / tickDelay)) numTicks = int(math.ceil(barTime / tickDelay))
displayedSkillDiff = skillDiff displayedSkillDiff = skillDiff
if displayedSkillDiff > ToontownBattleGlobals.UberSkill: if displayedSkillDiff > ToontownBattleGlobals.UberSkill:
@ -477,18 +477,18 @@ class RewardPanel(DirectFrame):
intervalList.append(Func(self.incrementExp, track, newValue, toon)) intervalList.append(Func(self.incrementExp, track, newValue, toon))
intervalList.append(Wait(tickDelay * 0.5)) intervalList.append(Wait(tickDelay * 0.5))
intervalList.append(Wait(0.1)) intervalList.append(Wait(0.3))
return intervalList return intervalList
def getMeritIntervalList(self, toon, dept, origMerits, earnedMerits): def getMeritIntervalList(self, toon, dept, origMerits, earnedMerits):
tickDelay = 1.0 / 60 tickDelay = 0.08
intervalList = [] intervalList = []
totalMerits = CogDisguiseGlobals.getTotalMerits(toon, dept) totalMerits = CogDisguiseGlobals.getTotalMerits(toon, dept)
neededMerits = 0 neededMerits = 0
if totalMerits and origMerits != totalMerits: if totalMerits and origMerits != totalMerits:
neededMerits = totalMerits - origMerits neededMerits = totalMerits - origMerits
intervalList.append(Func(self.showMeritIncLabel, dept, min(neededMerits, earnedMerits))) intervalList.append(Func(self.showMeritIncLabel, dept, min(neededMerits, earnedMerits)))
barTime = 0.5 barTime = math.log(earnedMerits + 1)
numTicks = int(math.ceil(barTime / tickDelay)) numTicks = int(math.ceil(barTime / tickDelay))
for i in xrange(numTicks): for i in xrange(numTicks):
t = (i + 1) / float(numTicks) t = (i + 1) / float(numTicks)
@ -497,10 +497,10 @@ class RewardPanel(DirectFrame):
intervalList.append(Wait(tickDelay)) intervalList.append(Wait(tickDelay))
intervalList.append(Func(self.resetMeritBarColor, dept)) intervalList.append(Func(self.resetMeritBarColor, dept))
intervalList.append(Wait(0.1)) intervalList.append(Wait(0.3))
if toon.cogLevels[dept] < ToontownGlobals.MaxCogSuitLevel: if toon.cogLevels[dept] < ToontownGlobals.MaxCogSuitLevel:
if neededMerits and toon.readyForPromotion(dept): if neededMerits and toon.readyForPromotion(dept):
intervalList.append(Wait(0.4)) intervalList.append(Wait(0.3))
intervalList += self.getPromotionIntervalList(toon, dept) intervalList += self.getPromotionIntervalList(toon, dept)
return intervalList return intervalList
@ -621,7 +621,7 @@ class RewardPanel(DirectFrame):
if earned > 0: if earned > 0:
earned = min(earned, quest.getNumQuestItems() - questDesc[4]) earned = min(earned, quest.getNumQuestItems() - questDesc[4])
if earned > 0 or base.localAvatar.tutorialAck == 0 and num == 1: if earned > 0 or base.localAvatar.tutorialAck == 0 and num == 1:
barTime = 0.5 barTime = math.log(earned + 1)
numTicks = int(math.ceil(barTime / tickDelay)) numTicks = int(math.ceil(barTime / tickDelay))
for i in xrange(numTicks): for i in xrange(numTicks):
t = (i + 1) / float(numTicks) t = (i + 1) / float(numTicks)
@ -683,19 +683,19 @@ class RewardPanel(DirectFrame):
if meritList[dept]: if meritList[dept]:
track += self.getMeritIntervalList(toon, dept, origMeritList[dept], meritList[dept]) track += self.getMeritIntervalList(toon, dept, origMeritList[dept], meritList[dept])
track.append(Wait(0.75)) track.append(Wait(1.0))
itemInterval = self.getItemIntervalList(toon, itemList) itemInterval = self.getItemIntervalList(toon, itemList)
if itemInterval: if itemInterval:
track.append(Func(self.initItemFrame, toon)) track.append(Func(self.initItemFrame, toon))
track.append(Wait(0.25)) track.append(Wait(1.0))
track += itemInterval track += itemInterval
track.append(Wait(0.5)) track.append(Wait(1.0))
missedItemInterval = self.getMissedItemIntervalList(toon, missedItemList) missedItemInterval = self.getMissedItemIntervalList(toon, missedItemList)
if missedItemInterval: if missedItemInterval:
track.append(Func(self.initMissedItemFrame, toon)) track.append(Func(self.initMissedItemFrame, toon))
track.append(Wait(0.25)) track.append(Wait(1.0))
track += missedItemInterval track += missedItemInterval
track.append(Wait(0.5)) track.append(Wait(1.0))
self.notify.debug('partList = %s' % partList) self.notify.debug('partList = %s' % partList)
newPart = 0 newPart = 0
for part in partList: for part in partList:
@ -707,9 +707,9 @@ class RewardPanel(DirectFrame):
partList = self.getCogPartIntervalList(toon, partList) partList = self.getCogPartIntervalList(toon, partList)
if partList: if partList:
track.append(Func(self.initCogPartFrame, toon)) track.append(Func(self.initCogPartFrame, toon))
track.append(Wait(0.25)) track.append(Wait(1.0))
track += partList track += partList
track.append(Wait(0.5)) track.append(Wait(1.0))
questList = self.getQuestIntervalList(toon, deathList, toonList, origQuestsList, itemList, helpfulToonsList) questList = self.getQuestIntervalList(toon, deathList, toonList, origQuestsList, itemList, helpfulToonsList)
if questList: if questList:
avQuests = [] avQuests = []
@ -717,9 +717,9 @@ class RewardPanel(DirectFrame):
avQuests.append(origQuestsList[i:i + 5]) avQuests.append(origQuestsList[i:i + 5])
track.append(Func(self.initQuestFrame, toon, copy.deepcopy(avQuests))) track.append(Func(self.initQuestFrame, toon, copy.deepcopy(avQuests)))
track.append(Wait(0.25)) track.append(Wait(1.0))
track += questList track += questList
track.append(Wait(0.5)) track.append(Wait(2.0))
track.append(Wait(0.25)) track.append(Wait(0.25))
if trackEnded: if trackEnded:
track.append(Func(self.vanishFrames)) track.append(Func(self.vanishFrames))

View file

@ -10,6 +10,9 @@ class DistributedKnockKnockDoorAI(DistributedAnimatedPropAI.DistributedAnimatedP
self.fsm.setName('DistributedKnockKnockDoor') self.fsm.setName('DistributedKnockKnockDoor')
self.propId = propId self.propId = propId
self.doLaterTask = None self.doLaterTask = None
def delete(self):
DistributedAnimatedPropAI.DistributedAnimatedPropAI.delete(self)
def enterOff(self): def enterOff(self):
DistributedAnimatedPropAI.DistributedAnimatedPropAI.enterOff(self) DistributedAnimatedPropAI.DistributedAnimatedPropAI.enterOff(self)

View file

@ -11,7 +11,7 @@ class ToontownLoadingScreen:
def __init__(self): def __init__(self):
self.__expectedCount = 0 self.__expectedCount = 0
self.__count = 0 self.__count = 0
self.textures = [(loader.loadTexture('phase_3.5/maps/loading/toon.jpg'), ToontownGlobals.getInterfaceFont(), (0.2, 0.6, 0.9, 1)), self.textures = [(loader.loadTexture('phase_3.5/maps/loading/toon.jpg'), ToontownGlobals.getInterfaceFont(), (0, 0, 0.5, 1)),
(loader.loadTexture('phase_3.5/maps/loading/cog.jpg'), ToontownGlobals.getSuitFont(), (1.0, 1.0, 1.0, 1)), (loader.loadTexture('phase_3.5/maps/loading/cog.jpg'), ToontownGlobals.getSuitFont(), (1.0, 1.0, 1.0, 1)),
(loader.loadTexture('phase_3.5/maps/loading/default.jpg'), ToontownGlobals.getInterfaceFont(), (0, 0, 0.5, 1)) (loader.loadTexture('phase_3.5/maps/loading/default.jpg'), ToontownGlobals.getInterfaceFont(), (0, 0, 0.5, 1))
] ]