This commit is contained in:
Paul 2001-03-25 21:33:20 +00:00
parent d26f36461e
commit 293ce2cc9a
12 changed files with 140 additions and 73 deletions

View File

@ -151,8 +151,6 @@ eng=RESTART LEVEL
; The following texts DO NOT require translation ; The following texts DO NOT require translation
; --------------------------------------------------------------- ; ---------------------------------------------------------------
[STR__DEBUG__FLY_MODE]
eng=Set FLY mode
[STR__DEBUG__BASICUNARMED_MODE] [STR__DEBUG__BASICUNARMED_MODE]
eng=Set BASICUNARMED mode eng=Set BASICUNARMED mode
[STR__DEBUG__FULLUNARMED_MODE] [STR__DEBUG__FULLUNARMED_MODE]
@ -165,6 +163,10 @@ eng=Set BALLOON mode
eng=Set NET mode eng=Set NET mode
[STR__DEBUG__CORALBLOWER_MODE] [STR__DEBUG__CORALBLOWER_MODE]
eng=Set 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] [STR__DEBUG__LEVEL_SELECT]
eng=LEVEL SELECT eng=LEVEL SELECT

View File

@ -158,6 +158,7 @@ player_src := demoplay \
player \ player \
pmodes \ pmodes \
pmbloon \ pmbloon \
pmdead \
pmfly \ pmfly \
psbutt \ psbutt \
psduck \ psduck \

View File

@ -83,41 +83,52 @@ void CPauseMenu::init()
m_guiFrame->setOt(OT_POS); m_guiFrame->setOt(OT_POS);
m_guiFrame->setFlags(CGUIObject::FLAG_DRAWBORDER); m_guiFrame->setFlags(CGUIObject::FLAG_DRAWBORDER);
int xpos=TEXT_SPACING;
CGUIFactory::createValueButtonFrame(m_guiFrame, 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, STR__PAUSE_MENU__CONTINUE,
&m_exitPauseMenuFlag,true); &m_exitPauseMenuFlag,true);
xpos+=TEXT_SPACING;
CGUIFactory::createValueButtonFrame(m_guiFrame, 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, STR__PAUSE_MENU__QUIT,
&m_quitGameFlag,true); &m_quitGameFlag,true);
xpos+=TEXT_SPACING*2;
CGUIFactory::createValueButtonFrame(m_guiFrame, CGUIFactory::createValueButtonFrame(m_guiFrame,
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*4,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,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,
STR__DEBUG__BASICUNARMED_MODE, STR__DEBUG__BASICUNARMED_MODE,
&newmode,PLAYER_MODE_BASICUNARMED); &newmode,PLAYER_MODE_BASICUNARMED);
xpos+=TEXT_SPACING;
#ifdef __USER_paul__ 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, // CGUIFactory::createValueButtonFrame(m_guiFrame,
// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*6,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, // (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,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,
// STR__DEBUG__NET_MODE, // STR__DEBUG__NET_MODE,
// &newmode,PLAYER_MODE_NET); // &newmode,PLAYER_MODE_NET);
// xpos+=TEXT_SPACING;
CGUIFactory::createValueButtonFrame(m_guiFrame, 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, STR__DEBUG__BALLOON_MODE,
&newmode,PLAYER_MODE_BALLOON); &newmode,PLAYER_MODE_BALLOON);
xpos+=TEXT_SPACING;
// CGUIFactory::createValueButtonFrame(m_guiFrame, // 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, // STR__DEBUG__CORALBLOWER_MODE,
// &newmode,PLAYER_MODE_CORALBLOWER); // &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; m_active=false;
} }

View File

@ -33,14 +33,22 @@
#include "player\pmodes.h" #include "player\pmodes.h"
#endif #endif
#ifndef __PLAYER_PMFLY_H__ #ifndef __PLAYER_PMCHOP_H__
#include "player\pmfly.h" #include "player\pmchop.h"
#endif #endif
#ifndef __PLAYER_PMBLOON_H__ #ifndef __PLAYER_PMBLOON_H__
#include "player\pmbloon.h" #include "player\pmbloon.h"
#endif #endif
#ifndef __PLAYER_PMDEAD_H__
#include "player\pmdead.h"
#endif
#ifndef __PLAYER_PMFLY_H__
#include "player\pmfly.h"
#endif
// to be removed // to be removed
#include "gfx\tpage.h" #include "gfx\tpage.h"
@ -130,7 +138,7 @@ static void writeDemoControls()
static const char *s_modeText[NUM_PLAYERMODES]= static const char *s_modeText[NUM_PLAYERMODES]=
{ {
"BASICUNARMED", "BASICUNARMED",
// "FULLUNARMED", "FULLUNARMED",
"BALLOON", "BALLOON",
// "NET", // "NET",
// "CORALBLOWER", // "CORALBLOWER",
@ -163,13 +171,17 @@ int CAMERA_SCROLLSPEED=60; // Speed of the scroll ( 60=1 tile scrolled every
CPlayerModeBase PLAYERMODE; CPlayerModeBase PLAYERMODE;
CPlayerModeChop PLAYERMODECHOP;
CPlayerModeBalloon PLAYERMODEBALLOON; CPlayerModeBalloon PLAYERMODEBALLOON;
CPlayerModeDead PLAYERMODEDEAD;
CPlayerModeFly PLAYERMODEFLY; CPlayerModeFly PLAYERMODEFLY;
CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]= CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]=
{ {
&PLAYERMODE, // PLAYER_MODE_BASICUNARMED &PLAYERMODE, // PLAYER_MODE_BASICUNARMED
&PLAYERMODECHOP, // PLAYER_MODE_FULLUNARMED
&PLAYERMODEBALLOON, // PLAYER_MODE_BALLOON &PLAYERMODEBALLOON, // PLAYER_MODE_BALLOON
&PLAYERMODEDEAD, // PLAYER_MODE_DEAD
&PLAYERMODEFLY, // PLAYER_MODE_FLY &PLAYERMODEFLY, // PLAYER_MODE_FLY
}; };
@ -634,14 +646,14 @@ void CPlayer::respawn()
// setState(STATE_IDLE); // setState(STATE_IDLE);
// Strip any items that the player might be holding // Strip any items that the player might be holding
// if(m_currentMode!=PLAYER_MODE_BASICUNARMED) if(m_currentMode!=PLAYER_MODE_BASICUNARMED)
// { {
// setMode(PLAYER_MODE_FULLUNARMED); setMode(PLAYER_MODE_FULLUNARMED);
// } }
// else else
// { {
setMode(PLAYER_MODE_BASICUNARMED); setMode(PLAYER_MODE_BASICUNARMED);
// } }
s_health=MAX_HEALTH; s_health=MAX_HEALTH;
m_invincibleFrameCount=INVIBCIBLE_FRAMES__START; m_invincibleFrameCount=INVIBCIBLE_FRAMES__START;
@ -704,6 +716,7 @@ void CPlayer::takeDamage(DAMAGE_TYPE _damage)
else else
{ {
CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_DEFEATED_JINGLE); CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_DEFEATED_JINGLE);
setMode(PLAYER_MODE_DEAD);
// setState(STATE_DEAD); // setState(STATE_DEAD);
} }
} }

View File

@ -49,7 +49,7 @@
typedef enum typedef enum
{ {
PLAYER_MODE_BASICUNARMED, PLAYER_MODE_BASICUNARMED,
// PLAYER_MODE_FULLUNARMED, PLAYER_MODE_FULLUNARMED,
PLAYER_MODE_BALLOON, PLAYER_MODE_BALLOON,
//PLAYER_MODE_BUBBLE_MIXTURE, //PLAYER_MODE_BUBBLE_MIXTURE,
//PLAYER_MODE_HELMET, //PLAYER_MODE_HELMET,
@ -57,6 +57,8 @@ typedef enum
// PLAYER_MODE_CORALBLOWER, // PLAYER_MODE_CORALBLOWER,
//PLAYER_MODE_JELLY_LAUNCHER, //PLAYER_MODE_JELLY_LAUNCHER,
PLAYER_MODE_DEAD,
PLAYER_MODE_FLY, PLAYER_MODE_FLY,
NUM_PLAYERMODES, NUM_PLAYERMODES,
@ -163,10 +165,8 @@ public:
PLAYERINPUT getPadInputDown() {return m_padInputDown;} PLAYERINPUT getPadInputDown() {return m_padInputDown;}
class CLayerCollision *getLayerCollision() {return m_layerCollision;} class CLayerCollision *getLayerCollision() {return m_layerCollision;}
void takeDamage(DAMAGE_TYPE _damage); void takeDamage(DAMAGE_TYPE _damage);
private:
void respawn(); void respawn();

View File

@ -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: Function:
Purpose: Purpose:
@ -65,6 +93,5 @@ const struct PlayerMetrics *CPlayerModeBalloon::getPlayerMetrics()
return &s_playerMetrics; return &s_playerMetrics;
} }
/*=========================================================================== /*===========================================================================
end */ end */

View File

@ -37,8 +37,18 @@
class CPlayerModeBalloon : public CPlayerModeBase class CPlayerModeBalloon : public CPlayerModeBase
{ {
public: public:
virtual void enter();
virtual void think();
virtual int canFallForever() {return true;} virtual int canFallForever() {return true;}
virtual const struct PlayerMetrics *getPlayerMetrics(); virtual const struct PlayerMetrics *getPlayerMetrics();
private:
enum
{
BALLOON_TIME=10*60,
};
int m_ballonTimer;
}; };

View File

@ -17,10 +17,6 @@
#include "player\pmdead.h" #include "player\pmdead.h"
//#ifndef __PLAYER_PLAYER_H__
//#include "player\player.h"
//#endif
/* Std Lib /* Std Lib
------- */ ------- */
@ -52,6 +48,7 @@
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CPlayerModeDead::enter() void CPlayerModeDead::enter()
{ {
m_deadTime=0;
} }
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
@ -62,28 +59,12 @@ void CPlayerModeDead::enter()
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CPlayerModeDead::think() void CPlayerModeDead::think()
{ {
DVECTOR pos; m_deadTime++;
int controlHeld; if((m_deadTime>DEATH_DELAY&&m_player->getPadInputDown()&PI_ACTION)||
m_deadTime>DEATH_TIMEOUT)
pos=getPlayerPos();
controlHeld=getPadInputHeld();
if(controlHeld&PI_LEFT)
{ {
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);
} }
/*=========================================================================== /*===========================================================================

View File

@ -36,6 +36,18 @@
class CPlayerModeDead : public CPlayerMode 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;
}; };

View File

@ -95,10 +95,6 @@ static CPlayerStateButtBounce stateButtBounce;
static CPlayerStateButtBounceFall stateButtBounceFall; static CPlayerStateButtBounceFall stateButtBounceFall;
static CPlayerStateButtBounceLand stateButtBounceLand; static CPlayerStateButtBounceLand stateButtBounceLand;
/*
static CPlayerStateDead stateDead;
*/
CPlayerState *CPlayerModeBase::s_stateTable[]= CPlayerState *CPlayerModeBase::s_stateTable[]=
{ {
&stateUnarmedIdle, // STATE_IDLE &stateUnarmedIdle, // STATE_IDLE
@ -129,16 +125,6 @@ static PlayerMetrics s_playerMetrics=
} }; } };
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Function: Function:
Purpose: Purpose:
@ -150,6 +136,14 @@ int CPlayerMode::getPadInputDown() {return m_player->getPadInputDown();}
DVECTOR CPlayerMode::getPlayerPos() {return m_player->getPlayerPos();} DVECTOR CPlayerMode::getPlayerPos() {return m_player->getPlayerPos();}
void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);} void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerMode::respawn() {m_player->respawn();}
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Function: Function:
Purpose: Purpose:

View File

@ -88,6 +88,8 @@ protected:
DVECTOR getPlayerPos(); DVECTOR getPlayerPos();
void setPlayerPos(DVECTOR *_pos); void setPlayerPos(DVECTOR *_pos);
void respawn();
class CPlayer *m_player; class CPlayer *m_player;
}; };
@ -135,8 +137,6 @@ public:
void jump(); void jump();
void fall(); void fall();
// virtual void respawn(class CPlayer *_player);
private: private:
int m_fallFrames; int m_fallFrames;

View File

@ -828,6 +828,22 @@ SOURCE=..\..\..\source\player\pmbloon.h
# End Source File # End Source File
# Begin 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 SOURCE=..\..\..\source\player\pmfly.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File