This commit is contained in:
parent
2c9b448264
commit
14fe98ab08
13 changed files with 71 additions and 22 deletions
Binary file not shown.
Binary file not shown.
|
@ -39,8 +39,6 @@
|
||||||
#include "system\vid.h"
|
#include "system\vid.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "fx\fxnrgbar.h"
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -58,6 +56,8 @@ void CNpcIronDogfishEnemy::postInit()
|
||||||
m_health = CLevel::getBossHealth();
|
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_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 );
|
CLevel::setBossHealth( m_health );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_energyBar )
|
||||||
|
{
|
||||||
|
m_energyBar->setToShutdown();
|
||||||
|
}
|
||||||
|
|
||||||
CNpcEnemy::shutdown();
|
CNpcEnemy::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -672,8 +677,8 @@ void CNpcIronDogfishEnemy::render()
|
||||||
{
|
{
|
||||||
if (!m_meterOn)
|
if (!m_meterOn)
|
||||||
{
|
{
|
||||||
CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
|
m_energyBar=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
|
||||||
T->SetMax(m_health);
|
m_energyBar->SetMax(m_data[m_type].initHealth);
|
||||||
m_meterOn=true;
|
m_meterOn=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
#include "fx\fx.h"
|
#include "fx\fx.h"
|
||||||
#include "fx\fxlaser.h"
|
#include "fx\fxlaser.h"
|
||||||
|
#include "fx\fxnrgbar.h"
|
||||||
|
|
||||||
|
|
||||||
class CNpcIronDogfishEnemy : public CNpcEnemy
|
class CNpcIronDogfishEnemy : public CNpcEnemy
|
||||||
{
|
{
|
||||||
|
@ -53,6 +55,7 @@ protected:
|
||||||
bool m_meterOn;
|
bool m_meterOn;
|
||||||
|
|
||||||
CFXLaser *m_effect;
|
CFXLaser *m_effect;
|
||||||
|
CFXNRGBar *m_energyBar;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -43,9 +43,6 @@
|
||||||
#include <sprites.h>
|
#include <sprites.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "fx\fx.h"
|
|
||||||
#include "fx\fxnrgbar.h"
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -70,6 +67,8 @@ void CNpcFlyingDutchmanEnemy::postInit()
|
||||||
m_fireCount = 0;
|
m_fireCount = 0;
|
||||||
|
|
||||||
m_invulnerableTimer = 0;
|
m_invulnerableTimer = 0;
|
||||||
|
|
||||||
|
m_energyBar = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -443,6 +442,11 @@ void CNpcFlyingDutchmanEnemy::shutdown()
|
||||||
CLevel::setBossHealth( m_health );
|
CLevel::setBossHealth( m_health );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_energyBar )
|
||||||
|
{
|
||||||
|
m_energyBar->setToShutdown();
|
||||||
|
}
|
||||||
|
|
||||||
CNpcEnemy::shutdown();
|
CNpcEnemy::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,8 +464,8 @@ void CNpcFlyingDutchmanEnemy::render()
|
||||||
{
|
{
|
||||||
if (!m_meterOn)
|
if (!m_meterOn)
|
||||||
{
|
{
|
||||||
CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
|
m_energyBar=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
|
||||||
T->SetMax(m_health);
|
m_energyBar->SetMax(m_data[m_type].initHealth);
|
||||||
m_meterOn=true;
|
m_meterOn=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
#ifndef __ENEMY_NFDUTCH_H__
|
#ifndef __ENEMY_NFDUTCH_H__
|
||||||
#define __ENEMY_NFDUTCH_H__
|
#define __ENEMY_NFDUTCH_H__
|
||||||
|
|
||||||
|
#include "fx\fx.h"
|
||||||
|
#include "fx\fxnrgbar.h"
|
||||||
|
|
||||||
|
|
||||||
class CNpcFlyingDutchmanEnemy : public CNpcEnemy
|
class CNpcFlyingDutchmanEnemy : public CNpcEnemy
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -39,6 +43,7 @@ protected:
|
||||||
u8 m_inRange;
|
u8 m_inRange;
|
||||||
u8 m_fireCount;
|
u8 m_fireCount;
|
||||||
s32 m_invulnerableTimer;
|
s32 m_invulnerableTimer;
|
||||||
|
CFXNRGBar *m_energyBar;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -88,6 +88,8 @@ void CNpcMotherJellyfishEnemy::postInit()
|
||||||
m_invulnerableTimer = 0;
|
m_invulnerableTimer = 0;
|
||||||
|
|
||||||
m_attackCounter = 0;
|
m_attackCounter = 0;
|
||||||
|
|
||||||
|
m_energyBar = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -578,6 +580,11 @@ void CNpcMotherJellyfishEnemy::shutdown()
|
||||||
CLevel::setBossHealth( m_health );
|
CLevel::setBossHealth( m_health );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_energyBar )
|
||||||
|
{
|
||||||
|
m_energyBar->setToShutdown();
|
||||||
|
}
|
||||||
|
|
||||||
CNpcEnemy::shutdown();
|
CNpcEnemy::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,8 +631,8 @@ void CNpcMotherJellyfishEnemy::render()
|
||||||
{
|
{
|
||||||
if (!m_meterOn)
|
if (!m_meterOn)
|
||||||
{
|
{
|
||||||
CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
|
m_energyBar=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
|
||||||
T->SetMax(m_health);
|
m_energyBar->SetMax(m_data[m_type].initHealth);
|
||||||
m_meterOn=true;
|
m_meterOn=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,7 @@ protected:
|
||||||
DVECTOR legsPos[4];
|
DVECTOR legsPos[4];
|
||||||
|
|
||||||
DVECTOR targetPos;
|
DVECTOR targetPos;
|
||||||
|
CFXNRGBar *m_energyBar;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -47,9 +47,6 @@
|
||||||
#include <sprites.h>
|
#include <sprites.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "fx\fx.h"
|
|
||||||
#include "fx\fxnrgbar.h"
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -72,6 +69,8 @@ void CNpcSubSharkEnemy::postInit()
|
||||||
m_timerTimer = 0;
|
m_timerTimer = 0;
|
||||||
m_salvoCount = 5;
|
m_salvoCount = 5;
|
||||||
m_movementTimer = GameState::getOneSecondInFrames() * ( 1 + ( ( 7 * m_health ) / m_data[m_type].initHealth ) );
|
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 );
|
CLevel::setBossHealth( m_health );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_energyBar )
|
||||||
|
{
|
||||||
|
m_energyBar->setToShutdown();
|
||||||
|
}
|
||||||
|
|
||||||
CNpcEnemy::shutdown();
|
CNpcEnemy::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -723,8 +727,8 @@ void CNpcSubSharkEnemy::render()
|
||||||
{
|
{
|
||||||
if (!m_meterOn)
|
if (!m_meterOn)
|
||||||
{
|
{
|
||||||
CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
|
m_energyBar=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
|
||||||
T->SetMax(m_health);
|
m_energyBar->SetMax(m_data[m_type].initHealth);
|
||||||
m_meterOn=true;
|
m_meterOn=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
#ifndef __ENEMY_NSSHARK_H__
|
#ifndef __ENEMY_NSSHARK_H__
|
||||||
#define __ENEMY_NSSHARK_H__
|
#define __ENEMY_NSSHARK_H__
|
||||||
|
|
||||||
|
#include "fx\fx.h"
|
||||||
|
#include "fx\fxnrgbar.h"
|
||||||
|
|
||||||
|
|
||||||
class CNpcSubSharkEnemy : public CNpcEnemy
|
class CNpcSubSharkEnemy : public CNpcEnemy
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -49,6 +53,7 @@ protected:
|
||||||
bool m_meterOn;
|
bool m_meterOn;
|
||||||
s32 m_invulnerableTimer;
|
s32 m_invulnerableTimer;
|
||||||
DVECTOR m_targetPos;
|
DVECTOR m_targetPos;
|
||||||
|
CFXNRGBar *m_energyBar;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -47,9 +47,6 @@
|
||||||
#include <sprites.h>
|
#include <sprites.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "fx\fx.h"
|
|
||||||
#include "fx\fxnrgbar.h"
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -168,6 +165,8 @@ void CNpcSeaSnakeEnemy::postInit()
|
||||||
m_meterOn=false;
|
m_meterOn=false;
|
||||||
m_turnDir = 0;
|
m_turnDir = 0;
|
||||||
m_waitTimer = 0;
|
m_waitTimer = 0;
|
||||||
|
|
||||||
|
m_energyBar = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -194,6 +193,11 @@ void CNpcSeaSnakeEnemy::shutdown()
|
||||||
m_segmentArray[segCount].shutdown();
|
m_segmentArray[segCount].shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_energyBar )
|
||||||
|
{
|
||||||
|
m_energyBar->setToShutdown();
|
||||||
|
}
|
||||||
|
|
||||||
CNpcEnemy::shutdown();
|
CNpcEnemy::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,8 +700,8 @@ void CNpcSeaSnakeEnemy::render()
|
||||||
{
|
{
|
||||||
if (!m_meterOn)
|
if (!m_meterOn)
|
||||||
{
|
{
|
||||||
CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
|
m_energyBar=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
|
||||||
T->SetMax( NPC_SEA_SNAKE_LENGTH );
|
m_energyBar->SetMax( NPC_SEA_SNAKE_LENGTH + 1 );
|
||||||
m_meterOn=true;
|
m_meterOn=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
#ifndef __ENEMY_NSSNAKE_H__
|
#ifndef __ENEMY_NSSNAKE_H__
|
||||||
#define __ENEMY_NSSNAKE_H__
|
#define __ENEMY_NSSNAKE_H__
|
||||||
|
|
||||||
|
#include "fx\fx.h"
|
||||||
|
#include "fx\fxnrgbar.h"
|
||||||
|
|
||||||
|
|
||||||
class CNpcSeaSnakeSegment
|
class CNpcSeaSnakeSegment
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -98,6 +102,7 @@ protected:
|
||||||
s16 m_circleHeading;
|
s16 m_circleHeading;
|
||||||
s16 m_origHeading;
|
s16 m_origHeading;
|
||||||
s32 m_waitTimer;
|
s32 m_waitTimer;
|
||||||
|
CFXNRGBar *m_energyBar;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -42,6 +42,11 @@ void CFXNRGBar::think(int _frames)
|
||||||
|
|
||||||
CNpcEnemy *P=(CNpcEnemy*)ParentThing;
|
CNpcEnemy *P=(CNpcEnemy*)ParentThing;
|
||||||
int Health=P->getHealth();
|
int Health=P->getHealth();
|
||||||
|
if ( Health < 0 )
|
||||||
|
{
|
||||||
|
Health = 0;
|
||||||
|
}
|
||||||
|
|
||||||
CurrentW=((NRGW/MaxHealth)*Health);
|
CurrentW=((NRGW/MaxHealth)*Health);
|
||||||
|
|
||||||
int Diff=DrawW-CurrentW;
|
int Diff=DrawW-CurrentW;
|
||||||
|
@ -49,7 +54,8 @@ int Diff=DrawW-CurrentW;
|
||||||
DrawW-=(Diff+1)>>1;
|
DrawW-=(Diff+1)>>1;
|
||||||
if (DrawW<=0 && Health==0)
|
if (DrawW<=0 && Health==0)
|
||||||
{
|
{
|
||||||
setToShutdown();
|
//setToShutdown();
|
||||||
|
DrawW = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue