diff --git a/source/enemy/nfdutch.cpp b/source/enemy/nfdutch.cpp index 849e67a95..b2743025a 100644 --- a/source/enemy/nfdutch.cpp +++ b/source/enemy/nfdutch.cpp @@ -149,7 +149,7 @@ void CNpcFlyingDutchmanEnemy::processMovement( int _frames ) } else { - m_movementTimer = GameState::getOneSecondInFrames() * 3; + m_movementTimer = GameState::getOneSecondInFrames() * 2; } } } @@ -216,7 +216,8 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames ) m_animPlaying = true; m_frame = 0; } - else if ( !m_animPlaying ) + //else if ( !m_animPlaying ) + else if ( m_frame > ( getFrameCount() >> 1 ) ) { // fire at player @@ -248,7 +249,7 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames ) else { m_controlFunc = NPC_CONTROL_MOVEMENT; - m_movementTimer = GameState::getOneSecondInFrames() * 3; + m_movementTimer = GameState::getOneSecondInFrames() * 2; m_state++; m_inRange = false; @@ -279,7 +280,7 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames ) else { m_controlFunc = NPC_CONTROL_MOVEMENT; - m_movementTimer = GameState::getOneSecondInFrames() * 3; + m_movementTimer = GameState::getOneSecondInFrames() * 2; m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1; m_inRange = false; @@ -313,6 +314,17 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +void CNpcFlyingDutchmanEnemy::processShotRecoil( int _frames ) +{ + if ( !m_animPlaying ) + { + m_state = m_oldState; + m_controlFunc = NPC_CONTROL_MOVEMENT; + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CNpcFlyingDutchmanEnemy::processShotDeathEnd( int _frames ) { if ( !m_animPlaying ) @@ -422,6 +434,7 @@ void CNpcFlyingDutchmanEnemy::collidedWith(CThing *_thisThing) player->justButtBouncedABadGuy(); } m_controlFunc = NPC_CONTROL_SHOT; + m_oldState = m_state; m_state = NPC_GENERIC_HIT_CHECK_HEALTH; drawAttackEffect(); @@ -463,6 +476,7 @@ u8 CNpcFlyingDutchmanEnemy::hasBeenAttacked() m_invulnerableTimer = 4 * GameState::getOneSecondInFrames(); m_controlFunc = NPC_CONTROL_SHOT; + m_oldState = m_state; m_state = NPC_GENERIC_HIT_CHECK_HEALTH; } } diff --git a/source/enemy/nfdutch.h b/source/enemy/nfdutch.h index cac35306f..ad9eaaed5 100644 --- a/source/enemy/nfdutch.h +++ b/source/enemy/nfdutch.h @@ -30,6 +30,7 @@ public: 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); @@ -44,6 +45,7 @@ protected: u8 m_inRange; u8 m_fireCount; s32 m_invulnerableTimer; + u8 m_oldState; }; #endif \ No newline at end of file