This commit is contained in:
parent
6f467a179e
commit
6deb46042f
13 changed files with 309 additions and 36 deletions
|
@ -152,8 +152,7 @@ hazard_src := hazard \
|
||||||
hrwheel \
|
hrwheel \
|
||||||
hpswitch \
|
hpswitch \
|
||||||
hrckshrd \
|
hrckshrd \
|
||||||
hinert \
|
hinert
|
||||||
hfemit
|
|
||||||
|
|
||||||
fx_src := fx \
|
fx_src := fx \
|
||||||
fxbaseanim \
|
fxbaseanim \
|
||||||
|
@ -296,7 +295,9 @@ triggers_src := trigger \
|
||||||
tteleprt \
|
tteleprt \
|
||||||
twater \
|
twater \
|
||||||
tplatfrm \
|
tplatfrm \
|
||||||
tgarygo
|
tgarygo \
|
||||||
|
tfemit \
|
||||||
|
tifemit
|
||||||
|
|
||||||
utils_src := utils \
|
utils_src := utils \
|
||||||
sincos \
|
sincos \
|
||||||
|
|
|
@ -115,10 +115,6 @@
|
||||||
#include "hazard\hinert.h"
|
#include "hazard\hinert.h"
|
||||||
#endif
|
#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_PRESSURE_SWITCH_HAZARD,
|
||||||
NPC_ROCKSHARD_HAZARD,
|
NPC_ROCKSHARD_HAZARD,
|
||||||
NPC_INERT_HAZARD,
|
NPC_INERT_HAZARD,
|
||||||
NPC_FLAME_EMITTER_HAZARD,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -284,12 +279,6 @@ CNpcHazard *hazard;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NPC_FLAME_EMITTER_HAZARD:
|
|
||||||
{
|
|
||||||
hazard = new ("flame emitter hazard") CNpcFlameEmitterHazard;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
hazard = NULL;
|
hazard = NULL;
|
||||||
|
|
|
@ -60,7 +60,6 @@ public:
|
||||||
NPC_PRESSURE_SWITCH_HAZARD,
|
NPC_PRESSURE_SWITCH_HAZARD,
|
||||||
NPC_ROCKSHARD_HAZARD,
|
NPC_ROCKSHARD_HAZARD,
|
||||||
NPC_INERT_HAZARD,
|
NPC_INERT_HAZARD,
|
||||||
NPC_FLAME_EMITTER_HAZARD,
|
|
||||||
|
|
||||||
NPC_HAZARD_TYPE_MAX,
|
NPC_HAZARD_TYPE_MAX,
|
||||||
};
|
};
|
||||||
|
|
53
source/triggers/tfemit.cpp
Normal file
53
source/triggers/tfemit.cpp
Normal 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
64
source/triggers/tfemit.h
Normal 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 */
|
79
source/triggers/tifemit.cpp
Normal file
79
source/triggers/tifemit.cpp
Normal 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
66
source/triggers/tifemit.h
Normal 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 */
|
|
@ -43,6 +43,14 @@
|
||||||
#include "triggers\tgarygo.h"
|
#include "triggers\tgarygo.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __TRIGGERS_TFEMIT_H__
|
||||||
|
#include "triggers\tfemit.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __TRIGGERS_TIFEMIT_H__
|
||||||
|
#include "triggers\tifemit.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __GAME_GAME_H__
|
#ifndef __GAME_GAME_H__
|
||||||
#include "game\game.h"
|
#include "game\game.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -90,6 +98,15 @@ CTrigger *trigger;
|
||||||
trigger=(CGaryStartTrigger*)new( "GaryStartTrigger") CGaryStartTrigger();
|
trigger=(CGaryStartTrigger*)new( "GaryStartTrigger") CGaryStartTrigger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Flame emitter
|
||||||
|
case TRIGGER_FLAMEEMITTER:
|
||||||
|
trigger=(CFlameEmitterTrigger*)new( "FlameEmitterTrigger") CFlameEmitterTrigger();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TRIGGER_INTERMITTENTFLAMEEMITTER:
|
||||||
|
trigger=(CIntermittentFlameEmitterTrigger*)new( "IntermittentFlameEmitterTrigger") CIntermittentFlameEmitterTrigger();
|
||||||
|
break;
|
||||||
|
|
||||||
case TRIGGER_PLATFORM:
|
case TRIGGER_PLATFORM:
|
||||||
trigger = (CPlatformTrigger*)new ("PlatformTrigger") CPlatformTrigger();
|
trigger = (CPlatformTrigger*)new ("PlatformTrigger") CPlatformTrigger();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -30,6 +30,8 @@ enum TRIGGER_TYPE
|
||||||
TRIGGER_INWATER,
|
TRIGGER_INWATER,
|
||||||
TRIGGER_OUTWATER,
|
TRIGGER_OUTWATER,
|
||||||
TRIGGER_GARYSTART,
|
TRIGGER_GARYSTART,
|
||||||
|
TRIGGER_FLAMEEMITTER,
|
||||||
|
TRIGGER_INTERMITTENTFLAMEEMITTER,
|
||||||
|
|
||||||
// Code based triggers
|
// Code based triggers
|
||||||
TRIGGER_PLATFORM,
|
TRIGGER_PLATFORM,
|
||||||
|
|
|
@ -132,6 +132,8 @@ CameraLock=3
|
||||||
InWater=4
|
InWater=4
|
||||||
OutOfWater=5
|
OutOfWater=5
|
||||||
GaryStart=6
|
GaryStart=6
|
||||||
|
FlameEmitter=7
|
||||||
|
IntermittentFlameEmitter=8
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
# FX
|
# FX
|
||||||
|
@ -167,4 +169,3 @@ PressureSwitch=18
|
||||||
SingleSpike=19
|
SingleSpike=19
|
||||||
CheckPoint=20
|
CheckPoint=20
|
||||||
WaterBucket=20
|
WaterBucket=20
|
||||||
FlameEmitter=21
|
|
|
@ -259,13 +259,3 @@ Collision=0
|
||||||
Health=0
|
Health=0
|
||||||
AttackStrength=0
|
AttackStrength=0
|
||||||
Respawn=1
|
Respawn=1
|
||||||
|
|
||||||
[FlameEmitter]
|
|
||||||
Gfx=..\..\graphics\hazards\fireball\fireball.gin
|
|
||||||
WayPoints=0
|
|
||||||
Speed=0
|
|
||||||
TurnRate=0
|
|
||||||
Collision=0
|
|
||||||
Health=0
|
|
||||||
AttackStrength=0
|
|
||||||
Respawn=0
|
|
||||||
|
|
|
@ -20,3 +20,7 @@ HasBox=1
|
||||||
[OutOfWater]
|
[OutOfWater]
|
||||||
|
|
||||||
[GaryStart]
|
[GaryStart]
|
||||||
|
|
||||||
|
[FlameEmitter]
|
||||||
|
|
||||||
|
[IntermittentFlameEmitter]
|
|
@ -881,14 +881,6 @@ SOURCE=..\..\..\source\hazard\hfan.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin 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
|
SOURCE=..\..\..\source\hazard\hfirebal.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@ -1925,6 +1917,14 @@ SOURCE=..\..\..\source\triggers\tcamlock.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin 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
|
SOURCE=..\..\..\source\triggers\tgarygo.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@ -1933,6 +1933,14 @@ SOURCE=..\..\..\source\triggers\tgarygo.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin 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
|
SOURCE=..\..\..\source\triggers\tlevexit.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
Loading…
Add table
Reference in a new issue