This commit is contained in:
parent
0ea76e8164
commit
231b8d041b
2 changed files with 21 additions and 7 deletions
|
@ -35,6 +35,7 @@ void CNpcFishHookPlatform::postInit()
|
||||||
CNpcPlatform::postInit();
|
CNpcPlatform::postInit();
|
||||||
|
|
||||||
m_isMoving = false;
|
m_isMoving = false;
|
||||||
|
m_isResetting = false;
|
||||||
m_isShuttingDown = false;
|
m_isShuttingDown = false;
|
||||||
m_lineBase.vx = Pos.vx;
|
m_lineBase.vx = Pos.vx;
|
||||||
m_lineBase.vy = 0;
|
m_lineBase.vy = 0;
|
||||||
|
@ -58,15 +59,27 @@ void CNpcFishHookPlatform::processLifetime( int _frames )
|
||||||
void CNpcFishHookPlatform::processMovement( int _frames )
|
void CNpcFishHookPlatform::processMovement( int _frames )
|
||||||
{
|
{
|
||||||
if ( m_isMoving )
|
if ( m_isMoving )
|
||||||
|
{
|
||||||
|
if ( m_isResetting )
|
||||||
|
{
|
||||||
|
Pos.vy += 2 * _frames;
|
||||||
|
|
||||||
|
if ( Pos.vy > m_base.vy )
|
||||||
|
{
|
||||||
|
Pos.vy = m_base.vy;
|
||||||
|
|
||||||
|
m_isResetting = false;
|
||||||
|
m_isMoving = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Pos.vy -= m_speed * _frames;
|
Pos.vy -= m_speed * _frames;
|
||||||
|
|
||||||
if ( Pos.vy < 0 )
|
if ( Pos.vy < 0 )
|
||||||
{
|
{
|
||||||
m_isActive = false;
|
m_isResetting = true;
|
||||||
m_timer = getRnd() % ( 4 * GameState::getOneSecondInFrames() );
|
}
|
||||||
m_timerType = NPC_PLATFORM_TIMER_RESPAWN;
|
|
||||||
m_isMoving = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ protected:
|
||||||
virtual void processMovement( int _frames );
|
virtual void processMovement( int _frames );
|
||||||
|
|
||||||
u8 m_isMoving;
|
u8 m_isMoving;
|
||||||
|
u8 m_isResetting;
|
||||||
DVECTOR m_lineBase;
|
DVECTOR m_lineBase;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue