This commit is contained in:
Charles 2001-06-27 18:28:21 +00:00
parent 2c9b448264
commit 14fe98ab08
13 changed files with 71 additions and 22 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -43,9 +43,6 @@
#include <sprites.h>
#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;
}

View File

@ -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

View File

@ -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;
}

View File

@ -71,6 +71,7 @@ protected:
DVECTOR legsPos[4];
DVECTOR targetPos;
CFXNRGBar *m_energyBar;
};
#endif

View File

@ -47,9 +47,6 @@
#include <sprites.h>
#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;
}

View File

@ -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

View File

@ -47,9 +47,6 @@
#include <sprites.h>
#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;
}

View File

@ -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

View File

@ -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;
}
}