This commit is contained in:
Paul 2001-02-27 22:06:24 +00:00
parent 138a2c6577
commit 19dbe081f6
7 changed files with 92 additions and 299 deletions

View file

@ -157,7 +157,6 @@ pickups_src := pickup \
player_src := demoplay \
panimsfx \
player \
pmodes \
psbutt \
pschop \
psdead \
@ -167,7 +166,10 @@ player_src := demoplay \
psidle \
psjump \
psrun \
pstates
pstates \
modelist \
pmodes \
pmboots
script_src := script \
function

View file

@ -25,6 +25,10 @@
#include "utils\mathtab.h"
#endif
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
/* Std Lib
------- */
@ -61,7 +65,7 @@
---------------------------------------------------------------------- */
void CShoesPickup::init()
{
CBasePickup::init();
CBaseRespawningPickup::init();
m_sin=0;
}
@ -73,7 +77,19 @@ void CShoesPickup::init()
---------------------------------------------------------------------- */
void CShoesPickup::collect(class CPlayer *_player)
{
CBasePickup::collect(_player);
CBaseRespawningPickup::collect(_player);
_player->setMode(PLAYER_MODE_SQUEAKYBOOTS);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int CShoesPickup::getRespawnTime()
{
return 60*30;
}
/*----------------------------------------------------------------------

View file

@ -34,7 +34,7 @@
Structure defintions
-------------------- */
class CShoesPickup : public CBasePickup
class CShoesPickup : public CBaseRespawningPickup
{
public:
virtual void init();
@ -42,6 +42,8 @@ public:
virtual void collect(class CPlayer *_player);
protected:
virtual int getRespawnTime();
virtual void thinkPickup(int _frames);
virtual void renderPickup(DVECTOR *_pos);

View file

@ -319,6 +319,8 @@ if(PadGetDown(0)&PAD_CIRCLE)
}
}
}
s_modes[m_currentMode].m_modeControl->think(this);
}
@ -679,6 +681,7 @@ void CPlayer::setMode(PLAYER_MODE _mode)
m_currentMode=_mode;
// Need to do something about this setState() for when the new mode doesn't have that state (pkg)
setState(m_currentState);
s_modes[m_currentMode].m_modeControl->enter(this);
}
@ -1052,7 +1055,10 @@ void CPlayer::takeDamage(DAMAGE_TYPE _damage)
break;
case DAMAGE__ELECTROCUTION:
// if squeaky boots then ouchThatHurt=false;
if(m_currentMode==PLAYER_MODE_SQUEAKYBOOTS)
{
ouchThatHurt=false;
}
break;
}

View file

@ -30,6 +30,10 @@
#include <dstructs.h>
#endif
#ifndef __PLAYER_PMODES_H__
#include "player\pmodes.h"
#endif
#ifndef __PLAYER_PSTATES_H__
#include "player\pstates.h"
#endif
@ -46,6 +50,18 @@
Tyepdefs && Defines
------------------- */
typedef enum
{
PLAYER_MODE_BASICUNARMED,
PLAYER_MODE_FULLUNARMED,
PLAYER_MODE_SQUEAKYBOOTS,
PLAYER_MODE_NET,
PLAYER_MODE_CORALBLOWER,
PLAYER_MODE_FLY,
NUM_PLAYERMODES,
}PLAYER_MODE;
typedef enum
{
STATE_IDLE,
@ -69,18 +85,6 @@ typedef enum
NUM_STATES,
}PLAYER_STATE;
typedef enum
{
PLAYER_MODE_BASICUNARMED,
PLAYER_MODE_FULLUNARMED,
PLAYER_MODE_SQUEAKYBOOTS,
PLAYER_MODE_NET,
PLAYER_MODE_CORALBLOWER,
PLAYER_MODE_FLY,
NUM_PLAYERMODES,
}PLAYER_MODE;
enum
{
FACING_LEFT=+1,
@ -171,7 +175,9 @@ protected:
// State
int setState(PLAYER_STATE _state);
public:
void setMode(PLAYER_MODE _mode);
private:
int getFacing();
void setFacing(int _facing);
int getAnimFrame();
@ -211,6 +217,7 @@ private:
typedef struct
{
PlayerMetrics m_metrics;
class CPlayerMode *m_modeControl;
class CPlayerState *m_states[NUM_STATES];
}PlayerMode;

View file

@ -15,45 +15,6 @@
Includes
-------- */
#include "player\player.h"
#ifndef __PLAYER__PSJUMP_H__
#include "player\psjump.h"
#endif
#ifndef __PLAYER__PSRUN_H__
#include "player\psrun.h"
#endif
#ifndef __PLAYER__PSFALL_H__
#include "player\psfall.h"
#endif
#ifndef __PLAYER__PSIDLE_H__
#include "player\psidle.h"
#endif
#ifndef __PLAYER__PSBUTT_H__
#include "player\psbutt.h"
#endif
#ifndef __PLAYER__PSCHOP_H__
#include "player\pschop.h"
#endif
#ifndef __PLAYER__PSDUCK_H__
#include "player\psduck.h"
#endif
#ifndef __PLAYER__PSDEAD_H__
#include "player\psdead.h"
#endif
#ifndef __PLAYER__PSFLY_H__
#include "player\psfly.h"
#endif
/* Std Lib
------- */
@ -76,234 +37,13 @@
Vars
---- */
CPlayerStateUnarmedIdle stateUnarmedIdle;
CPlayerStateCoralBlowerIdle stateCoralBlowerIdle;
CPlayerStateTeeterIdle stateTeeterIdle;
CPlayerStateJump stateJump;
CPlayerStateRun stateRun;
CPlayerStateFall stateFall;
CPlayerStateFallFar stateFallFar;
CPlayerStateButtBounce stateButtBounce;
CPlayerStateButtBounceFall stateButtBounceFall;
CPlayerStateButtBounceLand stateButtBounceLand;
CPlayerStateChop stateChop;
CPlayerStateRunChop stateRunChop;
CPlayerStateAirChop stateAirChop;
CPlayerStateDuck stateDuck;
CPlayerStateSoakUp stateSoackUp;
CPlayerStateGetUp stateGetup;
CPlayerStateDead stateDead;
CPlayerStateFly stateFly;
CPlayer::PlayerMode CPlayer::s_modes[NUM_PLAYERMODES]=
{
//
// Basic player mode. No attack, only butt bounce
//
{
{ {
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
} },
{
&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
NULL, // STATE_ATTACK
NULL, // STATE_RUNATTACK
NULL, // STATE_AIRATTACK
&stateDuck, // STATE_DUCK
&stateSoackUp, // STATE_SOAKUP
&stateGetup, // STATE_GETUP
&stateDead, // STATE_DEAD
}
},
//
// Full unarmed player mode. With 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
} },
{
&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
}
},
//
// 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
} },
{
&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
}
},
//
// Armed with net
//
{
{ {
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
} },
{
&stateUnarmedIdle, // STATE_IDLE
&stateTeeterIdle, // STATE_IDLETEETER
&stateJump, // STATE_JUMP
&stateRun, // STATE_RUN
&stateFall, // STATE_FALL
&stateFallFar, // STATE_FALLFAR
NULL, // STATE_BUTTBOUNCE
NULL, // STATE_BUTTFALL
NULL, // STATE_BUTTLAND
NULL, // STATE_ATTACK
NULL, // STATE_RUNATTACK
NULL, // STATE_AIRATTACK
NULL, // STATE_DUCK
NULL, // STATE_SOAKUP
NULL, // STATE_GETUP
&stateDead, // STATE_DEAD
}
},
//
// Armed with coral blower ( Heavy weapon so slows SB down )
//
{
{ {
DEFAULT_PLAYER_JUMP_VELOCITY/3, // PM__JUMP_VELOCITY
DEFAULT_PLAYER_MAX_JUMP_FRAMES/2, // PM__MAX_JUMP_FRAMES
DEFAULT_PLAYER_MAX_SAFE_FALL_FRAMES, // PM__MAX_SAFE_FALL_FRAMES
DEFAULT_PLAYER_MAX_RUN_VELOCITY/2, // PM__MAX_RUN_VELOCITY
DEFAULT_PLAYER_RUN_SPEEDUP/2, // PM__RUN_SPEEDUP
DEFAULT_PLAYER_RUN_REVERSESLOWDOWN, // PM__RUN_REVERSESLOWDOWN
DEFAULT_PLAYER_RUN_SLOWDOWN, // PM__RUN_SLOWDOWN
} },
{
&stateCoralBlowerIdle, // STATE_IDLE
&stateTeeterIdle, // STATE_IDLETEETER
&stateJump, // STATE_JUMP
&stateRun, // STATE_RUN
&stateFall, // STATE_FALL
&stateFallFar, // STATE_FALLFAR
NULL, // STATE_BUTTBOUNCE
NULL, // STATE_BUTTFALL
NULL, // STATE_BUTTLAND
NULL, // STATE_ATTACK
NULL, // STATE_RUNATTACK
NULL, // STATE_AIRATTACK
NULL, // STATE_DUCK
NULL, // STATE_SOAKUP
NULL, // STATE_GETUP
&stateDead, // STATE_DEAD
}
},
//
// Fly mode ( A useful debugging mode.. )
//
{
{ {
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
} },
{
&stateFly, // STATE_IDLE
&stateFly, // STATE_IDLETEETER
&stateFly, // STATE_JUMP
&stateFly, // STATE_RUN
&stateFly, // STATE_FALL
&stateFly, // STATE_FALLFAR
&stateFly, // STATE_BUTTBOUNCE
&stateFly, // STATE_BUTTFALL
&stateFly, // STATE_BUTTLAND
&stateFly, // STATE_ATTACK
&stateFly, // STATE_RUNATTACK
&stateFly, // STATE_AIRATTACK
&stateFly, // STATE_DUCK
&stateFly, // STATE_SOAKUP
&stateFly, // STATE_GETUP
&stateFly, // STATE_DEAD
}
},
};
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void a(){}
/*===========================================================================
end */

View file

@ -766,26 +766,17 @@ SOURCE=..\..\..\source\pickups\pspatula.h
# End Group
# Begin Group "player"
# PROP Default_Filter ""
# Begin Group "modes"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\source\player\demoplay.cpp
SOURCE=..\..\..\source\player\modelist.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\demoplay.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\panimsfx.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\player.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\player.h
SOURCE=..\..\..\source\player\pmboots.h
# End Source File
# Begin Source File
@ -793,6 +784,14 @@ SOURCE=..\..\..\source\player\pmodes.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\pmodes.h
# End Source File
# End Group
# Begin Group "states"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\source\player\psbutt.cpp
# End Source File
# Begin Source File
@ -872,6 +871,27 @@ SOURCE=..\..\..\source\player\pstates.cpp
SOURCE=..\..\..\source\player\pstates.h
# End Source File
# End Group
# Begin Source File
SOURCE=..\..\..\source\player\demoplay.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\demoplay.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\panimsfx.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\player.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\player.h
# End Source File
# End Group
# Begin Group "projectl"
# PROP Default_Filter ""