This commit is contained in:
Charles 2001-05-10 16:47:35 +00:00
parent ef05298c70
commit fbace83cd3
17 changed files with 168 additions and 93 deletions

View file

@ -68,7 +68,7 @@ void CNpcMotherJellyfishBackground::render()
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() )
{
SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),false);
m_actorGfx->RotateScale( SprFrame, renderPos, m_drawRotation, 8192, 8192 );
m_actorGfx->RotateScale( SprFrame, renderPos, 0, 8192, 8192 );
sBBox boundingBox = m_actorGfx->GetBBox();
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );

View file

@ -334,7 +334,7 @@ void CNpcMotherJellyfishEnemy::render()
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() )
{
SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),false);
m_actorGfx->RotateScale( SprFrame, renderPos, m_drawRotation, 8192, 8192 );
m_actorGfx->RotateScale( SprFrame, renderPos, 0, 8192, 8192 );
sBBox boundingBox = m_actorGfx->GetBBox();
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );

View file

@ -612,6 +612,7 @@ void CNpcEnemy::init()
m_reversed = false;
m_salvoCount = 0;
m_isActive = true;
m_isDying = false;
m_health = m_data[this->m_type].initHealth;
@ -663,6 +664,7 @@ void CNpcEnemy::reinit()
m_reversed = false;
m_salvoCount = 0;
m_isActive = true;
m_isDying = false;
m_health = m_data[this->m_type].initHealth;
@ -764,7 +766,7 @@ void CNpcEnemy::think(int _frames)
{
if ( m_isActive )
{
if ( m_animPlaying )
if ( m_animPlaying && !m_isDying )
{
s32 frameCount;
@ -844,7 +846,7 @@ void CNpcEnemy::processAttackCollision()
void CNpcEnemy::collidedWith( CThing *_thisThing )
{
if ( m_isActive && !m_isCaught )
if ( m_isActive && !m_isCaught && !m_isDying )
{
switch(_thisThing->getThingType())
{
@ -1208,6 +1210,9 @@ void CNpcEnemy::processShot( int _frames )
m_frame = 0;
m_state = NPC_GENERIC_HIT_DEATH_END;
m_isDying = true;
m_speed = -5;
if (m_data[m_type].skelType)
{
m_actorGfx->SetOtPos( 0 );
@ -1218,7 +1223,15 @@ void CNpcEnemy::processShot( int _frames )
case NPC_GENERIC_HIT_DEATH_END:
{
Pos.vy += 5 * _frames;
m_drawRotation += 64 * _frames;
m_drawRotation &= 4095;
Pos.vy += m_speed * _frames;
if ( m_speed < 5 )
{
m_speed++;
}
DVECTOR offset = CLevel::getCameraPos();
@ -1387,7 +1400,7 @@ void CNpcEnemy::processEvent( GAME_EVENT evt, CThing *sourceThing )
bool CNpcEnemy::canBeCaughtByNet()
{
return( m_isActive && m_data[m_type].canBeNetted );
return( m_isActive && !m_isDying && m_data[m_type].canBeNetted );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -1414,7 +1427,7 @@ void CNpcEnemy::caughtWithNet()
int CNpcEnemy::canCollide()
{
return( m_isActive );
return( m_isActive && !m_isDying );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -1480,7 +1493,17 @@ void CNpcEnemy::processUserCollision( 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;

View file

@ -299,6 +299,7 @@ protected:
u8 m_isBlowerOn;
DVECTOR m_caughtPos;
s16 m_speed;
u8 m_isDying;
s32 m_frame;
int m_animNo;

View file

@ -27,6 +27,10 @@
#include "system\vid.h"
#endif
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -71,7 +75,23 @@ void CNpcSmallJellyfishBackgroundEnemy::processMovement( int _frames )
if ( directionChange == 0 )
{
m_targetHeading += -1024 + ( getRnd() % 2049 );
CPlayer *player = GameScene.getPlayer();
if ( player->isHoldingNet() )
{
if ( ( getRnd() % 4 ) == 0 )
{
m_targetHeading = ratan2( playerYDist, playerXDist );
}
else
{
m_targetHeading += -1024 + ( getRnd() % 2049 );
}
}
else
{
m_targetHeading += -1024 + ( getRnd() % 2049 );
}
}
}
}
@ -135,7 +155,7 @@ void CNpcSmallJellyfishBackgroundEnemy::processMovement( int _frames )
if ( processGroundCollisionReverse( &moveX, &moveY ) )
{
m_targetHeading += 2048;
m_targetHeading += 1024;
m_targetHeading &= 4095;
}