This commit is contained in:
Charles 2001-05-23 19:11:51 +00:00
parent 6b081774f6
commit 6334123071
2 changed files with 14 additions and 6 deletions

View file

@ -32,6 +32,7 @@ void CNpcFireballHazard::init()
m_extension = 0; m_extension = 0;
m_velocity = 40; m_velocity = 40;
m_height = 50;
m_respawnRate = 4; m_respawnRate = 4;
} }
@ -51,6 +52,8 @@ void CNpcFireballHazard::setWaypoints( sThingHazard *ThisHazard )
newYPos = (u16) *PntList; newYPos = (u16) *PntList;
PntList++; PntList++;
addWaypoint( newXPos, newYPos );
DVECTOR startPos; DVECTOR startPos;
startPos.vx = newXPos << 4; startPos.vx = newXPos << 4;
startPos.vy = newYPos << 4; startPos.vy = newYPos << 4;
@ -74,6 +77,13 @@ void CNpcFireballHazard::setWaypoints( sThingHazard *ThisHazard )
{ {
addWaypoint( newXPos, newYPos ); addWaypoint( newXPos, newYPos );
} }
s32 minX, maxX, minY, maxY;
m_npcPath.getPathXExtents( &minX, &maxX );
m_width = maxX - minX;
m_npcPath.getPathYExtents( &minY, &maxY );
m_height = maxY - minY;
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -81,10 +91,6 @@ void CNpcFireballHazard::setWaypoints( sThingHazard *ThisHazard )
void CNpcFireballHazard::processMovement( int _frames ) void CNpcFireballHazard::processMovement( int _frames )
{ {
s32 velocity; s32 velocity;
s32 distSourceX;
s32 distSourceY;
m_npcPath.getDistToNextWaypoint( m_base, &distSourceX, &distSourceY );
if ( m_extension < 4096 ) if ( m_extension < 4096 )
{ {
@ -110,8 +116,8 @@ void CNpcFireballHazard::processMovement( int _frames )
return; return;
} }
Pos.vx = m_base.vx + ( ( distSourceX * m_extension ) >> 12 ); Pos.vx = m_base.vx + ( ( m_width * m_extension ) >> 12 );
Pos.vy = m_base.vy - ( 50 * rsin( m_extension >> 1 ) >> 12 ); Pos.vy = m_base.vy - ( m_height * rsin( m_extension >> 1 ) >> 12 );
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -28,6 +28,8 @@ protected:
void processTimer( int _frames ); void processTimer( int _frames );
s32 m_velocity; s32 m_velocity;
s32 m_width;
s32 m_height;
}; };
#endif #endif