This commit is contained in:
parent
4b980a9213
commit
d238e6ac10
3 changed files with 34 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue