This commit is contained in:
Charles 2001-06-16 17:45:30 +00:00
parent 6caddcbd2f
commit ff6bb7adfe
2 changed files with 57 additions and 0 deletions

View File

@ -39,6 +39,9 @@
#include "system\vid.h"
#endif
#include "fx\fx.h"
#include "fx\fxnrgbar.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -49,6 +52,13 @@ void CNpcIronDogfishEnemy::postInit()
m_npcPath.setPathType( CNpcPath::PONG_PATH );
m_steamTimer = 0;
m_vulnerableTimer = 0;
m_meterOn=false;
if ( CLevel::getIsBossRespawn() )
{
m_health = CLevel::getBossHealth();
m_speed = m_data[m_type].speed + ( ( 3 * ( m_data[m_type].initHealth - m_health ) ) / m_data[m_type].initHealth );
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -555,3 +565,47 @@ void CNpcIronDogfishEnemy::collidedWith( CThing *_thisThing )
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcIronDogfishEnemy::shutdown()
{
if ( m_state != NPC_GENERIC_HIT_DEATH_END )
{
CLevel::setIsBossRespawn( true );
CLevel::setBossHealth( m_health );
}
CNpcEnemy::shutdown();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcIronDogfishEnemy::render()
{
SprFrame = NULL;
if ( m_isActive )
{
CEnemyThing::render();
if (canRender())
{
if (!m_meterOn)
{
CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
T->SetMax(m_health);
m_meterOn=true;
}
DVECTOR &renderPos=getRenderPos();
SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),m_reversed);
m_actorGfx->RotateScale( SprFrame, renderPos, 0, 4096, 4096 );
sBBox boundingBox = m_actorGfx->GetBBox();
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );
setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 );
}
}
}

View File

@ -18,6 +18,8 @@ class CNpcIronDogfishEnemy : public CNpcEnemy
{
public:
virtual void postInit();
void render();
virtual void shutdown();
protected:
virtual void processTimer( int _frames );
virtual bool processSensor();
@ -41,6 +43,7 @@ protected:
s32 m_steamTimer;
s32 m_vulnerableTimer;
bool m_meterOn;
};
#endif