This commit is contained in:
Charles 2001-05-16 18:07:38 +00:00
parent 4662ccefdb
commit fc81449d2e
2 changed files with 67 additions and 1 deletions

View File

@ -177,6 +177,7 @@ void CNpcParasiticWormEnemy::postInit()
}
m_movementTimer = 2 * GameState::getOneSecondInFrames();
m_collTimer = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -360,6 +361,11 @@ void CNpcParasiticWormEnemy::processMovement( int _frames )
oldList->setHeading( heading );
oldList->updateCollisionArea();
}
if ( m_collTimer > 0 )
{
m_collTimer -= _frames;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -627,4 +633,61 @@ int CNpcParasiticWormSegment::checkCollisionAgainst( CThing *_thisThing, int _fr
}
return collided;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcParasiticWormEnemy::processShot( int _frames )
{
if ( !m_segment )
{
m_drawRotation += 64 * _frames;
m_drawRotation &= 4095;
Pos.vy += m_speed * _frames;
if ( m_speed < 5 )
{
m_speed++;
}
DVECTOR offset = CLevel::getCameraPos();
if ( Pos.vy - offset.vy > VidGetScrH() )
{
setToShutdown();
}
}
else
{
if ( m_collTimer <= 0 )
{
// knock segment off end of list
CNpcParasiticWormSegment *segment = m_segment;
CNpcParasiticWormSegment *oldSegment = segment;
while( segment->m_nextSegment )
{
oldSegment = segment;
segment = segment->m_nextSegment;
}
delete segment;
if ( segment == m_segment )
{
m_segment = NULL;
}
else
{
oldSegment->m_nextSegment = NULL;
}
m_collTimer = GameState::getOneSecondInFrames();
}
m_controlFunc = NPC_CONTROL_MOVEMENT;
}
}

View File

@ -56,6 +56,7 @@ protected:
virtual bool processSensor();
virtual void processClose( int _frames );
virtual void processMovement( int _frames );
virtual void processShot( int _frames );
//void resetParasiticWormHeadToTail();
virtual void processEnemyCollision( CThing *thisThing );
@ -66,6 +67,8 @@ protected:
};
CNpcParasiticWormSegment *m_segment;
s32 m_collTimer;
};
#endif