This commit is contained in:
parent
b4440f97b9
commit
8e3f39f3d9
@ -633,6 +633,16 @@ void CPlayer::addLife()
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
ATTACK_STATE CPlayer::getAttackState()
|
||||
{
|
||||
return m_currentPlayerModeClass->getAttackState();
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
|
@ -121,6 +121,16 @@ typedef enum
|
||||
}PLAYERINPUT;
|
||||
|
||||
|
||||
// For getAttackState()
|
||||
typedef enum
|
||||
{
|
||||
ATTACK_STATE__NONE,
|
||||
ATTACK_STATE__KARATE,
|
||||
ATTACK_STATE__BUTT_BOUNCE,
|
||||
} ATTACK_STATE;
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Structure defintions
|
||||
-------------------- */
|
||||
@ -153,6 +163,8 @@ public:
|
||||
|
||||
void addHealth(int _health);
|
||||
void addLife();
|
||||
ATTACK_STATE getAttackState();
|
||||
int isRecoveringFromHit() {return m_invincibleFrameCount!=0;}
|
||||
|
||||
public:
|
||||
void setMode(PLAYER_MODE _mode);
|
||||
|
@ -120,9 +120,16 @@ void CPlayerModeChop::setAnimFrame(int _animFrame)
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int CPlayerModeChop::isInAttackState()
|
||||
ATTACK_STATE CPlayerModeChop::getAttackState()
|
||||
{
|
||||
return m_chopping||CPlayerModeBase::isInAttackState();
|
||||
if(m_chopping)
|
||||
{
|
||||
return ATTACK_STATE__KARATE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return CPlayerModeBase::getAttackState();
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
virtual void setAnimNo(int _animNo);
|
||||
virtual void setAnimFrame(int _animFrame);
|
||||
|
||||
virtual int isInAttackState();
|
||||
virtual ATTACK_STATE getAttackState();
|
||||
|
||||
private:
|
||||
int canAttackFromThisState();
|
||||
|
@ -193,15 +193,15 @@ void CPlayerModeBase::render()
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int CPlayerModeBase::isInAttackState()
|
||||
ATTACK_STATE CPlayerModeBase::getAttackState()
|
||||
{
|
||||
int ret=false;
|
||||
ATTACK_STATE ret=ATTACK_STATE__NONE;
|
||||
|
||||
switch(getState())
|
||||
{
|
||||
case STATE_BUTTFALL:
|
||||
case STATE_BUTTLAND:
|
||||
ret=true;
|
||||
ret=ATTACK_STATE__BUTT_BOUNCE;
|
||||
break;
|
||||
|
||||
case STATE_IDLE:
|
||||
|
@ -88,7 +88,8 @@ public:
|
||||
int getPadInputHeld();
|
||||
int getPadInputDown();
|
||||
|
||||
virtual int isInAttackState() {return false;}
|
||||
virtual ATTACK_STATE getAttackState() {return ATTACK_STATE__NONE;}
|
||||
|
||||
|
||||
protected:
|
||||
DVECTOR getPlayerPos();
|
||||
@ -113,7 +114,7 @@ public:
|
||||
virtual void think();
|
||||
virtual void render();
|
||||
|
||||
virtual int isInAttackState();
|
||||
virtual ATTACK_STATE getAttackState();
|
||||
|
||||
virtual int canTeeter() {return m_currentState==STATE_IDLE;}
|
||||
virtual int canFallForever() {return m_currentState==STATE_BUTTFALL;}
|
||||
|
Loading…
Reference in New Issue
Block a user