This commit is contained in:
parent
4e4300b439
commit
aa3b575d38
3 changed files with 48 additions and 4 deletions
|
@ -81,8 +81,34 @@ void CNpcGeyserPlatformGenerator::think( int _frames )
|
|||
startPos.vx += ( -5 + ( getRnd() % 11 ) );
|
||||
newPlatform->init( startPos );
|
||||
|
||||
CNpcWaypoint *sourceWaypoint = m_npcPath.getWaypointList();
|
||||
|
||||
if ( sourceWaypoint )
|
||||
{
|
||||
while( sourceWaypoint )
|
||||
{
|
||||
newPlatform->addWaypoint( sourceWaypoint->pos.vx >> 4, sourceWaypoint->pos.vy >> 4 );
|
||||
sourceWaypoint = sourceWaypoint->nextWaypoint;
|
||||
}
|
||||
}
|
||||
|
||||
newPlatform->setLayerCollision( m_layerCollision );
|
||||
newPlatform->setTiltable( false );
|
||||
newPlatform->postInit();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcGeyserPlatformGenerator::getThinkBBox()
|
||||
{
|
||||
CRECT objThinkBox = getCollisionArea();
|
||||
|
||||
sBBox &thinkBBox = CThingManager::getThinkBBox();
|
||||
objThinkBox.x1 = thinkBBox.XMin;
|
||||
objThinkBox.x2 = thinkBBox.XMax;
|
||||
objThinkBox.y1 = thinkBBox.YMin;
|
||||
objThinkBox.y2 = thinkBBox.YMax;
|
||||
|
||||
return &objThinkBox;
|
||||
}
|
|
@ -23,6 +23,7 @@ class CNpcGeyserPlatformGenerator : public CNpcPlatform
|
|||
public:
|
||||
void setTargetType( NPC_PLATFORM_UNIT_TYPE targetType ) {m_targetType = targetType;}
|
||||
virtual void render();
|
||||
virtual CRECT const *getThinkBBox();
|
||||
protected:
|
||||
virtual void think( int _frames );
|
||||
virtual void collidedWith(CThing *_thisThing);
|
||||
|
|
|
@ -19,11 +19,28 @@
|
|||
|
||||
void CNpcBubblePlatform::processMovement( int _frames )
|
||||
{
|
||||
Pos.vy -= m_speed * _frames;
|
||||
|
||||
if ( Pos.vy < 0 )
|
||||
if ( !isSetToShutdown() )
|
||||
{
|
||||
setToShutdown();
|
||||
Pos.vy -= m_speed * _frames;
|
||||
|
||||
if ( m_npcPath.getWaypointCount() > 1 )
|
||||
{
|
||||
s32 minY, maxY;
|
||||
|
||||
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||
|
||||
if ( Pos.vy < minY )
|
||||
{
|
||||
setToShutdown();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Pos.vy < 0 )
|
||||
{
|
||||
setToShutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue