diff --git a/source/enemy/nmjfish.cpp b/source/enemy/nmjfish.cpp index c98dab6e3..487cb79c7 100644 --- a/source/enemy/nmjfish.cpp +++ b/source/enemy/nmjfish.cpp @@ -778,7 +778,7 @@ void CNpcMotherJellyfishEnemy::processShot( int _frames ) { case NPC_GENERIC_HIT_CHECK_HEALTH: { - if ( m_health > 0 ) + if ( m_health > 5 ) { m_health -= 5; @@ -790,6 +790,7 @@ void CNpcMotherJellyfishEnemy::processShot( int _frames ) } else { + m_health = 0; m_state = MOTHER_JELLYFISH_BEGIN_CIRCLE; } diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index d22c49fe1..a231b8f9e 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -220,13 +220,23 @@ CNpcEnemy *CNpcEnemy::Create(int enemyType) { case CNpcEnemy::NPC_MOTHER_JELLYFISH: case CNpcEnemy::NPC_SUB_SHARK: - case CNpcEnemy::NPC_SEA_SNAKE: case CNpcEnemy::NPC_FLYING_DUTCHMAN: case CNpcEnemy::NPC_IRON_DOGFISH: { if ( CLevel::getIsBossRespawn() ) { - if ( !CLevel::getBossHealth() ) + if ( CLevel::getBossHealth() <= 0 ) + { + return( NULL ); + } + } + } + + case CNpcEnemy::NPC_SEA_SNAKE: + { + if ( CLevel::getIsBossRespawn() ) + { + if ( CLevel::getBossHealth() < 0 ) { return( NULL ); } @@ -1191,10 +1201,11 @@ void CNpcEnemy::processShot( int _frames ) { m_health -= 5; - if ( m_health < 0 ) + if ( m_health <= 0 ) { m_state = NPC_GENERIC_HIT_DEATH_START; m_isDying = true; + m_health = 0; } else { diff --git a/source/enemy/nsshark.cpp b/source/enemy/nsshark.cpp index 69847ad33..4efbacf0d 100644 --- a/source/enemy/nsshark.cpp +++ b/source/enemy/nsshark.cpp @@ -680,7 +680,7 @@ void CNpcSubSharkEnemy::processShot( int _frames ) { m_health -= 5; - if ( m_health < 0 ) + if ( m_health <= 0 ) { m_state = NPC_GENERIC_HIT_DEATH_START; m_isDying = true; diff --git a/source/enemy/nssnake.cpp b/source/enemy/nssnake.cpp index fb5cefd02..b30e20847 100644 --- a/source/enemy/nssnake.cpp +++ b/source/enemy/nssnake.cpp @@ -187,7 +187,7 @@ void CNpcSeaSnakeEnemy::shutdown() } else { - CLevel::setBossHealth( 0 ); + CLevel::setBossHealth( -1 ); } // delete snake segments @@ -1057,24 +1057,31 @@ void CNpcSeaSnakeEnemy::processShot( int _frames ) { if ( !m_segmentCount ) { - m_drawRotation += 64 * _frames; - m_drawRotation &= 4095; - - Pos.vy += m_speed * _frames; - - if ( m_speed < 5 ) + if ( m_collTimer <= 0 ) { - m_speed++; + m_drawRotation += 64 * _frames; + m_drawRotation &= 4095; + + Pos.vy += m_speed * _frames; + + if ( m_speed < 5 ) + { + m_speed++; + } + + m_state = NPC_GENERIC_HIT_DEATH_END; + + DVECTOR offset = CLevel::getCameraPos(); + + if ( Pos.vy - offset.vy > VidGetScrH() ) + { + setToShutdown(); + CGameScene::setBossHasBeenKilled(); + } } - - m_state = NPC_GENERIC_HIT_DEATH_END; - - DVECTOR offset = CLevel::getCameraPos(); - - if ( Pos.vy - offset.vy > VidGetScrH() ) + else { - setToShutdown(); - CGameScene::setBossHasBeenKilled(); + m_controlFunc = NPC_CONTROL_MOVEMENT; } } else