Poodletooth-iLand/toontown/hood/HydrantInteractiveProp.py

119 lines
7 KiB
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
from direct.actor import Actor
from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import Sequence, Func
from toontown.hood import InteractiveAnimatedProp
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer
class HydrantInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('HydrantInteractiveProp')
2015-06-21 14:33:39 -05:00
BattleTrack = ToontownBattleGlobals.SQUIRT_TRACK
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[BattleTrack]
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.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.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.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.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.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 16:10:12 -06:00
IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0)
def __init__(self, node):
self.leftWater = None
self.rightWater = None
2015-06-21 14:33:39 -05:00
InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node)
2015-03-03 16:10:12 -06:00
def setupActor(self, node):
InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node)
2015-06-21 14:33:39 -05:00
2015-03-03 16:10:12 -06:00
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-06-21 14:33:39 -05:00
2015-03-03 16:10:12 -06:00
if self.leftWater:
2015-06-21 14:33:39 -05:00
self.leftWater.reparentTo(self.node.find('**/dx_left_water'))
2015-03-03 16:10:12 -06:00
base.leftWater = self.leftWater
self.leftWater.hide()
2015-06-21 14:33:39 -05:00
2015-03-03 16:10:12 -06:00
if self.rightWater:
2015-06-21 14:33:39 -05:00
self.rightWater.reparentTo(self.node.find('**/dx_right_water'))
2015-03-03 16:10:12 -06:00
self.rightWater.hide()
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-06-21 14:33:39 -05:00
return ('fightBoost' in origAnimName or 'fightCheer' in origAnimName) and not self.hoodId == ToontownGlobals.TheBrrrgh
2015-03-03 16:10:12 -06:00
def getOverrideIval(self, origAnimName):
result = Sequence()
2015-06-21 14:33:39 -05:00
if self.hasOverrideIval(origAnimName):
2015-03-03 16:10:12 -06:00
result.append(Func(self.showWater))
2015-06-24 17:00:15 -05:00
animAndSound = self.createAnimAndSoundIval('fight0' if 'fightBoost' in origAnimName else 'fight1')
result.append(animAndSound)
2015-03-03 16:10:12 -06:00
result.append(Func(self.hideWater))
2015-06-21 14:33:39 -05:00
2015-07-05 18:59:25 -05:00
return result