This commit is contained in:
Paul 2001-06-25 14:37:59 +00:00
parent 282ea41822
commit 4816984baf
2 changed files with 20 additions and 4 deletions

View File

@ -92,9 +92,18 @@ void CPlayerModeChop::think()
{ {
int facing; int facing;
facing=getFacing(); facing=getFacing();
m_chopping=false; // Oops.. if(m_chopFrame==CHOP_ATTACK_START_FRAME)
setPlayerCollisionSize(chopcsx*facing,chopcsy,chopcsw,chopcsh); {
m_chopping=true; // Oops.. m_chopping=false; // Oops..
setPlayerCollisionSize(chopcsx*facing,chopcsy,chopcsw,chopcsh);
m_chopping=true; // Oops..
}
else if(m_chopFrame==CHOP_ATTACK_END_FRAME+1)
{
m_chopping=false; // Oops..
setPlayerCollisionSize(m_savedCSX,m_savedCSY,m_savedCSW,m_savedCSH);
m_chopping=true; // Oops..
}
m_player->setAnimNo(ANIM_SPONGEBOB_KARATE); m_player->setAnimNo(ANIM_SPONGEBOB_KARATE);
m_player->setAnimFrame(m_chopFrame); m_player->setAnimFrame(m_chopFrame);
@ -135,7 +144,7 @@ void CPlayerModeChop::setAnimFrame(int _animFrame)
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
ATTACK_STATE CPlayerModeChop::getAttackState() ATTACK_STATE CPlayerModeChop::getAttackState()
{ {
if(m_chopping) if(m_chopping&&m_chopFrame>=CHOP_ATTACK_START_FRAME&&m_chopFrame<=CHOP_ATTACK_END_FRAME)
{ {
return ATTACK_STATE__KARATE; return ATTACK_STATE__KARATE;
} }

View File

@ -48,6 +48,13 @@ public:
virtual void setPlayerCollisionSize(int _x,int _y,int _w,int _h); virtual void setPlayerCollisionSize(int _x,int _y,int _w,int _h);
private: private:
enum
{
CHOP_ATTACK_START_FRAME=15,
CHOP_ATTACK_END_FRAME=21,
};
int canAttackFromThisState(); int canAttackFromThisState();
int m_savedAnimNo,m_savedAnimFrame; int m_savedAnimNo,m_savedAnimFrame;