This commit is contained in:
parent
d3d5d831dc
commit
fdf83f928a
4 changed files with 99 additions and 3 deletions
|
@ -23,11 +23,96 @@
|
|||
#include "player\player.h"
|
||||
#endif
|
||||
|
||||
#ifndef __UTILS_HEADER__
|
||||
#include "utils\utils.h"
|
||||
#endif
|
||||
|
||||
#ifndef __ANIM_SHARKMAN_HEADER__
|
||||
#include <ACTOR_SHARKMAN_ANIM.h>
|
||||
#endif
|
||||
|
||||
|
||||
void CNpcEnemy::processSharkManMovement( int _frames, s32 *moveX, s32 *moveY )
|
||||
{
|
||||
if ( m_movementTimer > 0 )
|
||||
{
|
||||
m_movementTimer -= _frames;
|
||||
|
||||
if ( m_animNo == m_data[m_type].moveAnim )
|
||||
{
|
||||
processGenericFixedPathWalk( _frames, moveX, moveY );
|
||||
}
|
||||
|
||||
if ( !m_animPlaying )
|
||||
{
|
||||
m_animPlaying = true;
|
||||
m_frame = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// change anim
|
||||
|
||||
if ( m_animNo == m_data[m_type].moveAnim )
|
||||
{
|
||||
u8 newAction = getRnd() % 5;
|
||||
|
||||
switch( newAction )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_movementTimer = GameState::getOneSecondInFrames() * 3;
|
||||
m_animNo = ANIM_SHARKMAN_IDLE1_;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
m_movementTimer = GameState::getOneSecondInFrames() * 8;
|
||||
m_animNo = m_data[m_type].moveAnim;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
m_movementTimer = GameState::getOneSecondInFrames() * 1;
|
||||
m_animNo = ANIM_SHARKMAN_IDLE2_;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 3:
|
||||
{
|
||||
m_movementTimer = GameState::getOneSecondInFrames() >> 1;
|
||||
m_animNo = ANIM_SHARKMAN_KICK_SAND;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 4:
|
||||
{
|
||||
m_movementTimer = GameState::getOneSecondInFrames() * 3;
|
||||
m_animNo = ANIM_SHARKMAN_PUSHUPS;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// return to move anim
|
||||
|
||||
m_movementTimer = GameState::getOneSecondInFrames() * 8;
|
||||
m_animNo = m_data[m_type].moveAnim;
|
||||
}
|
||||
|
||||
m_animPlaying = true;
|
||||
m_frame = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void CNpcEnemy::processCloseSharkManAttack( int _frames )
|
||||
{
|
||||
s32 moveX = 0, moveY = 0;
|
||||
|
@ -95,6 +180,7 @@ void CNpcEnemy::processCloseSharkManAttack( int _frames )
|
|||
m_timerFunc = NPC_TIMER_ATTACK_DONE;
|
||||
m_timerTimer = GameState::getOneSecondInFrames();
|
||||
m_sensorFunc = NPC_SENSOR_NONE;
|
||||
m_animNo = m_data[m_type].moveAnim;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -123,5 +209,6 @@ void CNpcEnemy::processCloseSharkManAttack( int _frames )
|
|||
else
|
||||
{
|
||||
m_controlFunc = NPC_CONTROL_MOVEMENT;
|
||||
m_animNo = m_data[m_type].moveAnim;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue