This commit is contained in:
Charles 2001-06-28 19:31:56 +00:00
parent 2668b7ca7a
commit fc84e1f409
3 changed files with 14 additions and 3 deletions

View file

@ -49,7 +49,7 @@ void CNpcEnemyGenerator::think(int _frames)
CNpcEnemy *enemy;
enemy=CNpcEnemy::Create( CNpcEnemy::NPC_SPIDER_CRAB );
enemy->setStartPos( ( Pos.vx - 8 ) >> 4, ( Pos.vy - 16 ) >> 4 );
enemy->setStartPosHighRes( Pos.vx, Pos.vy - 8 );
u16 *waypointPtr = m_npcPath.getWaypointPtr();

View file

@ -568,6 +568,16 @@ void CNpcEnemy::setStartPos( s32 xPos, s32 yPos )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::setStartPosHighRes( s32 xPos, s32 yPos )
{
Pos.vx = xPos;
Pos.vy = yPos;
m_initPos = m_base = Pos;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::setHeading( s32 xPos, s32 yPos )
{
m_heading = ( ratan2( ( ( yPos << 4 ) + 16 ) - Pos.vy, ( ( xPos << 4 ) + 8 ) - Pos.vx ) ) & 4095;
@ -1587,7 +1597,7 @@ bool CNpcEnemy::processCoralBlowerMovement( int _frames, s32 xDist, s32 yDist, u
{
s32 moveX, moveY;
s16 headingToTarget;
headingToTarget = ratan2( yDist, xDist );
s32 preShiftX = _frames * 3 * rcos( headingToTarget );
@ -1774,4 +1784,4 @@ void CNpcEnemy::processCoralBlower( int _frames )
}
m_isBlowerOn = false;
}
}

View file

@ -110,6 +110,7 @@ public:
void setWaypointCount( u8 newCount ) {m_npcPath.setWaypointCount( newCount );}
void setPathType( u8 newType ) {m_npcPath.setPathType( newType );}
void setStartPos( s32 xPos, s32 yPos );
void setStartPosHighRes( s32 xPos, s32 yPos );
virtual u8 hasBeenAttacked();
virtual void hasBeenSteamed( DVECTOR &steamPos ) {hasBeenAttacked();}
virtual u8 canBeCaughtByNet();