This commit is contained in:
Charles 2001-08-15 14:11:14 +00:00
parent e388c9585a
commit d79fba5228
6 changed files with 26 additions and 3 deletions

View File

@ -45,6 +45,8 @@ void CNpcSpiderCrabEnemy::postInit()
m_velocity = 5;
m_state = SPIDER_CRAB_INIT_JUMP;
m_initDelay = 2 * GameState::getOneSecondInFrames();
}
else
{
@ -63,7 +65,7 @@ bool CNpcSpiderCrabEnemy::processSensor()
default:
{
if ( abs( playerXDist ) < 64 )
if ( abs( playerXDist ) < 64 && m_initDelay <= 0 )
{
// only attack if within path extents
@ -321,6 +323,11 @@ void CNpcSpiderCrabEnemy::processMovement(int _frames)
}
else
{
if ( m_initDelay > 0 )
{
m_initDelay -= _frames;
}
processGenericFixedPathWalk( _frames, &moveX, &moveY );
if ( !m_animPlaying )

View File

@ -34,6 +34,7 @@ protected:
s32 m_attackDist;
int m_jumpDelay;
int m_initDelay;
enum NPC_SPIDER_CRAB_STATE
{

View File

@ -91,6 +91,8 @@ void CProjectile::init()
m_yScale = ONE;
m_shock = false;
updateCollisionArea();
m_highResX = 0;
m_highResY = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -383,8 +385,20 @@ void CProjectile::think(int _frames)
}
else
{
Pos.vx += ( _frames * m_speed * rcos( m_heading ) ) >> 12;
Pos.vy += ( _frames * m_speed * rsin( m_heading ) ) >> 12;
m_highResX += ( _frames * ( m_speed << 8 ) * rcos( m_heading ) ) >> 12;
m_highResY += ( _frames * ( m_speed << 8 ) * rsin( m_heading ) ) >> 12;
if ( abs( m_highResX ) > 256 )
{
Pos.vx += m_highResX >> 8;
m_highResX -= ( m_highResX >> 8 ) << 8;
}
if ( abs( m_highResY ) > 256 )
{
Pos.vy += m_highResY >> 8;
m_highResY -= ( m_highResY >> 8 ) << 8;
}
}
break;

View File

@ -90,6 +90,7 @@ protected:
s16 m_xScale;
s16 m_yScale;
u8 m_shock;
s32 m_highResX, m_highResY;
};
/*****************************************************************************/