This commit is contained in:
parent
6f467a179e
commit
6deb46042f
13 changed files with 309 additions and 36 deletions
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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue