diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index d61a0f581..fa9b050ad 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -590,7 +590,6 @@ void CNpcEnemy::init() { m_actorGfx=CActorPool::GetActor((FileEquate)m_data[m_type].skelType); m_spriteBank=0; - } else { @@ -640,8 +639,6 @@ void CNpcEnemy::init() m_isBlowerOn = false; m_speed = m_data[m_type].speed; - setCollisionSize( 100, 100 ); - updateCollisionArea(); } @@ -746,6 +743,13 @@ void CNpcEnemy::processGraphicFlipping() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +s32 CNpcEnemy::getFrameShift( int _frames ) +{ + return( ( _frames << 8 ) >> 1 ); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CNpcEnemy::think(int _frames) { int moveFrames = _frames; @@ -777,7 +781,7 @@ void CNpcEnemy::think(int _frames) frameCount = getFrameCount(); - s32 frameShift = ( moveFrames << 8 ) >> 1; + s32 frameShift = getFrameShift( moveFrames ); if ( ( frameCount << 8 ) - m_frame > frameShift ) { diff --git a/source/enemy/npc.h b/source/enemy/npc.h index edaac16d1..81b09aa7f 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -254,6 +254,7 @@ protected: bool processGroundCollisionReverse( s32 *moveX, s32 *moveY ); virtual void processEnemyCollision( CThing *thisThing ); virtual void processUserCollision( CThing *thisThing ); + virtual s32 getFrameShift( int _frames ); void reinit(); diff --git a/source/enemy/nsdart.cpp b/source/enemy/nsdart.cpp index c7c692ae6..341e81f41 100644 --- a/source/enemy/nsdart.cpp +++ b/source/enemy/nsdart.cpp @@ -91,4 +91,11 @@ void CNpcSquidDartEnemy::fireAsProjectile( s16 heading ) projectile->setGraphic( FRM_SQUIDDART_SWIM0001 ); projectile->setHasRGB( true ); projectile->setRGB( 255, 128, 255 ); -} \ No newline at end of file +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +s32 CNpcSquidDartEnemy::getFrameShift( int _frames ) +{ + return( ( _frames << 8 ) >> 2 ); +} diff --git a/source/enemy/nsdart.h b/source/enemy/nsdart.h index 82e232afd..19c8ef057 100644 --- a/source/enemy/nsdart.h +++ b/source/enemy/nsdart.h @@ -25,6 +25,8 @@ public: virtual int getFrameCount() {return( FRM_SQUIDDART_SWIM0004 - FRM_SQUIDDART_SWIM0001 + 1 );} virtual u8 canCollideWithEnemy() {return( false );} virtual void fireAsProjectile( s16 heading ); +protected: + virtual s32 getFrameShift( int _frames ); }; #endif