This commit is contained in:
parent
4b980a9213
commit
d238e6ac10
3 changed files with 34 additions and 1 deletions
|
@ -76,3 +76,34 @@ void CNpc::processCloseClamAttack( int _frames )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
void CNpc::init()
|
void CNpc::init()
|
||||||
{
|
{
|
||||||
m_type = NPC_FLAMING_SKULL;
|
m_type = NPC_CLAM;
|
||||||
|
|
||||||
m_heading = m_fireHeading = 0;
|
m_heading = m_fireHeading = 0;
|
||||||
m_movementTimer = 0;
|
m_movementTimer = 0;
|
||||||
|
|
|
@ -163,6 +163,7 @@ protected:
|
||||||
NPC_MOVEMENT_PENDULUM,
|
NPC_MOVEMENT_PENDULUM,
|
||||||
NPC_MOVEMENT_FIREBALL,
|
NPC_MOVEMENT_FIREBALL,
|
||||||
NPC_MOVEMENT_RETURNING_HAZARD,
|
NPC_MOVEMENT_RETURNING_HAZARD,
|
||||||
|
NPC_MOVEMENT_CLAM_RETRACT,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum NPC_MOVEMENT_MODIFIER_FUNC
|
enum NPC_MOVEMENT_MODIFIER_FUNC
|
||||||
|
@ -272,6 +273,7 @@ protected:
|
||||||
// clam functions
|
// clam functions
|
||||||
|
|
||||||
void processCloseClamAttack( int _frames );
|
void processCloseClamAttack( int _frames );
|
||||||
|
void processClamRetract( int _frames );
|
||||||
|
|
||||||
// spider crab functions
|
// spider crab functions
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue