diff --git a/makefile.gaz b/makefile.gaz index ce58879f7..d975f0fea 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -167,8 +167,7 @@ player_src := demoplay \ psrun \ pstates \ modelist \ - pmballoon \ - pmboots + pmballoon script_src := script \ function diff --git a/source/game/pause.cpp b/source/game/pause.cpp index 692f4d4d1..0eef1ef7c 100644 --- a/source/game/pause.cpp +++ b/source/game/pause.cpp @@ -107,18 +107,14 @@ void CPauseMenu::init() &newmode,PLAYER_MODE_FULLUNARMED); CGUIFactory::createValueButtonFrame(m_guiFrame, (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*7,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, - STR__DEBUG__SQUEAKYBOOTS_MODE, - &newmode,PLAYER_MODE_SQUEAKYBOOTS); - CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*8,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, STR__DEBUG__NET_MODE, &newmode,PLAYER_MODE_NET); CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*9,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, + (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*8,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, STR__DEBUG__BALLOON_MODE, &newmode,PLAYER_MODE_BALLOON); CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*10,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, + (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*9,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, STR__DEBUG__CORALBLOWER_MODE, &newmode,PLAYER_MODE_CORALBLOWER); #endif diff --git a/source/pickups/pglasses.cpp b/source/pickups/pglasses.cpp index 3c926d4c7..1625561cb 100644 --- a/source/pickups/pglasses.cpp +++ b/source/pickups/pglasses.cpp @@ -21,6 +21,10 @@ #include "pickups\pglasses.h" +#ifndef __PLAYER_PLAYER_H__ +#include "player\player.h" +#endif + /* Std Lib ------- */ @@ -70,6 +74,7 @@ void CGlassesPickup::init() ---------------------------------------------------------------------- */ void CGlassesPickup::collect(class CPlayer *_player) { + _player->giveGlasses(); CBasePickup::collect(_player); } diff --git a/source/pickups/pshoes.cpp b/source/pickups/pshoes.cpp index dcb691aa7..06b1c4812 100644 --- a/source/pickups/pshoes.cpp +++ b/source/pickups/pshoes.cpp @@ -77,7 +77,7 @@ void CShoesPickup::init() ---------------------------------------------------------------------- */ void CShoesPickup::collect(class CPlayer *_player) { - _player->setMode(PLAYER_MODE_SQUEAKYBOOTS); + _player->giveSqueakyBoots(); CBaseRespawningPickup::collect(_player); } diff --git a/source/player/modelist.cpp b/source/player/modelist.cpp index 0d8987190..aab5ef5c2 100644 --- a/source/player/modelist.cpp +++ b/source/player/modelist.cpp @@ -22,10 +22,6 @@ #include "player/pmodes.h" #endif -#ifndef __PLAYER_PMBOOTS_H__ -#include "player/pmboots.h" -#endif - #ifndef __PLAYER_PMBALLOON_H__ #include "player/pmballoon.h" #endif @@ -95,7 +91,6 @@ ---- */ CPlayerMode modeEmpty; -CPlayerModeBoots modeBoots; CPlayerModeBalloon modeBalloon; CPlayerStateUnarmedIdle stateUnarmedIdle; @@ -198,41 +193,6 @@ CPlayer::PlayerMode CPlayer::s_modes[NUM_PLAYERMODES]= } }, - // - // PLAYER_MODE_SQUEAKYBOOTS - // Squeaky boots. Also has butt bounce and karate chop - // - { - { { - DEFAULT_PLAYER_JUMP_VELOCITY, // PM__JUMP_VELOCITY - DEFAULT_PLAYER_MAX_JUMP_FRAMES, // PM__MAX_JUMP_FRAMES - DEFAULT_PLAYER_MAX_SAFE_FALL_FRAMES, // PM__MAX_SAFE_FALL_FRAMES - DEFAULT_PLAYER_MAX_RUN_VELOCITY, // PM__MAX_RUN_VELOCITY - DEFAULT_PLAYER_RUN_SPEEDUP, // PM__RUN_SPEEDUP - DEFAULT_PLAYER_RUN_REVERSESLOWDOWN, // PM__RUN_REVERSESLOWDOWN - DEFAULT_PLAYER_RUN_SLOWDOWN, // PM__RUN_SLOWDOWN - } }, - &modeBoots, - { - &stateUnarmedIdle, // STATE_IDLE - &stateTeeterIdle, // STATE_IDLETEETER - &stateJump, // STATE_JUMP - &stateRun, // STATE_RUN - &stateFall, // STATE_FALL - &stateFallFar, // STATE_FALLFAR - &stateButtBounce, // STATE_BUTTBOUNCE - &stateButtBounceFall, // STATE_BUTTFALL - &stateButtBounceLand, // STATE_BUTTLAND - &stateChop, // STATE_ATTACK - &stateRunChop, // STATE_RUNATTACK - &stateAirChop, // STATE_AIRATTACK - &stateDuck, // STATE_DUCK - &stateSoackUp, // STATE_SOAKUP - &stateGetup, // STATE_GETUP - &stateDead, // STATE_DEAD - } - }, - // // PLAYER_MODE_BALLOON // Holding a balloon diff --git a/source/player/player.cpp b/source/player/player.cpp index 88accae02..18d9f8f52 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -71,6 +71,23 @@ // Two dice. One says 'Re' on every face, the other says 'boot', // 'install', 'try', 'tire', 'sume' and 'number' +/* +WEAPON MODES + unamred constant + karate-chop constant + balloon timed ( respawn ) + bubble mixture (un)limited supply ( respawn ) + helmet constant ( respawn ) + coral blower constant ( respawn ) + net constant + jelly launcher limited supply ( respawn ) + +POWER-UPS + glasses constant + squeaky boots timed ( respawn ) + mm & bb ring timed +*/ + /*---------------------------------------------------------------------- Function Prototypes ------------------- */ @@ -134,7 +151,6 @@ static const char *s_modeText[NUM_PLAYERMODES]= { "BASICUNARMED", "FULLUNARMED", - "SQUEAKYBOOTS", "BALLOON", "NET", "CORALBLOWER", @@ -163,7 +179,6 @@ int CAMERA_STOPMOVETHRESHOLD=10; // If SB moves slower than this then the camer int CAMERA_SCROLLSPEED=60; // Speed of the scroll ( 60=1 tile scrolled every 4 and a bit frames ) -int angg=900; @@ -216,6 +231,8 @@ m_skel.setAng(512); setCollisionSize(25,50); setCollisionCentreOffset(0,-25); + + m_skel.setAng(900); } /*---------------------------------------------------------------------- @@ -248,7 +265,6 @@ void CPlayer::think(int _frames) CPlayerThing::think(_frames); -m_skel.setAng(angg); if(PadGetHeld(0)&PAD_L1&&PadGetHeld(0)&PAD_L2) { @@ -268,6 +284,23 @@ if(newmode!=-1) thinkVerticalMovement(); thinkHorizontalMovement(); + // Powerups + if(m_squeakyBootsTimer) + { + m_squeakyBootsTimer--; + } + if(m_invinvibilityRingTimer) + { + m_invinvibilityRingTimer--; + } + + // Flashing.. + if(m_invincibleFrameCount) + { + m_invincibleFrameCount--; + } + + #ifdef _STATE_DEBUG_ sprintf(posBuf,"%03d (%02d) ,%03d (%02d) = dfg:%+02d",Pos.vx,Pos.vx&0x0f,Pos.vy,Pos.vy&0x0f,m_layerCollision->getHeightFromGround(Pos.vx,Pos.vy)); #endif @@ -278,12 +311,6 @@ else if(Pos.vx>m_mapEdge.vx-64)Pos.vx=m_mapEdge.vx-64; if(Pos.vy<64)Pos.vy=64; else if(Pos.vy>m_mapEdge.vy-64)Pos.vy=m_mapEdge.vy-64; - // Flashing.. - if(m_invincibleFrameCount) - { - m_invincibleFrameCount--; - } - // Teeter if on an edge if(m_currentState==STATE_IDLE&&isOnEdge()) { @@ -815,13 +842,14 @@ void CPlayer::setAnimFrame(int _animFrame) if(m_animFrame==frameSfx->m_frame) { CSoundMediator::SFXID sfxId=frameSfx->m_sfxId; - if(m_currentMode==PLAYER_MODE_SQUEAKYBOOTS) + if(m_squeakyBootsTimer) { // Ugh.. horrible way to change the sfx when wearing squeaky boots (pkg) if(sfxId==CSoundMediator::SFX_SPONGEBOB_WALK_1)sfxId=CSoundMediator::SFX_SPONGEBOB_SQUEAKY_SHOES_1; else if(sfxId==CSoundMediator::SFX_SPONGEBOB_WALK_2)sfxId=CSoundMediator::SFX_SPONGEBOB_SQUEAKY_SHOES_2; } CSoundMediator::playSfx(sfxId); + break; } if(m_animFramem_frame) { @@ -1122,8 +1150,8 @@ int invincibleSponge=false; // NB: This is for debugging purposes only so don't #endif void CPlayer::takeDamage(DAMAGE_TYPE _damage) { - // Don't take damage if still recovering from the last hit - if(!m_invincibleFrameCount) + if(!m_invincibleFrameCount|| // Don't take damage if still recovering from the last hit + m_invinvibilityRingTimer) // Or if we have the invincibility ring on { int ouchThatHurt=true; @@ -1136,7 +1164,7 @@ void CPlayer::takeDamage(DAMAGE_TYPE _damage) break; case DAMAGE__ELECTROCUTION: - if(m_currentMode==PLAYER_MODE_SQUEAKYBOOTS) + if(m_squeakyBootsTimer) { ouchThatHurt=false; } diff --git a/source/player/player.h b/source/player/player.h index 2ed422499..c14069037 100644 --- a/source/player/player.h +++ b/source/player/player.h @@ -54,10 +54,13 @@ typedef enum { PLAYER_MODE_BASICUNARMED, PLAYER_MODE_FULLUNARMED, - PLAYER_MODE_SQUEAKYBOOTS, PLAYER_MODE_BALLOON, + //PLAYER_MODE_BUBBLE_MIXTURE, + //PLAYER_MODE_HELMET, PLAYER_MODE_NET, PLAYER_MODE_CORALBLOWER, + //PLAYER_MODE_JELLY_LAUNCHER, + PLAYER_MODE_FLY, NUM_PLAYERMODES, @@ -266,7 +269,7 @@ private: LOOKAROUND_MAXSCROLL=60, // Maximum distance to scroll LOOKAROUND_RESETSPEED=6, // Speed of scroll back when look around ended }; - int m_invincibleFrameCount; + int m_invincibleFrameCount; // Initial invincibility and also invincibility after taking damage void thinkVerticalMovement(); void thinkHorizontalMovement(); @@ -295,6 +298,23 @@ private: DVECTOR m_mapEdge; DVECTOR m_respawnPos; + + + // Powerups +private: + enum + { + SQUEAKY_BOOTS_TIME=60*10, + INVINCIBILITY_RING_TIME=60*10, + }; +public: + void giveGlasses() {m_glassesFlag=true;} + void giveSqueakyBoots() {m_squeakyBootsTimer=SQUEAKY_BOOTS_TIME;} + void giveInvinvibilityRing() {m_invinvibilityRingTimer=INVINCIBILITY_RING_TIME;} +private: + int m_glassesFlag; + int m_squeakyBootsTimer; + int m_invinvibilityRingTimer; }; diff --git a/source/player/pmboots.cpp b/source/player/pmboots.cpp deleted file mode 100644 index bf0322a25..000000000 --- a/source/player/pmboots.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/*========================================================================= - - pmboots.cpp - - Author: PKG - Created: - Project: Spongebob - Purpose: - - Copyright (c) 2001 Climax Development Ltd - -===========================================================================*/ - -/*---------------------------------------------------------------------- - Includes - -------- */ - -#include "player/pmboots.h" - -#ifndef __PLAYER_PLAYER_H__ -#include "player/player.h" -#endif - - -/* Std Lib - ------- */ - -/* Data - ---- */ - -/*---------------------------------------------------------------------- - Tyepdefs && Defines - ------------------- */ - -/*---------------------------------------------------------------------- - Structure defintions - -------------------- */ - -/*---------------------------------------------------------------------- - Function Prototypes - ------------------- */ - -/*---------------------------------------------------------------------- - Vars - ---- */ - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -int boottime=60*20; -void CPlayerModeBoots::enter(class CPlayer *_player) -{ - m_timer=boottime; -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBoots::think(class CPlayer *_player) -{ - if(--m_timer==0) - { - _player->setMode(PLAYER_MODE_FULLUNARMED); - } -} - -/*=========================================================================== -end */ diff --git a/source/player/pmboots.h b/source/player/pmboots.h deleted file mode 100644 index 09fddadd0..000000000 --- a/source/player/pmboots.h +++ /dev/null @@ -1,64 +0,0 @@ -/*========================================================================= - - pmboots.h - - Author: PKG - Created: - Project: Spongebob - Purpose: - - Copyright (c) 2001 Climax Development Ltd - -===========================================================================*/ - -#ifndef __PLAYER_PMBOOTS_H__ -#define __PLAYER_PMBOOTS_H__ - -/*---------------------------------------------------------------------- - Includes - -------- */ - -#ifndef __PLAYER_PMODES_H__ -#include "player/pmodes.h" -#endif - - -/* Std Lib - ------- */ - -/*---------------------------------------------------------------------- - Tyepdefs && Defines - ------------------- */ - -/*---------------------------------------------------------------------- - Structure defintions - -------------------- */ - -class CPlayerModeBoots : public CPlayerMode -{ -public: - virtual void enter(class CPlayer *_player); - virtual void think(class CPlayer *_player); - -private: - int m_timer; -}; - - -/*---------------------------------------------------------------------- - Globals - ------- */ - -/*---------------------------------------------------------------------- - Functions - --------- */ - -/*---------------------------------------------------------------------- */ - -#endif /* __PLAYER_PMBOOTS_H__ */ - -/*=========================================================================== - end */ - - - diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index ddd7d071a..d91e2a38f 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -768,14 +768,6 @@ SOURCE=..\..\..\source\player\pmballoon.h # End Source File # Begin Source File -SOURCE=..\..\..\source\player\pmboots.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\source\player\pmboots.h -# End Source File -# Begin Source File - SOURCE=..\..\..\source\player\pmodes.h # End Source File # End Group