diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 9e4e13b90..5e9480224 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -85,9 +85,9 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] = }, { // NPC_DUST_DEVIL - NPC_INIT_DEFAULT, + NPC_INIT_DUST_DEVIL, NPC_SENSOR_NONE, - NPC_MOVEMENT_FIXED_PATH, + NPC_MOVEMENT_DUST_DEVIL, NPC_MOVEMENT_MODIFIER_NONE, NPC_CLOSE_NONE, NPC_TIMER_NONE, @@ -495,7 +495,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] = void CNpc::init() { - m_type = NPC_FIREBALL; + m_type = NPC_DUST_DEVIL; m_heading = m_fireHeading = 0; m_movementTimer = 0; @@ -669,6 +669,27 @@ void CNpc::init() break; } + case NPC_INIT_DUST_DEVIL: + { + m_npcPath.initPath(); + + DVECTOR newPos; + + newPos.vx = 100; + newPos.vy = 10; + + m_npcPath.addWaypoint( newPos ); + + newPos.vx = 500; + newPos.vy = 10; + + m_npcPath.addWaypoint( newPos ); + + m_npcPath.setPathType( SINGLE_USE_PATH ); + + break; + } + default: break; @@ -1184,6 +1205,13 @@ void CNpc::processMovement(int _frames) break; } + case NPC_MOVEMENT_DUST_DEVIL: + { + processDustDevilMovement( _frames ); + + break; + } + default: break; diff --git a/source/enemy/npc.h b/source/enemy/npc.h index 184cb8fdd..7d511d809 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -94,6 +94,7 @@ protected: NPC_INIT_FISH_HOOK, NPC_INIT_PENDULUM, NPC_INIT_FIREBALL, + NPC_INIT_DUST_DEVIL, }; enum NPC_CONTROL_FUNC @@ -158,6 +159,7 @@ protected: NPC_MOVEMENT_IRON_DOGFISH, NPC_MOVEMENT_PENDULUM, NPC_MOVEMENT_FIREBALL, + NPC_MOVEMENT_DUST_DEVIL, }; enum NPC_MOVEMENT_MODIFIER_FUNC @@ -308,6 +310,7 @@ protected: void processCloseFishHookRise( int _frames ); void processPendulumMovement( int _frames ); void processFireballMovement( int _frames ); + void processDustDevilMovement( int _frames ); // data diff --git a/source/enemy/npcpath.cpp b/source/enemy/npcpath.cpp index 4258ad306..98f17b06e 100644 --- a/source/enemy/npcpath.cpp +++ b/source/enemy/npcpath.cpp @@ -46,7 +46,7 @@ void CNpcPath::initPath() void CNpcPath::resetPath() { - currentWaypoint = NULL; + currentWaypoint = waypoint; } void CNpcPath::addWaypoint( DVECTOR newPos )