This commit is contained in:
parent
a1bf80bc35
commit
6a94ade948
4 changed files with 12 additions and 7 deletions
|
@ -830,6 +830,13 @@ void CNpcEnemy::shutdown()
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int CNpcEnemy::getFrameCount()
|
||||||
|
{
|
||||||
|
return( m_actorGfx->getFrameCount( m_animNo ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcEnemy::think(int _frames)
|
void CNpcEnemy::think(int _frames)
|
||||||
{
|
{
|
||||||
CEnemyThing::think(_frames);
|
CEnemyThing::think(_frames);
|
||||||
|
@ -843,13 +850,9 @@ void CNpcEnemy::think(int _frames)
|
||||||
if ( m_animPlaying )
|
if ( m_animPlaying )
|
||||||
{
|
{
|
||||||
s32 frameCount;
|
s32 frameCount;
|
||||||
// BODGE!!!!!!!!!!!!!!!
|
|
||||||
if (m_actorGfx)
|
|
||||||
frameCount= m_actorGfx->getFrameCount(m_animNo);
|
|
||||||
else
|
|
||||||
frameCount= 6;
|
|
||||||
|
|
||||||
// BODGE END!!!!!!!!!!!
|
frameCount = getFrameCount();
|
||||||
|
|
||||||
s32 frameShift = ( _frames << 8 ) >> 1;
|
s32 frameShift = ( _frames << 8 ) >> 1;
|
||||||
|
|
||||||
if ( ( frameCount << 8 ) - m_frame > frameShift ) //( _frames >> 1 ) )
|
if ( ( frameCount << 8 ) - m_frame > frameShift ) //( _frames >> 1 ) )
|
||||||
|
|
|
@ -176,6 +176,7 @@ public:
|
||||||
void hasBeenAttacked();
|
void hasBeenAttacked();
|
||||||
bool canBeCaughtByNet();
|
bool canBeCaughtByNet();
|
||||||
void caughtWithNet();
|
void caughtWithNet();
|
||||||
|
virtual int getFrameCount();
|
||||||
|
|
||||||
static CNpcEnemy *Create(sThingActor *ThisActor);
|
static CNpcEnemy *Create(sThingActor *ThisActor);
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,7 @@ void CNpcSmallJellyfishEnemy::processMovementModifier( int _frames, s32 distX, s
|
||||||
dataPoint /= GameState::getOneSecondInFrames();
|
dataPoint /= GameState::getOneSecondInFrames();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_frame = ( ( m_movementTimer * ( m_actorGfx->getFrameCount(m_animNo) - 1 ) << 8 ) ) / GameState::getOneSecondInFrames();
|
m_frame = ( ( m_movementTimer * ( getFrameCount() - 1 ) << 8 ) ) / GameState::getOneSecondInFrames();
|
||||||
|
|
||||||
s32 resistance;
|
s32 resistance;
|
||||||
s32 absVelocity = abs( m_velocity );
|
s32 absVelocity = abs( m_velocity );
|
||||||
|
|
|
@ -22,6 +22,7 @@ class CNpcSmallJellyfishEnemy : public CNpcEnemy
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void render();
|
void render();
|
||||||
|
virtual int getFrameCount() {return( 6 );}
|
||||||
protected:
|
protected:
|
||||||
virtual bool processSensor();
|
virtual bool processSensor();
|
||||||
virtual void processClose( int _frames );
|
virtual void processClose( int _frames );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue