This commit is contained in:
parent
080f7bbb17
commit
69c516ecbf
3 changed files with 32 additions and 6 deletions
|
@ -23,6 +23,10 @@
|
|||
#include "player\player.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PROJECTL_PROJECTL_H__
|
||||
#include "projectl\projectl.h"
|
||||
#endif
|
||||
|
||||
|
||||
void CNpc::processCloseGhostPirateAttack( int _frames )
|
||||
{
|
||||
|
@ -47,7 +51,26 @@ void CNpc::processCloseGhostPirateAttack( int _frames )
|
|||
{
|
||||
m_extendDir = EXTEND_DOWN;
|
||||
|
||||
// fire too
|
||||
// fire
|
||||
|
||||
s16 heading;
|
||||
|
||||
CPlayer *player = GameScene.getPlayer();
|
||||
DVECTOR playerPos = player->getPos();
|
||||
|
||||
if ( playerPos.vx > Pos.vx )
|
||||
{
|
||||
heading = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
heading = 2048;
|
||||
}
|
||||
|
||||
CProjectile *projectile;
|
||||
|
||||
projectile = new( "test projectile" ) CProjectile;
|
||||
projectile->init( Pos, heading );
|
||||
}
|
||||
}
|
||||
else if ( m_extendDir == EXTEND_DOWN )
|
||||
|
|
|
@ -332,7 +332,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
},
|
||||
|
||||
{ // NPC_GHOST_PIRATE
|
||||
NPC_INIT_DEFAULT,
|
||||
NPC_INIT_GHOST_PIRATE,
|
||||
NPC_SENSOR_GHOST_PIRATE_USER_CLOSE,
|
||||
NPC_MOVEMENT_STATIC,
|
||||
NPC_MOVEMENT_MODIFIER_NONE,
|
||||
|
@ -383,7 +383,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
|
||||
void CNpc::init()
|
||||
{
|
||||
m_type = NPC_ANEMONE_1;
|
||||
m_type = NPC_GHOST_PIRATE;
|
||||
|
||||
m_heading = m_fireHeading = 0;
|
||||
m_movementTimer = 0;
|
||||
|
@ -397,11 +397,11 @@ void CNpc::init()
|
|||
m_timerFunc = m_data[this->m_type].timerFunc;
|
||||
m_sensorFunc = m_data[this->m_type].sensorFunc;
|
||||
|
||||
m_controlFunc = NPC_CONTROL_MOVEMENT;
|
||||
|
||||
switch ( m_data[this->m_type].initFunc )
|
||||
{
|
||||
case NPC_INIT_DEFAULT:
|
||||
m_controlFunc = NPC_CONTROL_MOVEMENT;
|
||||
|
||||
m_npcPath.initPath();
|
||||
|
||||
DVECTOR newPos;
|
||||
|
@ -430,8 +430,10 @@ void CNpc::init()
|
|||
|
||||
break;
|
||||
|
||||
case NPC_INIT_GHOST_PIRATE:
|
||||
m_heading = m_fireHeading = 3072;
|
||||
|
||||
default:
|
||||
m_controlFunc = NPC_CONTROL_MOVEMENT;
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -75,6 +75,7 @@ protected:
|
|||
NPC_INIT_DEFAULT = 0,
|
||||
NPC_INIT_SNAKE = 1,
|
||||
NPC_INIT_ACID,
|
||||
NPC_INIT_GHOST_PIRATE,
|
||||
};
|
||||
|
||||
enum NPC_CONTROL_FUNC
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue