This commit is contained in:
parent
f0b1e4b9a8
commit
59914477b4
@ -1548,9 +1548,9 @@ void CPlayer::setAnimNo(int _animNo)
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayer::springPlayerUp()
|
||||
void CPlayer::springPlayerUp(int _springHeight)
|
||||
{
|
||||
m_currentPlayerModeClass->springPlayerUp();
|
||||
m_currentPlayerModeClass->springPlayerUp(_springHeight);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -246,8 +246,8 @@ public:
|
||||
int getAnimNo();
|
||||
void setAnimNo(int _animNo);
|
||||
|
||||
void springPlayerUp(); // Springy branches
|
||||
void floatPlayerUp(); // Geysers
|
||||
void springPlayerUp(int _springHeight=55); // Springy branches
|
||||
void floatPlayerUp(); // Geysers
|
||||
void teleportTo(int _x,int _y);
|
||||
|
||||
private:
|
||||
|
@ -632,7 +632,7 @@ void CPlayerModeBase::jump()
|
||||
moveVel.vy=-getPlayerMetrics()->m_metric[PM__JUMP_VELOCITY]<<VELOCITY_SHIFT;
|
||||
setMoveVelocity(&moveVel);
|
||||
}
|
||||
int spr=2;
|
||||
int spr=5;
|
||||
void CPlayerModeBase::spring()
|
||||
{
|
||||
DVECTOR moveVel;
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
virtual void render(DVECTOR *_pos) {;}
|
||||
virtual void renderModeUi() {;} // Ui specific to this mode (eg: ammo)
|
||||
virtual int canDoLookAround() {return false;}
|
||||
virtual void springPlayerUp() {;}
|
||||
virtual void springPlayerUp(int _springHeight) {;}
|
||||
void inSoakUpState();
|
||||
|
||||
virtual int setState(int _state) {return 0;}
|
||||
@ -127,7 +127,7 @@ public:
|
||||
virtual void think();
|
||||
virtual void render() {;}
|
||||
virtual int canDoLookAround();
|
||||
virtual void springPlayerUp() {setState(STATE_SPRINGUP);}
|
||||
virtual void springPlayerUp(int _springHeight) {m_springHeight=_springHeight;setState(STATE_SPRINGUP);}
|
||||
|
||||
virtual ATTACK_STATE getAttackState();
|
||||
|
||||
@ -173,14 +173,18 @@ public:
|
||||
void fall();
|
||||
void buttFall();
|
||||
|
||||
int getSpringHeight() {return m_springHeight;}
|
||||
|
||||
|
||||
private:
|
||||
int m_fallFrames;
|
||||
int m_springHeight;
|
||||
|
||||
|
||||
protected:
|
||||
virtual class CPlayerState **getStateTable();
|
||||
|
||||
|
||||
private:
|
||||
class CPlayerState *m_currentStateClass;
|
||||
PLAYER_STATE m_currentState;
|
||||
|
@ -71,8 +71,7 @@ void CPlayerStateSpring::enter(CPlayerModeBase *_playerMode)
|
||||
{
|
||||
_playerMode->setAnimNo(ANIM_SPONGEBOB_JUMP);
|
||||
m_springFrames=0;
|
||||
|
||||
_playerMode->jump();
|
||||
_playerMode->spring();
|
||||
}
|
||||
|
||||
|
||||
@ -82,7 +81,6 @@ void CPlayerStateSpring::enter(CPlayerModeBase *_playerMode)
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int maxplayerspringframes=50;
|
||||
void CPlayerStateSpring::think(CPlayerModeBase *_playerMode)
|
||||
{
|
||||
const PlayerMetrics *metrics;
|
||||
@ -94,8 +92,9 @@ void CPlayerStateSpring::think(CPlayerModeBase *_playerMode)
|
||||
|
||||
_playerMode->advanceAnimFrameAndCheckForEndOfAnim();
|
||||
|
||||
if(m_springFrames<=maxplayerspringframes)
|
||||
if(m_springFrames<=_playerMode->getSpringHeight())
|
||||
{
|
||||
_playerMode->spring();
|
||||
m_springFrames++;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user