This commit is contained in:
parent
0a4a79ce04
commit
5a96378bc6
1 changed files with 53 additions and 1 deletions
|
@ -27,10 +27,18 @@
|
||||||
#include "player\player.h"
|
#include "player\player.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PROJECTL_PROJECTL_H__
|
||||||
|
#include "projectl\projectl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __UTILS_HEADER__
|
#ifndef __UTILS_HEADER__
|
||||||
#include "utils\utils.h"
|
#include "utils\utils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __SPR_SPRITES_H__
|
||||||
|
#include <sprites.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __ANIM_SHARKMAN_HEADER__
|
#ifndef __ANIM_SHARKMAN_HEADER__
|
||||||
#include <ACTOR_SHARKMAN_ANIM.h>
|
#include <ACTOR_SHARKMAN_ANIM.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,6 +47,9 @@
|
||||||
#define ANIM_SHARKMAN_KICK_SAND ANIM_SHARKMAN_IDLE1_
|
#define ANIM_SHARKMAN_KICK_SAND ANIM_SHARKMAN_IDLE1_
|
||||||
#define ANIM_SHARKMAN_PUSHUPS ANIM_SHARKMAN_IDLE1_
|
#define ANIM_SHARKMAN_PUSHUPS ANIM_SHARKMAN_IDLE1_
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcSharkManEnemy::processMovement( int _frames )
|
void CNpcSharkManEnemy::processMovement( int _frames )
|
||||||
{
|
{
|
||||||
s32 moveX = 0, moveY = 0;
|
s32 moveX = 0, moveY = 0;
|
||||||
|
@ -124,7 +135,48 @@ void CNpcSharkManEnemy::processMovement( int _frames )
|
||||||
processMovementModifier( _frames, moveX, moveY, 0, 0 );
|
processMovementModifier( _frames, moveX, moveY, 0, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcSharkManEnemy::processClose( int _frames )
|
void CNpcSharkManEnemy::processClose( int _frames )
|
||||||
|
{
|
||||||
|
if ( m_animNo != ANIM_SHARKMAN_RUN )
|
||||||
|
{
|
||||||
|
m_animPlaying = true;
|
||||||
|
m_animNo = ANIM_SHARKMAN_RUN;
|
||||||
|
m_frame = 0;
|
||||||
|
}
|
||||||
|
else if ( !m_animPlaying )
|
||||||
|
{
|
||||||
|
// anim finished, fire
|
||||||
|
DVECTOR newPos = Pos;
|
||||||
|
newPos.vy -= 50;
|
||||||
|
|
||||||
|
s32 xDist, yDist;
|
||||||
|
|
||||||
|
CPlayer *player = GameScene.getPlayer();
|
||||||
|
DVECTOR playerPos = player->getPos();
|
||||||
|
|
||||||
|
xDist = playerPos.vx - newPos.vx;
|
||||||
|
yDist = playerPos.vy - newPos.vy;
|
||||||
|
|
||||||
|
s16 heading = ratan2( yDist, xDist ) & 4095;
|
||||||
|
|
||||||
|
CProjectile *projectile;
|
||||||
|
projectile = new( "shark man projectile" ) CProjectile;
|
||||||
|
projectile->init( newPos, heading );
|
||||||
|
projectile->setGraphic( FRM__LIGHTNING2 );
|
||||||
|
|
||||||
|
m_controlFunc = NPC_CONTROL_MOVEMENT;
|
||||||
|
m_timerFunc = NPC_TIMER_ATTACK_DONE;
|
||||||
|
m_timerTimer = GameState::getOneSecondInFrames();
|
||||||
|
m_sensorFunc = NPC_SENSOR_NONE;
|
||||||
|
m_animNo = m_data[m_type].moveAnim;
|
||||||
|
m_animPlaying = true;
|
||||||
|
m_frame = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*void CNpcSharkManEnemy::processClose( int _frames )
|
||||||
{
|
{
|
||||||
s32 moveX = 0, moveY = 0;
|
s32 moveX = 0, moveY = 0;
|
||||||
s32 groundHeight;
|
s32 groundHeight;
|
||||||
|
@ -222,4 +274,4 @@ void CNpcSharkManEnemy::processClose( int _frames )
|
||||||
m_controlFunc = NPC_CONTROL_MOVEMENT;
|
m_controlFunc = NPC_CONTROL_MOVEMENT;
|
||||||
m_animNo = m_data[m_type].moveAnim;
|
m_animNo = m_data[m_type].moveAnim;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue