From 26e32d4c79f0e0863e2623b28778217a8b653524 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 30 Apr 2001 19:57:49 +0000 Subject: [PATCH] --- source/enemy/npc.cpp | 36 +++--------------------------------- source/enemy/npc.h | 1 - source/enemy/nsdart.h | 1 + source/enemy/nsjfish.h | 1 + 4 files changed, 5 insertions(+), 34 deletions(-) diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 960d6801c..c0792f625 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -592,7 +592,6 @@ void CNpcEnemy::init() m_heading = m_fireHeading = 0; m_movementTimer = 0; m_timerTimer = 0; - m_collisionTimer = 0; m_velocity = 0; m_extension = 0; m_rotation = 0; @@ -643,7 +642,6 @@ void CNpcEnemy::reinit() m_heading = m_fireHeading = 0; m_movementTimer = 0; m_timerTimer = 0; - m_collisionTimer = 0; m_velocity = 0; m_extension = 0; m_rotation = 0; @@ -1239,11 +1237,6 @@ void CNpcEnemy::processCollision() void CNpcEnemy::processTimer(int _frames) { - if ( m_collisionTimer > 0 ) - { - m_collisionTimer -= _frames; - } - if ( m_timerTimer > 0 ) { m_timerTimer -= _frames; @@ -1417,37 +1410,14 @@ void CNpcEnemy::processEnemyCollision( CThing *thisThing ) s16 headingFromTarget = ratan2( yDist, xDist ); - if ( xDist > 0 ) - { - Pos.vx += 6; - } - else - { - Pos.vx -= 6; - } - - if ( yDist > 0 ) - { - Pos.vy += 3; - } - else - { - Pos.vy -= 3; - } - Pos.vx += otherDelta.vx; Pos.vy += otherDelta.vy; - if ( m_collisionTimer <= 0 ) - { - m_collisionTimer = GameState::getOneSecondInFrames(); + m_heading = headingFromTarget; - m_heading = headingFromTarget; + // try next waypoint to get around other enemy - // try next waypoint to get around other enemy - - m_npcPath.incPath(); - } + m_npcPath.incPath(); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/enemy/npc.h b/source/enemy/npc.h index d443290eb..c3dde2c56 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -280,7 +280,6 @@ protected: s32 m_velocity; bool m_evadeClockwise; s32 m_movementTimer; - s32 m_collisionTimer; s32 m_timerTimer; s32 m_extension; bool m_extendDir; diff --git a/source/enemy/nsdart.h b/source/enemy/nsdart.h index 4e8270913..7500a52fc 100644 --- a/source/enemy/nsdart.h +++ b/source/enemy/nsdart.h @@ -19,6 +19,7 @@ class CNpcSquidDartEnemy : public CNpcEnemy public: void render(); virtual int getFrameCount() {return( 4 );} + virtual u8 canCollideWithEnemy() {return( false );} }; #endif diff --git a/source/enemy/nsjfish.h b/source/enemy/nsjfish.h index dc9773e54..5de1f710b 100644 --- a/source/enemy/nsjfish.h +++ b/source/enemy/nsjfish.h @@ -23,6 +23,7 @@ class CNpcSmallJellyfishEnemy : public CNpcEnemy public: void render(); virtual int getFrameCount() {return( 6 );} + virtual u8 canCollideWithEnemy() {return( false );} protected: virtual bool processSensor(); virtual void processClose( int _frames );