This commit is contained in:
parent
c2ab404cf6
commit
432cba9e4f
4 changed files with 381 additions and 0 deletions
85
source/triggers/thazwalk.cpp
Normal file
85
source/triggers/thazwalk.cpp
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*=========================================================================
|
||||
|
||||
thazwalk.cpp
|
||||
|
||||
Author: CRB
|
||||
Created:
|
||||
Project: Spongebob
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 2001 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Includes
|
||||
-------- */
|
||||
|
||||
#include "triggers\trigger.h"
|
||||
#include "triggers\thazwalk.h"
|
||||
|
||||
#ifndef __GAME_GAME_H__
|
||||
#include "game\game.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PLAYER_H__
|
||||
#include "player\player.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
||||
/* Data
|
||||
---- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Tyepdefs && Defines
|
||||
------------------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Structure defintions
|
||||
-------------------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function Prototypes
|
||||
------------------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Vars
|
||||
---- */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CHazardWalkTrigger::collidedWith(CThing *_thisThing)
|
||||
{
|
||||
if ( m_timeout <= 0 )
|
||||
{
|
||||
switch( _thisThing->getThingType() )
|
||||
{
|
||||
case TYPE_PLAYER:
|
||||
{
|
||||
CPlayer *player = (CPlayer *) _thisThing;
|
||||
|
||||
if ( m_hazard )
|
||||
{
|
||||
m_hazard->trigger();
|
||||
m_hazard = NULL;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
55
source/triggers/thazwalk.h
Normal file
55
source/triggers/thazwalk.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*=========================================================================
|
||||
|
||||
thazwalk.h
|
||||
|
||||
Author: Charles Blair
|
||||
Created:
|
||||
Project: Spongebob
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 2001 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
#ifndef __TRIGGERS_THAZWALK_H__
|
||||
#define __TRIGGERS_THAZWALK_H__
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Includes
|
||||
-------- */
|
||||
|
||||
#ifndef __TRIGGERS_THAZARD_H__
|
||||
#include "triggers\thazard.h"
|
||||
#endif
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Tyepdefs && Defines
|
||||
------------------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Structure defintions
|
||||
-------------------- */
|
||||
|
||||
class CHazardWalkTrigger : public CHazardTrigger
|
||||
{
|
||||
protected:
|
||||
virtual void collidedWith(CThing *_thisThing);
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Globals
|
||||
------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Functions
|
||||
--------- */
|
||||
|
||||
/*---------------------------------------------------------------------- */
|
||||
|
||||
#endif
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
Loading…
Add table
Add a link
Reference in a new issue