diff --git a/data/translations/text.dat b/data/translations/text.dat index 757061d80..8dc2dedb9 100644 --- a/data/translations/text.dat +++ b/data/translations/text.dat @@ -151,8 +151,6 @@ eng=RESTART LEVEL ; The following texts DO NOT require translation ; --------------------------------------------------------------- -[STR__DEBUG__FLY_MODE] -eng=Set FLY mode [STR__DEBUG__BASICUNARMED_MODE] eng=Set BASICUNARMED mode [STR__DEBUG__FULLUNARMED_MODE] @@ -165,6 +163,10 @@ eng=Set BALLOON mode eng=Set NET mode [STR__DEBUG__CORALBLOWER_MODE] eng=Set CORALBLOWER mode +[STR__DEBUG__DEAD_MODE] +eng=Set DEAD mode +[STR__DEBUG__FLY_MODE] +eng=Set FLY mode [STR__DEBUG__LEVEL_SELECT] eng=LEVEL SELECT diff --git a/makefile.gaz b/makefile.gaz index b462ddffc..8f9c2fb25 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -158,6 +158,7 @@ player_src := demoplay \ player \ pmodes \ pmbloon \ + pmdead \ pmfly \ psbutt \ psduck \ diff --git a/source/game/pause.cpp b/source/game/pause.cpp index 8d28522fb..da01c5169 100644 --- a/source/game/pause.cpp +++ b/source/game/pause.cpp @@ -83,41 +83,52 @@ void CPauseMenu::init() m_guiFrame->setOt(OT_POS); m_guiFrame->setFlags(CGUIObject::FLAG_DRAWBORDER); + int xpos=TEXT_SPACING; CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, + (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, STR__PAUSE_MENU__CONTINUE, &m_exitPauseMenuFlag,true); + xpos+=TEXT_SPACING; CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*2,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, + (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, STR__PAUSE_MENU__QUIT, &m_quitGameFlag,true); + xpos+=TEXT_SPACING*2; CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*4,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, - STR__DEBUG__FLY_MODE, - &newmode,PLAYER_MODE_FLY); - CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*5,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, + (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, STR__DEBUG__BASICUNARMED_MODE, &newmode,PLAYER_MODE_BASICUNARMED); - -#ifdef __USER_paul__ + xpos+=TEXT_SPACING; + CGUIFactory::createValueButtonFrame(m_guiFrame, + (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, + STR__DEBUG__FULLUNARMED_MODE, + &newmode,PLAYER_MODE_FULLUNARMED); + xpos+=TEXT_SPACING; // CGUIFactory::createValueButtonFrame(m_guiFrame, -// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*6,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, -// STR__DEBUG__FULLUNARMED_MODE, -// &newmode,PLAYER_MODE_FULLUNARMED); -// CGUIFactory::createValueButtonFrame(m_guiFrame, -// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*7,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, +// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, // STR__DEBUG__NET_MODE, // &newmode,PLAYER_MODE_NET); +// xpos+=TEXT_SPACING; CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*8,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, + (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, STR__DEBUG__BALLOON_MODE, &newmode,PLAYER_MODE_BALLOON); + xpos+=TEXT_SPACING; // 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,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, // STR__DEBUG__CORALBLOWER_MODE, // &newmode,PLAYER_MODE_CORALBLOWER); -#endif +// xpos+=TEXT_SPACING; + CGUIFactory::createValueButtonFrame(m_guiFrame, + (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, + STR__DEBUG__DEAD_MODE, + &newmode,PLAYER_MODE_DEAD); + xpos+=TEXT_SPACING; + CGUIFactory::createValueButtonFrame(m_guiFrame, + (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, + STR__DEBUG__FLY_MODE, + &newmode,PLAYER_MODE_FLY); + xpos+=TEXT_SPACING; m_active=false; } diff --git a/source/player/player.cpp b/source/player/player.cpp index b71ba2660..e73bf6405 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -33,14 +33,22 @@ #include "player\pmodes.h" #endif -#ifndef __PLAYER_PMFLY_H__ -#include "player\pmfly.h" +#ifndef __PLAYER_PMCHOP_H__ +#include "player\pmchop.h" #endif #ifndef __PLAYER_PMBLOON_H__ #include "player\pmbloon.h" #endif +#ifndef __PLAYER_PMDEAD_H__ +#include "player\pmdead.h" +#endif + +#ifndef __PLAYER_PMFLY_H__ +#include "player\pmfly.h" +#endif + // to be removed #include "gfx\tpage.h" @@ -130,7 +138,7 @@ static void writeDemoControls() static const char *s_modeText[NUM_PLAYERMODES]= { "BASICUNARMED", -// "FULLUNARMED", + "FULLUNARMED", "BALLOON", // "NET", // "CORALBLOWER", @@ -163,13 +171,17 @@ int CAMERA_SCROLLSPEED=60; // Speed of the scroll ( 60=1 tile scrolled every CPlayerModeBase PLAYERMODE; +CPlayerModeChop PLAYERMODECHOP; CPlayerModeBalloon PLAYERMODEBALLOON; +CPlayerModeDead PLAYERMODEDEAD; CPlayerModeFly PLAYERMODEFLY; CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]= { &PLAYERMODE, // PLAYER_MODE_BASICUNARMED + &PLAYERMODECHOP, // PLAYER_MODE_FULLUNARMED &PLAYERMODEBALLOON, // PLAYER_MODE_BALLOON + &PLAYERMODEDEAD, // PLAYER_MODE_DEAD &PLAYERMODEFLY, // PLAYER_MODE_FLY }; @@ -634,14 +646,14 @@ void CPlayer::respawn() // setState(STATE_IDLE); // Strip any items that the player might be holding -// if(m_currentMode!=PLAYER_MODE_BASICUNARMED) -// { -// setMode(PLAYER_MODE_FULLUNARMED); -// } -// else -// { + if(m_currentMode!=PLAYER_MODE_BASICUNARMED) + { + setMode(PLAYER_MODE_FULLUNARMED); + } + else + { setMode(PLAYER_MODE_BASICUNARMED); -// } + } s_health=MAX_HEALTH; m_invincibleFrameCount=INVIBCIBLE_FRAMES__START; @@ -704,6 +716,7 @@ void CPlayer::takeDamage(DAMAGE_TYPE _damage) else { CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_DEFEATED_JINGLE); + setMode(PLAYER_MODE_DEAD); // setState(STATE_DEAD); } } diff --git a/source/player/player.h b/source/player/player.h index 725b0a07e..c961ce247 100644 --- a/source/player/player.h +++ b/source/player/player.h @@ -49,7 +49,7 @@ typedef enum { PLAYER_MODE_BASICUNARMED, -// PLAYER_MODE_FULLUNARMED, + PLAYER_MODE_FULLUNARMED, PLAYER_MODE_BALLOON, //PLAYER_MODE_BUBBLE_MIXTURE, //PLAYER_MODE_HELMET, @@ -57,6 +57,8 @@ typedef enum // PLAYER_MODE_CORALBLOWER, //PLAYER_MODE_JELLY_LAUNCHER, + PLAYER_MODE_DEAD, + PLAYER_MODE_FLY, NUM_PLAYERMODES, @@ -163,10 +165,8 @@ public: PLAYERINPUT getPadInputDown() {return m_padInputDown;} class CLayerCollision *getLayerCollision() {return m_layerCollision;} - void takeDamage(DAMAGE_TYPE _damage); -private: void respawn(); diff --git a/source/player/pmbloon.cpp b/source/player/pmbloon.cpp index 307f4a357..ceda0b0aa 100644 --- a/source/player/pmbloon.cpp +++ b/source/player/pmbloon.cpp @@ -54,6 +54,34 @@ static PlayerMetrics s_playerMetrics= } }; +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CPlayerModeBalloon::enter() +{ + CPlayerModeBase::enter(); + m_ballonTimer=BALLOON_TIME; +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CPlayerModeBalloon::think() +{ + CPlayerModeBase::think(); + if(--m_ballonTimer==0) + { + m_player->setMode(PLAYER_MODE_FULLUNARMED); + PAUL_DBGMSG("*pop*"); + } +} + /*---------------------------------------------------------------------- Function: Purpose: @@ -65,6 +93,5 @@ const struct PlayerMetrics *CPlayerModeBalloon::getPlayerMetrics() return &s_playerMetrics; } - /*=========================================================================== end */ diff --git a/source/player/pmbloon.h b/source/player/pmbloon.h index 26b269ba5..7d81de53c 100644 --- a/source/player/pmbloon.h +++ b/source/player/pmbloon.h @@ -37,8 +37,18 @@ class CPlayerModeBalloon : public CPlayerModeBase { public: + virtual void enter(); + virtual void think(); + virtual int canFallForever() {return true;} virtual const struct PlayerMetrics *getPlayerMetrics(); + +private: + enum + { + BALLOON_TIME=10*60, + }; + int m_ballonTimer; }; diff --git a/source/player/pmdead.cpp b/source/player/pmdead.cpp index 6f74e7dde..078b33b42 100644 --- a/source/player/pmdead.cpp +++ b/source/player/pmdead.cpp @@ -17,10 +17,6 @@ #include "player\pmdead.h" -//#ifndef __PLAYER_PLAYER_H__ -//#include "player\player.h" -//#endif - /* Std Lib ------- */ @@ -52,6 +48,7 @@ ---------------------------------------------------------------------- */ void CPlayerModeDead::enter() { + m_deadTime=0; } /*---------------------------------------------------------------------- @@ -62,28 +59,12 @@ void CPlayerModeDead::enter() ---------------------------------------------------------------------- */ void CPlayerModeDead::think() { - DVECTOR pos; - int controlHeld; - - pos=getPlayerPos(); - controlHeld=getPadInputHeld(); - if(controlHeld&PI_LEFT) + m_deadTime++; + if((m_deadTime>DEATH_DELAY&&m_player->getPadInputDown()&PI_ACTION)|| + m_deadTime>DEATH_TIMEOUT) { - pos.vx-=5; + respawn(); } - else if(controlHeld&PI_RIGHT) - { - pos.vx+=5; - } - if(controlHeld&PI_UP) - { - pos.vy-=5; - } - else if(controlHeld&PI_DOWN) - { - pos.vy+=5; - } - setPlayerPos(&pos); } /*=========================================================================== diff --git a/source/player/pmdead.h b/source/player/pmdead.h index bb193b79c..047c533d9 100644 --- a/source/player/pmdead.h +++ b/source/player/pmdead.h @@ -36,6 +36,18 @@ class CPlayerModeDead : public CPlayerMode { +public: + virtual void enter(); + virtual void think(); + +private: + // Player can press ACTION to respawn after death + enum + { + DEATH_DELAY=2*60, // Can't force a respawn for this long + DEATH_TIMEOUT=5*60, // SB respawns automatically after this long + }; + int m_deadTime; }; diff --git a/source/player/pmodes.cpp b/source/player/pmodes.cpp index 67af86801..3b53a8a34 100644 --- a/source/player/pmodes.cpp +++ b/source/player/pmodes.cpp @@ -95,10 +95,6 @@ static CPlayerStateButtBounce stateButtBounce; static CPlayerStateButtBounceFall stateButtBounceFall; static CPlayerStateButtBounceLand stateButtBounceLand; -/* -static CPlayerStateDead stateDead; -*/ - CPlayerState *CPlayerModeBase::s_stateTable[]= { &stateUnarmedIdle, // STATE_IDLE @@ -129,16 +125,6 @@ static PlayerMetrics s_playerMetrics= } }; - - - - - - - - - - /*---------------------------------------------------------------------- Function: Purpose: @@ -150,6 +136,14 @@ int CPlayerMode::getPadInputDown() {return m_player->getPadInputDown();} DVECTOR CPlayerMode::getPlayerPos() {return m_player->getPlayerPos();} void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);} +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CPlayerMode::respawn() {m_player->respawn();} + /*---------------------------------------------------------------------- Function: Purpose: diff --git a/source/player/pmodes.h b/source/player/pmodes.h index 80e6588be..9be57c6cb 100644 --- a/source/player/pmodes.h +++ b/source/player/pmodes.h @@ -88,6 +88,8 @@ protected: DVECTOR getPlayerPos(); void setPlayerPos(DVECTOR *_pos); + void respawn(); + class CPlayer *m_player; }; @@ -135,8 +137,6 @@ public: void jump(); void fall(); -// virtual void respawn(class CPlayer *_player); - private: int m_fallFrames; diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index 1a42acc0d..89f54d3cf 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -828,6 +828,22 @@ SOURCE=..\..\..\source\player\pmbloon.h # End Source File # Begin Source File +SOURCE=..\..\..\source\player\pmchop.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\player\pmchop.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\player\pmdead.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\player\pmdead.h +# End Source File +# Begin Source File + SOURCE=..\..\..\source\player\pmfly.cpp # End Source File # Begin Source File