This commit is contained in:
Daveo 2001-05-29 18:40:38 +00:00
parent 66b8f87573
commit a22646985b
14 changed files with 37 additions and 37 deletions

View file

@ -50,7 +50,7 @@ void CNpcGeyserPlatformGenerator::think( int _frames )
if ( m_timer < 0 )
{
//m_timer = getRnd() % ( m_data[m_type].initTimer * GameState::getOneSecondInFrames() );
m_timer = m_data[m_type].initTimer * GameState::getOneSecondInFrames();
m_timer = m_dataPtr->initTimer * GameState::getOneSecondInFrames();
// generate new falling platform
@ -75,7 +75,7 @@ void CNpcGeyserPlatformGenerator::think( int _frames )
ASSERT(newPlatform);
newPlatform->setType( m_targetType );
newPlatform->setThingSubType( m_targetType );
newPlatform->setGraphic( m_graphicNum );
DVECTOR startPos = Pos;

View file

@ -53,7 +53,7 @@ void CNpcConveyorPlatformGenerator::think( int _frames )
m_timer = second;
m_timer += m_data[m_type].initTimer * second;
m_timer += m_dataPtr->initTimer * second;
m_timer += second - ( getRnd() % ( 2 * second ) );
@ -66,7 +66,7 @@ void CNpcConveyorPlatformGenerator::think( int _frames )
ASSERT(newPlatform);
newPlatform->setType( NPC_CONVEYOR_PLATFORM );
newPlatform->setThingSubType( NPC_CONVEYOR_PLATFORM );
newPlatform->setGraphic( m_graphicNum );
CNpcWaypoint *sourceWaypoint = m_npcPath.getWaypointList();

View file

@ -53,7 +53,7 @@ void CNpcFallingPlatformGenerator::think( int _frames )
m_timer = second;
m_timer += m_data[m_type].initTimer * second;
m_timer += m_dataPtr->initTimer * second;
m_timer += second - ( getRnd() % ( 2 * second ) );
@ -84,7 +84,7 @@ void CNpcFallingPlatformGenerator::think( int _frames )
ASSERT(newPlatform);
newPlatform->setType( m_targetType );
newPlatform->setThingSubType( m_targetType );
newPlatform->setGraphic( m_graphicNum );
CNpcWaypoint *sourceWaypoint = m_npcPath.getWaypointList();

View file

@ -394,7 +394,6 @@ CNpcPlatform *CNpcPlatform::Create(int Type)
}
ASSERT(platform);
platform->setType( (NPC_PLATFORM_UNIT_TYPE) Type );
platform->setThingSubType( Type );
platform->setTiltable( false );
@ -422,7 +421,7 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
dualPlatformSlave = (CNpcDualPlatform *) CNpcPlatform::Create( NPC_DUAL_PLATFORM );
dualPlatformSlave->setMaster( false );
dualPlatformSlave->setType( Type );
dualPlatformSlave->setThingSubType( Type );
dualPlatformSlave->setGraphic( ThisPlatform );
dualPlatformSlave->setTiltable( false );
@ -504,6 +503,7 @@ void CNpcPlatform::init()
{
CPlatformThing::init();
m_dataPtr=&m_data[getThingSubType()];
m_heading = 0;
m_velocity = 0;
@ -511,10 +511,10 @@ void CNpcPlatform::init()
m_reversed = false;
m_extension = 0;
m_contact = false;
m_timer = m_data[m_type].initTimer * GameState::getOneSecondInFrames();
m_timerType = m_data[m_type].initTimerType;
m_timer = m_dataPtr->initTimer * GameState::getOneSecondInFrames();
m_timerType = m_dataPtr->initTimerType;
m_isActive = true;
m_detectCollision = m_data[m_type].detectCollision;
m_detectCollision = m_dataPtr->detectCollision;
m_state = 0;
m_tiltAngle = 0;
m_tiltVelocity = 0;
@ -522,13 +522,13 @@ void CNpcPlatform::init()
m_initRotation = 0;
m_lifetime = 0;
m_lifetimeType = m_data[m_type].lifetimeType;
m_lifetimeType = m_dataPtr->lifetimeType;
m_isShuttingDown = false;
m_npcPath.initPath();
m_speed = m_data[m_type].speed;
m_speed = m_dataPtr->speed;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -539,7 +539,7 @@ void CNpcPlatform::init( DVECTOR initPos )
Pos = m_initPos = m_base = initPos;
m_initLifetime = m_lifetime = GameState::getOneSecondInFrames() * m_data[m_type].lifetime;
m_initLifetime = m_lifetime = GameState::getOneSecondInFrames() * m_dataPtr->lifetime;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -560,10 +560,10 @@ void CNpcPlatform::reinit()
m_rotation = 0;
m_reversed = false;
m_contact = false;
m_timer = m_data[m_type].initTimer * GameState::getOneSecondInFrames();
m_timerType = m_data[m_type].initTimerType;
m_timer = m_dataPtr->initTimer * GameState::getOneSecondInFrames();
m_timerType = m_dataPtr->initTimerType;
m_isActive = true;
m_detectCollision = m_data[m_type].detectCollision;
m_detectCollision = m_dataPtr->detectCollision;
m_state = 0;
m_tiltAngle = 0;
m_tiltVelocity = 0;
@ -1205,7 +1205,8 @@ void CNpcPlatform::addWaypoint( s32 xPos, s32 yPos )
void CNpcPlatform::setTypeFromMapEdit( u16 newType )
{
m_type = mapEditConvertTable[newType];
int Type= mapEditConvertTable[newType];
setThingSubType(Type);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -103,7 +103,6 @@ public:
virtual void think(int _frames);
virtual void render();
virtual u8 canDrop() {return true;}
void setType( NPC_PLATFORM_UNIT_TYPE newType ) {m_type = newType;}
void setTypeFromMapEdit( u16 newType );
virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
virtual u8 checkCollisionDelta( CThing *_thisThing, int threshold, CRECT collisionArea );
@ -114,7 +113,6 @@ public:
void setGraphic( u8 graphicNum );
virtual void setWaypoints( sThingPlatform *ThisPlatform );
virtual void trigger() {;}
NPC_PLATFORM_UNIT_TYPE getType() {return( m_type );}
static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType );
static CNpcPlatform *Create(int Type);
@ -187,7 +185,8 @@ protected:
// internal variables
NPC_PLATFORM_UNIT_TYPE m_type;
// NPC_PLATFORM_UNIT_TYPE m_type;
NPC_PLATFORM_DATA *m_dataPtr;
CNpcPath m_npcPath;
s32 m_heading;
s32 m_velocity;

View file

@ -40,7 +40,7 @@ void CNpcLinearPlatform::processMovement( int _frames )
if ( !pathComplete )
{
s16 decDir, incDir;
s16 maxTurnRate = m_data[m_type].turnSpeed;
s16 maxTurnRate = m_dataPtr->turnSpeed;
decDir = m_heading - headingToTarget;

View file

@ -88,6 +88,7 @@ void CNpcRisingBridgePlatform::setWaypoints( sThingPlatform *ThisPlatform )
ASSERT( trigger );
trigger->init();
trigger->setThingSubType(0);
trigger->setPositionAndSize( newXPos << 4, newYPos << 4, 100, 0 );
//trigger->setTargetBox(TriggerList->TargetPos.X<<4,TriggerList->TargetPos.Y<<4,TriggerList->TargetSize.X<<4,TriggerList->TargetSize.Y<<4);
trigger->setPlatform( this );
@ -100,7 +101,7 @@ void CNpcRisingBridgePlatform::processMovement( int _frames )
if ( m_triggered )
{
m_triggered = false;
m_extension += ( m_data[m_type].speed * _frames ) << 8;
m_extension += ( m_dataPtr->speed * _frames ) << 8;
if ( m_extension > m_maxExtension )
{
m_extension = m_maxExtension;