SBSPSS/source/triggers/tfemit.cpp

77 lines
1.9 KiB
C++
Raw Normal View History

2001-06-02 00:03:24 +02:00
/*=========================================================================
tfemit.h
2001-06-04 16:04:39 +02:00
Author: CRB
2001-06-02 00:03:24 +02:00
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
2001-07-21 21:04:16 +02:00
#include "fx\fxfire.h"
2001-06-02 00:03:24 +02:00
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CFlameEmitterTrigger::setPositionAndSize(int _x,int _y,int _w,int _h)
{
CTrigger::setPositionAndSize( _x, _y, _w, _h );
2001-06-04 21:01:17 +02:00
m_effect = CFX::Create( CFX::FX_TYPE_FLAMES, Pos );
2001-07-21 21:04:16 +02:00
CFXFire *FX = (CFXFire *) m_effect;
FX->SetSize(_w,_h);
// m_animEffect->SetScaleX( ( _w * ONE ) >> 5 );
// m_animEffect->SetScaleY( ( _h * ONE ) >> 5 );
2001-06-04 21:01:17 +02:00
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CFlameEmitterTrigger::setHeading(int newHeading)
{
CFXBaseAnim *m_animEffect = (CFXBaseAnim *) m_effect;
m_animEffect->SetHeading( newHeading );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CFlameEmitterTrigger::setSize( int _w, int _h )
{
2001-07-21 21:04:16 +02:00
CFXFire *FX= (CFXFire *) m_effect;
FX->SetSize(_w,_h);
// m_animEffect->SetScaleX( ( _w * ONE ) >> 5 );
// m_animEffect->SetScaleY( ( _h * ONE ) >> 5 );
2001-06-02 00:03:24 +02:00
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CFlameEmitterTrigger::collidedWith(CThing *_thisThing)
{
switch(_thisThing->getThingType())
{
case TYPE_PLAYER:
{
CPlayer *player = (CPlayer *) _thisThing;
if ( !player->isRecoveringFromHit() )
{
2001-06-04 21:06:32 +02:00
player->takeDamage( DAMAGE__KILL_OUTRIGHT );
2001-06-02 00:03:24 +02:00
}
break;
}
default:
break;
}
}