Swim run SFX

This commit is contained in:
John 2015-07-01 15:12:45 +03:00
parent b726175902
commit 2b02385e51
3 changed files with 15 additions and 0 deletions

View file

@ -354,6 +354,7 @@ class Estate(Place.Place):
def __setUnderwaterFog(self):
if base.wantFog:
self.fog.setColor(0.245, 0.322, 0.5)
self.fog.setLinearRange(0.1, 100.0)
render.setFog(self.fog)
self.loader.hood.sky.setFog(self.fog)

View file

@ -237,6 +237,7 @@ class ToonHood(Hood):
def setUnderwaterFog(self):
if base.wantFog:
self.fog.setColor(0.245, 0.322, 0.5)
self.fog.setLinearRange(0.1, 100.0)
render.setFog(self.fog)
self.sky.setFog(self.fog)

View file

@ -455,6 +455,8 @@ class Toon(Avatar.Avatar, ToonHead):
self.setTag('pieCode', str(ToontownGlobals.PieCodeToon))
self.setFont(ToontownGlobals.getToonFont())
self.soundChatBubble = base.loadSfx('phase_3/audio/sfx/GUI_balloon_popup.ogg')
self.swimRunSfx = base.loadSfx('phase_4/audio/sfx/AV_footstep_runloop_water.ogg')
self.swimRunLooping = False
self.animFSM = ClassicFSM('Toon', [State('off', self.enterOff, self.exitOff),
State('neutral', self.enterNeutral, self.exitNeutral),
State('victory', self.enterVictory, self.exitVictory),
@ -1377,9 +1379,19 @@ class Toon(Avatar.Avatar, ToonHead):
deltaT = currT - self.lastWakeTime
if action == OTPGlobals.RUN_INDEX and deltaT > ToontownGlobals.WakeRunDelta or deltaT > ToontownGlobals.WakeWalkDelta:
self.getWake().createRipple(wakeWaterHeight, rate=1, startFrame=4)
if not self.swimRunLooping:
base.playSfx(self.swimRunSfx, node=self, looping=1)
self.lastWakeTime = currT
self.swimRunLooping = True
else:
self.stopSwimRunSfx()
return action
def stopSwimRunSfx(self):
if self.swimRunLooping:
self.swimRunSfx.stop()
self.swimRunLooping = False
def enterOff(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
self.setActiveShadow(0)
self.playingAnim = None
@ -1572,6 +1584,7 @@ class Toon(Avatar.Avatar, ToonHead):
Emote.globalEmote.releaseBody(self, 'toon, exitRun')
def enterSwim(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
self.stopSwimRunSfx()
Emote.globalEmote.disableAll(self, 'enterSwim')
self.playingAnim = 'swim'
self.loop('swim')