2001-05-05 01:12:26 +02:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
pbgeyser.h
|
|
|
|
|
|
|
|
Author: CRB
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2001 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
#ifndef __PLATFORM_PBGEYSER_H__
|
|
|
|
#include "platform\pbgeyser.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __UTILS_HEADER__
|
|
|
|
#include "utils\utils.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __GAME_GAME_H__
|
|
|
|
#include "game\game.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void CNpcGeyserPlatformGenerator::collidedWith(CThing *_thisThing)
|
|
|
|
{
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void CNpcGeyserPlatformGenerator::render()
|
|
|
|
{
|
|
|
|
// no rendering
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void CNpcGeyserPlatformGenerator::think( int _frames )
|
|
|
|
{
|
|
|
|
m_timer -= _frames;
|
|
|
|
|
|
|
|
if ( m_timer < 0 )
|
|
|
|
{
|
2001-05-05 23:36:37 +02:00
|
|
|
//m_timer = getRnd() % ( m_data[m_type].initTimer * GameState::getOneSecondInFrames() );
|
2001-05-29 20:40:38 +02:00
|
|
|
m_timer = m_dataPtr->initTimer * GameState::getOneSecondInFrames();
|
2001-05-05 01:12:26 +02:00
|
|
|
|
|
|
|
// generate new falling platform
|
|
|
|
|
|
|
|
CNpcPlatform *newPlatform;
|
|
|
|
newPlatform = NULL;
|
|
|
|
|
|
|
|
switch( m_targetType )
|
|
|
|
{
|
|
|
|
case NPC_BUBBLE_PLATFORM:
|
|
|
|
{
|
2001-05-25 22:00:13 +02:00
|
|
|
//newPlatform = new ("falling platform") CNpcBubblePlatform;
|
|
|
|
newPlatform = CNpcPlatform::Create( m_targetType );
|
2001-05-05 01:12:26 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
ASSERT( 0 );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ASSERT(newPlatform);
|
|
|
|
|
2001-05-29 20:40:38 +02:00
|
|
|
newPlatform->setThingSubType( m_targetType );
|
2001-05-05 01:12:26 +02:00
|
|
|
newPlatform->setGraphic( m_graphicNum );
|
|
|
|
|
|
|
|
DVECTOR startPos = Pos;
|
|
|
|
startPos.vx += ( -5 + ( getRnd() % 11 ) );
|
|
|
|
newPlatform->init( startPos );
|
|
|
|
|
2001-05-30 00:07:28 +02:00
|
|
|
newPlatform->setWaypointCount( m_npcPath.getWaypointCount() );
|
|
|
|
newPlatform->setWaypointPtr( m_npcPath.getWaypointPtr() );
|
2001-05-22 22:39:46 +02:00
|
|
|
|
2001-05-05 01:12:26 +02:00
|
|
|
newPlatform->setTiltable( false );
|
|
|
|
newPlatform->postInit();
|
|
|
|
}
|
|
|
|
}
|