2001-05-24 01:08:26 +02:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
hpswitch.cpp
|
|
|
|
|
|
|
|
Author: CRB
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2001 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
#ifndef __HAZARD_HPSWITCH_H__
|
|
|
|
#include "hazard\hpswitch.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __UTILS_HEADER__
|
|
|
|
#include "utils\utils.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __PLAYER_PLAYER_H__
|
|
|
|
#include "player\player.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void CNpcPressureSwitchHazard::init()
|
|
|
|
{
|
|
|
|
CNpcHazard::init();
|
|
|
|
|
|
|
|
m_rotation = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void CNpcPressureSwitchHazard::setWaypoints( sThingHazard *ThisHazard )
|
|
|
|
{
|
|
|
|
u16 *PntList=(u16*)MakePtr(ThisHazard,sizeof(sThingHazard));
|
|
|
|
|
|
|
|
u16 newXPos, newYPos;
|
|
|
|
|
|
|
|
// get init pos
|
|
|
|
|
|
|
|
newXPos = (u16) *PntList;
|
|
|
|
PntList++;
|
|
|
|
newYPos = (u16) *PntList;
|
|
|
|
PntList++;
|
|
|
|
|
|
|
|
m_triggerPos.vx = newXPos;
|
|
|
|
m_triggerPos.vy = newYPos;
|
|
|
|
|
|
|
|
DVECTOR startPos;
|
2001-05-31 18:24:48 +02:00
|
|
|
startPos.vx = ( newXPos << 4 ) + 8;
|
|
|
|
startPos.vy = ( newYPos << 4 ) + 16;
|
2001-05-24 01:08:26 +02:00
|
|
|
|
|
|
|
Pos = startPos;
|
|
|
|
m_base = Pos;
|
2001-06-19 22:07:57 +02:00
|
|
|
|
|
|
|
s32 minX, maxX, minY, maxY;
|
|
|
|
|
|
|
|
m_npcPath.getPathXExtents( &minX, &maxX );
|
|
|
|
m_npcPath.getPathYExtents( &minY, &maxY );
|
|
|
|
|
|
|
|
m_thinkArea.x1 = minX;
|
|
|
|
m_thinkArea.x2 = maxX;
|
|
|
|
m_thinkArea.y1 = minY;
|
|
|
|
m_thinkArea.y2 = maxY;
|
2001-05-24 01:08:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void CNpcPressureSwitchHazard::collidedWith( CThing *_thisThing )
|
|
|
|
{
|
|
|
|
if ( m_isActive )
|
|
|
|
{
|
|
|
|
switch(_thisThing->getThingType())
|
|
|
|
{
|
|
|
|
case TYPE_PLAYER:
|
|
|
|
{
|
|
|
|
m_platform->setTriggered();
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/*void CNpcRisingWeightWheelHazard::render()
|
|
|
|
{
|
|
|
|
CHazardThing::render();
|
|
|
|
|
|
|
|
if (canRender())
|
|
|
|
{
|
|
|
|
DVECTOR &renderPos=getRenderPos();
|
|
|
|
|
|
|
|
SVECTOR rotation;
|
|
|
|
rotation.vx = 0;
|
|
|
|
rotation.vy = 0;
|
|
|
|
rotation.vz = m_rotation;
|
|
|
|
|
|
|
|
VECTOR scale;
|
|
|
|
scale.vx = ONE;
|
|
|
|
scale.vy = ONE;
|
|
|
|
scale.vz = ONE;
|
|
|
|
|
|
|
|
m_modelGfx->Render(renderPos,&rotation,&scale);
|
|
|
|
}
|
|
|
|
}*/
|