This commit is contained in:
parent
00e017b62d
commit
4c64c9ed4e
25 changed files with 58 additions and 40 deletions
|
@ -19,7 +19,7 @@
|
|||
|
||||
void CNpcBubblePlatform::processMovement( int _frames )
|
||||
{
|
||||
Pos.vy -= m_data[m_type].speed * _frames;
|
||||
Pos.vy -= m_speed * _frames;
|
||||
|
||||
if ( Pos.vy < 0 )
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
void CNpcBigWheelPlatform::processMovement( int _frames )
|
||||
{
|
||||
m_rotation += m_data[m_type].speed * _frames;
|
||||
m_rotation += m_speed * _frames;
|
||||
m_rotation &= 4095;
|
||||
|
||||
Pos.vx = m_base.vx + ( ( m_extension * rcos( m_rotation ) ) >> 12 );
|
||||
|
|
|
@ -35,7 +35,7 @@ void CNpcCartPlatform::postInit()
|
|||
|
||||
m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH );
|
||||
|
||||
m_carSpeed = m_data[m_type].speed << 8;
|
||||
m_carSpeed = m_speed << 8;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -28,7 +28,7 @@ void CNpcCircularPlatform::postInit()
|
|||
|
||||
void CNpcCircularPlatform::processMovement( int _frames )
|
||||
{
|
||||
m_rotation += m_data[m_type].speed;
|
||||
m_rotation += m_speed;
|
||||
m_rotation &= 4095;
|
||||
|
||||
Pos.vx = m_base.vx + ( ( m_extension * rcos( m_rotation ) ) >> 12 );
|
||||
|
|
|
@ -55,7 +55,7 @@ void CNpcFallingPlatform::processMovement( int _frames )
|
|||
else
|
||||
{
|
||||
moveX = 0;
|
||||
moveY = m_data[m_type].speed * _frames;
|
||||
moveY = m_speed * _frames;
|
||||
|
||||
if ( heading == 3072 )
|
||||
{
|
||||
|
|
|
@ -49,7 +49,7 @@ void CNpcFallingNoRespawnPlatform::processMovement( int _frames )
|
|||
else
|
||||
{
|
||||
moveX = 0;
|
||||
moveY = m_data[m_type].speed * _frames;
|
||||
moveY = m_speed * _frames;
|
||||
|
||||
if ( heading == 3072 )
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@ void CNpcFishHookPlatform::processMovement( int _frames )
|
|||
{
|
||||
if ( m_isMoving )
|
||||
{
|
||||
Pos.vy -= m_data[m_type].speed * _frames;
|
||||
Pos.vy -= m_speed * _frames;
|
||||
|
||||
if ( Pos.vy < 0 )
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ void CNpcGeyserPlatform::processMovement( int _frames )
|
|||
}
|
||||
else
|
||||
{
|
||||
s32 moveY = m_data[m_type].speed * _frames;
|
||||
s32 moveY = m_speed * _frames;
|
||||
|
||||
if ( Pos.vy < ( minY + 64 ) )
|
||||
{
|
||||
|
@ -86,7 +86,7 @@ void CNpcGeyserPlatform::processMovement( int _frames )
|
|||
}
|
||||
else
|
||||
{
|
||||
s32 moveY = m_data[m_type].speed * _frames;
|
||||
s32 moveY = m_speed * _frames;
|
||||
|
||||
if ( Pos.vy < ( minY + 64 ) )
|
||||
{
|
||||
|
|
|
@ -428,6 +428,8 @@ void CNpcPlatform::init()
|
|||
m_isShuttingDown = false;
|
||||
|
||||
m_npcPath.initPath();
|
||||
|
||||
m_speed = m_data[m_type].speed;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -112,6 +112,8 @@ public:
|
|||
void setToShutdown();
|
||||
u8 isSetToShutdown() {return( m_isShuttingDown );}
|
||||
|
||||
void setSpeed( s16 newSpeed ) {m_speed = newSpeed;}
|
||||
|
||||
protected:
|
||||
// NPC data structure definitions //
|
||||
|
||||
|
@ -202,6 +204,7 @@ protected:
|
|||
s32 m_tiltAngle;
|
||||
s32 m_tiltVelocity;
|
||||
bool m_extendDir;
|
||||
s16 m_speed;
|
||||
|
||||
CModelGfx *m_modelGfx;
|
||||
u8 m_isShuttingDown;
|
||||
|
|
|
@ -59,7 +59,7 @@ void CNpcLeafPlatform::processMovement( int _frames )
|
|||
else
|
||||
{
|
||||
moveX = 0;
|
||||
moveY = m_data[m_type].speed * _frames;
|
||||
moveY = m_speed * _frames;
|
||||
|
||||
if ( heading == 3072 )
|
||||
{
|
||||
|
|
|
@ -77,8 +77,8 @@ void CNpcLinearPlatform::processMovement( int _frames )
|
|||
m_heading += moveDist;
|
||||
m_heading &= 4095;
|
||||
|
||||
s32 preShiftX = _frames * m_data[m_type].speed * rcos( m_heading );
|
||||
s32 preShiftY = _frames * m_data[m_type].speed * rsin( m_heading );
|
||||
s32 preShiftX = _frames * m_speed * rcos( m_heading );
|
||||
s32 preShiftY = _frames * m_speed * rsin( m_heading );
|
||||
|
||||
moveX = preShiftX >> 12;
|
||||
if ( !moveX && preShiftX )
|
||||
|
|
|
@ -89,7 +89,7 @@ void CNpcRaftPlatform::processMovement( int _frames )
|
|||
|
||||
distX = distX / abs( distX );
|
||||
|
||||
if ( m_layerCollision->getHeightFromGround( Pos.vx + ( distX * m_data[m_type].speed * _frames ), Pos.vy ) < -maxHeight )
|
||||
if ( m_layerCollision->getHeightFromGround( Pos.vx + ( distX * m_speed * _frames ), Pos.vy ) < -maxHeight )
|
||||
{
|
||||
// there is an obstacle in the way, increment the path point (hopefully this will resolve the problem)
|
||||
|
||||
|
@ -105,7 +105,7 @@ void CNpcRaftPlatform::processMovement( int _frames )
|
|||
{
|
||||
// groundHeight <= yMovement indicates either just above ground or on or below ground
|
||||
|
||||
moveX = distX * m_data[m_type].speed * _frames;
|
||||
moveX = distX * m_speed * _frames;
|
||||
moveY = groundHeight;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -63,11 +63,11 @@ void CNpcSteerableBarrelPlatform::processMovement( int _frames )
|
|||
{
|
||||
// roll barrel right
|
||||
|
||||
moveX = m_data[m_type].speed * _frames;
|
||||
moveX = m_speed * _frames;
|
||||
}
|
||||
else if ( playerX < -5 )
|
||||
{
|
||||
moveX = -m_data[m_type].speed * _frames;
|
||||
moveX = -m_speed * _frames;
|
||||
}
|
||||
|
||||
// check for collision
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue