From fe30bb578fd56308a0d1036d28f1cdc026f91035 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 2 Jul 2001 19:59:04 +0000 Subject: [PATCH] --- source/enemy/nfdutch.cpp | 32 ++++++++++++++++++++++---------- source/enemy/nfdutch.h | 2 +- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/source/enemy/nfdutch.cpp b/source/enemy/nfdutch.cpp index 2cf314633..491272fba 100644 --- a/source/enemy/nfdutch.cpp +++ b/source/enemy/nfdutch.cpp @@ -236,7 +236,8 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames ) DVECTOR newPos = Pos; newPos.vy -= 50; projectile->init( newPos, heading ); - projectile->setGraphic( FRM__LIGHTNING2 ); + projectile->setGraphic( FRM__SNAKEBILE ); + projectile->setSpeed( 5 ); 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 ) { CNpcEnemy::processShotDeathEnd( _frames ); @@ -430,6 +422,8 @@ void CNpcFlyingDutchmanEnemy::collidedWith(CThing *_thisThing) m_state = NPC_GENERIC_HIT_CHECK_HEALTH; 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 ); +} diff --git a/source/enemy/nfdutch.h b/source/enemy/nfdutch.h index ca8e5e681..cac35306f 100644 --- a/source/enemy/nfdutch.h +++ b/source/enemy/nfdutch.h @@ -26,10 +26,10 @@ public: virtual void postInit(); void render(); virtual void shutdown(); + virtual u8 hasBeenAttacked(); protected: virtual void processClose( int _frames ); virtual void processMovement( int _frames ); - virtual void processShotRecoil( int _frames ); virtual void processShotDeathEnd( int _frames ); virtual void collidedWith(CThing *_thisThing);