This commit is contained in:
Paul 2001-05-01 18:39:41 +00:00
parent a882d0a177
commit dddd2028f8
13 changed files with 58 additions and 6 deletions

View File

@ -204,7 +204,8 @@ player_src := demoplay \
pshitgnd \ pshitgnd \
psidle \ psidle \
psjump \ psjump \
psrun psrun \
psspring
script_src := script \ script_src := script \
function function

View File

@ -19,6 +19,15 @@
#include "utils\utils.h" #include "utils\utils.h"
#endif #endif
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcBranchPlatform::postInit() void CNpcBranchPlatform::postInit()
@ -77,6 +86,7 @@ void CNpcBranchPlatform::processMovement( int _frames )
if ( ( m_reversed && newAngle < -256 ) || newAngle > 256 ) if ( ( m_reversed && newAngle < -256 ) || newAngle > 256 )
{ {
// flick player upwards // flick player upwards
GameScene.getPlayer()->springPlayerUp();
} }
s16 angularForce = 3 * _frames; s16 angularForce = 3 * _frames;

View File

@ -1084,6 +1084,17 @@ void CPlayer::setAnimNo(int _animNo)
setAnimFrame(0); setAnimFrame(0);
} }
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayer::springPlayerUp()
{
m_currentPlayerModeClass->springPlayerUp();
}
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Function: Function:
Purpose: Purpose:

View File

@ -67,6 +67,7 @@ typedef enum
STATE_IDLE, STATE_IDLE,
STATE_IDLETEETER, STATE_IDLETEETER,
STATE_JUMP, STATE_JUMP,
STATE_SPRINGUP,
STATE_RUN, STATE_RUN,
STATE_FALL, STATE_FALL,
STATE_FALLFAR, STATE_FALLFAR,
@ -195,6 +196,8 @@ public:
int getAnimFrameCount(); int getAnimFrameCount();
int getAnimNo(); int getAnimNo();
void setAnimNo(int _animNo); void setAnimNo(int _animNo);
void springPlayerUp();
private: private:
void playAnimFrameSfx(int _animNo,int _animFrame); void playAnimFrameSfx(int _animNo,int _animFrame);

View File

@ -199,6 +199,7 @@ int CPlayerModeBubbleMixture::canBlowBubbleFromThisState()
ret=true; ret=true;
break; break;
case STATE_SPRINGUP:
case STATE_FALLFAR: case STATE_FALLFAR:
case STATE_BUTTBOUNCE: case STATE_BUTTBOUNCE:
case STATE_BUTTFALL: case STATE_BUTTFALL:

View File

@ -152,6 +152,7 @@ int CPlayerModeChop::canAttackFromThisState()
ret=true; ret=true;
break; break;
case STATE_SPRINGUP:
case STATE_FALLFAR: case STATE_FALLFAR:
case STATE_BUTTBOUNCE: case STATE_BUTTBOUNCE:
case STATE_BUTTFALL: case STATE_BUTTFALL:

View File

@ -46,6 +46,10 @@
#include "player\psduck.h" #include "player\psduck.h"
#endif #endif
#ifndef __PLAYER__PSSPRING_H__
#include "player\psspring.h"
#endif
/* Std Lib /* Std Lib
------- */ ------- */
@ -83,6 +87,7 @@ static CPlayerState *s_stateTable[]=
&s_stateWeaponIdle, // STATE_IDLE &s_stateWeaponIdle, // STATE_IDLE
&s_stateWeaponIdle, // STATE_IDLETEETER &s_stateWeaponIdle, // STATE_IDLETEETER
&s_stateJump, // STATE_JUMP &s_stateJump, // STATE_JUMP
&s_stateSpring, // STATE_SPRINGUP
&s_stateWalk, // STATE_RUN &s_stateWalk, // STATE_RUN
&s_stateFall, // STATE_FALL &s_stateFall, // STATE_FALL
&s_stateFallFar, // STATE_FALLFAR &s_stateFallFar, // STATE_FALLFAR

View File

@ -202,6 +202,7 @@ int CPlayerModeJellyLauncher::setState(int _state)
case STATE_IDLE: case STATE_IDLE:
case STATE_IDLETEETER: case STATE_IDLETEETER:
case STATE_JUMP: case STATE_JUMP:
case STATE_SPRINGUP:
case STATE_RUN: case STATE_RUN:
case STATE_FALLFAR: case STATE_FALLFAR:
case STATE_BUTTBOUNCE: case STATE_BUTTBOUNCE:
@ -243,6 +244,7 @@ int CPlayerModeJellyLauncher::canFireFromThisState()
break; break;
case STATE_JUMP: case STATE_JUMP:
case STATE_SPRINGUP:
case STATE_RUN: case STATE_RUN:
case STATE_FALL: case STATE_FALL:
case STATE_FALLFAR: case STATE_FALLFAR:

View File

@ -275,6 +275,7 @@ int CPlayerModeNet::canSwingNetFromThisState()
ret=true; ret=true;
break; break;
case STATE_SPRINGUP:
case STATE_FALLFAR: case STATE_FALLFAR:
case STATE_BUTTBOUNCE: case STATE_BUTTBOUNCE:
case STATE_BUTTFALL: case STATE_BUTTFALL:

View File

@ -58,6 +58,10 @@
#include "player\psduck.h" #include "player\psduck.h"
#endif #endif
#ifndef __PLAYER__PSSPRING_H__
#include "player\psspring.h"
#endif
/* Std Lib /* Std Lib
------- */ ------- */
@ -91,6 +95,7 @@ static CPlayerState *s_stateTable[]=
&s_stateUnarmedIdle, // STATE_IDLE &s_stateUnarmedIdle, // STATE_IDLE
&s_stateTeeterIdle, // STATE_IDLETEETER &s_stateTeeterIdle, // STATE_IDLETEETER
&s_stateJump, // STATE_JUMP &s_stateJump, // STATE_JUMP
&s_stateSpring, // STATE_SPRINGUP
&s_stateRun, // STATE_RUN &s_stateRun, // STATE_RUN
&s_stateFall, // STATE_FALL &s_stateFall, // STATE_FALL
&s_stateFallFar, // STATE_FALLFAR &s_stateFallFar, // STATE_FALLFAR
@ -196,6 +201,7 @@ int CPlayerModeBase::canDoLookAround()
break; break;
case STATE_JUMP: case STATE_JUMP:
case STATE_SPRINGUP:
case STATE_RUN: case STATE_RUN:
case STATE_FALL: case STATE_FALL:
case STATE_FALLFAR: case STATE_FALLFAR:
@ -231,6 +237,7 @@ ATTACK_STATE CPlayerModeBase::getAttackState()
case STATE_IDLE: case STATE_IDLE:
case STATE_IDLETEETER: case STATE_IDLETEETER:
case STATE_JUMP: case STATE_JUMP:
case STATE_SPRINGUP:
case STATE_RUN: case STATE_RUN:
case STATE_FALL: case STATE_FALL:
case STATE_FALLFAR: case STATE_FALLFAR:
@ -258,7 +265,7 @@ void CPlayerModeBase::thinkVerticalMovement()
} }
else if(m_currentState!=STATE_FALL&&m_currentState!=STATE_FALLFAR&& else if(m_currentState!=STATE_FALL&&m_currentState!=STATE_FALLFAR&&
m_currentState!=STATE_BUTTFALL&&m_currentState!=STATE_BUTTBOUNCE&& m_currentState!=STATE_BUTTFALL&&m_currentState!=STATE_BUTTBOUNCE&&
m_currentState!=STATE_JUMP) m_currentState!=STATE_JUMP&&m_currentState!=STATE_SPRINGUP)
{ {
DVECTOR pos; DVECTOR pos;
pos=m_player->getPlayerPos(); pos=m_player->getPlayerPos();

View File

@ -85,6 +85,7 @@ public:
virtual void render(DVECTOR *_pos) {;} virtual void render(DVECTOR *_pos) {;}
virtual void renderModeUi() {;} // Ui specific to this mode (eg: ammo) virtual void renderModeUi() {;} // Ui specific to this mode (eg: ammo)
virtual int canDoLookAround() {return false;} virtual int canDoLookAround() {return false;}
virtual void springPlayerUp() {;}
int getPadInputHeld(); int getPadInputHeld();
@ -116,6 +117,7 @@ public:
virtual void think(); virtual void think();
virtual void render() {;} virtual void render() {;}
virtual int canDoLookAround(); virtual int canDoLookAround();
virtual void springPlayerUp() {setState(STATE_SPRINGUP);}
virtual ATTACK_STATE getAttackState(); virtual ATTACK_STATE getAttackState();

View File

@ -70,7 +70,7 @@ CPlayerStateSpring s_stateSpring;
void CPlayerStateSpring::enter(CPlayerModeBase *_playerMode) void CPlayerStateSpring::enter(CPlayerModeBase *_playerMode)
{ {
_playerMode->setAnimNo(ANIM_SPONGEBOB_JUMP); _playerMode->setAnimNo(ANIM_SPONGEBOB_JUMP);
m_jumpFrames=0; m_springFrames=0;
_playerMode->jump(); _playerMode->jump();
} }
@ -82,7 +82,7 @@ void CPlayerStateSpring::enter(CPlayerModeBase *_playerMode)
Params: Params:
Returns: Returns:
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
int maxspring=20; int maxplayerspringframes=25;
void CPlayerStateSpring::think(CPlayerModeBase *_playerMode) void CPlayerStateSpring::think(CPlayerModeBase *_playerMode)
{ {
const PlayerMetrics *metrics; const PlayerMetrics *metrics;
@ -94,9 +94,9 @@ void CPlayerStateSpring::think(CPlayerModeBase *_playerMode)
_playerMode->advanceAnimFrameAndCheckForEndOfAnim(); _playerMode->advanceAnimFrameAndCheckForEndOfAnim();
if(m_jumpFrames<=metrics->m_metric[PM__MAX_JUMP_FRAMES]) if(m_springFrames<=maxspring)
{ {
m_jumpFrames++; m_springFrames++;
} }
else else
{ {

View File

@ -1227,6 +1227,14 @@ SOURCE=..\..\..\source\player\psrun.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\player\psspring.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\psspring.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\pstates.h SOURCE=..\..\..\source\player\pstates.h
# End Source File # End Source File
# End Group # End Group