This commit is contained in:
parent
c574dd3894
commit
adee4b97be
@ -133,6 +133,16 @@ void CNpcJumpingClamEnemy::setupWaypoints( sThingActor *ThisActor )
|
||||
|
||||
m_maxExtension = isqrt2( ( xDist * xDist ) + ( yDist * yDist ) );
|
||||
}
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -137,6 +137,16 @@ void CNpcMotherJellyfishEnemy::setupWaypoints( sThingActor *ThisActor )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -519,6 +519,16 @@ void CNpcEnemy::setupWaypoints( sThingActor *ThisActor )
|
||||
|
||||
setHeading( newXPos, newYPos );
|
||||
}
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -125,6 +125,7 @@ public:
|
||||
virtual void setupWaypoints( sThingActor *ThisActor );
|
||||
|
||||
virtual int canCollide();
|
||||
virtual CRECT const *getThinkBBox() {return &m_thinkArea;}
|
||||
|
||||
bool canBeSuckedUp();
|
||||
bool suckUp( DVECTOR *suckPos, int _frames );
|
||||
@ -313,6 +314,7 @@ protected:
|
||||
u8 m_isDying;
|
||||
u32 m_RGB;
|
||||
int m_soundId;
|
||||
CRECT m_thinkArea;
|
||||
|
||||
s32 m_frame;
|
||||
int m_animNo;
|
||||
|
@ -29,6 +29,7 @@ public:
|
||||
virtual void render();
|
||||
virtual int getFrameCount() {return( FRM_JELLYFISH1_SWIM7 - FRM_JELLYFISH1_SWIM1 + 1 );}
|
||||
virtual u8 canCollideWithEnemy() {return( false );}
|
||||
virtual CRECT const *getThinkBBox() {return( &getCollisionArea() );}
|
||||
protected:
|
||||
virtual bool processSensor();
|
||||
virtual void processClose( int _frames );
|
||||
|
@ -721,7 +721,7 @@ void CNpcSeaSnakeEnemy::processShot( int _frames )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcSeaSnakeEnemy::getThinkBBox()
|
||||
/*const CRECT *CNpcSeaSnakeEnemy::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -732,7 +732,7 @@ const CRECT *CNpcSeaSnakeEnemy::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
virtual void shutdown();
|
||||
virtual void render();
|
||||
virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual bool processSensor();
|
||||
virtual void processClose( int _frames );
|
||||
|
@ -158,7 +158,7 @@ void CNpcSkullStomperEnemy::processClose( int _frames )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcSkullStomperEnemy::getThinkBBox()
|
||||
/*const CRECT *CNpcSkullStomperEnemy::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -169,7 +169,7 @@ const CRECT *CNpcSkullStomperEnemy::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -18,7 +18,7 @@ class CNpcSkullStomperEnemy : public CNpcEnemy
|
||||
{
|
||||
public:
|
||||
virtual void postInit();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void processEnemyCollision( CThing *thisThing );
|
||||
virtual bool processSensor();
|
||||
|
@ -375,6 +375,16 @@ void CNpcHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||
|
||||
Pos = startPos;
|
||||
m_base = Pos;
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -83,6 +83,7 @@ public:
|
||||
virtual void setRespawnRate( s16 newRespawnRate ) {m_respawnRate=newRespawnRate;}
|
||||
virtual void trigger() {}
|
||||
virtual void leftThinkZone(int _frames);
|
||||
virtual CRECT const *getThinkBBox() {return &m_thinkArea;}
|
||||
|
||||
static NPC_HAZARD_UNIT_TYPE getTypeFromMapEdit( u16 newType );
|
||||
static CNpcHazard *Create(int Type);
|
||||
@ -118,6 +119,7 @@ protected:
|
||||
CModelGfx *m_modelGfx;
|
||||
s16 m_respawnRate;
|
||||
int m_soundId;
|
||||
CRECT m_thinkArea;
|
||||
|
||||
CThing *m_platform;
|
||||
|
||||
|
@ -155,7 +155,7 @@ void CNpcBarrelHazard::render()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcBarrelHazard::getThinkBBox()
|
||||
/*const CRECT *CNpcBarrelHazard::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -166,4 +166,4 @@ const CRECT *CNpcBarrelHazard::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
@ -23,7 +23,7 @@ class CNpcBarrelHazard : public CNpcHazard
|
||||
public:
|
||||
void init();
|
||||
void render();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
void processMovement( int _frames );
|
||||
|
||||
|
@ -198,7 +198,7 @@ void CNpcBouncingBarrelHazard::render()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcBouncingBarrelHazard::getThinkBBox()
|
||||
/*const CRECT *CNpcBouncingBarrelHazard::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -209,7 +209,7 @@ const CRECT *CNpcBouncingBarrelHazard::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -23,7 +23,7 @@ class CNpcBouncingBarrelHazard : public CNpcHazard
|
||||
public:
|
||||
void init();
|
||||
void render();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
void processMovement( int _frames );
|
||||
virtual void collidedWith(CThing *_thisThing);
|
||||
|
@ -77,6 +77,16 @@ void CNpcBouncingRockHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||
trigger=(CHazardTrigger*)CTrigger::Create(CTrigger::TRIGGER_HAZARD_WALK);
|
||||
trigger->setPositionAndSize( ( newXPos << 4 ) + 8, ( newYPos << 4 ) + 16, 100, 0 );
|
||||
trigger->setHazard( this );
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -79,7 +79,7 @@ void CNpcBigWheelHazard::collidedWith( CThing *_thisThing )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcBigWheelHazard::getThinkBBox()
|
||||
/*const CRECT *CNpcBigWheelHazard::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -90,4 +90,4 @@ const CRECT *CNpcBigWheelHazard::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
@ -23,7 +23,7 @@ class CNpcBigWheelHazard : public CNpcHazard
|
||||
public:
|
||||
void init();
|
||||
virtual void render();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
void processMovement( int _frames );
|
||||
virtual void collidedWith(CThing *_thisThing);
|
||||
|
@ -105,6 +105,16 @@ void CNpcConveyorSwitchHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||
PntList++;
|
||||
m_conveyorPos.vx = ( newXPos << 4 ) + 8;
|
||||
m_conveyorPos.vy = ( newYPos << 4 ) + 8;
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -181,7 +181,7 @@ void CNpcDualPlatformBarrelHazard::render()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcDualPlatformBarrelHazard::getThinkBBox()
|
||||
/*const CRECT *CNpcDualPlatformBarrelHazard::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -192,4 +192,4 @@ const CRECT *CNpcDualPlatformBarrelHazard::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
@ -23,7 +23,7 @@ class CNpcDualPlatformBarrelHazard : public CNpcHazard
|
||||
public:
|
||||
void init();
|
||||
void render();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
void processMovement( int _frames );
|
||||
|
||||
|
@ -259,6 +259,16 @@ void CNpcFallingHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||
|
||||
Pos = startPos;
|
||||
m_base = Pos;
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -78,6 +78,11 @@ void CNpcFireballHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||
m_width = -m_width;
|
||||
}
|
||||
}
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -63,6 +63,15 @@ void CNpcLogHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||
Pos = startPos;
|
||||
Pos.vy = minY;
|
||||
m_base = Pos;
|
||||
|
||||
s32 minX, maxX;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -84,7 +84,10 @@ void CNpcPendulumHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||
Pos = startPos;
|
||||
}
|
||||
|
||||
m_base = Pos;
|
||||
m_thinkArea.x1 = Pos.vx - m_length;
|
||||
m_thinkArea.x2 = Pos.vx + m_length;
|
||||
m_thinkArea.y1 = Pos.vy - m_length;
|
||||
m_thinkArea.y2 = Pos.vy + m_length;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -57,6 +57,16 @@ void CNpcPressureSwitchHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||
|
||||
Pos = startPos;
|
||||
m_base = Pos;
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -202,7 +202,7 @@ void CNpcRollingRockHazard::render()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcRollingRockHazard::getThinkBBox()
|
||||
/*const CRECT *CNpcRollingRockHazard::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -213,4 +213,4 @@ const CRECT *CNpcRollingRockHazard::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
@ -23,7 +23,7 @@ class CNpcRollingRockHazard : public CNpcHazard
|
||||
public:
|
||||
void init();
|
||||
void render();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
void processMovement( int _frames );
|
||||
|
||||
|
@ -95,6 +95,16 @@ void CNpcRisingWeightHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||
m_pulleyPos.vx = startPos.vx;
|
||||
m_pulleyPos.vy = startPos.vy - ( m_maxExtension >> 8 );
|
||||
}
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -57,6 +57,16 @@ void CNpcRisingWeightWheelHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||
|
||||
m_wheelPos.vx = newXPos;
|
||||
m_wheelPos.vy = newYPos;
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -95,7 +95,7 @@ void CNpcSpikesHazard::processMovement( int _frames )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcSpikesHazard::getThinkBBox()
|
||||
/*const CRECT *CNpcSpikesHazard::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -106,7 +106,7 @@ const CRECT *CNpcSpikesHazard::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -22,7 +22,7 @@ class CNpcSpikesHazard : public CNpcHazard
|
||||
{
|
||||
public:
|
||||
void init();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void processTimer( int _frames );
|
||||
void processMovement( int _frames );
|
||||
|
@ -93,4 +93,9 @@ void CNpcSwordfishHazard::setWaypoints( sThingHazard *ThisHazard )
|
||||
m_heading = 2048;
|
||||
}
|
||||
}
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
@ -153,6 +153,16 @@ void CNpcBalloonBridgePlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
PntList++;
|
||||
|
||||
m_maxExtension = abs( ( ( newYPos << 4 ) + 16 ) - startPos.vy );
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -92,7 +92,7 @@ void CNpcGeyserPlatformGenerator::think( int _frames )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcGeyserPlatformGenerator::getThinkBBox()
|
||||
/*const CRECT *CNpcGeyserPlatformGenerator::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -103,4 +103,4 @@ const CRECT *CNpcGeyserPlatformGenerator::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
@ -23,7 +23,7 @@ class CNpcGeyserPlatformGenerator : public CNpcPlatform
|
||||
public:
|
||||
void setTargetType( NPC_PLATFORM_UNIT_TYPE targetType ) {m_targetType = targetType;}
|
||||
virtual void render();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void think( int _frames );
|
||||
virtual void collidedWith(CThing *_thisThing);
|
||||
|
@ -95,6 +95,16 @@ void CNpcBranchPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
{
|
||||
m_reversed = false;
|
||||
}
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -31,6 +31,16 @@ void CNpcBubblePlatform::postInit()
|
||||
CNpcPlatform::postInit();
|
||||
|
||||
m_pop = false;
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -109,7 +119,7 @@ void CNpcBubblePlatform::processLifetime( int _frames )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcBubblePlatform::getThinkBBox()
|
||||
/*const CRECT *CNpcBubblePlatform::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -120,4 +130,4 @@ const CRECT *CNpcBubblePlatform::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
@ -23,7 +23,7 @@ class CNpcBubblePlatform : public CNpcPlatform
|
||||
public:
|
||||
virtual void render();
|
||||
virtual void postInit();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void processLifetime( int _frames );
|
||||
virtual void processMovement( int _frames );
|
||||
|
@ -65,6 +65,16 @@ void CNpcBubbleTubePlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
PntList++;
|
||||
|
||||
m_maxExtension = ( ( newYPos << 4 ) + 16 ) - startPos.vy;
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -89,11 +89,16 @@ void CNpcBigWheelPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
{
|
||||
init( startPos );
|
||||
}
|
||||
|
||||
m_thinkArea.x1 = Pos.vx - m_extension;
|
||||
m_thinkArea.x2 = Pos.vx + m_extension;
|
||||
m_thinkArea.y1 = Pos.vy - m_extension;
|
||||
m_thinkArea.y2 = Pos.vy + m_extension;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcBigWheelPlatform::getThinkBBox()
|
||||
/*const CRECT *CNpcBigWheelPlatform::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -104,7 +109,7 @@ const CRECT *CNpcBigWheelPlatform::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
class CNpcBigWheelPlatform : public CNpcPlatform
|
||||
{
|
||||
public:
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
virtual void postInit();
|
||||
virtual int getHeightFromPlatformAtPosition(int _x,int _y, int offsetX = 0, int offsetY = 0);
|
||||
protected:
|
||||
|
@ -87,7 +87,7 @@ void CNpcConveyorPlatformGenerator::think( int _frames )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcConveyorPlatformGenerator::getThinkBBox()
|
||||
/*const CRECT *CNpcConveyorPlatformGenerator::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -98,7 +98,7 @@ const CRECT *CNpcConveyorPlatformGenerator::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -183,7 +183,7 @@ void CNpcConveyorPlatform::processMovement( int _frames )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcConveyorPlatform::getThinkBBox()
|
||||
/*const CRECT *CNpcConveyorPlatform::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -194,7 +194,7 @@ const CRECT *CNpcConveyorPlatform::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -22,7 +22,7 @@ class CNpcConveyorPlatform : public CNpcPlatform
|
||||
{
|
||||
public:
|
||||
virtual void postInit();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
virtual void render();
|
||||
virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
|
||||
protected:
|
||||
@ -37,7 +37,7 @@ class CNpcConveyorPlatformGenerator : public CNpcPlatform
|
||||
{
|
||||
public:
|
||||
virtual void render();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void think( int _frames );
|
||||
virtual void collidedWith(CThing *_thisThing);
|
||||
|
@ -38,7 +38,7 @@ void CNpcDropPlatform::processMovement( int _frames )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcDropPlatform::getThinkBBox()
|
||||
/*const CRECT *CNpcDropPlatform::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -49,4 +49,4 @@ const CRECT *CNpcDropPlatform::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
@ -20,8 +20,8 @@
|
||||
|
||||
class CNpcDropPlatform : public CNpcPlatform
|
||||
{
|
||||
public:
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//public:
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void processMovement( int _frames );
|
||||
};
|
||||
|
@ -127,6 +127,16 @@ void CNpcDualPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
setLineBase( Pos );
|
||||
m_otherPlatform->setLineBase( slavePos );
|
||||
}
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -311,7 +321,7 @@ void CNpcDualPlatform::render()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcDualPlatform::getThinkBBox()
|
||||
/*const CRECT *CNpcDualPlatform::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -322,7 +332,7 @@ const CRECT *CNpcDualPlatform::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
void setLineBase( DVECTOR base ) {m_lineBase = base;}
|
||||
DVECTOR getLineBase() {return( m_lineBase );}
|
||||
virtual void render();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void setWaypoints( sThingPlatform *ThisPlatform );
|
||||
virtual void processMovement( int _frames );
|
||||
|
@ -150,7 +150,7 @@ void CNpcJellyfishPlatform::think( int _frames )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcJellyfishPlatform::getThinkBBox()
|
||||
/*const CRECT *CNpcJellyfishPlatform::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -161,4 +161,4 @@ const CRECT *CNpcJellyfishPlatform::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
@ -23,7 +23,7 @@ class CNpcJellyfishPlatform : public CNpcLinearPlatform
|
||||
public:
|
||||
virtual void postInit();
|
||||
virtual void think( int _frames );
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void collidedWith(CThing *_thisThing);
|
||||
|
||||
|
@ -81,6 +81,16 @@ void CNpcLanternPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
{
|
||||
init( startPos );
|
||||
}
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -116,7 +126,7 @@ void CNpcLanternPlatform::processMovement( int _frames )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcLanternPlatform::getThinkBBox()
|
||||
/*const CRECT *CNpcLanternPlatform::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -127,4 +137,4 @@ const CRECT *CNpcLanternPlatform::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
||||
|
@ -22,7 +22,7 @@ class CNpcLanternPlatform : public CNpcPlatform
|
||||
{
|
||||
public:
|
||||
virtual void postInit();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void setWaypoints( sThingPlatform *ThisPlatform );
|
||||
virtual void processMovement( int _frames );
|
||||
|
@ -555,6 +555,16 @@ void CNpcPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
setWaypointCount( ThisPlatform->PointCount - 1 );
|
||||
|
||||
setWaypointPtr( waypoints );
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -125,6 +125,7 @@ public:
|
||||
virtual void jump() {;}
|
||||
virtual void leftThinkZone(int _frames);
|
||||
s16 getCollisionAngle() {return m_collisionAngle;}
|
||||
virtual CRECT const *getThinkBBox() {return &m_thinkArea;}
|
||||
|
||||
static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType );
|
||||
static CNpcPlatform *Create(int Type);
|
||||
@ -246,6 +247,7 @@ protected:
|
||||
virtual void setCollisionAngle(int newAngle); // Actually.. this probly doesn't need to be in the base calss anymore.. :/
|
||||
s16 m_collisionAngle;
|
||||
|
||||
CRECT m_thinkArea;
|
||||
|
||||
};
|
||||
|
||||
|
@ -65,6 +65,16 @@ void CNpcLiftPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
PntList++;
|
||||
|
||||
m_maxExtension = ( ( newYPos << 4 ) + 16 ) - startPos.vy;
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -139,7 +139,7 @@ void CNpcLinearPlatform::processMovement( int _frames )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcLinearPlatform::getThinkBBox()
|
||||
/*const CRECT *CNpcLinearPlatform::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -150,4 +150,4 @@ const CRECT *CNpcLinearPlatform::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
@ -22,7 +22,7 @@ class CNpcLinearPlatform : public CNpcPlatform
|
||||
{
|
||||
public:
|
||||
virtual void postInit();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void processMovement( int _frames );
|
||||
};
|
||||
|
@ -88,7 +88,14 @@ void CNpcPendulumPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
else
|
||||
{
|
||||
init( startPos );
|
||||
|
||||
m_length = 200;
|
||||
}
|
||||
|
||||
m_thinkArea.x1 = Pos.vx - m_length;
|
||||
m_thinkArea.x2 = Pos.vx + m_length;
|
||||
m_thinkArea.y1 = Pos.vy - m_length;
|
||||
m_thinkArea.y2 = Pos.vy + m_length;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -192,7 +199,7 @@ void CNpcPendulumPlatform::render()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcPendulumPlatform::getThinkBBox()
|
||||
/*const CRECT *CNpcPendulumPlatform::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -200,4 +207,4 @@ const CRECT *CNpcPendulumPlatform::getThinkBBox()
|
||||
objThinkBox.y1 = thinkBBox.YMax - 1;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
@ -23,7 +23,7 @@ class CNpcPendulumPlatform : public CNpcPlatform
|
||||
public:
|
||||
virtual void postInit();
|
||||
virtual void render();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void setWaypoints( sThingPlatform *ThisPlatform );
|
||||
virtual void processMovement( int _frames );
|
||||
|
@ -214,7 +214,7 @@ void CNpcRaftPlatform::render()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcRaftPlatform::getThinkBBox()
|
||||
/*const CRECT *CNpcRaftPlatform::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
@ -225,4 +225,4 @@ const CRECT *CNpcRaftPlatform::getThinkBBox()
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
||||
}*/
|
@ -23,7 +23,7 @@ class CNpcRaftPlatform : public CNpcPlatform
|
||||
public:
|
||||
virtual void postInit();
|
||||
virtual void render();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
//virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void processMovement( int _frames );
|
||||
|
||||
|
@ -90,6 +90,16 @@ void CNpcRisingBridgePlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
trigger->setPositionAndSize( ( newXPos << 4 ) + 8, ( newYPos << 4 ) + 16, 100, 0 );
|
||||
//trigger->setTargetBox(TriggerList->TargetPos.X<<4,TriggerList->TargetPos.Y<<4,TriggerList->TargetSize.X<<4,TriggerList->TargetSize.Y<<4);
|
||||
trigger->setPlatform( this );
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -168,6 +168,16 @@ void CNpcSteamSwitchPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
trigger=(CSteamSwitchEmitterTrigger*)CTrigger::Create(CTrigger::TRIGGER_STEAM_SWITCH_EMITTER);
|
||||
trigger->setPositionAndSize( ( newXPos << 4 ) + 8, ( newYPos << 4 ) + 16 - 50, 100, 100 );
|
||||
trigger->toggleVisible();
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -89,6 +89,16 @@ void CNpcTrapdoorPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||
|
||||
m_triggerPos.vx = newXPos;
|
||||
m_triggerPos.vy = newYPos;
|
||||
|
||||
s32 minX, maxX, minY, maxY;
|
||||
|
||||
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
m_thinkArea.x1 = minX;
|
||||
m_thinkArea.x2 = maxX;
|
||||
m_thinkArea.y1 = minY;
|
||||
m_thinkArea.y2 = maxY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user