From 9d0aef7b89e7820a0e0837194bdf71dc983948a4 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 30 Jan 2001 20:30:52 +0000 Subject: [PATCH] --- source/enemy/npc.cpp | 43 +++++++++++++++++++++++++++++++++++++++- source/enemy/npc.h | 4 ++++ source/enemy/npcpath.cpp | 2 ++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 5bdc42e12..b406d98dd 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -108,6 +108,18 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] = 2048, }, + { // NPC_FIREBALL + NPC_INIT_FIREBALL, + NPC_SENSOR_NONE, + NPC_MOVEMENT_FIREBALL, + NPC_MOVEMENT_MODIFIER_NONE, + NPC_CLOSE_NONE, + NPC_TIMER_NONE, + false, + 3, + 2048, + }, + { // NPC_SMALL_JELLYFISH_1 NPC_INIT_DEFAULT, NPC_SENSOR_JELLYFISH_USER_CLOSE, @@ -483,7 +495,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] = void CNpc::init() { - m_type = NPC_FISH_HOOK; + m_type = NPC_FIREBALL; m_heading = m_fireHeading = 0; m_movementTimer = 0; @@ -638,6 +650,28 @@ void CNpc::init() break; } + case NPC_INIT_FIREBALL: + { + m_npcPath.initPath(); + + DVECTOR newPos; + + newPos.vx = 200; + newPos.vy = 100; + + m_npcPath.addWaypoint( newPos ); + + m_npcPath.setPathType( SINGLE_USE_PATH ); + + m_extension = newPos.vx - Pos.vx; + + m_velocity = m_data[m_type].speed; + + m_timerTimer = GameState::getOneSecondInFrames() * 4; + + break; + } + default: break; @@ -1146,6 +1180,13 @@ void CNpc::processMovement(int _frames) break; } + case NPC_MOVEMENT_FIREBALL: + { + processFireballMovement( _frames ); + + break; + } + default: break; diff --git a/source/enemy/npc.h b/source/enemy/npc.h index a18e9aa05..184cb8fdd 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -34,6 +34,7 @@ public: NPC_FISH_HOOK, NPC_DUST_DEVIL, NPC_PENDULUM, + NPC_FIREBALL, NPC_SMALL_JELLYFISH_1, NPC_SMALL_JELLYFISH_2, NPC_LARGE_JELLYFISH, @@ -92,6 +93,7 @@ protected: NPC_INIT_FALLING_ITEM, NPC_INIT_FISH_HOOK, NPC_INIT_PENDULUM, + NPC_INIT_FIREBALL, }; enum NPC_CONTROL_FUNC @@ -155,6 +157,7 @@ protected: NPC_MOVEMENT_FLYING_DUTCHMAN, NPC_MOVEMENT_IRON_DOGFISH, NPC_MOVEMENT_PENDULUM, + NPC_MOVEMENT_FIREBALL, }; enum NPC_MOVEMENT_MODIFIER_FUNC @@ -304,6 +307,7 @@ protected: void processCloseFallingItemFall( int _frames ); void processCloseFishHookRise( int _frames ); void processPendulumMovement( int _frames ); + void processFireballMovement( int _frames ); // data diff --git a/source/enemy/npcpath.cpp b/source/enemy/npcpath.cpp index 342bb7d2f..4258ad306 100644 --- a/source/enemy/npcpath.cpp +++ b/source/enemy/npcpath.cpp @@ -84,6 +84,8 @@ void CNpcPath::addWaypoint( DVECTOR newPos ) this->waypoint = newWaypoint; waypointCount++; + + currentWaypoint = this->waypoint; } }