From 2ef77639d3c0da26c05fa3c40aeca095d50af09c Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 14 May 2001 18:48:54 +0000 Subject: [PATCH] --- source/enemy/nanemone.cpp | 2 +- source/enemy/npc.cpp | 12 +++++++++++- source/platform/pfishhk.cpp | 12 ++++++++++++ source/platform/pfishhk.h | 1 + source/platform/pjellfsh.cpp | 11 ++++++++++- source/platform/pjellfsh.h | 1 + 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/source/enemy/nanemone.cpp b/source/enemy/nanemone.cpp index 019a4d35f..c23dd382b 100644 --- a/source/enemy/nanemone.cpp +++ b/source/enemy/nanemone.cpp @@ -485,7 +485,7 @@ void CNpcAnemone2Enemy::processClose( int _frames ) m_controlFunc = NPC_CONTROL_MOVEMENT; m_timerFunc = NPC_TIMER_ATTACK_DONE; - m_timerTimer = GameState::getOneSecondInFrames(); + m_timerTimer = 4 * GameState::getOneSecondInFrames(); m_sensorFunc = NPC_SENSOR_NONE; } } diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 14a2f86fd..6497921a1 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -1455,7 +1455,17 @@ void CNpcEnemy::processEnemyCollision( CThing *thisThing ) } Pos.vx += otherDelta.vx; - Pos.vy += otherDelta.vy; + + s32 groundHeight = m_layerCollision->getHeightFromGround( Pos.vx, Pos.vy, 16 ); + + if ( groundHeight < 8 ) + { + Pos.vy += groundHeight; + } + else + { + Pos.vy += otherDelta.vy; + } m_heading = headingFromTarget; diff --git a/source/platform/pfishhk.cpp b/source/platform/pfishhk.cpp index 1ff2cb066..3b525117f 100644 --- a/source/platform/pfishhk.cpp +++ b/source/platform/pfishhk.cpp @@ -165,3 +165,15 @@ void CNpcFishHookPlatform::render() } } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +const CRECT *CNpcFishHookPlatform::getThinkBBox() +{ + CRECT objThinkBox = getCollisionArea(); + + sBBox &thinkBBox = CThingManager::getThinkBBox(); + objThinkBox.y2 = thinkBBox.YMin + 1; + + return &objThinkBox; +} \ No newline at end of file diff --git a/source/platform/pfishhk.h b/source/platform/pfishhk.h index 52f097423..b0870bdd4 100644 --- a/source/platform/pfishhk.h +++ b/source/platform/pfishhk.h @@ -23,6 +23,7 @@ class CNpcFishHookPlatform : public CNpcPlatform public: virtual void postInit(); virtual void render(); + virtual CRECT const *getThinkBBox(); protected: virtual void processLifetime( int _frames ); virtual void processMovement( int _frames ); diff --git a/source/platform/pjellfsh.cpp b/source/platform/pjellfsh.cpp index a15b9bd98..d1013f44a 100644 --- a/source/platform/pjellfsh.cpp +++ b/source/platform/pjellfsh.cpp @@ -41,6 +41,7 @@ void CNpcJellyfishPlatform::postInit() m_vertScale = 0; m_dipCount = 0; + m_dipOffset = 0; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -119,16 +120,23 @@ void CNpcJellyfishPlatform::think( int _frames ) { s16 sineVal = ( m_dipCount << 10 ) / GameState::getOneSecondInFrames(); - Pos.vy += ( 3 * rcos( sineVal ) ) >> 12; + m_dipOffset = ( 4 * rcos( sineVal ) ) >> 12; m_dipCount += _frames; } + else + { + m_dipOffset = 0; + } } else { m_dipCount = 0; + m_dipOffset = 0; } + Pos.vy += m_dipOffset; + CNpcLinearPlatform::think( _frames ); } @@ -143,6 +151,7 @@ void CNpcJellyfishPlatform::render() if (canRender()) { DVECTOR &renderPos=getRenderPos(); + //renderPos.vy += m_dipOffset; SVECTOR rotation; rotation.vx = 0; rotation.vy = 0; diff --git a/source/platform/pjellfsh.h b/source/platform/pjellfsh.h index 2473fcd11..f0569a1f3 100644 --- a/source/platform/pjellfsh.h +++ b/source/platform/pjellfsh.h @@ -29,6 +29,7 @@ protected: s32 m_vertScale; u8 m_dipCount; + s32 m_dipOffset; }; #endif \ No newline at end of file