This commit is contained in:
Charles 2001-02-06 21:25:25 +00:00
parent 4b980a9213
commit d238e6ac10
3 changed files with 34 additions and 1 deletions

View File

@ -75,4 +75,35 @@ void CNpc::processCloseClamAttack( int _frames )
m_sensorFunc = NPC_SENSOR_NONE;
}
}
}
void CNpc::processClamRetract( int _frames )
{
s32 velocity;
// retract
if ( m_extension > 0 )
{
velocity = -_frames;
if ( m_extension < _frames )
{
velocity = m_extension - _frames;
}
m_extension += velocity;
Pos.vx += ( velocity * rcos( m_heading ) ) >> 12;
Pos.vy += ( velocity * rsin( m_heading ) ) >> 12;
}
else
{
// halt clam
m_controlFunc = NPC_CONTROL_NONE;
m_timerFunc = NPC_TIMER_NONE;
m_sensorFunc = NPC_SENSOR_NONE;
}
}

View File

@ -48,7 +48,7 @@
void CNpc::init()
{
m_type = NPC_FLAMING_SKULL;
m_type = NPC_CLAM;
m_heading = m_fireHeading = 0;
m_movementTimer = 0;

View File

@ -163,6 +163,7 @@ protected:
NPC_MOVEMENT_PENDULUM,
NPC_MOVEMENT_FIREBALL,
NPC_MOVEMENT_RETURNING_HAZARD,
NPC_MOVEMENT_CLAM_RETRACT,
};
enum NPC_MOVEMENT_MODIFIER_FUNC
@ -272,6 +273,7 @@ protected:
// clam functions
void processCloseClamAttack( int _frames );
void processClamRetract( int _frames );
// spider crab functions