diff --git a/Graphics/levels/Chapter01/Level04/Level04.MEX b/Graphics/levels/Chapter01/Level04/Level04.MEX index e1bfb1121..c1195df86 100644 Binary files a/Graphics/levels/Chapter01/Level04/Level04.MEX and b/Graphics/levels/Chapter01/Level04/Level04.MEX differ diff --git a/Graphics/levels/Chapter01/Level04/level04.Mep b/Graphics/levels/Chapter01/Level04/level04.Mep index 4d1ead3ac..fd1b5dc18 100644 Binary files a/Graphics/levels/Chapter01/Level04/level04.Mep and b/Graphics/levels/Chapter01/Level04/level04.Mep differ diff --git a/source/enemy/ndogfish.cpp b/source/enemy/ndogfish.cpp index 1a555ff86..9c209bfa3 100644 --- a/source/enemy/ndogfish.cpp +++ b/source/enemy/ndogfish.cpp @@ -39,8 +39,6 @@ #include "system\vid.h" #endif -#include "fx\fxnrgbar.h" - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -58,6 +56,8 @@ void CNpcIronDogfishEnemy::postInit() m_health = CLevel::getBossHealth(); m_speed = m_data[m_type].speed + ( ( 3 * ( m_data[m_type].initHealth - m_health ) ) / m_data[m_type].initHealth ); } + + m_energyBar = NULL; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -655,6 +655,11 @@ void CNpcIronDogfishEnemy::shutdown() CLevel::setBossHealth( m_health ); } + if ( m_energyBar ) + { + m_energyBar->setToShutdown(); + } + CNpcEnemy::shutdown(); } @@ -672,8 +677,8 @@ void CNpcIronDogfishEnemy::render() { if (!m_meterOn) { - CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this); - T->SetMax(m_health); + m_energyBar=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this); + m_energyBar->SetMax(m_data[m_type].initHealth); m_meterOn=true; } diff --git a/source/enemy/ndogfish.h b/source/enemy/ndogfish.h index 59bb091c5..48a3dc4d7 100644 --- a/source/enemy/ndogfish.h +++ b/source/enemy/ndogfish.h @@ -16,6 +16,8 @@ #include "fx\fx.h" #include "fx\fxlaser.h" +#include "fx\fxnrgbar.h" + class CNpcIronDogfishEnemy : public CNpcEnemy { @@ -53,6 +55,7 @@ protected: bool m_meterOn; CFXLaser *m_effect; + CFXNRGBar *m_energyBar; }; #endif \ No newline at end of file diff --git a/source/enemy/nfdutch.cpp b/source/enemy/nfdutch.cpp index a71491d45..578d4f009 100644 --- a/source/enemy/nfdutch.cpp +++ b/source/enemy/nfdutch.cpp @@ -43,9 +43,6 @@ #include #endif -#include "fx\fx.h" -#include "fx\fxnrgbar.h" - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -70,6 +67,8 @@ void CNpcFlyingDutchmanEnemy::postInit() m_fireCount = 0; m_invulnerableTimer = 0; + + m_energyBar = NULL; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -443,6 +442,11 @@ void CNpcFlyingDutchmanEnemy::shutdown() CLevel::setBossHealth( m_health ); } + if ( m_energyBar ) + { + m_energyBar->setToShutdown(); + } + CNpcEnemy::shutdown(); } @@ -460,8 +464,8 @@ void CNpcFlyingDutchmanEnemy::render() { if (!m_meterOn) { - CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this); - T->SetMax(m_health); + m_energyBar=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this); + m_energyBar->SetMax(m_data[m_type].initHealth); m_meterOn=true; } diff --git a/source/enemy/nfdutch.h b/source/enemy/nfdutch.h index e0bbdac28..63958539e 100644 --- a/source/enemy/nfdutch.h +++ b/source/enemy/nfdutch.h @@ -14,6 +14,10 @@ #ifndef __ENEMY_NFDUTCH_H__ #define __ENEMY_NFDUTCH_H__ +#include "fx\fx.h" +#include "fx\fxnrgbar.h" + + class CNpcFlyingDutchmanEnemy : public CNpcEnemy { public: @@ -39,6 +43,7 @@ protected: u8 m_inRange; u8 m_fireCount; s32 m_invulnerableTimer; + CFXNRGBar *m_energyBar; }; #endif \ No newline at end of file diff --git a/source/enemy/nmjfish.cpp b/source/enemy/nmjfish.cpp index c7452ec2c..d9f205cc1 100644 --- a/source/enemy/nmjfish.cpp +++ b/source/enemy/nmjfish.cpp @@ -88,6 +88,8 @@ void CNpcMotherJellyfishEnemy::postInit() m_invulnerableTimer = 0; m_attackCounter = 0; + + m_energyBar = NULL; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -578,6 +580,11 @@ void CNpcMotherJellyfishEnemy::shutdown() CLevel::setBossHealth( m_health ); } + if ( m_energyBar ) + { + m_energyBar->setToShutdown(); + } + CNpcEnemy::shutdown(); } @@ -624,8 +631,8 @@ void CNpcMotherJellyfishEnemy::render() { if (!m_meterOn) { - CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this); - T->SetMax(m_health); + m_energyBar=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this); + m_energyBar->SetMax(m_data[m_type].initHealth); m_meterOn=true; } diff --git a/source/enemy/nmjfish.h b/source/enemy/nmjfish.h index 1c60d70d1..70f0e1c97 100644 --- a/source/enemy/nmjfish.h +++ b/source/enemy/nmjfish.h @@ -71,6 +71,7 @@ protected: DVECTOR legsPos[4]; DVECTOR targetPos; + CFXNRGBar *m_energyBar; }; #endif \ No newline at end of file diff --git a/source/enemy/nsshark.cpp b/source/enemy/nsshark.cpp index cf1c06dd8..4f805e3fa 100644 --- a/source/enemy/nsshark.cpp +++ b/source/enemy/nsshark.cpp @@ -47,9 +47,6 @@ #include #endif -#include "fx\fx.h" -#include "fx\fxnrgbar.h" - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -72,6 +69,8 @@ void CNpcSubSharkEnemy::postInit() m_timerTimer = 0; m_salvoCount = 5; m_movementTimer = GameState::getOneSecondInFrames() * ( 1 + ( ( 7 * m_health ) / m_data[m_type].initHealth ) ); + + m_energyBar = NULL; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -706,6 +705,11 @@ void CNpcSubSharkEnemy::shutdown() CLevel::setBossHealth( m_health ); } + if ( m_energyBar ) + { + m_energyBar->setToShutdown(); + } + CNpcEnemy::shutdown(); } @@ -723,8 +727,8 @@ void CNpcSubSharkEnemy::render() { if (!m_meterOn) { - CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this); - T->SetMax(m_health); + m_energyBar=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this); + m_energyBar->SetMax(m_data[m_type].initHealth); m_meterOn=true; } diff --git a/source/enemy/nsshark.h b/source/enemy/nsshark.h index f11462281..7037d853d 100644 --- a/source/enemy/nsshark.h +++ b/source/enemy/nsshark.h @@ -14,6 +14,10 @@ #ifndef __ENEMY_NSSHARK_H__ #define __ENEMY_NSSHARK_H__ +#include "fx\fx.h" +#include "fx\fxnrgbar.h" + + class CNpcSubSharkEnemy : public CNpcEnemy { public: @@ -49,6 +53,7 @@ protected: bool m_meterOn; s32 m_invulnerableTimer; DVECTOR m_targetPos; + CFXNRGBar *m_energyBar; }; #endif \ No newline at end of file diff --git a/source/enemy/nssnake.cpp b/source/enemy/nssnake.cpp index 15070ff4e..77808ffe4 100644 --- a/source/enemy/nssnake.cpp +++ b/source/enemy/nssnake.cpp @@ -47,9 +47,6 @@ #include #endif -#include "fx\fx.h" -#include "fx\fxnrgbar.h" - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -168,6 +165,8 @@ void CNpcSeaSnakeEnemy::postInit() m_meterOn=false; m_turnDir = 0; m_waitTimer = 0; + + m_energyBar = NULL; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -194,6 +193,11 @@ void CNpcSeaSnakeEnemy::shutdown() m_segmentArray[segCount].shutdown(); } + if ( m_energyBar ) + { + m_energyBar->setToShutdown(); + } + CNpcEnemy::shutdown(); } @@ -696,8 +700,8 @@ void CNpcSeaSnakeEnemy::render() { if (!m_meterOn) { - CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this); - T->SetMax( NPC_SEA_SNAKE_LENGTH ); + m_energyBar=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this); + m_energyBar->SetMax( NPC_SEA_SNAKE_LENGTH + 1 ); m_meterOn=true; } diff --git a/source/enemy/nssnake.h b/source/enemy/nssnake.h index c3624c847..6074b6ef7 100644 --- a/source/enemy/nssnake.h +++ b/source/enemy/nssnake.h @@ -14,6 +14,10 @@ #ifndef __ENEMY_NSSNAKE_H__ #define __ENEMY_NSSNAKE_H__ +#include "fx\fx.h" +#include "fx\fxnrgbar.h" + + class CNpcSeaSnakeSegment { public: @@ -98,6 +102,7 @@ protected: s16 m_circleHeading; s16 m_origHeading; s32 m_waitTimer; + CFXNRGBar *m_energyBar; }; #endif \ No newline at end of file diff --git a/source/fx/fxnrgbar.cpp b/source/fx/fxnrgbar.cpp index f0d02b36e..a3f372039 100644 --- a/source/fx/fxnrgbar.cpp +++ b/source/fx/fxnrgbar.cpp @@ -42,6 +42,11 @@ void CFXNRGBar::think(int _frames) CNpcEnemy *P=(CNpcEnemy*)ParentThing; int Health=P->getHealth(); + if ( Health < 0 ) + { + Health = 0; + } + CurrentW=((NRGW/MaxHealth)*Health); int Diff=DrawW-CurrentW; @@ -49,7 +54,8 @@ int Diff=DrawW-CurrentW; DrawW-=(Diff+1)>>1; if (DrawW<=0 && Health==0) { - setToShutdown(); + //setToShutdown(); + DrawW = 0; } }