This commit is contained in:
Charles 2001-05-23 18:45:27 +00:00
parent becb234bd7
commit 673f7f4ce2
8 changed files with 127 additions and 3 deletions

View File

@ -141,7 +141,9 @@ hazard_src := hazard \
hdbarrel \
hbbarrel \
hrrock \
hflytrap
hflytrap \
hrweight \
hrwheel
fx_src := fx \
fxtrail \

View File

@ -95,6 +95,14 @@
#include "hazard\hflytrap.h"
#endif
#ifndef __HAZARD_HRWEIGHT_H__
#include "hazard\hrweight.h"
#endif
#ifndef __HAZARD_HRWHEEL_H__
#include "hazard\hrwheel.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -116,6 +124,8 @@ CNpcHazard::NPC_HAZARD_UNIT_TYPE CNpcHazard::mapEditConvertTable[NPC_HAZARD_TYPE
NPC_FIREBALL_HAZARD,
NPC_ROLLING_ROCK_HAZARD,
NPC_FLY_TRAP_HAZARD,
NPC_RISING_WEIGHT_HAZARD,
NPC_RISING_WEIGHT_WHEEL_HAZARD,
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -224,6 +234,18 @@ CNpcHazard *CNpcHazard::Create(sThingHazard *ThisHazard)
break;
}
case NPC_RISING_WEIGHT_HAZARD:
{
hazard = new ("rising weight hazard") CNpcRisingWeightHazard;
break;
}
case NPC_RISING_WEIGHT_WHEEL_HAZARD:
{
hazard = new ("rising weight wheel hazard") CNpcRisingWeightWheelHazard;
break;
}
default:
{
hazard = NULL;
@ -233,6 +255,7 @@ CNpcHazard *CNpcHazard::Create(sThingHazard *ThisHazard)
ASSERT( hazard );
hazard->setType( hazardType );
hazard->init();
hazard->setWaypoints( ThisHazard );
hazard->setGraphic( ThisHazard );

View File

@ -52,6 +52,8 @@ public:
NPC_FIREBALL_HAZARD,
NPC_ROLLING_ROCK_HAZARD,
NPC_FLY_TRAP_HAZARD,
NPC_RISING_WEIGHT_HAZARD,
NPC_RISING_WEIGHT_WHEEL_HAZARD,
NPC_HAZARD_TYPE_MAX,
};
@ -65,6 +67,8 @@ public:
virtual void setWaypoints( sThingHazard *ThisHazard );
void addWaypoint( s32 xPos, s32 yPos );
virtual void setRespawnRate( s16 newRespawnRate ) {m_respawnRate=newRespawnRate;}
void setType( NPC_HAZARD_UNIT_TYPE type ) {m_type = type;}
NPC_HAZARD_UNIT_TYPE getType() {return( m_type );}
static NPC_HAZARD_UNIT_TYPE getTypeFromMapEdit( u16 newType );
static CNpcHazard *Create(sThingHazard *ThisHazard);
@ -88,6 +92,7 @@ protected:
virtual void processTimer( int _frames );
virtual void collidedWith(CThing *_thisThing);
NPC_HAZARD_UNIT_TYPE m_type;
CNpcPath m_npcPath;
//CActorGfx *m_actorGfx;
//SpriteBank *m_spriteBank;

View File

@ -31,6 +31,18 @@
#include "level\level.h"
#ifndef __HAZARD_HAZARD_H__
#include "hazard\hazard.h"
#endif
#ifndef __HAZARD_HRWEIGHT_H__
#include "hazard\hrweight.h"
#endif
#ifndef __HAZARD_HRWHEEL_H__
#include "hazard\hrwheel.h"
#endif
/* Std Lib
------- */
@ -177,6 +189,51 @@ void CThingManager::initAllThings()
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CThingManager::matchWheelsAndWeights()
{
CNpcHazard *hazard1;
CNpcHazard *hazard2;
hazard1 = (CNpcHazard *) s_thingLists[CThing::TYPE_HAZARD];
while( hazard1 )
{
if ( hazard1->getType() == CNpcHazard::NPC_RISING_WEIGHT_HAZARD )
{
CNpcRisingWeightHazard *weight = (CNpcRisingWeightHazard *) hazard1;
DVECTOR wheelPos = weight->getWheelPos();
hazard2 = (CNpcHazard *) s_thingLists[CThing::TYPE_HAZARD];
while( hazard2 )
{
if ( hazard2->getType() == CNpcHazard::NPC_RISING_WEIGHT_WHEEL_HAZARD )
{
CNpcRisingWeightWheelHazard *wheel = (CNpcRisingWeightWheelHazard *) hazard2;
DVECTOR testPos = wheel->getWheelPos();
if ( testPos.vx == wheelPos.vx && testPos.vy == wheelPos.vy )
{
wheel->linkToWeight( weight );
}
}
hazard2 = (CNpcHazard *) hazard2->m_nextListThing;
}
}
hazard1 = (CNpcHazard *) hazard1->m_nextListThing;
}
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -62,6 +62,7 @@ public:
static CThing* checkCollisionAreaAgainstThings(CRECT *_area,int _type,int _continue);
static void initCollision();
static void matchWheelsAndWeights();
static sBBox &getRenderBBox() {return(m_RenderBBox);}
static sBBox &getThinkBBox() {return(m_ThinkBBox);}

View File

@ -150,5 +150,5 @@ BouncingBarrel=12
Fireball=13
BouncingRock=12
FlyTrap=15
RisingWeight=16
RisingWeightWheel=17

View File

@ -199,3 +199,23 @@ Collision=0
Health=0
AttackStrength=0
Respawn=2
[RisingWeight]
Gfx=..\..\graphics\hazards\1tonweight\1tonweight.gin
Waypoints=3
Speed=0
TurnRate=0
Collision=0
Health=0
AttackStrength=0
Respawn=2
[RisingWeightWheel]
Gfx=..\..\graphics\hazards\1tonlever\1tonlever.gin
Waypoints=3
Speed=0
TurnRate=0
Collision=0
Health=0
AttackStrength=0
Respawn=2

View File

@ -925,6 +925,22 @@ SOURCE=..\..\..\source\hazard\hrrock.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\hazard\hrweight.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\hazard\hrweight.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\hazard\hrwheel.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\hazard\hrwheel.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\hazard\hsaw.cpp
# End Source File
# Begin Source File