These need some more work

This commit is contained in:
John Cote 2015-05-17 22:46:24 -04:00
parent 76a8190ed7
commit badea7d47e
16 changed files with 858 additions and 321 deletions

View file

@ -106,6 +106,7 @@ want-mat-all-tailors #t
want-talkative-tyler #f want-talkative-tyler #f
estate-day-night #t estate-day-night #t
want-language-selection #t want-language-selection #t
active-holidays 64, 65, 66
# Developer options: # Developer options:
want-dev #f want-dev #f

View file

@ -260,7 +260,10 @@ class BattleCalculatorAI:
return return
def __checkPropBonus(self, track): def __checkPropBonus(self, track):
return self.battle.getInteractivePropTrackBonus() == track result = False
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:

View file

@ -39,6 +39,25 @@ 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
@ -133,10 +152,8 @@ 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)
prop = self.getInteractiveProp() if self.interactiveProp:
self.interactiveProp.gotoFaceoff()
if prop:
prop.gotoBattleCheer()
def __handleFaceOffDone(self): def __handleFaceOffDone(self):
self.notify.debug('FaceOff done') self.notify.debug('FaceOff done')
@ -164,10 +181,8 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
toon.startSmooth() toon.startSmooth()
self.accept('resumeAfterReward', self.handleResumeAfterReward) self.accept('resumeAfterReward', self.handleResumeAfterReward)
prop = self.getInteractiveProp() if self.interactiveProp:
self.interactiveProp.gotoVictory()
if prop:
prop.gotoVictory()
self.playReward(ts) self.playReward(ts)
def playReward(self, ts): def playReward(self, ts):
@ -195,10 +210,8 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
self.notify.debug('enterResume()') self.notify.debug('enterResume()')
if self.hasLocalToon(): if self.hasLocalToon():
self.removeLocalToon() self.removeLocalToon()
prop = self.getInteractiveProp() if self.interactiveProp:
self.interactiveProp.requestIdleOrSad()
if prop:
prop.requestIdleOrSad()
def exitResume(self): def exitResume(self):
pass pass

View file

@ -318,25 +318,11 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
def setBattleCellId(self, battleCellId): def setBattleCellId(self, battleCellId):
pass pass
def getInteractiveProp(self): def setInteractivePropTrackBonus(self, trackBonus):
if config.GetBool('want-anim-props', True): self.interactivePropTrackBonus = trackBonus
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):
prop = self.getInteractiveProp() return self.interactivePropTrackBonus
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))
@ -377,17 +363,12 @@ 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:
@ -1067,10 +1048,9 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
return Task.done return Task.done
def enterWaitForInput(self, ts = 0): def enterWaitForInput(self, ts = 0):
prop = self.getInteractiveProp() self.notify.debug('enterWaitForInput()')
if self.interactiveProp:
if prop: self.interactiveProp.gotoBattleCheer()
prop.gotoBattleCheer()
self.choseAttackAlready = 0 self.choseAttackAlready = 0
if self.localToonActive(): if self.localToonActive():
self.__enterLocalToonWaitForInput() self.__enterLocalToonWaitForInput()
@ -1262,10 +1242,7 @@ 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:
prop = self.getInteractiveProp() localAvatar.inventory.setInteractivePropTrackBonus(self.interactivePropTrackBonus)
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

View file

@ -400,7 +400,8 @@ class Movie(DirectObject.DirectObject):
if ival: if ival:
track.append(ival) track.append(ival)
camTrack.append(camIval) camTrack.append(camIval)
ival, camIval = MovieHeal.doHeals(self.__findToonAttack(HEAL), self.battle.getInteractivePropTrackBonus() == HEAL) hasHealBonus = 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)

View file

@ -236,11 +236,8 @@ class DistributedBuilding(DistributedObject.DistributedObject):
pass pass
def enterToon(self, ts): def enterToon(self, ts):
prop = self.getInteractiveProp() if self.getInteractiveProp():
self.getInteractiveProp().buildingLiberated(self.doId)
if prop:
prop.buildingLiberated(self.doId)
self.setToToon() self.setToToon()
def exitToon(self): def exitToon(self):
@ -259,11 +256,7 @@ class DistributedBuilding(DistributedObject.DistributedObject):
pass pass
def enterSuit(self, ts): def enterSuit(self, ts):
prop = self.getInteractiveProp() self.makePropSad()
if prop and not prop.state == 'Sad':
prop.gotoSad(self.doId)
self.setToSuit() self.setToSuit()
def exitSuit(self): def exitSuit(self):
@ -928,23 +921,38 @@ class DistributedBuilding(DistributedObject.DistributedObject):
self.elevatorNodePath.setPosHpr(0, 0, 0, 0, 0, 0) self.elevatorNodePath.setPosHpr(0, 0, 0, 0, 0, 0)
def getSbSearchString(self): def getSbSearchString(self):
return 'landmarkBlocks/sb' + str(self.block) + ':*_landmark_*_DNARoot' result = 'landmarkBlocks/sb' + str(self.block) + ':*_landmark_*_DNARoot'
return result
def adjustSbNodepathScale(self, nodePath): def adjustSbNodepathScale(self, nodePath):
pass pass
def getVisZoneId(self): def getVisZoneId(self):
exteriorZoneId = base.cr.playGame.hood.dnaStore.getZoneFromBlockNumber(self.block) exteriorZoneId = base.cr.playGame.hood.dnaStore.getZoneFromBlockNumber(self.block)
return ZoneUtil.getTrueZoneId(exteriorZoneId, self.zoneId) visZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.zoneId)
return visZoneId
def getInteractiveProp(self): def getInteractiveProp(self):
result = None
if self.interactiveProp: if self.interactiveProp:
return self.interactiveProp result = self.interactiveProp
elif base.cr.playGame.hood: else:
visZoneId = self.getVisZoneId()
if base.cr.playGame.hood:
loader = base.cr.playGame.hood.loader loader = base.cr.playGame.hood.loader
if hasattr(loader, 'getInteractiveProp'): if hasattr(loader, 'getInteractiveProp'):
self.interactiveProp = base.cr.playGame.hood.loader.getInteractiveProp(self.getVisZoneId()) self.interactiveProp = loader.getInteractiveProp(visZoneId)
result = self.interactiveProp
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')
return result
return self.interactiveProp def makePropSad(self):
return None self.notify.debug('makePropSad')
if self.getInteractiveProp():
if self.getInteractiveProp().state == 'Sad':
pass
self.getInteractiveProp().gotoSad(self.doId)

View file

@ -46,6 +46,18 @@ 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):

View file

@ -2,94 +2,235 @@ 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')
BattleTrack = ToontownBattleGlobals.SQUIRT_TRACK BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[ToontownBattleGlobals.SQUIRT_TRACK]
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[BattleTrack] ZoneToIdles = {ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_hydrant_idle0',
1,
ZoneToIdles = { 1,
ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_hydrant_idle0', 1, 1, None, 3, 10), None,
('tt_a_ara_ttc_hydrant_idle2', 1, 1, None, 3, 10), 3,
('tt_a_ara_ttc_hydrant_idle1', 1, 1, None, 3, 10), 10),
('tt_a_ara_ttc_hydrant_idleAwesome3', 1, 1, None, 3, 10)), ('tt_a_ara_ttc_hydrant_idle2',
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), 1,
('tt_a_ara_ttc_hydrant_idle1', 1, 1, None, 3, 10), None,
('tt_a_ara_ttc_hydrant_idleAwesome3', 1, 1, None, 3, 10)), 3,
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_hydrant_idle0', 3, 10, 'tt_a_ara_dga_hydrant_idle0settle', 3, 10), 10),
('tt_a_ara_dga_hydrant_idleLook1', 1, 1, None, 3, 10), ('tt_a_ara_ttc_hydrant_idle1',
('tt_a_ara_dga_hydrant_idleSneeze2', 1, 1, None, 3, 10), 1,
('tt_a_ara_dga_hydrant_idleAwesome3', 1, 1, None, 3, 10)), 1,
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_hydrant_idle0', 3, 10, 'tt_a_ara_mml_hydrant_idle0settle', 3, 10), None,
('tt_a_ara_mml_hydrant_idle2', 3, 10, 'tt_a_ara_mml_hydrant_idle2settle', 3, 10), 3,
('tt_a_ara_mml_hydrant_idle1', 3, 10, 'tt_a_ara_mml_hydrant_idle1settle', 3, 10), 10),
('tt_a_ara_mml_hydrant_idleAwesome3', 1, 1, None, 3, 10)), ('tt_a_ara_ttc_hydrant_idleAwesome3',
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), 1,
('tt_a_ara_tbr_hydrant_idleSneeze2', 1, 1, None, 3, 10), None,
('tt_a_ara_tbr_hydrant_idleAwesome3', 1, 1, None, 3, 10)), 3,
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_hydrant_idle0', 3, 10, None, 0, 0), 10)),
('tt_a_ara_ddl_hydrant_idle1', 1, 1, None, 0, 0), ToontownGlobals.FunnyFarm: (('tt_a_ara_ttc_hydrant_idle0',
('tt_a_ara_ddl_hydrant_idle2', 1, 1, None, 0, 0), 1,
('tt_a_ara_ddl_hydrant_idleAwesome3', 1, 1, None, 0, 0))} 1,
None,
ZoneToIdleIntoFightAnims = { 3,
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_idleIntoFight', 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.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',
ZoneToVictoryAnims = { ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_hydrant_victoryDance',
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',
ZoneToSadAnims = { ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_hydrant_fightSad',
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'),
ZoneToFightAnims = { ToontownGlobals.FunnyFarm: ('tt_a_ara_ttc_hydrant_fightBoost', 'tt_a_ara_ttc_hydrant_fightCheer', 'tt_a_ara_ttc_hydrant_fightIdle'),
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) InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node, ToontownGlobals.HYDRANTS_BUFF_BATTLES)
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(self.node.find('**/dx_left_water')) self.leftWater.reparentTo(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(self.node.find('**/dx_right_water')) self.rightWater.reparentTo(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:
@ -104,15 +245,20 @@ class HydrantInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
self.rightWater.show() self.rightWater.show()
def hasOverrideIval(self, origAnimName): def hasOverrideIval(self, origAnimName):
return ('fightBoost' in origAnimName or 'fightCheer' in origAnimName) and not self.hoodId == ToontownGlobals.TheBrrrgh result = False
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))
anim = self.createAnimIval('fight0' if 'fightBoost' in origAnimName else 'fight1') if 'fightBoost' in origAnimName:
result.append(anim) animKey = 'fight0'
else:
animKey = 'fight1'
animAndSound = self.createAnimAndSoundIval(animKey)
result.append(animAndSound)
result.append(Func(self.hideWater)) result.append(Func(self.hideWater))
return result return result

View file

@ -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, Parallel from direct.interval.IntervalGlobal import Sequence, ActorInterval, Wait, Func, SoundInterval, 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,8 +30,9 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
HpTextGenerator = TextNode('HpTextGenerator') HpTextGenerator = TextNode('HpTextGenerator')
BattleCheerText = '+' BattleCheerText = '+'
def __init__(self, node): def __init__(self, node, holidayId = -1):
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
@ -44,9 +45,11 @@ 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()
@ -55,6 +58,7 @@ 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
@ -110,6 +114,7 @@ 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()
@ -154,14 +159,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
animIval = self.createAnimIval(animKey) animAndSoundIval = self.createAnimAndSoundIval(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(animIval, self.getSpecialIval(origAnimName))) result.append(Parallel(animAndSoundIval, self.getSpecialIval(origAnimName)))
else: else:
result.append(animIval) result.append(animAndSoundIval)
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))
@ -171,7 +176,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.createAnimIval('sad') result = self.createAnimAndSoundIval('sad')
return result return result
def hasSpecialIval(self, origAnimName): def hasSpecialIval(self, origAnimName):
@ -189,17 +194,26 @@ 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:
animIval = self.createAnimIval('victory') animAndSoundIval = self.createAnimAndSoundIval('victory')
result.append(animIval) result.append(animAndSoundIval)
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()
@ -274,6 +288,8 @@ 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())
@ -283,25 +299,28 @@ 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 createIdleAnimInterval(self, whichIdleAnim, startingTime = 0): def createIdleAnimAndSoundInterval(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)
return Parallel(animIval, specialIval) idleAnimAndSound = Parallel(animIval, soundIval, specialIval)
else: else:
return animIval idleAnimAndSound = Parallel(animIval, soundIval)
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
idleAnim = self.createIdleAnimInterval(whichIdleAnim) idleAnimAndSound = self.createIdleAnimAndSoundInterval(whichIdleAnim)
result = Sequence(idleAnim, Wait(self.IdlePauseTime), Func(self.startNextIdleAnim)) result = Sequence(idleAnimAndSound, 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]
@ -314,7 +333,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(idleAnim) result.append(idleAnimAndSound)
if self.getSettleName(whichIdleAnim): if self.getSettleName(whichIdleAnim):
result.append(self.node.actorInterval('settle%d' % whichIdleAnim)) result.append(self.node.actorInterval('settle%d' % whichIdleAnim))
@ -324,24 +343,39 @@ 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)
@ -357,6 +391,7 @@ 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
@ -377,9 +412,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)
anim = self.createIdleAnimInterval(whichIdleAnim, self.lastIdleTime) animAndSound = self.createIdleAnimAndSoundInterval(whichIdleAnim, self.lastIdleTime)
result.append(anim) result.append(animAndSound)
idleIntoFightIval = self.createAnimIval('idleIntoFight') idleIntoFightIval = self.createAnimAndSoundIval('idleIntoFight')
result.append(idleIntoFightIval) result.append(idleIntoFightIval)
result.append(Func(self.gotoBattleCheer)) result.append(Func(self.gotoBattleCheer))
return result return result
@ -437,18 +472,37 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
result = self.ZoneToIdles[self.hoodId][whichIdleAnim] result = self.ZoneToIdles[self.hoodId][whichIdleAnim]
return result return result
def createAnimIval(self, animKey): def createAnimAndSoundIval(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)
return Parallel(animIval, specialIval) idleAnimAndSound = Parallel(animIval, soundIval, specialIval)
if base.config.GetBool('interactive-prop-info', False):
idleAnimAndSound.append(printFunc)
else: else:
return animIval idleAnimAndSound = Parallel(animIval, soundIval)
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

View file

@ -2,92 +2,229 @@ 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')
BattleTrack = ToontownBattleGlobals.THROW_TRACK BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[ToontownBattleGlobals.THROW_TRACK]
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[BattleTrack] ZoneToIdles = {ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_mailbox_idle0',
3,
ZoneToIdles = { 10,
ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_mailbox_idle0', 3, 10, 'tt_a_ara_ttc_mailbox_idle0settle', 3, 10), 'tt_a_ara_ttc_mailbox_idle0settle',
('tt_a_ara_ttc_mailbox_idleTake2', 1, 1, None, 3, 10), 3,
('tt_a_ara_ttc_mailbox_idleLook1', 1, 1, None, 3, 10), 10),
('tt_a_ara_ttc_mailbox_idleAwesome3', 1, 1, None, 3, 10)), ('tt_a_ara_ttc_mailbox_idleTake2',
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), 1,
('tt_a_ara_dod_mailbox_idle1', 1, 1, None, 3, 10), None,
('tt_a_ara_dod_mailbox_idleAwesome3', 1, 1, None, 3, 10)), 3,
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_mailbox_idle0', 3, 10, 'tt_a_ara_dga_mailbox_idle0settle', 3, 10), 10),
('tt_a_ara_dga_mailbox_idleTake1', 1, 1, None, 3, 10), ('tt_a_ara_ttc_mailbox_idleLook1',
('tt_a_ara_dga_mailbox_idleLook2', 1, 1, None, 3, 10), 1,
('tt_a_ara_dga_mailbox_idleAwesome3', 1, 1, None, 3, 10)), 1,
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_mailbox_idle0', 3, 10, 'tt_a_ara_mml_mailbox_idle0settle', 3, 10), None,
('tt_a_ara_mml_mailbox_idleTake1', 1, 1, None, 3, 10), 3,
('tt_a_ara_mml_mailbox_idleLook2', 1, 1, None, 3, 10), 10),
('tt_a_ara_mml_mailbox_idleAwesome3', 1, 1, None, 3, 10)), ('tt_a_ara_ttc_mailbox_idleAwesome3',
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), 1,
('tt_a_ara_tbr_mailbox_idleSpin0', 1, 1, None, 3, 10), None,
('tt_a_ara_tbr_mailbox_idleAwesome3', 1, 1, None, 3, 10)), 3,
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_mailbox_idleSleep0', 3, 10, None, 0, 0), 10)),
('tt_a_ara_ddl_mailbox_idleShake2', 1, 1, None, 0, 0), ToontownGlobals.FunnyFarm: (('tt_a_ara_ttc_mailbox_idle0',
('tt_a_ara_ddl_mailbox_idleSnore1', 1, 1, None, 0, 0), 3,
('tt_a_ara_ddl_mailbox_idleAwesome3', 1, 1, None, 0, 0))} 10,
'tt_a_ara_ttc_mailbox_idle0settle',
ZoneToIdleIntoFightAnims = { 3,
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_idleIntoFight', 10),
('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',
ZoneToVictoryAnims = { ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_mailbox_victoryDance',
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',
ZoneToSadAnims = { ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_mailbox_fightSad',
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'),
ZoneToFightAnims = { ToontownGlobals.FunnyFarm: ('tt_a_ara_ttc_mailbox_fightBoost', 'tt_a_ara_ttc_mailbox_fightCheer', 'tt_a_ara_ttc_mailbox_fightIdle'),
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) InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node, ToontownGlobals.MAILBOXES_BUFF_BATTLES)
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):
return 'fightBoost' in origAnimName result = False
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

View file

@ -1,72 +1,212 @@
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')
BattleTrack = ToontownBattleGlobals.HEAL_TRACK BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[ToontownBattleGlobals.HEAL_TRACK]
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[BattleTrack] ZoneToIdles = {ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_trashcan_idleTake2',
1,
ZoneToIdles = { 1,
ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_trashcan_idleTake2', 1, 1, None, 3, 10), None,
('tt_a_ara_ttc_trashcan_idleHiccup0', 1, 1, None, 3, 10), 3,
('tt_a_ara_ttc_trashcan_idleLook1', 1, 1, None, 3, 10), 10),
('tt_a_ara_ttc_trashcan_idleAwesome3', 1, 1, None, 3, 10)), ('tt_a_ara_ttc_trashcan_idleHiccup0',
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), 1,
('tt_a_ara_dod_trashcan_idle1', 1, 1, None, 3, 10), None,
('tt_a_ara_dod_trashcan_idleAwesome3', 1, 1, None, 3, 10)), 3,
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_trashcan_idleTake2', 1, 1, None, 3, 10), 10),
('tt_a_ara_dga_trashcan_idleHiccup0', 1, 1, None, 3, 10), ('tt_a_ara_ttc_trashcan_idleLook1',
('tt_a_ara_dga_trashcan_idleLook1', 1, 1, None, 3, 10), 1,
('tt_a_ara_dga_trashcan_idleAwesome3', 1, 1, None, 3, 10)), 1,
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_trashcan_idleBounce0', 3, 10, 'tt_a_ara_mml_trashcan_idle0settle', 3, 10), None,
('tt_a_ara_mml_trashcan_idleLook1', 1, 1, None, 3, 10), 3,
('tt_a_ara_mml_trashcan_idleHelicopter2', 1, 1, None, 3, 10), 10),
('tt_a_ara_mml_trashcan_idleAwesome3', 1, 1, None, 3, 10)), ('tt_a_ara_ttc_trashcan_idleAwesome3',
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), 1,
('tt_a_ara_tbr_trashcan_idle0', 1, 1, None, 3, 10), None,
('tt_a_ara_tbr_trashcan_idleAwesome3', 1, 1, None, 3, 10)), 3,
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_trashcan_idleSleep0', 3, 10, None, 0, 0), 10)),
('tt_a_ara_ddl_trashcan_idleShake2', 1, 1, None, 0, 0), ToontownGlobals.FunnyFarm: (('tt_a_ara_ttc_trashcan_idleTake2',
('tt_a_ara_ddl_trashcan_idleSnore1', 1, 1, None, 0, 0), 1,
('tt_a_ara_ddl_trashcan_idleAwesome3', 1, 1, None, 0, 0))} 1,
None,
ZoneToIdleIntoFightAnims = { 3,
ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_idleIntoFight', 10),
('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',
ZoneToVictoryAnims = { ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_trashcan_victoryDance',
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',
ZoneToSadAnims = { ToontownGlobals.FunnyFarm: 'tt_a_ara_ttc_trashcan_fightSad',
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'),
ZoneToFightAnims = { ToontownGlobals.FunnyFarm: ('tt_a_ara_ttc_trashcan_fightBoost', 'tt_a_ara_ttc_trashcan_fightCheer', 'tt_a_ara_ttc_trashcan_fightIdle'),
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', 'tt_a_ara_mml_trashcan_fightCheer0', 'tt_a_ara_mml_trashcan_fightCheer1', 'tt_a_ara_mml_trashcan_fightIdle'), 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'),
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) InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node, ToontownGlobals.TRASHCANS_BUFF_BATTLES)

View file

@ -222,6 +222,22 @@ 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:

View file

@ -60,9 +60,7 @@ 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

View file

@ -1187,7 +1187,10 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
messenger.send('exitTrackFrame', [track]) messenger.send('exitTrackFrame', [track])
def checkPropBonus(self, track): def checkPropBonus(self, track):
return track == self.interactivePropTrackBonus result = False
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():

View file

@ -886,6 +886,9 @@ WINTER_CAROLING = 57
VALENTINES_DAY = 59 VALENTINES_DAY = 59
SILLYMETER_HOLIDAY = 60 SILLYMETER_HOLIDAY = 60
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

View file

@ -17,7 +17,8 @@ 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, ZoneUtil, HydrantInteractiveProp, MailboxInteractiveProp, TrashcanInteractiveProp from toontown.hood import QuietZoneState
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
@ -291,7 +292,6 @@ 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()
@ -313,26 +313,50 @@ 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 xrange(interactivePropNodes.getNumPaths()): for j in xrange(numInteractivePropNodes):
propNode = interactivePropNodes.getPath(j) interactivePropNode = interactivePropNodes.getPath(j)
propName = propNode.getName() className = 'InteractiveAnimatedProp'
if 'hydrant' in interactivePropNode.getName():
if 'hydrant' in propName: className = 'HydrantInteractiveProp'
prop = HydrantInteractiveProp.HydrantInteractiveProp(propNode) elif 'trashcan' in interactivePropNode.getName():
elif 'trashcan' in propName: className = 'TrashcanInteractiveProp'
prop = TrashcanInteractiveProp.TrashcanInteractiveProp(propNode) elif 'mailbox' in interactivePropNode.getName():
elif 'mailbox' in propName: className = 'MailboxInteractiveProp'
prop = MailboxInteractiveProp.MailboxInteractiveProp(propNode) 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: else:
continue self.notify.error('already have interactive prop %s in zone %s' % (self.zoneIdToInteractivePropDict, zoneId))
if i in self.animPropDict: animatedBuildingNodes = i.findAllMatches('**/*:animated_building_*;-h')
self.animPropDict[i].append(prop) for np in animatedBuildingNodes:
else: if np.getName().startswith('sb'):
self.animPropDict[i] = [prop] animatedBuildingNodes.removePath(np)
self.zoneIdToInteractivePropDict[int(i.getName())] = prop numAnimatedBuildingNodes = animatedBuildingNodes.getNumPaths()
for j in xrange(numAnimatedBuildingNodes):
animatedBuildingNode = animatedBuildingNodes.getPath(j)
className = 'GenericAnimatedBuilding'
symbols = {}
base.cr.importModule(symbols, 'toontown.hood', [className])
classObj = getattr(symbols[className], className)
animatedBuildingObj = classObj(animatedBuildingNode)
animPropList = self.animPropDict.get(i)
if animPropList is None:
animPropList = self.animPropDict.setdefault(i, [])
animPropList.append(animatedBuildingObj)
return
def deleteAnimatedProps(self): def deleteAnimatedProps(self):
for zoneNode, animPropList in self.animPropDict.items(): for zoneNode, animPropList in self.animPropDict.items():
@ -350,6 +374,7 @@ 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:
return self.zoneIdToInteractivePropDict[zoneId] result = self.zoneIdToInteractivePropDict[zoneId]
return None return result