This commit is contained in:
Daveo 2001-06-19 21:35:02 +00:00
parent fed2acdd38
commit 3898864301
8 changed files with 37 additions and 29 deletions

View File

@ -13,7 +13,6 @@
#include "FX\FXGeyser.h" #include "FX\FXGeyser.h"
int MaxHeight=128;
int GeyserSpeed=4; int GeyserSpeed=4;
/*****************************************************************************/ /*****************************************************************************/
@ -34,7 +33,7 @@ void CFXGeyser::think(int Frames)
{ {
currentFrame=FRM__GUSH000; currentFrame=FRM__GUSH000;
} }
TargetHeight=MaxHeight; // TargetHeight=MaxHeight;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -16,6 +16,8 @@ virtual void init(DVECTOR const &Pos);
virtual void think(int Frames); virtual void think(int Frames);
virtual void render(); virtual void render();
void setHeight(int H) {TargetHeight=H;}
protected: protected:
s16 TargetHeight,Height; s16 TargetHeight,Height;
u16 currentFrame; u16 currentFrame;

View File

@ -1,8 +1,8 @@
/*========================================================================= /*=========================================================================
twdripemit.cpp toilgeysor
Author: CRB Author: Dave - based on the original story by CB
Created: Created:
Project: Spongebob Project: Spongebob
Purpose: Purpose:
@ -11,26 +11,27 @@
===========================================================================*/ ===========================================================================*/
#ifndef __TRIGGERS_TWDRIPEMIT_H__ #ifndef __TRIGGERS_TOILGEYSER_H__
#include "triggers\twdripemit.h" #include "triggers\toilgeyser.h"
#endif #endif
#ifndef __GAME_GAME_H__ #ifndef __GAME_GAME_H__
#include "game\game.h" #include "game\game.h"
#endif #endif
#include "fx/fxgeyser.h"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CWaterDripEmitterTrigger::think(int _frames) void COilGeyserTrigger::think(int _frames)
{ {
CTrigger::think( _frames ); CTrigger::think( _frames );
if ( m_timer <= 0 ) if ( m_timer <= 0 )
{ {
CFX::Create( CFX::FX_TYPE_DROP_WATER, Pos ); m_FX->setHeight(m_Height);
m_timer = GameState::getOneSecondInFrames() *5;
m_timer = GameState::getOneSecondInFrames() >> 2; m_Height^=128;
} }
else else
{ {
@ -40,9 +41,11 @@ void CWaterDripEmitterTrigger::think(int _frames)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CWaterDripEmitterTrigger::setPositionAndSize(int _x,int _y,int _w,int _h) void COilGeyserTrigger::setPositionAndSize(int _x,int _y,int _w,int _h)
{ {
CTrigger::setPositionAndSize( _x, _y, _w, _h ); CTrigger::setPositionAndSize( _x, _y, _w, _h );
m_FX=(CFXGeyser*)CFX::Create( CFX::FX_TYPE_GEYSER_OIL, Pos );
m_FX->setHeight(0);
m_timer = 0; m_timer = 0;
m_Height=128;
} }

View File

@ -1,8 +1,8 @@
/*========================================================================= /*=========================================================================
twdripemit.h toilgeysor
Author: CRB Author: Dave - based on the original story by CB
Created: Created:
Project: Spongebob Project: Spongebob
Purpose: Purpose:
@ -11,8 +11,8 @@
===========================================================================*/ ===========================================================================*/
#ifndef __TRIGGERS_TWDRIPEMIT_H__ #ifndef __TRIGGERS_TOILGEYSER_H__
#define __TRIGGERS_TWDRIPEMIT_H__ #define __TRIGGERS_TOILGEYSER_H__
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Includes Includes
@ -38,26 +38,18 @@
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Structure defintions Structure defintions
-------------------- */ -------------------- */
class CFXGeyser;
class CWaterDripEmitterTrigger : public CTrigger class COilGeyserTrigger: public CTrigger
{ {
public: public:
virtual void think(int _frames); virtual void think(int _frames);
virtual void setPositionAndSize(int _x,int _y,int _w,int _h); virtual void setPositionAndSize(int _x,int _y,int _w,int _h);
protected: protected:
s32 m_timer; s32 m_timer;
CFXGeyser *m_FX;
int m_Height;
}; };
/*----------------------------------------------------------------------
Globals
------- */
/*----------------------------------------------------------------------
Functions
--------- */
/*---------------------------------------------------------------------- */
#endif #endif
/*=========================================================================== /*===========================================================================

View File

@ -147,6 +147,10 @@
#include "triggers\twindright.h" #include "triggers\twindright.h"
#endif #endif
#ifndef __TRIGGERS_TOILGEYSER_H__
#include "triggers\toilgeyser.h"
#endif
#ifndef __GAME_GAME_H__ #ifndef __GAME_GAME_H__
#include "game\game.h" #include "game\game.h"
#endif #endif
@ -326,6 +330,10 @@ CTrigger *trigger;
case TRIGGER_WIND_RIGHT: case TRIGGER_WIND_RIGHT:
trigger = (CWindRightTrigger*)new("WindRightTrigger") CWindRightTrigger(); trigger = (CWindRightTrigger*)new("WindRightTrigger") CWindRightTrigger();
break; break;
// Oil Geyser
case TRIGGER_OIL_GEYSER:
trigger = (COilGeyserTrigger*)new("OilGeyserTrigger") COilGeyserTrigger();
break;
default: default:
trigger=NULL; trigger=NULL;

View File

@ -55,6 +55,7 @@ enum TRIGGER_TYPE
TRIGGER_WIND_DOWN, TRIGGER_WIND_DOWN,
TRIGGER_WIND_LEFT, TRIGGER_WIND_LEFT,
TRIGGER_WIND_RIGHT, TRIGGER_WIND_RIGHT,
TRIGGER_OIL_GEYSER,
// Code based triggers // Code based triggers
TRIGGER_PLATFORM, TRIGGER_PLATFORM,

View File

@ -161,6 +161,7 @@ WindUp=28
WindDown=29 WindDown=29
WindLeft=30 WindLeft=30
WindRight=31 WindRight=31
OilGeyser=32
################################################ ################################################
# FX # FX

View File

@ -69,4 +69,6 @@ HasBox=1
[WindLeft] [WindLeft]
[WindRight] [WindRight]
[OilGeyser]