mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 12:12:36 -06:00
They don't need more work
This commit is contained in:
parent
539afab9fe
commit
39b42edbda
19 changed files with 306 additions and 960 deletions
1
dependencies/config/general.prc
vendored
1
dependencies/config/general.prc
vendored
|
@ -103,7 +103,6 @@ want-talkative-tyler #f
|
||||||
estate-day-night #t
|
estate-day-night #t
|
||||||
want-garden-game #f
|
want-garden-game #f
|
||||||
want-language-selection #t
|
want-language-selection #t
|
||||||
active-holidays 64, 65, 66
|
|
||||||
|
|
||||||
# Developer options:
|
# Developer options:
|
||||||
want-dev #f
|
want-dev #f
|
||||||
|
|
|
@ -260,10 +260,7 @@ class BattleCalculatorAI:
|
||||||
return
|
return
|
||||||
|
|
||||||
def __checkPropBonus(self, track):
|
def __checkPropBonus(self, track):
|
||||||
result = False
|
return self.battle.getInteractivePropTrackBonus() == track
|
||||||
if self.battle.getInteractivePropTrackBonus() == track:
|
|
||||||
result = True
|
|
||||||
return result
|
|
||||||
|
|
||||||
def __targetDefense(self, suit, atkTrack):
|
def __targetDefense(self, suit, atkTrack):
|
||||||
if atkTrack == HEAL:
|
if atkTrack == HEAL:
|
||||||
|
|
|
@ -39,25 +39,6 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
|
||||||
self.ignore(self.PlayGameSetPlaceEvent)
|
self.ignore(self.PlayGameSetPlaceEvent)
|
||||||
self.removeCollisionData()
|
self.removeCollisionData()
|
||||||
|
|
||||||
def setInteractivePropTrackBonus(self, trackBonus):
|
|
||||||
DistributedBattleBase.DistributedBattleBase.setInteractivePropTrackBonus(self, trackBonus)
|
|
||||||
if self.interactivePropTrackBonus >= 0:
|
|
||||||
if base.cr.playGame.hood:
|
|
||||||
self.calcInteractiveProp()
|
|
||||||
else:
|
|
||||||
self.acceptOnce(self.PlayGameSetPlaceEvent, self.calcInteractiveProp)
|
|
||||||
|
|
||||||
def calcInteractiveProp(self):
|
|
||||||
if base.cr.playGame.hood:
|
|
||||||
loader = base.cr.playGame.hood.loader
|
|
||||||
if hasattr(loader, 'getInteractiveProp'):
|
|
||||||
self.interactiveProp = loader.getInteractiveProp(self.zoneId)
|
|
||||||
self.notify.debug('self.interactiveProp = %s' % self.interactiveProp)
|
|
||||||
else:
|
|
||||||
self.notify.warning('no loader.getInteractiveProp self.interactiveProp is None')
|
|
||||||
else:
|
|
||||||
self.notify.warning('no hood self.interactiveProp is None')
|
|
||||||
|
|
||||||
def setMembers(self, suits, suitsJoining, suitsPending, suitsActive, suitsLured, suitTraps, toons, toonsJoining, toonsPending, toonsActive, toonsRunning, timestamp):
|
def setMembers(self, suits, suitsJoining, suitsPending, suitsActive, suitsLured, suitTraps, toons, toonsJoining, toonsPending, toonsActive, toonsRunning, timestamp):
|
||||||
if self.battleCleanedUp():
|
if self.battleCleanedUp():
|
||||||
return
|
return
|
||||||
|
@ -152,8 +133,10 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
|
||||||
if len(self.toons) > 0 and base.localAvatar == self.toons[0]:
|
if len(self.toons) > 0 and base.localAvatar == self.toons[0]:
|
||||||
Emote.globalEmote.disableAll(self.toons[0], 'dbattle, enterFaceOff')
|
Emote.globalEmote.disableAll(self.toons[0], 'dbattle, enterFaceOff')
|
||||||
self.__faceOff(ts, self.faceOffName, self.__handleFaceOffDone)
|
self.__faceOff(ts, self.faceOffName, self.__handleFaceOffDone)
|
||||||
if self.interactiveProp:
|
prop = self.getInteractiveProp()
|
||||||
self.interactiveProp.gotoFaceoff()
|
|
||||||
|
if prop:
|
||||||
|
prop.gotoBattleCheer()
|
||||||
|
|
||||||
def __handleFaceOffDone(self):
|
def __handleFaceOffDone(self):
|
||||||
self.notify.debug('FaceOff done')
|
self.notify.debug('FaceOff done')
|
||||||
|
@ -181,8 +164,10 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
|
||||||
toon.startSmooth()
|
toon.startSmooth()
|
||||||
|
|
||||||
self.accept('resumeAfterReward', self.handleResumeAfterReward)
|
self.accept('resumeAfterReward', self.handleResumeAfterReward)
|
||||||
if self.interactiveProp:
|
prop = self.getInteractiveProp()
|
||||||
self.interactiveProp.gotoVictory()
|
|
||||||
|
if prop:
|
||||||
|
prop.gotoVictory()
|
||||||
self.playReward(ts)
|
self.playReward(ts)
|
||||||
|
|
||||||
def playReward(self, ts):
|
def playReward(self, ts):
|
||||||
|
@ -210,8 +195,10 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
|
||||||
self.notify.debug('enterResume()')
|
self.notify.debug('enterResume()')
|
||||||
if self.hasLocalToon():
|
if self.hasLocalToon():
|
||||||
self.removeLocalToon()
|
self.removeLocalToon()
|
||||||
if self.interactiveProp:
|
prop = self.getInteractiveProp()
|
||||||
self.interactiveProp.requestIdleOrSad()
|
|
||||||
|
if prop:
|
||||||
|
prop.requestIdleOrSad()
|
||||||
|
|
||||||
def exitResume(self):
|
def exitResume(self):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -318,11 +318,25 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
|
||||||
def setBattleCellId(self, battleCellId):
|
def setBattleCellId(self, battleCellId):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def setInteractivePropTrackBonus(self, trackBonus):
|
def getInteractiveProp(self):
|
||||||
self.interactivePropTrackBonus = trackBonus
|
if config.GetBool('want-anim-props', True):
|
||||||
|
if self.interactiveProp:
|
||||||
|
return self.interactiveProp
|
||||||
|
elif base.cr.playGame.hood and hasattr(base.cr.playGame.hood, 'loader'):
|
||||||
|
loader = base.cr.playGame.hood.loader
|
||||||
|
|
||||||
|
if hasattr(loader, 'getInteractiveProp'):
|
||||||
|
self.interactiveProp = base.cr.playGame.hood.loader.getInteractiveProp(self.zoneId)
|
||||||
|
|
||||||
|
return self.interactiveProp
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
def getInteractivePropTrackBonus(self):
|
def getInteractivePropTrackBonus(self):
|
||||||
return self.interactivePropTrackBonus
|
prop = self.getInteractiveProp()
|
||||||
|
|
||||||
|
return prop.BattleTrack if prop else -1
|
||||||
|
|
||||||
def setPosition(self, x, y, z):
|
def setPosition(self, x, y, z):
|
||||||
self.notify.debug('setPosition() - %d %d %d' % (x, y, z))
|
self.notify.debug('setPosition() - %d %d %d' % (x, y, z))
|
||||||
|
@ -363,12 +377,17 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
|
||||||
oldsuits = self.suits
|
oldsuits = self.suits
|
||||||
self.suits = []
|
self.suits = []
|
||||||
suitGone = 0
|
suitGone = 0
|
||||||
|
prop = self.getInteractiveProp()
|
||||||
|
|
||||||
for s in suits:
|
for s in suits:
|
||||||
if s in self.cr.doId2do:
|
if s in self.cr.doId2do:
|
||||||
suit = self.cr.doId2do[s]
|
suit = self.cr.doId2do[s]
|
||||||
suit.setState('Battle')
|
suit.setState('Battle')
|
||||||
self.suits.append(suit)
|
self.suits.append(suit)
|
||||||
suit.interactivePropTrackBonus = self.interactivePropTrackBonus
|
|
||||||
|
if prop:
|
||||||
|
suit.interactivePropTrackBonus = prop.BattleTrack
|
||||||
|
|
||||||
try:
|
try:
|
||||||
suit.battleTrap
|
suit.battleTrap
|
||||||
except:
|
except:
|
||||||
|
@ -1048,9 +1067,10 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
|
||||||
return Task.done
|
return Task.done
|
||||||
|
|
||||||
def enterWaitForInput(self, ts = 0):
|
def enterWaitForInput(self, ts = 0):
|
||||||
self.notify.debug('enterWaitForInput()')
|
prop = self.getInteractiveProp()
|
||||||
if self.interactiveProp:
|
|
||||||
self.interactiveProp.gotoBattleCheer()
|
if prop:
|
||||||
|
prop.gotoBattleCheer()
|
||||||
self.choseAttackAlready = 0
|
self.choseAttackAlready = 0
|
||||||
if self.localToonActive():
|
if self.localToonActive():
|
||||||
self.__enterLocalToonWaitForInput()
|
self.__enterLocalToonWaitForInput()
|
||||||
|
@ -1242,7 +1262,10 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
|
||||||
if base.cr.playGame.getPlace() != None:
|
if base.cr.playGame.getPlace() != None:
|
||||||
base.cr.playGame.getPlace().setState('battle', self.localToonBattleEvent)
|
base.cr.playGame.getPlace().setState('battle', self.localToonBattleEvent)
|
||||||
if localAvatar and hasattr(localAvatar, 'inventory') and localAvatar.inventory:
|
if localAvatar and hasattr(localAvatar, 'inventory') and localAvatar.inventory:
|
||||||
localAvatar.inventory.setInteractivePropTrackBonus(self.interactivePropTrackBonus)
|
prop = self.getInteractiveProp()
|
||||||
|
|
||||||
|
if prop:
|
||||||
|
localAvatar.inventory.setInteractivePropTrackBonus(prop.BattleTrack)
|
||||||
camera.wrtReparentTo(self)
|
camera.wrtReparentTo(self)
|
||||||
base.camLens.setMinFov(self.camFov/(4./3.))
|
base.camLens.setMinFov(self.camFov/(4./3.))
|
||||||
return
|
return
|
||||||
|
|
|
@ -400,8 +400,7 @@ class Movie(DirectObject.DirectObject):
|
||||||
if ival:
|
if ival:
|
||||||
track.append(ival)
|
track.append(ival)
|
||||||
camTrack.append(camIval)
|
camTrack.append(camIval)
|
||||||
hasHealBonus = self.battle.getInteractivePropTrackBonus() == HEAL
|
ival, camIval = MovieHeal.doHeals(self.__findToonAttack(HEAL), self.battle.getInteractivePropTrackBonus() == HEAL)
|
||||||
ival, camIval = MovieHeal.doHeals(self.__findToonAttack(HEAL), hasHealBonus)
|
|
||||||
if ival:
|
if ival:
|
||||||
track.append(ival)
|
track.append(ival)
|
||||||
camTrack.append(camIval)
|
camTrack.append(camIval)
|
||||||
|
|
|
@ -1,44 +1,4 @@
|
||||||
from DistributedToonInteriorAI import *
|
from DistributedToonInteriorAI import *
|
||||||
from toontown.toonbase import ToontownGlobals
|
|
||||||
|
|
||||||
|
|
||||||
class DistributedToonHallInteriorAI(DistributedToonInteriorAI):
|
class DistributedToonHallInteriorAI(DistributedToonInteriorAI):
|
||||||
def __init__(self, block, air, zoneId, building):
|
pass
|
||||||
DistributedToonInteriorAI.__init__(self, block, air, zoneId, building)
|
|
||||||
self.accept('ToonEnteredZone', self.logToonEntered)
|
|
||||||
self.accept('ToonLeftZone', self.logToonLeft)
|
|
||||||
|
|
||||||
def logToonEntered(self, avId, zoneId):
|
|
||||||
result = self.getCurPhase()
|
|
||||||
if result == -1:
|
|
||||||
phase = 'not available'
|
|
||||||
else:
|
|
||||||
phase = str(result)
|
|
||||||
self.air.writeServerEvent('sillyMeter', avId, 'enter|%s' % phase)
|
|
||||||
|
|
||||||
def logToonLeft(self, avId, zoneId):
|
|
||||||
result = self.getCurPhase()
|
|
||||||
if result == -1:
|
|
||||||
phase = 'not available'
|
|
||||||
else:
|
|
||||||
phase = str(result)
|
|
||||||
self.air.writeServerEvent('sillyMeter', avId, 'exit|%s' % phase)
|
|
||||||
|
|
||||||
def getCurPhase(self):
|
|
||||||
result = -1
|
|
||||||
enoughInfoToRun = False
|
|
||||||
if ToontownGlobals.SILLYMETER_HOLIDAY in simbase.air.holidayManager.currentHolidays and simbase.air.holidayManager.currentHolidays[ToontownGlobals.SILLYMETER_HOLIDAY] != None and simbase.air.holidayManager.currentHolidays[ToontownGlobals.SILLYMETER_HOLIDAY].getRunningState():
|
|
||||||
if hasattr(simbase.air, 'SillyMeterMgr'):
|
|
||||||
enoughInfoToRun = True
|
|
||||||
else:
|
|
||||||
self.notify.debug('simbase.air does not have SillyMeterMgr')
|
|
||||||
else:
|
|
||||||
self.notify.debug('holiday is not running')
|
|
||||||
self.notify.debug('enoughInfoToRun = %s' % enoughInfoToRun)
|
|
||||||
if enoughInfoToRun and simbase.air.SillyMeterMgr.getIsRunning():
|
|
||||||
result = simbase.air.SillyMeterMgr.getCurPhase()
|
|
||||||
return result
|
|
||||||
|
|
||||||
def delete(self):
|
|
||||||
self.ignoreAll()
|
|
||||||
DistributedToonInteriorAI.delete(self)
|
|
|
@ -44,7 +44,6 @@ from toontown.toon import Toon, DistributedToon
|
||||||
from ToontownMsgTypes import *
|
from ToontownMsgTypes import *
|
||||||
import HoodMgr
|
import HoodMgr
|
||||||
import PlayGame
|
import PlayGame
|
||||||
from toontown.hood import StreetSign
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,7 +73,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
||||||
self.catalogManager = None
|
self.catalogManager = None
|
||||||
self.tutorialManager = None
|
self.tutorialManager = None
|
||||||
self.newsManager = None
|
self.newsManager = None
|
||||||
self.streetSign = None
|
|
||||||
self.distributedDistrict = None
|
self.distributedDistrict = None
|
||||||
self.partyManager = None
|
self.partyManager = None
|
||||||
self.lobbyManager = None
|
self.lobbyManager = None
|
||||||
|
@ -84,7 +82,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
||||||
self.csm = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_CLIENT_SERVICES_MANAGER, 'ClientServicesManager')
|
self.csm = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_CLIENT_SERVICES_MANAGER, 'ClientServicesManager')
|
||||||
self.ttsFriendsManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TTS_FRIENDS_MANAGER, 'TTSFriendsManager')
|
self.ttsFriendsManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TTS_FRIENDS_MANAGER, 'TTSFriendsManager')
|
||||||
|
|
||||||
self.streetSign = None
|
|
||||||
self.furnitureManager = None
|
self.furnitureManager = None
|
||||||
self.objectManager = None
|
self.objectManager = None
|
||||||
self.openAvatarPanels = set()
|
self.openAvatarPanels = set()
|
||||||
|
@ -406,9 +403,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
||||||
base.localAvatar.defaultZone,
|
base.localAvatar.defaultZone,
|
||||||
-1])
|
-1])
|
||||||
self._userLoggingOut = False
|
self._userLoggingOut = False
|
||||||
if not self.streetSign:
|
|
||||||
self.streetSign = StreetSign.StreetSign()
|
|
||||||
return
|
|
||||||
|
|
||||||
def exitPlayingGame(self):
|
def exitPlayingGame(self):
|
||||||
ivalMgr.interrupt()
|
ivalMgr.interrupt()
|
||||||
|
|
|
@ -46,18 +46,6 @@ class GenericAnimatedProp(AnimatedProp.AnimatedProp):
|
||||||
def enter(self):
|
def enter(self):
|
||||||
self.node.postFlatten()
|
self.node.postFlatten()
|
||||||
AnimatedProp.AnimatedProp.enter(self)
|
AnimatedProp.AnimatedProp.enter(self)
|
||||||
doAnimLoop = True
|
|
||||||
try:
|
|
||||||
if type(self).__name__ == 'instance':
|
|
||||||
if self.__class__.__name__ == 'GenericAnimatedProp':
|
|
||||||
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.HYDRANTS_BUFF_BATTLES):
|
|
||||||
doAnimLoop = True
|
|
||||||
else:
|
|
||||||
doAnimLoop = False
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if doAnimLoop:
|
|
||||||
self.node.loop('anim')
|
self.node.loop('anim')
|
||||||
|
|
||||||
def exit(self):
|
def exit(self):
|
||||||
|
|
|
@ -2,235 +2,94 @@ from direct.actor import Actor
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
from direct.interval.IntervalGlobal import Sequence, Func
|
from direct.interval.IntervalGlobal import Sequence, Func
|
||||||
from toontown.hood import InteractiveAnimatedProp
|
from toontown.hood import InteractiveAnimatedProp
|
||||||
from toontown.hood import GenericAnimatedProp
|
|
||||||
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer
|
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer
|
||||||
|
|
||||||
class HydrantInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
|
class HydrantInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('HydrantInteractiveProp')
|
notify = DirectNotifyGlobal.directNotify.newCategory('HydrantInteractiveProp')
|
||||||
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[ToontownBattleGlobals.SQUIRT_TRACK]
|
BattleTrack = ToontownBattleGlobals.SQUIRT_TRACK
|
||||||
ZoneToIdles = {ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_hydrant_idle0',
|
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[BattleTrack]
|
||||||
1,
|
|
||||||
1,
|
ZoneToIdles = {
|
||||||
None,
|
ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_hydrant_idle0', 1, 1, None, 3, 10),
|
||||||
3,
|
('tt_a_ara_ttc_hydrant_idle2', 1, 1, None, 3, 10),
|
||||||
10),
|
('tt_a_ara_ttc_hydrant_idle1', 1, 1, None, 3, 10),
|
||||||
('tt_a_ara_ttc_hydrant_idle2',
|
('tt_a_ara_ttc_hydrant_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
1,
|
ToontownGlobals.DonaldsDock: (('tt_a_ara_ttc_hydrant_idle0', 1, 1, None, 3, 10),
|
||||||
1,
|
('tt_a_ara_ttc_hydrant_idle2', 1, 1, None, 3, 10),
|
||||||
None,
|
('tt_a_ara_ttc_hydrant_idle1', 1, 1, None, 3, 10),
|
||||||
3,
|
('tt_a_ara_ttc_hydrant_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
10),
|
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_hydrant_idle0', 3, 10, 'tt_a_ara_dga_hydrant_idle0settle', 3, 10),
|
||||||
('tt_a_ara_ttc_hydrant_idle1',
|
('tt_a_ara_dga_hydrant_idleLook1', 1, 1, None, 3, 10),
|
||||||
1,
|
('tt_a_ara_dga_hydrant_idleSneeze2', 1, 1, None, 3, 10),
|
||||||
1,
|
('tt_a_ara_dga_hydrant_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
None,
|
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_hydrant_idle0', 3, 10, 'tt_a_ara_mml_hydrant_idle0settle', 3, 10),
|
||||||
3,
|
('tt_a_ara_mml_hydrant_idle2', 3, 10, 'tt_a_ara_mml_hydrant_idle2settle', 3, 10),
|
||||||
10),
|
('tt_a_ara_mml_hydrant_idle1', 3, 10, 'tt_a_ara_mml_hydrant_idle1settle', 3, 10),
|
||||||
('tt_a_ara_ttc_hydrant_idleAwesome3',
|
('tt_a_ara_mml_hydrant_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
1,
|
ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_hydrant_idleShiver1', 1, 1, None, 3, 10),
|
||||||
1,
|
('tt_a_ara_tbr_hydrant_idleRubNose0', 1, 1, None, 3, 10),
|
||||||
None,
|
('tt_a_ara_tbr_hydrant_idleSneeze2', 1, 1, None, 3, 10),
|
||||||
3,
|
('tt_a_ara_tbr_hydrant_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
10)),
|
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_hydrant_idle0', 3, 10, None, 0, 0),
|
||||||
ToontownGlobals.FunnyFarm: (('tt_a_ara_ttc_hydrant_idle0',
|
('tt_a_ara_ddl_hydrant_idle1', 1, 1, None, 0, 0),
|
||||||
1,
|
('tt_a_ara_ddl_hydrant_idle2', 1, 1, None, 0, 0),
|
||||||
1,
|
('tt_a_ara_ddl_hydrant_idleAwesome3', 1, 1, None, 0, 0))}
|
||||||
None,
|
|
||||||
3,
|
ZoneToIdleIntoFightAnims = {
|
||||||
10),
|
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_idleIntoFight',
|
||||||
('tt_a_ara_ttc_hydrant_idle2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_ttc_hydrant_idle1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_ttc_hydrant_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.DonaldsDock: (('tt_a_ara_ttc_hydrant_idle0',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_ttc_hydrant_idle2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_ttc_hydrant_idle1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_ttc_hydrant_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_hydrant_idle0',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
'tt_a_ara_dga_hydrant_idle0settle',
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dga_hydrant_idleLook1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dga_hydrant_idleSneeze2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dga_hydrant_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_hydrant_idle0',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
'tt_a_ara_mml_hydrant_idle0settle',
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_mml_hydrant_idle2',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
'tt_a_ara_mml_hydrant_idle2settle',
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_mml_hydrant_idle1',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
'tt_a_ara_mml_hydrant_idle1settle',
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_mml_hydrant_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_hydrant_idleShiver1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_tbr_hydrant_idleRubNose0',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_tbr_hydrant_idleSneeze2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_tbr_hydrant_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_hydrant_idle0',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0),
|
|
||||||
('tt_a_ara_ddl_hydrant_idle1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0),
|
|
||||||
('tt_a_ara_ddl_hydrant_idle2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0),
|
|
||||||
('tt_a_ara_ddl_hydrant_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0))}
|
|
||||||
ZoneToIdleIntoFightAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_idleIntoFight',
|
|
||||||
ToontownGlobals.FunnyFarm: 'tt_a_ara_ddl_hydrant_idleIntoFight',
|
|
||||||
ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_idleIntoFight',
|
ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_idleIntoFight',
|
||||||
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_idleIntoFight',
|
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_idleIntoFight',
|
||||||
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_idleIntoFight',
|
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_idleIntoFight',
|
||||||
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_idleIntoFight',
|
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_idleIntoFight',
|
||||||
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_idleIntoFight'}
|
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_idleIntoFight'}
|
||||||
ZoneToVictoryAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_victoryDance',
|
|
||||||
ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_hydrant_victoryDance',
|
ZoneToVictoryAnims = {
|
||||||
|
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_victoryDance',
|
||||||
ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_victoryDance',
|
ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_victoryDance',
|
||||||
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_victoryDance',
|
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_victoryDance',
|
||||||
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_victoryDance',
|
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_victoryDance',
|
||||||
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_victoryDance',
|
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_victoryDance',
|
||||||
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_victoryDance'}
|
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_victoryDance'}
|
||||||
ZoneToSadAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_fightSad',
|
|
||||||
ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_hydrant_fightSad',
|
ZoneToSadAnims = {
|
||||||
|
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_fightSad',
|
||||||
ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_fightSad',
|
ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_fightSad',
|
||||||
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_fightSad',
|
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_fightSad',
|
||||||
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_fightSad',
|
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_fightSad',
|
||||||
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_fightSad',
|
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_fightSad',
|
||||||
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_fightSad'}
|
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_fightSad'}
|
||||||
ZoneToFightAnims = {ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_hydrant_fightBoost', 'tt_a_ara_ttc_hydrant_fightCheer', 'tt_a_ara_ttc_hydrant_fightIdle'),
|
|
||||||
ToontownGlobals.FunnyFarm: ('tt_a_ara_ttc_hydrant_fightBoost', 'tt_a_ara_ttc_hydrant_fightCheer', 'tt_a_ara_ttc_hydrant_fightIdle'),
|
ZoneToFightAnims = {
|
||||||
|
ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_hydrant_fightBoost', 'tt_a_ara_ttc_hydrant_fightCheer', 'tt_a_ara_ttc_hydrant_fightIdle'),
|
||||||
ToontownGlobals.DonaldsDock: ('tt_a_ara_ttc_hydrant_fightBoost', 'tt_a_ara_ttc_hydrant_fightCheer', 'tt_a_ara_ttc_hydrant_fightIdle'),
|
ToontownGlobals.DonaldsDock: ('tt_a_ara_ttc_hydrant_fightBoost', 'tt_a_ara_ttc_hydrant_fightCheer', 'tt_a_ara_ttc_hydrant_fightIdle'),
|
||||||
ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_hydrant_fightBoost', 'tt_a_ara_dga_hydrant_fightCheer', 'tt_a_ara_dga_hydrant_fightIdle'),
|
ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_hydrant_fightBoost', 'tt_a_ara_dga_hydrant_fightCheer', 'tt_a_ara_dga_hydrant_fightIdle'),
|
||||||
ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_hydrant_fightBoost', 'tt_a_ara_mml_hydrant_fightCheer', 'tt_a_ara_mml_hydrant_fightIdle'),
|
ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_hydrant_fightBoost', 'tt_a_ara_mml_hydrant_fightCheer', 'tt_a_ara_mml_hydrant_fightIdle'),
|
||||||
ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_hydrant_fightBoost', 'tt_a_ara_tbr_hydrant_fightCheer', 'tt_a_ara_tbr_hydrant_fightIdle'),
|
ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_hydrant_fightBoost', 'tt_a_ara_tbr_hydrant_fightCheer', 'tt_a_ara_tbr_hydrant_fightIdle'),
|
||||||
ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_hydrant_fightBoost', 'tt_a_ara_ddl_hydrant_fightCheer', 'tt_a_ara_ddl_hydrant_fightIdle')}
|
ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_hydrant_fightBoost', 'tt_a_ara_ddl_hydrant_fightCheer', 'tt_a_ara_ddl_hydrant_fightIdle')}
|
||||||
|
|
||||||
IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0)
|
IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0)
|
||||||
|
|
||||||
def __init__(self, node):
|
def __init__(self, node):
|
||||||
self.leftWater = None
|
self.leftWater = None
|
||||||
self.rightWater = None
|
self.rightWater = None
|
||||||
InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node, ToontownGlobals.HYDRANTS_BUFF_BATTLES)
|
InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node)
|
||||||
return
|
|
||||||
|
|
||||||
def setupActor(self, node):
|
def setupActor(self, node):
|
||||||
InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node)
|
InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node)
|
||||||
|
|
||||||
if not self.hoodId == ToontownGlobals.TheBrrrgh:
|
if not self.hoodId == ToontownGlobals.TheBrrrgh:
|
||||||
water = loader.loadModel('phase_5/models/char/tt_m_efx_hydrantSquirt')
|
water = loader.loadModel('phase_5/models/char/tt_m_efx_hydrantSquirt')
|
||||||
self.leftWater = water.find('**/efx_hydrantSquirtLeft')
|
self.leftWater = water.find('**/efx_hydrantSquirtLeft')
|
||||||
self.rightWater = water.find('**/efx_hydrantSquirtRight')
|
self.rightWater = water.find('**/efx_hydrantSquirtRight')
|
||||||
dx_left_water = self.node.find('**/dx_left_water')
|
|
||||||
if self.leftWater:
|
if self.leftWater:
|
||||||
self.leftWater.reparentTo(dx_left_water)
|
self.leftWater.reparentTo(self.node.find('**/dx_left_water'))
|
||||||
base.leftWater = self.leftWater
|
base.leftWater = self.leftWater
|
||||||
self.leftWater.hide()
|
self.leftWater.hide()
|
||||||
else:
|
|
||||||
self.notify.warning('couldnt find %s in rig for hood %d' % ('dx_left_water', self.hoodId))
|
|
||||||
dx_right_water = self.node.find('**/dx_right_water')
|
|
||||||
if self.rightWater:
|
if self.rightWater:
|
||||||
self.rightWater.reparentTo(dx_right_water)
|
self.rightWater.reparentTo(self.node.find('**/dx_right_water'))
|
||||||
self.rightWater.hide()
|
self.rightWater.hide()
|
||||||
else:
|
|
||||||
self.notify.warning('couldnt find %s in rig for hood %d' % ('dx_left_water', self.hoodId))
|
|
||||||
|
|
||||||
def hideWater(self):
|
def hideWater(self):
|
||||||
if self.leftWater:
|
if self.leftWater:
|
||||||
|
@ -245,20 +104,15 @@ class HydrantInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
|
||||||
self.rightWater.show()
|
self.rightWater.show()
|
||||||
|
|
||||||
def hasOverrideIval(self, origAnimName):
|
def hasOverrideIval(self, origAnimName):
|
||||||
result = False
|
return ('fightBoost' in origAnimName or 'fightCheer' in origAnimName) and not self.hoodId == ToontownGlobals.TheBrrrgh
|
||||||
if ('fightBoost' in origAnimName or 'fightCheer' in origAnimName) and not self.hoodId == ToontownGlobals.TheBrrrgh:
|
|
||||||
result = True
|
|
||||||
return result
|
|
||||||
|
|
||||||
def getOverrideIval(self, origAnimName):
|
def getOverrideIval(self, origAnimName):
|
||||||
result = Sequence()
|
result = Sequence()
|
||||||
if ('fightBoost' in origAnimName or 'fightCheer' in origAnimName) and not self.hoodId == ToontownGlobals.TheBrrrgh:
|
|
||||||
|
if self.hasOverrideIval(origAnimName):
|
||||||
result.append(Func(self.showWater))
|
result.append(Func(self.showWater))
|
||||||
if 'fightBoost' in origAnimName:
|
anim = self.createAnimIval('fight0' if 'fightBoost' in origAnimName else 'fight1')
|
||||||
animKey = 'fight0'
|
result.append(anim)
|
||||||
else:
|
|
||||||
animKey = 'fight1'
|
|
||||||
animAndSound = self.createAnimAndSoundIval(animKey)
|
|
||||||
result.append(animAndSound)
|
|
||||||
result.append(Func(self.hideWater))
|
result.append(Func(self.hideWater))
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -2,7 +2,7 @@ import math
|
||||||
import random
|
import random
|
||||||
import GenericAnimatedProp
|
import GenericAnimatedProp
|
||||||
from direct.actor import Actor
|
from direct.actor import Actor
|
||||||
from direct.interval.IntervalGlobal import Sequence, ActorInterval, Wait, Func, SoundInterval, Parallel
|
from direct.interval.IntervalGlobal import Sequence, ActorInterval, Wait, Func, Parallel
|
||||||
from direct.fsm import FSM
|
from direct.fsm import FSM
|
||||||
from direct.showbase.PythonUtil import weightedChoice
|
from direct.showbase.PythonUtil import weightedChoice
|
||||||
from pandac.PandaModules import TextNode, Vec3
|
from pandac.PandaModules import TextNode, Vec3
|
||||||
|
@ -30,9 +30,8 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
HpTextGenerator = TextNode('HpTextGenerator')
|
HpTextGenerator = TextNode('HpTextGenerator')
|
||||||
BattleCheerText = '+'
|
BattleCheerText = '+'
|
||||||
|
|
||||||
def __init__(self, node, holidayId = -1):
|
def __init__(self, node):
|
||||||
FSM.FSM.__init__(self, 'InteractiveProp-%s' % str(node))
|
FSM.FSM.__init__(self, 'InteractiveProp-%s' % str(node))
|
||||||
self.holidayId = holidayId
|
|
||||||
self.numIdles = 0
|
self.numIdles = 0
|
||||||
self.numFightAnims = 0
|
self.numFightAnims = 0
|
||||||
self.idleInterval = None
|
self.idleInterval = None
|
||||||
|
@ -45,11 +44,9 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
self.okToStartNextAnim = False
|
self.okToStartNextAnim = False
|
||||||
cellIndexStr = node.getTag('DNACellIndex')
|
cellIndexStr = node.getTag('DNACellIndex')
|
||||||
self.cellIndex = ord(cellIndexStr)
|
self.cellIndex = ord(cellIndexStr)
|
||||||
self.origAnimNameToSound = {}
|
|
||||||
self.lastPlayingAnimPhase = 0
|
self.lastPlayingAnimPhase = 0
|
||||||
self.buildingsMakingMeSad = set()
|
self.buildingsMakingMeSad = set()
|
||||||
GenericAnimatedProp.GenericAnimatedProp.__init__(self, node)
|
GenericAnimatedProp.GenericAnimatedProp.__init__(self, node)
|
||||||
return
|
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
self.exit()
|
self.exit()
|
||||||
|
@ -58,7 +55,6 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
self.battleCheerInterval = None
|
self.battleCheerInterval = None
|
||||||
self.sadInterval = None
|
self.sadInterval = None
|
||||||
self.victoryInterval = None
|
self.victoryInterval = None
|
||||||
return
|
|
||||||
|
|
||||||
def getCellIndex(self):
|
def getCellIndex(self):
|
||||||
return self.cellIndex
|
return self.cellIndex
|
||||||
|
@ -114,7 +110,6 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
self.battleCheerInterval = self.createBattleCheerInterval()
|
self.battleCheerInterval = self.createBattleCheerInterval()
|
||||||
self.victoryInterval = self.createVictoryInterval()
|
self.victoryInterval = self.createVictoryInterval()
|
||||||
self.sadInterval = self.createSadInterval()
|
self.sadInterval = self.createSadInterval()
|
||||||
return
|
|
||||||
|
|
||||||
def createIdleInterval(self):
|
def createIdleInterval(self):
|
||||||
result = Sequence()
|
result = Sequence()
|
||||||
|
@ -159,14 +154,14 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
result = Sequence()
|
result = Sequence()
|
||||||
for i in xrange(self.numFightAnims):
|
for i in xrange(self.numFightAnims):
|
||||||
animKey = 'fight%d' % i
|
animKey = 'fight%d' % i
|
||||||
animAndSoundIval = self.createAnimAndSoundIval(animKey)
|
animIval = self.createAnimIval(animKey)
|
||||||
origAnimName = self.node.getAnimFilename(animKey).split('/')[-1]
|
origAnimName = self.node.getAnimFilename(animKey).split('/')[-1]
|
||||||
if self.hasOverrideIval(origAnimName):
|
if self.hasOverrideIval(origAnimName):
|
||||||
result.append(self.getOverrideIval(origAnimName))
|
result.append(self.getOverrideIval(origAnimName))
|
||||||
elif self.hasSpecialIval(origAnimName):
|
elif self.hasSpecialIval(origAnimName):
|
||||||
result.append(Parallel(animAndSoundIval, self.getSpecialIval(origAnimName)))
|
result.append(Parallel(animIval, self.getSpecialIval(origAnimName)))
|
||||||
else:
|
else:
|
||||||
result.append(animAndSoundIval)
|
result.append(animIval)
|
||||||
|
|
||||||
self.createBattleCheerText()
|
self.createBattleCheerText()
|
||||||
battleCheerTextIval = Sequence(Func(self.hpText.show), self.hpText.posInterval(duration=4.0, pos=Vec3(0, 0, 7), startPos=(0, 0, 3)), Func(self.hpText.hide))
|
battleCheerTextIval = Sequence(Func(self.hpText.show), self.hpText.posInterval(duration=4.0, pos=Vec3(0, 0, 7), startPos=(0, 0, 3)), Func(self.hpText.hide))
|
||||||
|
@ -176,7 +171,7 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
def createSadInterval(self):
|
def createSadInterval(self):
|
||||||
result = Sequence()
|
result = Sequence()
|
||||||
if self.hoodId in self.ZoneToSadAnims:
|
if self.hoodId in self.ZoneToSadAnims:
|
||||||
result = self.createAnimAndSoundIval('sad')
|
result = self.createAnimIval('sad')
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def hasSpecialIval(self, origAnimName):
|
def hasSpecialIval(self, origAnimName):
|
||||||
|
@ -194,26 +189,17 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
def createVictoryInterval(self):
|
def createVictoryInterval(self):
|
||||||
result = Sequence()
|
result = Sequence()
|
||||||
if self.hoodId in self.ZoneToVictoryAnims:
|
if self.hoodId in self.ZoneToVictoryAnims:
|
||||||
animAndSoundIval = self.createAnimAndSoundIval('victory')
|
animIval = self.createAnimIval('victory')
|
||||||
result.append(animAndSoundIval)
|
result.append(animIval)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def enter(self):
|
def enter(self):
|
||||||
GenericAnimatedProp.GenericAnimatedProp.enter(self)
|
GenericAnimatedProp.GenericAnimatedProp.enter(self)
|
||||||
if base.config.GetBool('props-buff-battles', True):
|
if base.config.GetBool('props-buff-battles', True):
|
||||||
self.notify.debug('props buff battles is true')
|
self.notify.debug('props buff battles is true')
|
||||||
if base.cr.newsManager.isHolidayRunning(self.holidayId):
|
|
||||||
self.notify.debug('holiday is running, doing idle interval')
|
|
||||||
self.node.stop()
|
self.node.stop()
|
||||||
self.node.pose('idle0', 0)
|
self.node.pose('idle0', 0)
|
||||||
if base.config.GetBool('interactive-prop-random-idles', 1):
|
|
||||||
self.requestIdleOrSad()
|
|
||||||
else:
|
|
||||||
self.idleInterval.loop()
|
self.idleInterval.loop()
|
||||||
else:
|
|
||||||
self.notify.debug('holiday is NOT running, doing nothing')
|
|
||||||
self.node.stop()
|
|
||||||
self.node.pose('idle0', 0)
|
|
||||||
else:
|
else:
|
||||||
self.notify.debug('props do not buff battles')
|
self.notify.debug('props do not buff battles')
|
||||||
self.node.stop()
|
self.node.stop()
|
||||||
|
@ -288,8 +274,6 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
whichAnim = self.chooseIdleAnimToRun()
|
whichAnim = self.chooseIdleAnimToRun()
|
||||||
if self.visId == localAvatar.zoneId:
|
if self.visId == localAvatar.zoneId:
|
||||||
self.notify.debug('whichAnim=%s' % whichAnim)
|
self.notify.debug('whichAnim=%s' % whichAnim)
|
||||||
if __dev__:
|
|
||||||
self.notify.info('whichAnim=%s %s' % (whichAnim, self.getOrigIdleAnimName(whichAnim)))
|
|
||||||
self.lastPlayingAnimPhase = whichAnim
|
self.lastPlayingAnimPhase = whichAnim
|
||||||
self.curIval = self.createIdleAnimSequence(whichAnim)
|
self.curIval = self.createIdleAnimSequence(whichAnim)
|
||||||
self.notify.debug('starting curIval of length %s' % self.curIval.getDuration())
|
self.notify.debug('starting curIval of length %s' % self.curIval.getDuration())
|
||||||
|
@ -299,28 +283,25 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
self.notify.debug('false self.okToStartNextAnim=%s' % self.okToStartNextAnim)
|
self.notify.debug('false self.okToStartNextAnim=%s' % self.okToStartNextAnim)
|
||||||
return
|
return
|
||||||
|
|
||||||
def createIdleAnimAndSoundInterval(self, whichIdleAnim, startingTime = 0):
|
def createIdleAnimInterval(self, whichIdleAnim, startingTime = 0):
|
||||||
animIval = self.node.actorInterval('idle%d' % whichIdleAnim, startTime=startingTime)
|
animIval = self.node.actorInterval('idle%d' % whichIdleAnim, startTime=startingTime)
|
||||||
animIvalDuration = animIval.getDuration()
|
animIvalDuration = animIval.getDuration()
|
||||||
origAnimName = self.ZoneToIdles[self.hoodId][whichIdleAnim]
|
origAnimName = self.ZoneToIdles[self.hoodId][whichIdleAnim]
|
||||||
if isinstance(origAnimName, tuple):
|
if isinstance(origAnimName, tuple):
|
||||||
origAnimName = origAnimName[0]
|
origAnimName = origAnimName[0]
|
||||||
soundIval = self.createSoundInterval(origAnimName, animIvalDuration)
|
|
||||||
soundIvalDuration = soundIval.getDuration()
|
|
||||||
if self.hasSpecialIval(origAnimName):
|
if self.hasSpecialIval(origAnimName):
|
||||||
specialIval = self.getSpecialIval(origAnimName)
|
specialIval = self.getSpecialIval(origAnimName)
|
||||||
idleAnimAndSound = Parallel(animIval, soundIval, specialIval)
|
return Parallel(animIval, specialIval)
|
||||||
else:
|
else:
|
||||||
idleAnimAndSound = Parallel(animIval, soundIval)
|
return animIval
|
||||||
return idleAnimAndSound
|
|
||||||
|
|
||||||
def createIdleAnimSequence(self, whichIdleAnim):
|
def createIdleAnimSequence(self, whichIdleAnim):
|
||||||
dummyResult = Sequence(Wait(self.IdlePauseTime))
|
dummyResult = Sequence(Wait(self.IdlePauseTime))
|
||||||
if not hasattr(self, 'node') or not self.node:
|
if not hasattr(self, 'node') or not self.node:
|
||||||
self.notify.warning("createIdleAnimSequence returning dummyResult hasattr(self,'node')=%s" % hasattr(self, 'node'))
|
self.notify.warning("createIdleAnimSequence returning dummyResult hasattr(self,'node')=%s" % hasattr(self, 'node'))
|
||||||
return dummyResult
|
return dummyResult
|
||||||
idleAnimAndSound = self.createIdleAnimAndSoundInterval(whichIdleAnim)
|
idleAnim = self.createIdleAnimInterval(whichIdleAnim)
|
||||||
result = Sequence(idleAnimAndSound, Wait(self.IdlePauseTime), Func(self.startNextIdleAnim))
|
result = Sequence(idleAnim, Wait(self.IdlePauseTime), Func(self.startNextIdleAnim))
|
||||||
if isinstance(self.ZoneToIdles[self.hoodId][whichIdleAnim], tuple) and len(self.ZoneToIdles[self.hoodId][whichIdleAnim]) > 2:
|
if isinstance(self.ZoneToIdles[self.hoodId][whichIdleAnim], tuple) and len(self.ZoneToIdles[self.hoodId][whichIdleAnim]) > 2:
|
||||||
info = self.ZoneToIdles[self.hoodId][whichIdleAnim]
|
info = self.ZoneToIdles[self.hoodId][whichIdleAnim]
|
||||||
origAnimName = info[0]
|
origAnimName = info[0]
|
||||||
|
@ -333,7 +314,7 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
pauseTime = random.randrange(minPauseTime, maxPauseTime + 1)
|
pauseTime = random.randrange(minPauseTime, maxPauseTime + 1)
|
||||||
result = Sequence()
|
result = Sequence()
|
||||||
for i in xrange(numberOfLoops):
|
for i in xrange(numberOfLoops):
|
||||||
result.append(idleAnimAndSound)
|
result.append(idleAnim)
|
||||||
|
|
||||||
if self.getSettleName(whichIdleAnim):
|
if self.getSettleName(whichIdleAnim):
|
||||||
result.append(self.node.actorInterval('settle%d' % whichIdleAnim))
|
result.append(self.node.actorInterval('settle%d' % whichIdleAnim))
|
||||||
|
@ -343,39 +324,24 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
|
|
||||||
def gotoFaceoff(self):
|
def gotoFaceoff(self):
|
||||||
self.notify.debugStateCall(self)
|
self.notify.debugStateCall(self)
|
||||||
if base.cr.newsManager.isHolidayRunning(self.holidayId):
|
|
||||||
self.request('Faceoff')
|
self.request('Faceoff')
|
||||||
else:
|
|
||||||
self.notify.debug('not going to faceoff because holiday %d is not running' % self.holidayId)
|
|
||||||
|
|
||||||
def gotoBattleCheer(self):
|
def gotoBattleCheer(self):
|
||||||
self.notify.debugStateCall(self)
|
self.notify.debugStateCall(self)
|
||||||
if base.cr.newsManager.isHolidayRunning(self.holidayId):
|
|
||||||
self.request('BattleCheer')
|
self.request('BattleCheer')
|
||||||
else:
|
|
||||||
self.notify.debug('not going to battleCheer because holiday %d is not running' % self.holidayId)
|
|
||||||
|
|
||||||
def gotoIdle(self):
|
def gotoIdle(self):
|
||||||
self.notify.debugStateCall(self)
|
self.notify.debugStateCall(self)
|
||||||
if base.cr.newsManager.isHolidayRunning(self.holidayId):
|
|
||||||
self.request('DoIdleAnim')
|
self.request('DoIdleAnim')
|
||||||
else:
|
|
||||||
self.notify.debug('not going to idle because holiday %d is not running' % self.holidayId)
|
|
||||||
|
|
||||||
def gotoVictory(self):
|
def gotoVictory(self):
|
||||||
self.notify.debugStateCall(self)
|
self.notify.debugStateCall(self)
|
||||||
if base.cr.newsManager.isHolidayRunning(self.holidayId):
|
|
||||||
self.request('Victory')
|
self.request('Victory')
|
||||||
else:
|
|
||||||
self.notify.debug('not going to victory because holiday %d is not running' % self.holidayId)
|
|
||||||
|
|
||||||
def gotoSad(self, buildingDoId):
|
def gotoSad(self, buildingDoId):
|
||||||
self.notify.debugStateCall(self)
|
self.notify.debugStateCall(self)
|
||||||
self.buildingsMakingMeSad.add(buildingDoId)
|
self.buildingsMakingMeSad.add(buildingDoId)
|
||||||
if base.cr.newsManager.isHolidayRunning(self.holidayId):
|
|
||||||
self.request('Sad')
|
self.request('Sad')
|
||||||
else:
|
|
||||||
self.notify.debug('not going to sad because holiday %d is not running' % self.holidayId)
|
|
||||||
|
|
||||||
def buildingLiberated(self, buildingDoId):
|
def buildingLiberated(self, buildingDoId):
|
||||||
self.buildingsMakingMeSad.discard(buildingDoId)
|
self.buildingsMakingMeSad.discard(buildingDoId)
|
||||||
|
@ -391,7 +357,6 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
self.notify.debugStateCall(self)
|
self.notify.debugStateCall(self)
|
||||||
self.curIval.pause()
|
self.curIval.pause()
|
||||||
self.curIval = None
|
self.curIval = None
|
||||||
return
|
|
||||||
|
|
||||||
def calcWhichIdleAnim(self, animName):
|
def calcWhichIdleAnim(self, animName):
|
||||||
result = 0
|
result = 0
|
||||||
|
@ -412,9 +377,9 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
result = Sequence()
|
result = Sequence()
|
||||||
if self.lastIdleAnimName:
|
if self.lastIdleAnimName:
|
||||||
whichIdleAnim = self.calcWhichIdleAnim(self.lastIdleAnimName)
|
whichIdleAnim = self.calcWhichIdleAnim(self.lastIdleAnimName)
|
||||||
animAndSound = self.createIdleAnimAndSoundInterval(whichIdleAnim, self.lastIdleTime)
|
anim = self.createIdleAnimInterval(whichIdleAnim, self.lastIdleTime)
|
||||||
result.append(animAndSound)
|
result.append(anim)
|
||||||
idleIntoFightIval = self.createAnimAndSoundIval('idleIntoFight')
|
idleIntoFightIval = self.createAnimIval('idleIntoFight')
|
||||||
result.append(idleIntoFightIval)
|
result.append(idleIntoFightIval)
|
||||||
result.append(Func(self.gotoBattleCheer))
|
result.append(Func(self.gotoBattleCheer))
|
||||||
return result
|
return result
|
||||||
|
@ -472,37 +437,18 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
|
||||||
result = self.ZoneToIdles[self.hoodId][whichIdleAnim]
|
result = self.ZoneToIdles[self.hoodId][whichIdleAnim]
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def createAnimAndSoundIval(self, animKey):
|
def createAnimIval(self, animKey):
|
||||||
animIval = self.node.actorInterval(animKey)
|
animIval = self.node.actorInterval(animKey)
|
||||||
animIvalDuration = animIval.getDuration()
|
animIvalDuration = animIval.getDuration()
|
||||||
origAnimName = self.node.getAnimFilename(animKey)
|
origAnimName = self.node.getAnimFilename(animKey)
|
||||||
soundIval = self.createSoundInterval(origAnimName, animIvalDuration)
|
|
||||||
soundIvalDuration = soundIval.getDuration()
|
|
||||||
printFunc = Func(self.printAnimIfClose, animKey)
|
|
||||||
if self.hasSpecialIval(origAnimName):
|
if self.hasSpecialIval(origAnimName):
|
||||||
specialIval = self.getSpecialIval(origAnimName)
|
specialIval = self.getSpecialIval(origAnimName)
|
||||||
idleAnimAndSound = Parallel(animIval, soundIval, specialIval)
|
return Parallel(animIval, specialIval)
|
||||||
if base.config.GetBool('interactive-prop-info', False):
|
|
||||||
idleAnimAndSound.append(printFunc)
|
|
||||||
else:
|
else:
|
||||||
idleAnimAndSound = Parallel(animIval, soundIval)
|
return animIval
|
||||||
if base.config.GetBool('interactive-prop-info', False):
|
|
||||||
idleAnimAndSound.append(printFunc)
|
|
||||||
return idleAnimAndSound
|
|
||||||
|
|
||||||
def printAnimIfClose(self, animKey):
|
|
||||||
if base.config.GetBool('interactive-prop-info', False):
|
|
||||||
try:
|
|
||||||
animName = self.node.getAnimFilename(animKey)
|
|
||||||
baseAnimName = animName.split('/')[-1]
|
|
||||||
if localAvatar.zoneId == self.visId:
|
|
||||||
self.notify.info('playing %s' % baseAnimName)
|
|
||||||
except Exception, e:
|
|
||||||
self.notify.warning('Unknown error in printAnimIfClose, giving up:\n%s' % str(e))
|
|
||||||
|
|
||||||
def clearCurIval(self):
|
def clearCurIval(self):
|
||||||
if self.curIval:
|
if self.curIval:
|
||||||
self.curIval.finish()
|
self.curIval.finish()
|
||||||
clearPythonIvals(self.curIval)
|
clearPythonIvals(self.curIval)
|
||||||
self.curIval = None
|
self.curIval = None
|
||||||
return
|
|
||||||
|
|
|
@ -2,229 +2,92 @@ from direct.actor import Actor
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
from direct.interval.IntervalGlobal import Sequence, Func
|
from direct.interval.IntervalGlobal import Sequence, Func
|
||||||
from toontown.hood import InteractiveAnimatedProp
|
from toontown.hood import InteractiveAnimatedProp
|
||||||
from toontown.hood import GenericAnimatedProp
|
|
||||||
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer
|
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer
|
||||||
|
|
||||||
class MailboxInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
|
class MailboxInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('MailboxInteractiveProp')
|
notify = DirectNotifyGlobal.directNotify.newCategory('MailboxInteractiveProp')
|
||||||
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[ToontownBattleGlobals.THROW_TRACK]
|
BattleTrack = ToontownBattleGlobals.THROW_TRACK
|
||||||
ZoneToIdles = {ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_mailbox_idle0',
|
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[BattleTrack]
|
||||||
3,
|
|
||||||
10,
|
ZoneToIdles = {
|
||||||
'tt_a_ara_ttc_mailbox_idle0settle',
|
ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_mailbox_idle0', 3, 10, 'tt_a_ara_ttc_mailbox_idle0settle', 3, 10),
|
||||||
3,
|
('tt_a_ara_ttc_mailbox_idleTake2', 1, 1, None, 3, 10),
|
||||||
10),
|
('tt_a_ara_ttc_mailbox_idleLook1', 1, 1, None, 3, 10),
|
||||||
('tt_a_ara_ttc_mailbox_idleTake2',
|
('tt_a_ara_ttc_mailbox_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
1,
|
ToontownGlobals.DonaldsDock: (('tt_a_ara_dod_mailbox_idle0', 3, 10, 'tt_a_ara_dod_mailbox_idle0settle', 3, 10),
|
||||||
1,
|
('tt_a_ara_dod_mailbox_idle2', 1, 1, None, 3, 10),
|
||||||
None,
|
('tt_a_ara_dod_mailbox_idle1', 1, 1, None, 3, 10),
|
||||||
3,
|
('tt_a_ara_dod_mailbox_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
10),
|
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_mailbox_idle0', 3, 10, 'tt_a_ara_dga_mailbox_idle0settle', 3, 10),
|
||||||
('tt_a_ara_ttc_mailbox_idleLook1',
|
('tt_a_ara_dga_mailbox_idleTake1', 1, 1, None, 3, 10),
|
||||||
1,
|
('tt_a_ara_dga_mailbox_idleLook2', 1, 1, None, 3, 10),
|
||||||
1,
|
('tt_a_ara_dga_mailbox_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
None,
|
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_mailbox_idle0', 3, 10, 'tt_a_ara_mml_mailbox_idle0settle', 3, 10),
|
||||||
3,
|
('tt_a_ara_mml_mailbox_idleTake1', 1, 1, None, 3, 10),
|
||||||
10),
|
('tt_a_ara_mml_mailbox_idleLook2', 1, 1, None, 3, 10),
|
||||||
('tt_a_ara_ttc_mailbox_idleAwesome3',
|
('tt_a_ara_mml_mailbox_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
1,
|
ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_mailbox_idleShiver1', 1, 1, None, 3, 10),
|
||||||
1,
|
('tt_a_ara_tbr_mailbox_idleSneeze2', 1, 1, None, 3, 10),
|
||||||
None,
|
('tt_a_ara_tbr_mailbox_idleSpin0', 1, 1, None, 3, 10),
|
||||||
3,
|
('tt_a_ara_tbr_mailbox_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
10)),
|
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_mailbox_idleSleep0', 3, 10, None, 0, 0),
|
||||||
ToontownGlobals.FunnyFarm: (('tt_a_ara_ttc_mailbox_idle0',
|
('tt_a_ara_ddl_mailbox_idleShake2', 1, 1, None, 0, 0),
|
||||||
3,
|
('tt_a_ara_ddl_mailbox_idleSnore1', 1, 1, None, 0, 0),
|
||||||
10,
|
('tt_a_ara_ddl_mailbox_idleAwesome3', 1, 1, None, 0, 0))}
|
||||||
'tt_a_ara_ttc_mailbox_idle0settle',
|
|
||||||
3,
|
ZoneToIdleIntoFightAnims = {
|
||||||
10),
|
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_idleIntoFight',
|
||||||
('tt_a_ara_ttc_mailbox_idleTake2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_ttc_mailbox_idleLook1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_ttc_mailbox_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.DonaldsDock: (('tt_a_ara_dod_mailbox_idle0',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
'tt_a_ara_dod_mailbox_idle0settle',
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dod_mailbox_idle2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dod_mailbox_idle1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dod_mailbox_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_mailbox_idle0',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
'tt_a_ara_dga_mailbox_idle0settle',
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dga_mailbox_idleTake1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dga_mailbox_idleLook2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dga_mailbox_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_mailbox_idle0',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
'tt_a_ara_mml_mailbox_idle0settle',
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_mml_mailbox_idleTake1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_mml_mailbox_idleLook2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_mml_mailbox_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_mailbox_idleShiver1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_tbr_mailbox_idleSneeze2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_tbr_mailbox_idleSpin0',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_tbr_mailbox_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_mailbox_idleSleep0',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0),
|
|
||||||
('tt_a_ara_ddl_mailbox_idleShake2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0),
|
|
||||||
('tt_a_ara_ddl_mailbox_idleSnore1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0),
|
|
||||||
('tt_a_ara_ddl_mailbox_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0))}
|
|
||||||
ZoneToIdleIntoFightAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_idleIntoFight',
|
|
||||||
ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_mailbox_idleIntoFight',
|
|
||||||
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_idleIntoFight',
|
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_idleIntoFight',
|
||||||
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_idleIntoFight',
|
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_idleIntoFight',
|
||||||
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_idleIntoFight',
|
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_idleIntoFight',
|
||||||
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_idleIntoFight',
|
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_idleIntoFight',
|
||||||
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_idleIntoFight'}
|
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_idleIntoFight'}
|
||||||
ZoneToVictoryAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_victoryDance',
|
|
||||||
ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_mailbox_victoryDance',
|
ZoneToVictoryAnims = {
|
||||||
|
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_victoryDance',
|
||||||
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_victoryDance',
|
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_victoryDance',
|
||||||
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_victoryDance',
|
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_victoryDance',
|
||||||
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_victoryDance',
|
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_victoryDance',
|
||||||
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_victoryDance',
|
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_victoryDance',
|
||||||
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_victoryDance'}
|
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_victoryDance'}
|
||||||
ZoneToSadAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_fightSad',
|
|
||||||
ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_mailbox_fightSad',
|
ZoneToSadAnims = {
|
||||||
|
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_fightSad',
|
||||||
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_fightSad',
|
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_fightSad',
|
||||||
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_fightSad',
|
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_fightSad',
|
||||||
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_fightSad',
|
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_fightSad',
|
||||||
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_fightSad',
|
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_fightSad',
|
||||||
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_fightSad'}
|
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_fightSad'}
|
||||||
ZoneToFightAnims = {ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_mailbox_fightBoost', 'tt_a_ara_ttc_mailbox_fightCheer', 'tt_a_ara_ttc_mailbox_fightIdle'),
|
|
||||||
ToontownGlobals.FunnyFarm: ('tt_a_ara_ttc_mailbox_fightBoost', 'tt_a_ara_ttc_mailbox_fightCheer', 'tt_a_ara_ttc_mailbox_fightIdle'),
|
ZoneToFightAnims = {
|
||||||
|
ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_mailbox_fightBoost', 'tt_a_ara_ttc_mailbox_fightCheer', 'tt_a_ara_ttc_mailbox_fightIdle'),
|
||||||
ToontownGlobals.DonaldsDock: ('tt_a_ara_dod_mailbox_fightBoost', 'tt_a_ara_dod_mailbox_fightCheer', 'tt_a_ara_dod_mailbox_fightIdle'),
|
ToontownGlobals.DonaldsDock: ('tt_a_ara_dod_mailbox_fightBoost', 'tt_a_ara_dod_mailbox_fightCheer', 'tt_a_ara_dod_mailbox_fightIdle'),
|
||||||
ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_mailbox_fightBoost', 'tt_a_ara_dga_mailbox_fightCheer', 'tt_a_ara_dga_mailbox_fightIdle'),
|
ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_mailbox_fightBoost', 'tt_a_ara_dga_mailbox_fightCheer', 'tt_a_ara_dga_mailbox_fightIdle'),
|
||||||
ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_mailbox_fightBoost', 'tt_a_ara_mml_mailbox_fightCheer', 'tt_a_ara_mml_mailbox_fightIdle'),
|
ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_mailbox_fightBoost', 'tt_a_ara_mml_mailbox_fightCheer', 'tt_a_ara_mml_mailbox_fightIdle'),
|
||||||
ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_mailbox_fightBoost', 'tt_a_ara_tbr_mailbox_fightCheer', 'tt_a_ara_tbr_mailbox_fightIdle'),
|
ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_mailbox_fightBoost', 'tt_a_ara_tbr_mailbox_fightCheer', 'tt_a_ara_tbr_mailbox_fightIdle'),
|
||||||
ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_mailbox_fightBoost', 'tt_a_ara_ddl_mailbox_fightCheer', 'tt_a_ara_ddl_mailbox_fightIdle')}
|
ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_mailbox_fightBoost', 'tt_a_ara_ddl_mailbox_fightCheer', 'tt_a_ara_ddl_mailbox_fightIdle')}
|
||||||
|
|
||||||
IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0)
|
IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0)
|
||||||
|
|
||||||
def __init__(self, node):
|
def __init__(self, node):
|
||||||
InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node, ToontownGlobals.MAILBOXES_BUFF_BATTLES)
|
InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node)
|
||||||
|
|
||||||
def setupActor(self, node):
|
def setupActor(self, node):
|
||||||
self.pieActor = Actor.Actor('phase_5/models/char/tt_r_prp_ext_piePackage', {'fightBoost': 'phase_5/models/char/tt_a_prp_ext_piePackage_fightBoost'})
|
self.pieActor = Actor.Actor('phase_5/models/char/tt_r_prp_ext_piePackage', {'fightBoost': 'phase_5/models/char/tt_a_prp_ext_piePackage_fightBoost'})
|
||||||
self.pieActor.reparentTo(self.node)
|
self.pieActor.reparentTo(self.node)
|
||||||
self.pieActor.hide()
|
self.pieActor.hide()
|
||||||
|
|
||||||
InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node)
|
InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node)
|
||||||
|
|
||||||
def hasSpecialIval(self, origAnimName):
|
def hasSpecialIval(self, origAnimName):
|
||||||
result = False
|
return 'fightBoost' in origAnimName
|
||||||
if 'fightBoost' in origAnimName:
|
|
||||||
result = True
|
|
||||||
return result
|
|
||||||
|
|
||||||
def getSpecialIval(self, origAnimName):
|
def getSpecialIval(self, origAnimName):
|
||||||
result = Sequence()
|
result = Sequence()
|
||||||
if 'fightBoost' in origAnimName:
|
|
||||||
|
if self.hasSpecialIval(origAnimName):
|
||||||
result.append(Func(self.pieActor.show))
|
result.append(Func(self.pieActor.show))
|
||||||
result.append(self.pieActor.actorInterval('fightBoost'))
|
result.append(self.pieActor.actorInterval('fightBoost'))
|
||||||
result.append(Func(self.pieActor.hide))
|
result.append(Func(self.pieActor.hide))
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -1,66 +0,0 @@
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
import datetime
|
|
||||||
from pandac.PandaModules import *
|
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
|
||||||
from direct.distributed import DistributedObject
|
|
||||||
from direct.showbase import AppRunnerGlobal
|
|
||||||
from toontown.toonbase import TTLocalizer
|
|
||||||
|
|
||||||
class StreetSign(DistributedObject.DistributedObject):
|
|
||||||
RedownloadTaskName = 'RedownloadStreetSign'
|
|
||||||
StreetSignFileName = config.GetString('street-sign-filename', 'texture.jpg')
|
|
||||||
StreetSignBaseDir = config.GetString('street-sign-base-dir', 'sign')
|
|
||||||
StreetSignUrl = base.config.GetString('street-sign-url', 'http://cdn.toontown.disney.go.com/toontown/en/street-signs/img/')
|
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('StreetSign')
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.downloadingStreetSign = False
|
|
||||||
self.percentDownloaded = 0.0
|
|
||||||
self.startDownload = datetime.datetime.now()
|
|
||||||
self.endDownload = datetime.datetime.now()
|
|
||||||
self.notify.info('Street sign url is %s' % self.StreetSignUrl)
|
|
||||||
#self.redownloadStreetSign()
|
|
||||||
|
|
||||||
def replaceTexture(self):
|
|
||||||
searchPath = DSearchPath()
|
|
||||||
searchPath.appendDirectory(self.directory)
|
|
||||||
|
|
||||||
def redownloadStreetSign(self):
|
|
||||||
self.precentDownload = 0.0
|
|
||||||
self.startRedownload = datetime.datetime.now()
|
|
||||||
self.downloadingStreetSign = True
|
|
||||||
Filename(self.StreetSignBaseDir + '/.').makeDir()
|
|
||||||
http = HTTPClient.getGlobalPtr()
|
|
||||||
self.url = self.StreetSignUrl + self.StreetSignFileName
|
|
||||||
self.ch = http.makeChannel(True)
|
|
||||||
localFilename = Filename(self.StreetSignBaseDir, self.StreetSignFileName)
|
|
||||||
self.ch.getHeader(DocumentSpec(self.url))
|
|
||||||
size = self.ch.getFileSize()
|
|
||||||
doc = self.ch.getDocumentSpec()
|
|
||||||
localSize = localFilename.getFileSize()
|
|
||||||
outOfDate = True
|
|
||||||
if size == localSize:
|
|
||||||
if doc.hasDate():
|
|
||||||
date = doc.getDate()
|
|
||||||
localDate = HTTPDate(localFilename.getTimestamp())
|
|
||||||
if localDate.compareTo(date) > 0:
|
|
||||||
outOfDate = False
|
|
||||||
self.notify.info('Street Sign is up to date')
|
|
||||||
if outOfDate and self.ch.isValid():
|
|
||||||
self.ch.beginGetDocument(doc)
|
|
||||||
self.ch.downloadToFile(localFilename)
|
|
||||||
taskMgr.add(self.downloadStreetSignTask, self.RedownloadTaskName)
|
|
||||||
|
|
||||||
def downloadStreetSignTask(self, task):
|
|
||||||
if self.ch.run():
|
|
||||||
return task.cont
|
|
||||||
doc = self.ch.getDocumentSpec()
|
|
||||||
date = ''
|
|
||||||
if doc.hasDate():
|
|
||||||
date = doc.getDate().getString()
|
|
||||||
if not self.ch.isValid():
|
|
||||||
self.redownloadingStreetSign = False
|
|
||||||
return task.done
|
|
||||||
self.notify.info('Down downloading street sign')
|
|
||||||
return task.done
|
|
|
@ -1,212 +1,72 @@
|
||||||
from direct.actor import Actor
|
from direct.actor import Actor
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
from toontown.hood import InteractiveAnimatedProp
|
from toontown.hood import InteractiveAnimatedProp
|
||||||
from toontown.hood import GenericAnimatedProp
|
|
||||||
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer
|
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer
|
||||||
|
|
||||||
class TrashcanInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
|
class TrashcanInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('TrashcanInteractiveProp')
|
notify = DirectNotifyGlobal.directNotify.newCategory('TrashcanInteractiveProp')
|
||||||
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[ToontownBattleGlobals.HEAL_TRACK]
|
BattleTrack = ToontownBattleGlobals.HEAL_TRACK
|
||||||
ZoneToIdles = {ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_trashcan_idleTake2',
|
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[BattleTrack]
|
||||||
1,
|
|
||||||
1,
|
ZoneToIdles = {
|
||||||
None,
|
ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_trashcan_idleTake2', 1, 1, None, 3, 10),
|
||||||
3,
|
('tt_a_ara_ttc_trashcan_idleHiccup0', 1, 1, None, 3, 10),
|
||||||
10),
|
('tt_a_ara_ttc_trashcan_idleLook1', 1, 1, None, 3, 10),
|
||||||
('tt_a_ara_ttc_trashcan_idleHiccup0',
|
('tt_a_ara_ttc_trashcan_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
1,
|
ToontownGlobals.DonaldsDock: (('tt_a_ara_dod_trashcan_idleBounce2', 3, 10, 'tt_a_ara_dod_trashcan_idle0settle', 3, 10),
|
||||||
1,
|
('tt_a_ara_dod_trashcan_idle0', 1, 1, None, 3, 10),
|
||||||
None,
|
('tt_a_ara_dod_trashcan_idle1', 1, 1, None, 3, 10),
|
||||||
3,
|
('tt_a_ara_dod_trashcan_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
10),
|
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_trashcan_idleTake2', 1, 1, None, 3, 10),
|
||||||
('tt_a_ara_ttc_trashcan_idleLook1',
|
('tt_a_ara_dga_trashcan_idleHiccup0', 1, 1, None, 3, 10),
|
||||||
1,
|
('tt_a_ara_dga_trashcan_idleLook1', 1, 1, None, 3, 10),
|
||||||
1,
|
('tt_a_ara_dga_trashcan_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
None,
|
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_trashcan_idleBounce0', 3, 10, 'tt_a_ara_mml_trashcan_idle0settle', 3, 10),
|
||||||
3,
|
('tt_a_ara_mml_trashcan_idleLook1', 1, 1, None, 3, 10),
|
||||||
10),
|
('tt_a_ara_mml_trashcan_idleHelicopter2', 1, 1, None, 3, 10),
|
||||||
('tt_a_ara_ttc_trashcan_idleAwesome3',
|
('tt_a_ara_mml_trashcan_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
1,
|
ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_trashcan_idleShiver1', 1, 1, None, 3, 10),
|
||||||
1,
|
('tt_a_ara_tbr_trashcan_idleSneeze2', 1, 1, None, 3, 10),
|
||||||
None,
|
('tt_a_ara_tbr_trashcan_idle0', 1, 1, None, 3, 10),
|
||||||
3,
|
('tt_a_ara_tbr_trashcan_idleAwesome3', 1, 1, None, 3, 10)),
|
||||||
10)),
|
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_trashcan_idleSleep0', 3, 10, None, 0, 0),
|
||||||
ToontownGlobals.FunnyFarm: (('tt_a_ara_ttc_trashcan_idleTake2',
|
('tt_a_ara_ddl_trashcan_idleShake2', 1, 1, None, 0, 0),
|
||||||
1,
|
('tt_a_ara_ddl_trashcan_idleSnore1', 1, 1, None, 0, 0),
|
||||||
1,
|
('tt_a_ara_ddl_trashcan_idleAwesome3', 1, 1, None, 0, 0))}
|
||||||
None,
|
|
||||||
3,
|
ZoneToIdleIntoFightAnims = {
|
||||||
10),
|
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_idleIntoFight',
|
||||||
('tt_a_ara_ttc_trashcan_idleHiccup0',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_ttc_trashcan_idleLook1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_ttc_trashcan_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.DonaldsDock: (('tt_a_ara_dod_trashcan_idleBounce2',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
'tt_a_ara_dod_trashcan_idle0settle',
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dod_trashcan_idle0',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dod_trashcan_idle1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dod_trashcan_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_trashcan_idleTake2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dga_trashcan_idleHiccup0',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dga_trashcan_idleLook1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_dga_trashcan_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_trashcan_idleBounce0',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
'tt_a_ara_mml_trashcan_idle0settle',
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_mml_trashcan_idleLook1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_mml_trashcan_idleHelicopter2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_mml_trashcan_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_trashcan_idleShiver1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_tbr_trashcan_idleSneeze2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_tbr_trashcan_idle0',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10),
|
|
||||||
('tt_a_ara_tbr_trashcan_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
3,
|
|
||||||
10)),
|
|
||||||
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_trashcan_idleSleep0',
|
|
||||||
3,
|
|
||||||
10,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0),
|
|
||||||
('tt_a_ara_ddl_trashcan_idleShake2',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0),
|
|
||||||
('tt_a_ara_ddl_trashcan_idleSnore1',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0),
|
|
||||||
('tt_a_ara_ddl_trashcan_idleAwesome3',
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
None,
|
|
||||||
0,
|
|
||||||
0))}
|
|
||||||
ZoneToIdleIntoFightAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_idleIntoFight',
|
|
||||||
ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_trashcan_idleIntoFight',
|
|
||||||
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_idleIntoFight',
|
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_idleIntoFight',
|
||||||
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_idleIntoFight',
|
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_idleIntoFight',
|
||||||
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_idleIntoFight',
|
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_idleIntoFight',
|
||||||
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_idleIntoFight',
|
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_idleIntoFight',
|
||||||
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_idleIntoFight'}
|
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_idleIntoFight'}
|
||||||
ZoneToVictoryAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_victoryDance',
|
|
||||||
ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_trashcan_victoryDance',
|
ZoneToVictoryAnims = {
|
||||||
|
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_victoryDance',
|
||||||
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_victoryDance',
|
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_victoryDance',
|
||||||
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_victoryDance',
|
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_victoryDance',
|
||||||
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_victoryDance',
|
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_victoryDance',
|
||||||
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_victoryDance',
|
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_victoryDance',
|
||||||
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_victoryDance'}
|
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_victoryDance'}
|
||||||
ZoneToSadAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_fightSad',
|
|
||||||
ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_trashcan_fightSad',
|
ZoneToSadAnims = {
|
||||||
|
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_fightSad',
|
||||||
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_fightSad',
|
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_fightSad',
|
||||||
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_fightSad',
|
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_fightSad',
|
||||||
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_fightSad',
|
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_fightSad',
|
||||||
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_fightSad',
|
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_fightSad',
|
||||||
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_fightSad'}
|
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_fightSad'}
|
||||||
ZoneToFightAnims = {ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_trashcan_fightBoost', 'tt_a_ara_ttc_trashcan_fightCheer', 'tt_a_ara_ttc_trashcan_fightIdle'),
|
|
||||||
ToontownGlobals.FunnyFarm: ('tt_a_ara_ttc_trashcan_fightBoost', 'tt_a_ara_ttc_trashcan_fightCheer', 'tt_a_ara_ttc_trashcan_fightIdle'),
|
ZoneToFightAnims = {
|
||||||
|
ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_trashcan_fightBoost', 'tt_a_ara_ttc_trashcan_fightCheer', 'tt_a_ara_ttc_trashcan_fightIdle'),
|
||||||
ToontownGlobals.DonaldsDock: ('tt_a_ara_dod_trashcan_fightBoost', 'tt_a_ara_dod_trashcan_fightCheer', 'tt_a_ara_dod_trashcan_fightIdle'),
|
ToontownGlobals.DonaldsDock: ('tt_a_ara_dod_trashcan_fightBoost', 'tt_a_ara_dod_trashcan_fightCheer', 'tt_a_ara_dod_trashcan_fightIdle'),
|
||||||
ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_trashcan_fightBoost', 'tt_a_ara_dga_trashcan_fightCheer', 'tt_a_ara_dga_trashcan_fightIdle'),
|
ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_trashcan_fightBoost', 'tt_a_ara_dga_trashcan_fightCheer', 'tt_a_ara_dga_trashcan_fightIdle'),
|
||||||
ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_trashcan_fightBoost',
|
ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_trashcan_fightBoost', 'tt_a_ara_mml_trashcan_fightCheer0', 'tt_a_ara_mml_trashcan_fightCheer1', 'tt_a_ara_mml_trashcan_fightIdle'),
|
||||||
'tt_a_ara_mml_trashcan_fightCheer0',
|
|
||||||
'tt_a_ara_mml_trashcan_fightCheer1',
|
|
||||||
'tt_a_ara_mml_trashcan_fightIdle'),
|
|
||||||
ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_trashcan_fightBoost', 'tt_a_ara_tbr_trashcan_fightCheer', 'tt_a_ara_tbr_trashcan_fightIdle'),
|
ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_trashcan_fightBoost', 'tt_a_ara_tbr_trashcan_fightCheer', 'tt_a_ara_tbr_trashcan_fightIdle'),
|
||||||
ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_trashcan_fightBoost', 'tt_a_ara_ddl_trashcan_fightCheer', 'tt_a_ara_ddl_trashcan_fightIdle')}
|
ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_trashcan_fightBoost', 'tt_a_ara_ddl_trashcan_fightCheer', 'tt_a_ara_ddl_trashcan_fightIdle')}
|
||||||
|
|
||||||
IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0)
|
IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0)
|
||||||
|
|
||||||
def __init__(self, node):
|
def __init__(self, node):
|
||||||
InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node, ToontownGlobals.TRASHCANS_BUFF_BATTLES)
|
InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node)
|
|
@ -222,22 +222,6 @@ class SafeZoneLoader(StateData.StateData):
|
||||||
animPropList = self.animPropDict.setdefault(i, [])
|
animPropList = self.animPropDict.setdefault(i, [])
|
||||||
animPropList.append(animPropObj)
|
animPropList.append(animPropObj)
|
||||||
|
|
||||||
interactivePropNodes = i.findAllMatches('**/interactive_prop_*')
|
|
||||||
numInteractivePropNodes = interactivePropNodes.getNumPaths()
|
|
||||||
for j in xrange(numInteractivePropNodes):
|
|
||||||
interactivePropNode = interactivePropNodes.getPath(j)
|
|
||||||
className = 'GenericAnimatedProp'
|
|
||||||
symbols = {}
|
|
||||||
base.cr.importModule(symbols, 'toontown.hood', [className])
|
|
||||||
classObj = getattr(symbols[className], className)
|
|
||||||
interactivePropObj = classObj(interactivePropNode)
|
|
||||||
animPropList = self.animPropDict.get(i)
|
|
||||||
if animPropList is None:
|
|
||||||
animPropList = self.animPropDict.setdefault(i, [])
|
|
||||||
animPropList.append(interactivePropObj)
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
def deleteAnimatedProps(self):
|
def deleteAnimatedProps(self):
|
||||||
for zoneNode, animPropList in self.animPropDict.items():
|
for zoneNode, animPropList in self.animPropDict.items():
|
||||||
for animProp in animPropList:
|
for animProp in animPropList:
|
||||||
|
|
|
@ -46,7 +46,9 @@ class DistributedSuitBase(DistributedAvatar.DistributedAvatar, Suit.Suit, SuitBa
|
||||||
self.maxSkeleRevives = 0
|
self.maxSkeleRevives = 0
|
||||||
self.sillySurgeText = False
|
self.sillySurgeText = False
|
||||||
self.interactivePropTrackBonus = -1
|
self.interactivePropTrackBonus = -1
|
||||||
return
|
|
||||||
|
def setInteractivePropTrackBonus(self, trackBonus):
|
||||||
|
self.interactivePropTrackBonus = trackBonus
|
||||||
|
|
||||||
def setVirtual(self, virtual):
|
def setVirtual(self, virtual):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -1177,10 +1177,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
|
||||||
messenger.send('exitTrackFrame', [track])
|
messenger.send('exitTrackFrame', [track])
|
||||||
|
|
||||||
def checkPropBonus(self, track):
|
def checkPropBonus(self, track):
|
||||||
result = False
|
return track == self.interactivePropTrackBonus
|
||||||
if track == self.interactivePropTrackBonus:
|
|
||||||
result = True
|
|
||||||
return result
|
|
||||||
|
|
||||||
def stopAndClearPropBonusIval(self):
|
def stopAndClearPropBonusIval(self):
|
||||||
if self.propBonusIval and self.propBonusIval.isPlaying():
|
if self.propBonusIval and self.propBonusIval.isPlaying():
|
||||||
|
|
|
@ -883,9 +883,6 @@ SILLYMETER_HOLIDAY = 60
|
||||||
MAILBOX_ZERO_HOLIDAY = 61
|
MAILBOX_ZERO_HOLIDAY = 61
|
||||||
TRASHCAN_ZERO_HOLIDAY = 62
|
TRASHCAN_ZERO_HOLIDAY = 62
|
||||||
SILLY_SURGE_HOLIDAY = 63
|
SILLY_SURGE_HOLIDAY = 63
|
||||||
HYDRANTS_BUFF_BATTLES = 64
|
|
||||||
MAILBOXES_BUFF_BATTLES = 65
|
|
||||||
TRASHCANS_BUFF_BATTLES = 66
|
|
||||||
SILLY_CHATTER_ONE = 67
|
SILLY_CHATTER_ONE = 67
|
||||||
SILLY_CHATTER_TWO = 68
|
SILLY_CHATTER_TWO = 68
|
||||||
SILLY_CHATTER_THREE = 69
|
SILLY_CHATTER_THREE = 69
|
||||||
|
|
|
@ -134,8 +134,6 @@ class Street(BattlePlace.BattlePlace):
|
||||||
self.enterZone(requestStatus['zoneId'])
|
self.enterZone(requestStatus['zoneId'])
|
||||||
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList)
|
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList)
|
||||||
self.fsm.request(requestStatus['how'], [requestStatus])
|
self.fsm.request(requestStatus['how'], [requestStatus])
|
||||||
self.replaceStreetSignTextures()
|
|
||||||
return
|
|
||||||
|
|
||||||
def exit(self, visibilityFlag = 1):
|
def exit(self, visibilityFlag = 1):
|
||||||
if visibilityFlag:
|
if visibilityFlag:
|
||||||
|
@ -369,32 +367,3 @@ class Street(BattlePlace.BattlePlace):
|
||||||
self.halloweenLights += geom.findAllMatches('**/prop_snow_tree*')
|
self.halloweenLights += geom.findAllMatches('**/prop_snow_tree*')
|
||||||
for light in self.halloweenLights:
|
for light in self.halloweenLights:
|
||||||
light.setColorScaleOff(1)
|
light.setColorScaleOff(1)
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
def replaceStreetSignTextures(self):
|
|
||||||
if not hasattr(base.cr, 'playGame'):
|
|
||||||
return
|
|
||||||
place = base.cr.playGame.getPlace()
|
|
||||||
if place is None:
|
|
||||||
return
|
|
||||||
geom = base.cr.playGame.getPlace().loader.geom
|
|
||||||
signs = geom.findAllMatches('**/*tunnelAheadSign*;+s')
|
|
||||||
if signs.getNumPaths() > 0:
|
|
||||||
streetSign = base.cr.streetSign
|
|
||||||
signTexturePath = streetSign.StreetSignBaseDir + '/' + streetSign.StreetSignFileName
|
|
||||||
loaderTexturePath = Filename(str(signTexturePath))
|
|
||||||
alphaPath = 'phase_4/maps/tt_t_ara_gen_tunnelAheadSign_a.rgb'
|
|
||||||
inDreamland = False
|
|
||||||
if place.zoneId and ZoneUtil.getCanonicalHoodId(place.zoneId) == ToontownGlobals.DonaldsDreamland:
|
|
||||||
inDreamland = True
|
|
||||||
alphaPath = 'phase_4/maps/tt_t_ara_gen_tunnelAheadSign_a.rgb'
|
|
||||||
if Filename(signTexturePath).exists():
|
|
||||||
signTexture = loader.loadTexture(loaderTexturePath, alphaPath)
|
|
||||||
for sign in signs:
|
|
||||||
if Filename(signTexturePath).exists():
|
|
||||||
sign.setTexture(signTexture, 1)
|
|
||||||
if inDreamland:
|
|
||||||
sign.setColorScale(0.525, 0.525, 0.525, 1)
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
|
@ -17,8 +17,7 @@ from toontown.toon.Toon import teleportDebug
|
||||||
from toontown.battle import BattleParticles
|
from toontown.battle import BattleParticles
|
||||||
from direct.fsm import StateData
|
from direct.fsm import StateData
|
||||||
from toontown.building import ToonInterior
|
from toontown.building import ToonInterior
|
||||||
from toontown.hood import QuietZoneState
|
from toontown.hood import QuietZoneState, ZoneUtil, HydrantInteractiveProp, MailboxInteractiveProp, TrashcanInteractiveProp
|
||||||
from toontown.hood import ZoneUtil
|
|
||||||
from direct.interval.IntervalGlobal import *
|
from direct.interval.IntervalGlobal import *
|
||||||
from toontown.dna.DNAParser import DNABulkLoader
|
from toontown.dna.DNAParser import DNABulkLoader
|
||||||
|
|
||||||
|
@ -284,6 +283,7 @@ class TownLoader(StateData.StateData):
|
||||||
def createAnimatedProps(self, nodeList):
|
def createAnimatedProps(self, nodeList):
|
||||||
self.animPropDict = {}
|
self.animPropDict = {}
|
||||||
self.zoneIdToInteractivePropDict = {}
|
self.zoneIdToInteractivePropDict = {}
|
||||||
|
|
||||||
for i in nodeList:
|
for i in nodeList:
|
||||||
animPropNodes = i.findAllMatches('**/animated_prop_*')
|
animPropNodes = i.findAllMatches('**/animated_prop_*')
|
||||||
numAnimPropNodes = animPropNodes.getNumPaths()
|
numAnimPropNodes = animPropNodes.getNumPaths()
|
||||||
|
@ -305,32 +305,26 @@ class TownLoader(StateData.StateData):
|
||||||
animPropList.append(animPropObj)
|
animPropList.append(animPropObj)
|
||||||
|
|
||||||
interactivePropNodes = i.findAllMatches('**/interactive_prop_*')
|
interactivePropNodes = i.findAllMatches('**/interactive_prop_*')
|
||||||
numInteractivePropNodes = interactivePropNodes.getNumPaths()
|
|
||||||
for j in range(numInteractivePropNodes):
|
|
||||||
interactivePropNode = interactivePropNodes.getPath(j)
|
|
||||||
className = 'InteractiveAnimatedProp'
|
|
||||||
if 'hydrant' in interactivePropNode.getName():
|
|
||||||
className = 'HydrantInteractiveProp'
|
|
||||||
elif 'trashcan' in interactivePropNode.getName():
|
|
||||||
className = 'TrashcanInteractiveProp'
|
|
||||||
elif 'mailbox' in interactivePropNode.getName():
|
|
||||||
className = 'MailboxInteractiveProp'
|
|
||||||
symbols = {}
|
|
||||||
base.cr.importModule(symbols, 'toontown.hood', [className])
|
|
||||||
classObj = getattr(symbols[className], className)
|
|
||||||
interactivePropObj = classObj(interactivePropNode)
|
|
||||||
animPropList = self.animPropDict.get(i)
|
|
||||||
if animPropList is None:
|
|
||||||
animPropList = self.animPropDict.setdefault(i, [])
|
|
||||||
animPropList.append(interactivePropObj)
|
|
||||||
if interactivePropObj.getCellIndex() == 0:
|
|
||||||
zoneId = int(i.getName())
|
|
||||||
if zoneId not in self.zoneIdToInteractivePropDict:
|
|
||||||
self.zoneIdToInteractivePropDict[zoneId] = interactivePropObj
|
|
||||||
else:
|
|
||||||
self.notify.error('already have interactive prop %s in zone %s' % (self.zoneIdToInteractivePropDict, zoneId))
|
|
||||||
|
|
||||||
return
|
for j in xrange(interactivePropNodes.getNumPaths()):
|
||||||
|
propNode = interactivePropNodes.getPath(j)
|
||||||
|
propName = propNode.getName()
|
||||||
|
|
||||||
|
if 'hydrant' in propName:
|
||||||
|
prop = HydrantInteractiveProp.HydrantInteractiveProp(propNode)
|
||||||
|
elif 'trashcan' in propName:
|
||||||
|
prop = TrashcanInteractiveProp.TrashcanInteractiveProp(propNode)
|
||||||
|
elif 'mailbox' in propName:
|
||||||
|
prop = MailboxInteractiveProp.MailboxInteractiveProp(propNode)
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if i in self.animPropDict:
|
||||||
|
self.animPropDict[i].append(prop)
|
||||||
|
else:
|
||||||
|
self.animPropDict[i] = [prop]
|
||||||
|
|
||||||
|
self.zoneIdToInteractivePropDict[int(i.getName())] = prop
|
||||||
|
|
||||||
def deleteAnimatedProps(self):
|
def deleteAnimatedProps(self):
|
||||||
for zoneNode, animPropList in self.animPropDict.items():
|
for zoneNode, animPropList in self.animPropDict.items():
|
||||||
|
@ -348,7 +342,6 @@ class TownLoader(StateData.StateData):
|
||||||
animProp.exit()
|
animProp.exit()
|
||||||
|
|
||||||
def getInteractiveProp(self, zoneId):
|
def getInteractiveProp(self, zoneId):
|
||||||
result = None
|
|
||||||
if zoneId in self.zoneIdToInteractivePropDict:
|
if zoneId in self.zoneIdToInteractivePropDict:
|
||||||
result = self.zoneIdToInteractivePropDict[zoneId]
|
return self.zoneIdToInteractivePropDict[zoneId]
|
||||||
return result
|
return None
|
||||||
|
|
Loading…
Reference in a new issue