From 0d2eeed5cb5e8281ebeba3efa5e5ac541c4a02a0 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 25 May 2001 18:48:58 +0000 Subject: [PATCH] --- source/player/pmbloon.cpp | 17 +++++++++++++++++ source/player/pmbloon.h | 9 +++++++++ 2 files changed, 26 insertions(+) diff --git a/source/player/pmbloon.cpp b/source/player/pmbloon.cpp index 6efad0b13..fc9f716cc 100644 --- a/source/player/pmbloon.cpp +++ b/source/player/pmbloon.cpp @@ -75,6 +75,18 @@ static PlayerMetrics s_playerMetrics= } }; +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CPlayerModeBalloon::enter() +{ + CPlayerModeBase::enter(); + m_timer=0; +} + /*---------------------------------------------------------------------- Function: Purpose: @@ -84,6 +96,11 @@ static PlayerMetrics s_playerMetrics= void CPlayerModeBalloon::think() { CPlayerModeBase::think(); + if(++m_timer>BALLOON_TIMEOUT) + { + CSoundMediator::playSfx(CSoundMediator::SFX_BALLOON_POP); + m_player->setMode(PLAYER_MODE_FULLUNARMED); + } } /*---------------------------------------------------------------------- diff --git a/source/player/pmbloon.h b/source/player/pmbloon.h index cfd7d945b..cd1740774 100644 --- a/source/player/pmbloon.h +++ b/source/player/pmbloon.h @@ -37,6 +37,7 @@ class CPlayerModeBalloon : public CPlayerModeBase { public: + virtual void enter(); virtual void think(); virtual void render(DVECTOR *_pos); @@ -45,6 +46,14 @@ public: virtual void setAnimNo(int _animNo); + +private: + enum + { + BALLOON_TIMEOUT=5*60, + }; + int m_timer; + };