This commit is contained in:
Charles 2001-06-01 22:03:24 +00:00
parent 6f467a179e
commit 6deb46042f
13 changed files with 309 additions and 36 deletions

View File

@ -152,8 +152,7 @@ hazard_src := hazard \
hrwheel \
hpswitch \
hrckshrd \
hinert \
hfemit
hinert
fx_src := fx \
fxbaseanim \
@ -296,7 +295,9 @@ triggers_src := trigger \
tteleprt \
twater \
tplatfrm \
tgarygo
tgarygo \
tfemit \
tifemit
utils_src := utils \
sincos \

View File

@ -115,10 +115,6 @@
#include "hazard\hinert.h"
#endif
#ifndef __HAZARD_HFEMIT_H__
#include "hazard\hfemit.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -145,7 +141,6 @@ CNpcHazard::NPC_HAZARD_UNIT_TYPE CNpcHazard::mapEditConvertTable[NPC_HAZARD_TYPE
NPC_PRESSURE_SWITCH_HAZARD,
NPC_ROCKSHARD_HAZARD,
NPC_INERT_HAZARD,
NPC_FLAME_EMITTER_HAZARD,
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -284,12 +279,6 @@ CNpcHazard *hazard;
break;
}
case NPC_FLAME_EMITTER_HAZARD:
{
hazard = new ("flame emitter hazard") CNpcFlameEmitterHazard;
break;
}
default:
{
hazard = NULL;

View File

@ -60,7 +60,6 @@ public:
NPC_PRESSURE_SWITCH_HAZARD,
NPC_ROCKSHARD_HAZARD,
NPC_INERT_HAZARD,
NPC_FLAME_EMITTER_HAZARD,
NPC_HAZARD_TYPE_MAX,
};

View File

@ -0,0 +1,53 @@
/*=========================================================================
tfemit.h
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __TRIGGERS_TFEMIT_H__
#include "triggers\tfemit.h"
#endif
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CFlameEmitterTrigger::setPositionAndSize(int _x,int _y,int _w,int _h)
{
CTrigger::setPositionAndSize( _x, _y, _w, _h );
m_effect = CFX::Create( CFX::FX_TYPE_FLAMES, Pos );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CFlameEmitterTrigger::collidedWith(CThing *_thisThing)
{
switch(_thisThing->getThingType())
{
case TYPE_PLAYER:
{
CPlayer *player = (CPlayer *) _thisThing;
if ( !player->isRecoveringFromHit() )
{
player->takeDamage( DAMAGE__BURN_ENEMY );
}
break;
}
default:
break;
}
}

64
source/triggers/tfemit.h Normal file
View File

@ -0,0 +1,64 @@
/*=========================================================================
tfemit.h
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __TRIGGERS_TFEMIT_H__
#define __TRIGGERS_TFEMIT_H__
/*----------------------------------------------------------------------
Includes
-------- */
#ifndef __THING_THING_H__
#include "thing/thing.h"
#endif
#ifndef __TRIGGER_TRIGGER_HEADER__
#include "triggers\trigger.h"
#endif
#include "fx\fx.h"
/* Std Lib
------- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
class CFlameEmitterTrigger : public CTrigger
{
public:
virtual void setPositionAndSize(int _x,int _y,int _w,int _h);
protected:
virtual void collidedWith(CThing *_thisThing);
CFX *m_effect;
};
/*----------------------------------------------------------------------
Globals
------- */
/*----------------------------------------------------------------------
Functions
--------- */
/*---------------------------------------------------------------------- */
#endif /* __TRIGGERS_TLEVEXIT_H__ */
/*===========================================================================
end */

View File

@ -0,0 +1,79 @@
/*=========================================================================
tifemit.h
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __TRIGGERS_TIFEMIT_H__
#include "triggers\tifemit.h"
#endif
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CIntermittentFlameEmitterTrigger::init()
{
CFlameEmitterTrigger::init();
m_timer = 0;
m_isActive = true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CIntermittentFlameEmitterTrigger::think(int _frames)
{
CTrigger::think(_frames);
if ( m_timer <= 0 )
{
m_timer = GameState::getOneSecondInFrames() * 2;
m_effect->toggleVisible();
m_isActive = !m_isActive;
}
else
{
m_timer -= _frames;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CIntermittentFlameEmitterTrigger::collidedWith(CThing *_thisThing)
{
if ( m_isActive )
{
switch(_thisThing->getThingType())
{
case TYPE_PLAYER:
{
CPlayer *player = (CPlayer *) _thisThing;
if ( !player->isRecoveringFromHit() )
{
player->takeDamage( DAMAGE__BURN_ENEMY );
}
break;
}
default:
break;
}
}
}

66
source/triggers/tifemit.h Normal file
View File

@ -0,0 +1,66 @@
/*=========================================================================
tfemit.h
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __TRIGGERS_TIFEMIT_H__
#define __TRIGGERS_TIFEMIT_H__
/*----------------------------------------------------------------------
Includes
-------- */
#ifndef __THING_THING_H__
#include "thing/thing.h"
#endif
#ifndef __TRIGGER_TFEMIT__
#include "triggers\tfemit.h"
#endif
#include "fx\fx.h"
/* Std Lib
------- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
class CIntermittentFlameEmitterTrigger : public CFlameEmitterTrigger
{
public:
virtual void init();
virtual void think(int _frames);
protected:
virtual void collidedWith(CThing *_thisThing);
s32 m_timer;
u8 m_isActive;
};
/*----------------------------------------------------------------------
Globals
------- */
/*----------------------------------------------------------------------
Functions
--------- */
/*---------------------------------------------------------------------- */
#endif /* __TRIGGERS_TLEVEXIT_H__ */
/*===========================================================================
end */

View File

@ -43,6 +43,14 @@
#include "triggers\tgarygo.h"
#endif
#ifndef __TRIGGERS_TFEMIT_H__
#include "triggers\tfemit.h"
#endif
#ifndef __TRIGGERS_TIFEMIT_H__
#include "triggers\tifemit.h"
#endif
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
@ -90,6 +98,15 @@ CTrigger *trigger;
trigger=(CGaryStartTrigger*)new( "GaryStartTrigger") CGaryStartTrigger();
break;
// Flame emitter
case TRIGGER_FLAMEEMITTER:
trigger=(CFlameEmitterTrigger*)new( "FlameEmitterTrigger") CFlameEmitterTrigger();
break;
case TRIGGER_INTERMITTENTFLAMEEMITTER:
trigger=(CIntermittentFlameEmitterTrigger*)new( "IntermittentFlameEmitterTrigger") CIntermittentFlameEmitterTrigger();
break;
case TRIGGER_PLATFORM:
trigger = (CPlatformTrigger*)new ("PlatformTrigger") CPlatformTrigger();
break;

View File

@ -30,6 +30,8 @@ enum TRIGGER_TYPE
TRIGGER_INWATER,
TRIGGER_OUTWATER,
TRIGGER_GARYSTART,
TRIGGER_FLAMEEMITTER,
TRIGGER_INTERMITTENTFLAMEEMITTER,
// Code based triggers
TRIGGER_PLATFORM,

View File

@ -132,6 +132,8 @@ CameraLock=3
InWater=4
OutOfWater=5
GaryStart=6
FlameEmitter=7
IntermittentFlameEmitter=8
################################################
# FX
@ -166,5 +168,4 @@ RisingWeightWheel=17
PressureSwitch=18
SingleSpike=19
CheckPoint=20
WaterBucket=20
FlameEmitter=21
WaterBucket=20

View File

@ -259,13 +259,3 @@ Collision=0
Health=0
AttackStrength=0
Respawn=1
[FlameEmitter]
Gfx=..\..\graphics\hazards\fireball\fireball.gin
WayPoints=0
Speed=0
TurnRate=0
Collision=0
Health=0
AttackStrength=0
Respawn=0

View File

@ -19,4 +19,8 @@ HasBox=1
[OutOfWater]
[GaryStart]
[GaryStart]
[FlameEmitter]
[IntermittentFlameEmitter]

View File

@ -881,14 +881,6 @@ SOURCE=..\..\..\source\hazard\hfan.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\hazard\hfemit.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\hazard\hfemit.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\hazard\hfirebal.cpp
# End Source File
# Begin Source File
@ -1925,6 +1917,14 @@ SOURCE=..\..\..\source\triggers\tcamlock.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\triggers\tfemit.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\triggers\tfemit.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\triggers\tgarygo.cpp
# End Source File
# Begin Source File
@ -1933,6 +1933,14 @@ SOURCE=..\..\..\source\triggers\tgarygo.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\triggers\tifemit.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\triggers\tifemit.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\triggers\tlevexit.cpp
# End Source File
# Begin Source File