mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 11:42:39 -06:00
Swim run SFX
This commit is contained in:
parent
b726175902
commit
2b02385e51
3 changed files with 15 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue