This commit is contained in:
Charles 2001-05-01 16:28:51 +00:00
parent 991083d6b5
commit 9df303b4e7
2 changed files with 33 additions and 0 deletions

View file

@ -27,6 +27,10 @@
#include "utils\utils.h" #include "utils\utils.h"
#endif #endif
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
#ifndef __HAZARD_HFALLING_H__ #ifndef __HAZARD_HFALLING_H__
#include "hazard\hfalling.h" #include "hazard\hfalling.h"
#endif #endif
@ -255,3 +259,30 @@ void CNpcHazard::render()
} }
} }
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcHazard::collidedWith( CThing *_thisThing )
{
if ( m_isActive )
{
switch(_thisThing->getThingType())
{
case TYPE_PLAYER:
{
CPlayer *player = (CPlayer *) _thisThing;
if ( !player->isRecoveringFromHit() )
{
player->takeDamage( DAMAGE__HIT_ENEMY );
}
break;
}
default:
ASSERT(0);
break;
}
}
}

View file

@ -68,6 +68,8 @@ protected:
virtual void processMovement( int _frames ); virtual void processMovement( int _frames );
virtual void processTimer( int _frames ); virtual void processTimer( int _frames );
virtual void collidedWith(CThing *_thisThing);
CNpcPath m_npcPath; CNpcPath m_npcPath;
//CActorGfx *m_actorGfx; //CActorGfx *m_actorGfx;
//SpriteBank *m_spriteBank; //SpriteBank *m_spriteBank;