This commit is contained in:
Charles 2001-07-02 19:59:04 +00:00
parent ad643eda78
commit fe30bb578f
2 changed files with 23 additions and 11 deletions

View File

@ -236,7 +236,8 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames )
DVECTOR newPos = Pos; DVECTOR newPos = Pos;
newPos.vy -= 50; newPos.vy -= 50;
projectile->init( newPos, heading ); projectile->init( newPos, heading );
projectile->setGraphic( FRM__LIGHTNING2 ); projectile->setGraphic( FRM__SNAKEBILE );
projectile->setSpeed( 5 );
m_fireCount++; m_fireCount++;
@ -312,15 +313,6 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames )
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFlyingDutchmanEnemy::processShotRecoil( int _frames )
{
m_invulnerableTimer = 2 * GameState::getOneSecondInFrames();
CNpcEnemy::processShotRecoil( _frames );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFlyingDutchmanEnemy::processShotDeathEnd( int _frames ) void CNpcFlyingDutchmanEnemy::processShotDeathEnd( int _frames )
{ {
CNpcEnemy::processShotDeathEnd( _frames ); CNpcEnemy::processShotDeathEnd( _frames );
@ -430,6 +422,8 @@ void CNpcFlyingDutchmanEnemy::collidedWith(CThing *_thisThing)
m_state = NPC_GENERIC_HIT_CHECK_HEALTH; m_state = NPC_GENERIC_HIT_CHECK_HEALTH;
drawAttackEffect(); drawAttackEffect();
m_invulnerableTimer = 2 * GameState::getOneSecondInFrames();
} }
} }
@ -454,3 +448,21 @@ void CNpcFlyingDutchmanEnemy::collidedWith(CThing *_thisThing)
} }
} }
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
u8 CNpcFlyingDutchmanEnemy::hasBeenAttacked()
{
if ( m_invulnerableTimer <= 0 )
{
if ( m_controlFunc != NPC_CONTROL_SHOT )
{
m_invulnerableTimer = 2 * GameState::getOneSecondInFrames();
m_controlFunc = NPC_CONTROL_SHOT;
m_state = NPC_GENERIC_HIT_CHECK_HEALTH;
}
}
return( true );
}

View File

@ -26,10 +26,10 @@ public:
virtual void postInit(); virtual void postInit();
void render(); void render();
virtual void shutdown(); virtual void shutdown();
virtual u8 hasBeenAttacked();
protected: protected:
virtual void processClose( int _frames ); virtual void processClose( int _frames );
virtual void processMovement( int _frames ); virtual void processMovement( int _frames );
virtual void processShotRecoil( int _frames );
virtual void processShotDeathEnd( int _frames ); virtual void processShotDeathEnd( int _frames );
virtual void collidedWith(CThing *_thisThing); virtual void collidedWith(CThing *_thisThing);