Poodletooth-iLand/toontown/hood/HydrantInteractiveProp.py

265 lines
13 KiB
Python
Raw Normal View History

2015-03-03 22:10:12 +00:00
from direct.actor import Actor
from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import Sequence, Func
from toontown.hood import InteractiveAnimatedProp
2015-05-18 02:46:24 +00:00
from toontown.hood import GenericAnimatedProp
2015-03-03 22:10:12 +00:00
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer
class HydrantInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('HydrantInteractiveProp')
2015-05-18 02:46:24 +00:00
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[ToontownBattleGlobals.SQUIRT_TRACK]
ZoneToIdles = {ToontownGlobals.ToontownCentral: (('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.FunnyFarm: (('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.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.DaisyGardens: 'tt_a_ara_dga_hydrant_idleIntoFight',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_idleIntoFight',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_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',
ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_victoryDance',
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_victoryDance',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_victoryDance',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_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',
ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_fightSad',
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_fightSad',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_fightSad',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_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'),
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.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.DonaldsDreamland: ('tt_a_ara_ddl_hydrant_fightBoost', 'tt_a_ara_ddl_hydrant_fightCheer', 'tt_a_ara_ddl_hydrant_fightIdle')}
2015-03-03 22:10:12 +00:00
IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0)
def __init__(self, node):
self.leftWater = None
self.rightWater = None
2015-05-18 02:46:24 +00:00
InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node, ToontownGlobals.HYDRANTS_BUFF_BATTLES)
return
2015-03-03 22:10:12 +00:00
def setupActor(self, node):
InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node)
if not self.hoodId == ToontownGlobals.TheBrrrgh:
water = loader.loadModel('phase_5/models/char/tt_m_efx_hydrantSquirt')
self.leftWater = water.find('**/efx_hydrantSquirtLeft')
self.rightWater = water.find('**/efx_hydrantSquirtRight')
2015-05-18 02:46:24 +00:00
dx_left_water = self.node.find('**/dx_left_water')
2015-03-03 22:10:12 +00:00
if self.leftWater:
2015-05-18 02:46:24 +00:00
self.leftWater.reparentTo(dx_left_water)
2015-03-03 22:10:12 +00:00
base.leftWater = self.leftWater
self.leftWater.hide()
2015-05-18 02:46:24 +00:00
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')
2015-03-03 22:10:12 +00:00
if self.rightWater:
2015-05-18 02:46:24 +00:00
self.rightWater.reparentTo(dx_right_water)
2015-03-03 22:10:12 +00:00
self.rightWater.hide()
2015-05-18 02:46:24 +00:00
else:
self.notify.warning('couldnt find %s in rig for hood %d' % ('dx_left_water', self.hoodId))
2015-03-03 22:10:12 +00:00
def hideWater(self):
if self.leftWater:
self.leftWater.hide()
if self.rightWater:
self.rightWater.hide()
def showWater(self):
if self.leftWater:
self.leftWater.show()
if self.rightWater:
self.rightWater.show()
def hasOverrideIval(self, origAnimName):
2015-05-18 02:46:24 +00:00
result = False
if ('fightBoost' in origAnimName or 'fightCheer' in origAnimName) and not self.hoodId == ToontownGlobals.TheBrrrgh:
result = True
return result
2015-03-03 22:10:12 +00:00
def getOverrideIval(self, origAnimName):
result = Sequence()
2015-05-18 02:46:24 +00:00
if ('fightBoost' in origAnimName or 'fightCheer' in origAnimName) and not self.hoodId == ToontownGlobals.TheBrrrgh:
2015-03-03 22:10:12 +00:00
result.append(Func(self.showWater))
2015-05-18 02:46:24 +00:00
if 'fightBoost' in origAnimName:
animKey = 'fight0'
else:
animKey = 'fight1'
animAndSound = self.createAnimAndSoundIval(animKey)
result.append(animAndSound)
2015-03-03 22:10:12 +00:00
result.append(Func(self.hideWater))
2015-05-09 17:27:08 +00:00
return result