This commit is contained in:
Charles 2001-06-12 19:30:01 +00:00
parent a52ee00ff3
commit a8f6989d13
4 changed files with 57 additions and 8 deletions

View File

@ -1,2 +1,3 @@
bodystatic bodystatic
headstatic headstatic
headstaticmouthshut

View File

@ -428,15 +428,15 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SEA_SNAKE { // NPC_SEA_SNAKE
ACTORS_SEASNAKE_SBK, ACTORS_SEASNAKE_SBK,
ANIM_SEASNAKE_HEADSTATIC, ANIM_SEASNAKE_HEADSTATICMOUTHSHUT,
NPC_SENSOR_NONE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_FIXED_PATH, NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
3, 3,
256, 256,
DETECT_ATTACK_COLLISION_GENERIC, DETECT_ALL_COLLISION,
DAMAGE__SHOCK_ENEMY, DAMAGE__SHOCK_ENEMY,
1, 1,
0, 0,

View File

@ -222,7 +222,12 @@ void CNpcSeaSnakeEnemy::shutdown()
bool CNpcSeaSnakeEnemy::processSensor() bool CNpcSeaSnakeEnemy::processSensor()
{ {
/*if ( playerXDistSqr + playerYDistSqr < 40000 ) if ( m_sensorFunc == NPC_SENSOR_NONE )
{
return( false );
}
if ( playerXDistSqr + playerYDistSqr < 40000 )
{ {
m_controlFunc = NPC_CONTROL_CLOSE; m_controlFunc = NPC_CONTROL_CLOSE;
@ -231,9 +236,7 @@ bool CNpcSeaSnakeEnemy::processSensor()
else else
{ {
return( false ); return( false );
}*/ }
return( false );
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -246,6 +249,39 @@ void CNpcSeaSnakeEnemy::processMovement( int _frames )
DVECTOR oldPos = Pos; DVECTOR oldPos = Pos;
u8 skipCounter; u8 skipCounter;
if ( m_snapTimer > 0 )
{
m_snapTimer -= _frames;
if ( m_snapTimer <= 0 )
{
m_animNo = ANIM_SEASNAKE_HEADSTATICMOUTHSHUT;
m_animPlaying = true;
m_frame = 0;
}
else
{
m_openTimer -= _frames;
if ( m_openTimer <= 0 )
{
if ( m_animNo == ANIM_SEASNAKE_HEADSTATIC )
{
m_animNo = ANIM_SEASNAKE_HEADSTATICMOUTHSHUT;
}
else
{
m_animNo = ANIM_SEASNAKE_HEADSTATIC;
}
m_animPlaying = true;
m_frame = 0;
m_openTimer = GameState::getOneSecondInFrames() >> 2;
}
}
}
if ( m_data[m_type].moveSfx < CSoundMediator::NUM_SFXIDS ) if ( m_data[m_type].moveSfx < CSoundMediator::NUM_SFXIDS )
{ {
CSoundMediator::playSfx( m_data[m_type].moveSfx ); CSoundMediator::playSfx( m_data[m_type].moveSfx );
@ -477,6 +513,9 @@ void CNpcSeaSnakeEnemy::processClose( int _frames )
m_timerFunc = NPC_TIMER_ATTACK_DONE; m_timerFunc = NPC_TIMER_ATTACK_DONE;
m_timerTimer = GameState::getOneSecondInFrames(); m_timerTimer = GameState::getOneSecondInFrames();
m_sensorFunc = NPC_SENSOR_NONE; m_sensorFunc = NPC_SENSOR_NONE;
m_snapTimer = m_movementTimer;
m_openTimer = GameState::getOneSecondInFrames() >> 2;
} }
@ -730,3 +769,9 @@ const CRECT *CNpcSeaSnakeEnemy::getThinkBBox()
return &objThinkBox; return &objThinkBox;
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSeaSnakeEnemy::processUserCollision( CThing *thisThing )
{
}

View File

@ -60,6 +60,7 @@ protected:
virtual void processMovement( int _frames ); virtual void processMovement( int _frames );
virtual void processShot( int _frames ); virtual void processShot( int _frames );
virtual void processEnemyCollision( CThing *thisThing ); virtual void processEnemyCollision( CThing *thisThing );
virtual void processUserCollision( CThing *thisThing );
enum enum
{ {
@ -80,6 +81,8 @@ protected:
CNpcSeaSnakeSegment *m_segment; CNpcSeaSnakeSegment *m_segment;
CNpcPositionHistory *m_positionHistory; CNpcPositionHistory *m_positionHistory;
s32 m_collTimer; s32 m_collTimer;
s32 m_snapTimer;
s32 m_openTimer;
}; };
#endif #endif