This commit is contained in:
parent
c574dd3894
commit
adee4b97be
64 changed files with 313 additions and 62 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue