This commit is contained in:
Charles 2001-05-04 23:12:26 +00:00
parent 9ea6f40efa
commit c1386b8903
11 changed files with 177 additions and 2 deletions

View File

@ -110,7 +110,8 @@ platform_src := platform \
pfgen \
pfallnor \
praft \
plantern
plantern \
pbgeyser
hazard_src := hazard \
hfalling \

View File

@ -0,0 +1,87 @@
/*=========================================================================
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
#ifndef __PLATFORM_PBUBBLE_H__
#include "platform\pbubble.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 )
{
m_timer = getRnd() % ( m_data[m_type].initTimer * GameState::getOneSecondInFrames() );
// generate new falling platform
CNpcPlatform *newPlatform;
newPlatform = NULL;
switch( m_targetType )
{
case NPC_BUBBLE_PLATFORM:
{
newPlatform = new ("falling platform") CNpcBubblePlatform;
break;
}
default:
{
ASSERT( 0 );
break;
}
}
ASSERT(newPlatform);
newPlatform->setType( m_targetType );
newPlatform->setGraphic( m_graphicNum );
DVECTOR startPos = Pos;
startPos.vx += ( -5 + ( getRnd() % 11 ) );
newPlatform->init( startPos );
newPlatform->setLayerCollision( m_layerCollision );
newPlatform->setTiltable( false );
newPlatform->postInit();
}
}

View File

@ -0,0 +1,33 @@
/*=========================================================================
pbgeyser.h
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __PLATFORM_PBGEYSER_H__
#define __PLATFORM_PBGEYSER_H__
#ifndef __PLATFORM_PLATFORM_H__
#include "platform\platform.h"
#endif
class CNpcGeyserPlatformGenerator : public CNpcPlatform
{
public:
void setTargetType( NPC_PLATFORM_UNIT_TYPE targetType ) {m_targetType = targetType;}
virtual void render();
protected:
virtual void think( int _frames );
virtual void collidedWith(CThing *_thisThing);
NPC_PLATFORM_UNIT_TYPE m_targetType;
};
#endif

View File

@ -20,4 +20,9 @@
void CNpcBubblePlatform::processMovement( int _frames )
{
Pos.vy -= m_data[m_type].speed * _frames;
if ( Pos.vy < 0 )
{
setToShutdown();
}
}

View File

@ -53,7 +53,7 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
DAMAGE__NONE,
0,
4,
NPC_PLATFORM_FINITE_LIFE_RESPAWN,
NPC_PLATFORM_INFINITE_LIFE,
0,
NPC_PLATFORM_TIMER_NONE,
},
@ -298,6 +298,18 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
NPC_PLATFORM_TIMER_NONE,
},
{ // NPC_BUBBLE_GEYSER_GENERATOR
2,
128,
true,
DAMAGE__NONE,
0,
4,
NPC_PLATFORM_INFINITE_LIFE,
1,
NPC_PLATFORM_TIMER_NONE,
},
{ // NPC_PLAYER_BUBBLE_PLATFORM
3,
128,
@ -335,5 +347,6 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF
NPC_RAFT_PLATFORM,
NPC_VERTICAL_OILDRUM_GENERATOR,
NPC_LANTERN_PLATFORM,
NPC_BUBBLE_GEYSER_GENERATOR,
NPC_PLAYER_BUBBLE_PLATFORM,
};

View File

@ -119,6 +119,10 @@
#include "platform\plantern.h"
#endif
#ifndef __PLATFORM_PBGEYSER_H__
#include "platform\pbgeyser.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -268,6 +272,15 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
break;
}
case NPC_BUBBLE_GEYSER_GENERATOR:
{
CNpcGeyserPlatformGenerator *generator;
generator = new ("bubble geyser generator") CNpcGeyserPlatformGenerator;
generator->setTargetType( NPC_BUBBLE_PLATFORM );
platform = generator;
break;
}
case NPC_LANTERN_PLATFORM:
{
platform = new ("lantern platform") CNpcLanternPlatform;

View File

@ -75,6 +75,7 @@ public:
NPC_VERTICAL_OILDRUM_GENERATOR,
NPC_VERTICAL_OILDRUM_PLATFORM,
NPC_LANTERN_PLATFORM,
NPC_BUBBLE_GEYSER_GENERATOR,
NPC_PLAYER_BUBBLE_PLATFORM,
NPC_PLATFORM_TYPE_MAX,
};

View File

@ -103,6 +103,7 @@ Wooden=6
Raft=19
VertOilDrumGenerator=20
SwingingLantern=21
BubbleGeyserGenerator=22
################################################
# Triggers
@ -133,5 +134,6 @@ SpinningBlades=6
Masher=7
Fan=8
Spikes=9
#Wheel=10

View File

@ -129,3 +129,13 @@ Collision=0
Health=0
AttackStrength=0
Respawn=2
#[Wheel]
#Gfx=..\..\graphics\hazards\wheel\wheel.gin
#WayPoints=0
#Speed=0
#TurnRate=0
#Collision=0
#Health=0
#AttackStrength=0
#Respawn=2

View File

@ -85,3 +85,5 @@ Gfx=..\..\Graphics\platforms\vert_Oildrum\vert_Oildrum.gin
[SwingingLantern]
Gfx=..\..\Graphics\platforms\wooden\wooden.gin
[BubbleGeyserGenerator]
Gfx=..\..\Graphics\platforms\Bubble\bubble.gin

View File

@ -1125,6 +1125,14 @@ SOURCE=..\..\..\source\pickups\pspatula.h
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\source\platform\pbgeyser.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pbgeyser.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pbob.cpp
# End Source File
# Begin Source File