This commit is contained in:
Paul 2001-06-21 19:11:35 +00:00
parent a1a8a6b4a4
commit 9ee7f92dc0
4 changed files with 127 additions and 1 deletions

View File

@ -41,6 +41,47 @@
#include "gfx\font.h" #include "gfx\font.h"
#endif #endif
// States
#ifndef __PLAYER__PSBUTT_H__
#include "player\psbutt.h"
#endif
#ifndef __PLAYER__PSLOOK_H__
#include "player\pslook.h"
#endif
#ifndef __PLAYER__PSJUMP_H__
#include "player\psjump.h"
#endif
#ifndef __PLAYER__PSJMPBCK_H__
#include "player\psjmpbck.h"
#endif
#ifndef __PLAYER__PSRUN_H__
#include "player\psrun.h"
#endif
#ifndef __PLAYER__PSFALL_H__
#include "player\psfall.h"
#endif
#ifndef __PLAYER__PSHITGND_H__
#include "player\pshitgnd.h"
#endif
#ifndef __PLAYER__PSIDLE_H__
#include "player\psidle.h"
#endif
#ifndef __PLAYER__PSDUCK_H__
#include "player\psduck.h"
#endif
#ifndef __PLAYER__PSSPRING_H__
#include "player\psspring.h"
#endif
/* Std Lib /* Std Lib
------- */ ------- */
@ -73,6 +114,33 @@
Vars Vars
---- */ ---- */
static CPlayerState *s_stateTable[]=
{
&s_stateNetIdle, // STATE_IDLE
&s_stateTeeterIdle, // STATE_IDLETEETER
&s_stateJump, // STATE_JUMP
&s_stateSpring, // STATE_SPRINGUP
&s_stateRun, // STATE_RUN
&s_stateFall, // STATE_FALL
&s_stateFallFar, // STATE_FALLFAR
&s_stateHitGround, // STATE_HITGROUND
&s_stateButtBounce, // STATE_BUTTBOUNCE
&s_stateButtBounceFall, // STATE_BUTTFALL
&s_stateButtBounceLand, // STATE_BUTTLAND
&s_stateButtBounceUp, // STATE_BUTTBOUNCEUP
&s_stateDuck, // STATE_DUCK
&s_stateSoakUp, // STATE_SOAKUP
&s_stateGetUp, // STATE_GETUP
&s_stateLookDown, // STATE_LOOKDOWN
&s_stateLookDownRelax, // STATE_LOOKDOWNRELAX
&s_stateLookUp, // STATE_LOOKUP
&s_stateLookUpRelax, // STATE_LOOKUPRELAX
&s_stateJumpBack, // STATE_JUMPBACK
NULL, // STATE_CART
NULL, // STATE_FLOAT
};
// Net pulse // Net pulse
int npspeed=150; int npspeed=150;
int npsize=40; int npsize=40;
@ -323,6 +391,17 @@ void CPlayerModeNet::setAnimFrame(int _animFrame)
m_savedAnimFrame=_animFrame; m_savedAnimFrame=_animFrame;
} }
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
CPlayerState **CPlayerModeNet::getStateTable()
{
return s_stateTable;
}
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Function: Function:
Purpose: Purpose:

View File

@ -44,6 +44,9 @@ public:
virtual void setAnimNo(int _animNo); virtual void setAnimNo(int _animNo);
virtual void setAnimFrame(int _animFrame); virtual void setAnimFrame(int _animFrame);
protected:
virtual class CPlayerState **getStateTable();
private: private:
typedef enum typedef enum
{ {

View File

@ -57,6 +57,7 @@
CPlayerStateUnarmedIdle s_stateUnarmedIdle; CPlayerStateUnarmedIdle s_stateUnarmedIdle;
CPlayerStateTeeterIdle s_stateTeeterIdle; CPlayerStateTeeterIdle s_stateTeeterIdle;
CPlayerStateWeaponIdle s_stateWeaponIdle; CPlayerStateWeaponIdle s_stateWeaponIdle;
CPlayerStateNetIdle s_stateNetIdle;
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
@ -265,8 +266,14 @@ static IdleAnims s_unarmedIdleAnims[]=
{ -1, ANIM_SPONGEBOB_IDLEBREATH, -1, 5*60 }, { -1, ANIM_SPONGEBOB_IDLEBREATH, -1, 5*60 },
{ -1, ANIM_SPONGEBOB_IDLEBREATH, -1, 5*60 }, { -1, ANIM_SPONGEBOB_IDLEBREATH, -1, 5*60 },
{ -1, ANIM_SPONGEBOB_IDLEBIGEYE, -1, 1 }, { -1, ANIM_SPONGEBOB_IDLEBIGEYE, -1, 1 },
{ -1, ANIM_SPONGEBOB_IDLEBIGEYE, -1, 1 },
{ -1, ANIM_SPONGEBOB_IDLEFACEUPSIDEDOWN, -1, 1 }, { -1, ANIM_SPONGEBOB_IDLEFACEUPSIDEDOWN, -1, 1 },
{ -1, ANIM_SPONGEBOB_IDLEBANDAID, -1, 1 },
{ -1, ANIM_SPONGEBOB_IDLEEYEPOP, -1, 1 },
{ -1, ANIM_SPONGEBOB_IDLEINHAT, -1, 1 },
{ -1, ANIM_SPONGEBOB_IDLEMATURE, -1, 1 },
{ -1, ANIM_SPONGEBOB_IDLEMOUSTACHE, -1, 1 },
{ -1, ANIM_SPONGEBOB_IDLENOFACE, -1, 1 },
{ -1, ANIM_SPONGEBOB_IDLEZORRO, -1, 1 },
}; };
static int s_numUnarmedIdleAnims=sizeof(s_unarmedIdleAnims)/sizeof(IdleAnims); static int s_numUnarmedIdleAnims=sizeof(s_unarmedIdleAnims)/sizeof(IdleAnims);
IdleAnims *CPlayerStateUnarmedIdle::getIdleAnimsDb(int _animNo) IdleAnims *CPlayerStateUnarmedIdle::getIdleAnimsDb(int _animNo)
@ -306,5 +313,32 @@ int CPlayerStateWeaponIdle::getNumIdleAnims()
} }
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
static IdleAnims s_netIdleAnims[]=
{
// start frame loop frame end frame loop count
{ -1, ANIM_SPONGEBOB_IDLEBREATH, -1, 10*60 }, // default
{ -1, ANIM_SPONGEBOB_IDLEBREATH, -1, 5*60 },
{ -1, ANIM_SPONGEBOB_IDLEBREATH, -1, 5*60 },
{ -1, ANIM_SPONGEBOB_IDLENET, -1, 1 },
{ -1, ANIM_SPONGEBOB_IDLEWEAPON, -1, 1 },
};
static int s_numNetIdleAnims=sizeof(s_netIdleAnims)/sizeof(IdleAnims);
IdleAnims *CPlayerStateNetIdle::getIdleAnimsDb(int _animNo)
{
ASSERT(_animNo<getNumIdleAnims());
return &s_netIdleAnims[_animNo];
}
int CPlayerStateNetIdle::getNumIdleAnims()
{
return s_numNetIdleAnims;
}
/*=========================================================================== /*===========================================================================
end */ end */

View File

@ -103,6 +103,15 @@ private:
}; };
class CPlayerStateNetIdle : public CPlayerStateIdle
{
private:
virtual IdleAnims *getIdleAnimsDb(int _animNo);
virtual int getNumIdleAnims();
};
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Globals Globals
------- */ ------- */
@ -110,6 +119,7 @@ private:
extern CPlayerStateUnarmedIdle s_stateUnarmedIdle; extern CPlayerStateUnarmedIdle s_stateUnarmedIdle;
extern CPlayerStateTeeterIdle s_stateTeeterIdle; extern CPlayerStateTeeterIdle s_stateTeeterIdle;
extern CPlayerStateWeaponIdle s_stateWeaponIdle; extern CPlayerStateWeaponIdle s_stateWeaponIdle;
extern CPlayerStateNetIdle s_stateNetIdle;
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------