This commit is contained in:
Charles 2001-05-14 18:48:54 +00:00
parent 45e993fffa
commit 2ef77639d3
6 changed files with 36 additions and 3 deletions

View File

@ -485,7 +485,7 @@ void CNpcAnemone2Enemy::processClose( int _frames )
m_controlFunc = NPC_CONTROL_MOVEMENT; m_controlFunc = NPC_CONTROL_MOVEMENT;
m_timerFunc = NPC_TIMER_ATTACK_DONE; m_timerFunc = NPC_TIMER_ATTACK_DONE;
m_timerTimer = GameState::getOneSecondInFrames(); m_timerTimer = 4 * GameState::getOneSecondInFrames();
m_sensorFunc = NPC_SENSOR_NONE; m_sensorFunc = NPC_SENSOR_NONE;
} }
} }

View File

@ -1455,7 +1455,17 @@ void CNpcEnemy::processEnemyCollision( CThing *thisThing )
} }
Pos.vx += otherDelta.vx; 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; m_heading = headingFromTarget;

View File

@ -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;
}

View File

@ -23,6 +23,7 @@ class CNpcFishHookPlatform : public CNpcPlatform
public: public:
virtual void postInit(); virtual void postInit();
virtual void render(); virtual void render();
virtual CRECT const *getThinkBBox();
protected: protected:
virtual void processLifetime( int _frames ); virtual void processLifetime( int _frames );
virtual void processMovement( int _frames ); virtual void processMovement( int _frames );

View File

@ -41,6 +41,7 @@ void CNpcJellyfishPlatform::postInit()
m_vertScale = 0; m_vertScale = 0;
m_dipCount = 0; m_dipCount = 0;
m_dipOffset = 0;
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -119,16 +120,23 @@ void CNpcJellyfishPlatform::think( int _frames )
{ {
s16 sineVal = ( m_dipCount << 10 ) / GameState::getOneSecondInFrames(); s16 sineVal = ( m_dipCount << 10 ) / GameState::getOneSecondInFrames();
Pos.vy += ( 3 * rcos( sineVal ) ) >> 12; m_dipOffset = ( 4 * rcos( sineVal ) ) >> 12;
m_dipCount += _frames; m_dipCount += _frames;
} }
else
{
m_dipOffset = 0;
}
} }
else else
{ {
m_dipCount = 0; m_dipCount = 0;
m_dipOffset = 0;
} }
Pos.vy += m_dipOffset;
CNpcLinearPlatform::think( _frames ); CNpcLinearPlatform::think( _frames );
} }
@ -143,6 +151,7 @@ void CNpcJellyfishPlatform::render()
if (canRender()) if (canRender())
{ {
DVECTOR &renderPos=getRenderPos(); DVECTOR &renderPos=getRenderPos();
//renderPos.vy += m_dipOffset;
SVECTOR rotation; SVECTOR rotation;
rotation.vx = 0; rotation.vx = 0;
rotation.vy = 0; rotation.vy = 0;

View File

@ -29,6 +29,7 @@ protected:
s32 m_vertScale; s32 m_vertScale;
u8 m_dipCount; u8 m_dipCount;
s32 m_dipOffset;
}; };
#endif #endif