This commit is contained in:
Paul 2001-06-14 21:22:40 +00:00
parent f0b1e4b9a8
commit 59914477b4
5 changed files with 14 additions and 11 deletions

View File

@ -1548,9 +1548,9 @@ void CPlayer::setAnimNo(int _animNo)
Params: Params:
Returns: Returns:
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CPlayer::springPlayerUp() void CPlayer::springPlayerUp(int _springHeight)
{ {
m_currentPlayerModeClass->springPlayerUp(); m_currentPlayerModeClass->springPlayerUp(_springHeight);
} }
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------

View File

@ -246,8 +246,8 @@ public:
int getAnimNo(); int getAnimNo();
void setAnimNo(int _animNo); void setAnimNo(int _animNo);
void springPlayerUp(); // Springy branches void springPlayerUp(int _springHeight=55); // Springy branches
void floatPlayerUp(); // Geysers void floatPlayerUp(); // Geysers
void teleportTo(int _x,int _y); void teleportTo(int _x,int _y);
private: private:

View File

@ -632,7 +632,7 @@ void CPlayerModeBase::jump()
moveVel.vy=-getPlayerMetrics()->m_metric[PM__JUMP_VELOCITY]<<VELOCITY_SHIFT; moveVel.vy=-getPlayerMetrics()->m_metric[PM__JUMP_VELOCITY]<<VELOCITY_SHIFT;
setMoveVelocity(&moveVel); setMoveVelocity(&moveVel);
} }
int spr=2; int spr=5;
void CPlayerModeBase::spring() void CPlayerModeBase::spring()
{ {
DVECTOR moveVel; DVECTOR moveVel;

View File

@ -91,7 +91,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() {;} virtual void springPlayerUp(int _springHeight) {;}
void inSoakUpState(); void inSoakUpState();
virtual int setState(int _state) {return 0;} virtual int setState(int _state) {return 0;}
@ -127,7 +127,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 void springPlayerUp(int _springHeight) {m_springHeight=_springHeight;setState(STATE_SPRINGUP);}
virtual ATTACK_STATE getAttackState(); virtual ATTACK_STATE getAttackState();
@ -173,14 +173,18 @@ public:
void fall(); void fall();
void buttFall(); void buttFall();
int getSpringHeight() {return m_springHeight;}
private: private:
int m_fallFrames; int m_fallFrames;
int m_springHeight;
protected: protected:
virtual class CPlayerState **getStateTable(); virtual class CPlayerState **getStateTable();
private: private:
class CPlayerState *m_currentStateClass; class CPlayerState *m_currentStateClass;
PLAYER_STATE m_currentState; PLAYER_STATE m_currentState;

View File

@ -71,8 +71,7 @@ void CPlayerStateSpring::enter(CPlayerModeBase *_playerMode)
{ {
_playerMode->setAnimNo(ANIM_SPONGEBOB_JUMP); _playerMode->setAnimNo(ANIM_SPONGEBOB_JUMP);
m_springFrames=0; m_springFrames=0;
_playerMode->spring();
_playerMode->jump();
} }
@ -82,7 +81,6 @@ void CPlayerStateSpring::enter(CPlayerModeBase *_playerMode)
Params: Params:
Returns: Returns:
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
int maxplayerspringframes=50;
void CPlayerStateSpring::think(CPlayerModeBase *_playerMode) void CPlayerStateSpring::think(CPlayerModeBase *_playerMode)
{ {
const PlayerMetrics *metrics; const PlayerMetrics *metrics;
@ -94,8 +92,9 @@ void CPlayerStateSpring::think(CPlayerModeBase *_playerMode)
_playerMode->advanceAnimFrameAndCheckForEndOfAnim(); _playerMode->advanceAnimFrameAndCheckForEndOfAnim();
if(m_springFrames<=maxplayerspringframes) if(m_springFrames<=_playerMode->getSpringHeight())
{ {
_playerMode->spring();
m_springFrames++; m_springFrames++;
} }
else else