This commit is contained in:
Charles 2001-04-09 23:02:20 +00:00
parent 835548766c
commit 308f06a726
2 changed files with 15 additions and 7 deletions

View File

@ -214,13 +214,20 @@ void CNpcEnemy::setStartPos( s32 xPos, s32 yPos )
m_initPos = m_base = Pos;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::setHeading( s32 xPos, s32 yPos )
{
m_heading = ratan2( ( yPos << 4 ) - Pos.vy, ( xPos << 4 ) - Pos.vx );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Static function to initialise the actor pool with levels nasty folk
void CNpcEnemy::CacheActor(int Type)
{
int m_type = mapEditConvertTable[Type - NPC_ENEMY_MAPEDIT_OFFSET];
CActorPool::AddActor(m_data[m_type].skelType);
}
@ -350,7 +357,7 @@ void CNpcEnemy::postInit()
case NPC_INIT_FISH_HOOK:
{
m_heading = m_fireHeading = 3072;
DVECTOR newPos;
newPos.vx = 100;
@ -399,7 +406,7 @@ void CNpcEnemy::postInit()
case NPC_INIT_FISH_FOLK:
{
m_heading = m_fireHeading = 0;
DVECTOR newPos;
newPos.vx = 200;
@ -448,8 +455,8 @@ void CNpcEnemy::postInit()
heading &= 4095;
spikePos = Pos;
spikePos.vx += ( 10 * rcos( heading ) ) >> 12;
spikePos.vy += ( 10 * rsin( heading ) ) >> 12;
spikePos.vx += ( 40 * rcos( heading ) ) >> 12;
spikePos.vy += ( 40 * rsin( heading ) ) >> 12;
projectile = new( "anemone lev2 projectile" ) CProjectile;
projectile->init( spikePos, heading, CProjectile::PROJECTILE_FIXED, CProjectile::PROJECTILE_INFINITE_LIFE );
@ -985,7 +992,7 @@ bool CNpcEnemy::processSensor()
case NPC_SENSOR_SKULL_STOMPER_USER_CLOSE:
{
if ( playerXDistSqr + playerYDistSqr < 40000 )
if ( playerXDistSqr < 10000 && playerYDist >= 0 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
m_extendDir = EXTEND_DOWN;
@ -1644,4 +1651,4 @@ void CNpcEnemy::caughtWithNet()
m_timerFunc = NPC_TIMER_RESPAWN;
m_timerTimer = 4 * GameState::getOneSecondInFrames();
}
}
}

View File

@ -168,6 +168,7 @@ public:
void setType( NPC_UNIT_TYPE newType ) {m_type = newType;}
void setTypeFromMapEdit( u16 newType );
void setHeading( s32 newHeading ) {m_heading = newHeading;}
void setHeading( s32 xPos, s32 yPos );
void addWaypoint( s32 xPos, s32 yPos );
void setPathType( u8 newType ) {m_npcPath.setPathType( newType );}
void setStartPos( s32 xPos, s32 yPos );