This commit is contained in:
Charles 2001-05-05 19:08:02 +00:00
parent d8d896cdf4
commit 7943f99cbb
11 changed files with 114 additions and 2 deletions

View File

@ -114,7 +114,8 @@ platform_src := platform \
pbgeyser \
pleaf \
pbwheel \
psbarrel
psbarrel \
pjellfsh
hazard_src := hazard \
hfalling \
@ -128,7 +129,8 @@ hazard_src := hazard \
hmasher \
hfan \
hspikes \
hbwheel
hbwheel \
hdbarrel
fx_src := fx \
fxjfish

View File

@ -75,6 +75,10 @@
#include "hazard\hbwheel.h"
#endif
#ifndef __HAZARD_HDBARREL_H__
#include "hazard\hdbarrel.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -91,6 +95,7 @@ CNpcHazard::NPC_HAZARD_UNIT_TYPE CNpcHazard::mapEditConvertTable[NPC_HAZARD_TYPE
NPC_FAN_HAZARD,
NPC_SPIKES_HAZARD,
NPC_BIG_WHEEL_HAZARD,
NPC_DUAL_PLATFORM_BARREL_HAZARD,
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -169,6 +174,12 @@ CNpcHazard *CNpcHazard::Create(sThingHazard *ThisHazard)
break;
}
case NPC_DUAL_PLATFORM_BARREL_HAZARD:
{
hazard = new ("dual platform barrel hazard") CNpcDualPlatformBarrelHazard;
break;
}
default:
{
hazard = NULL;

View File

@ -47,6 +47,7 @@ public:
NPC_FAN_HAZARD,
NPC_SPIKES_HAZARD,
NPC_BIG_WHEEL_HAZARD,
NPC_DUAL_PLATFORM_BARREL_HAZARD,
NPC_HAZARD_TYPE_MAX,
};

View File

@ -15,6 +15,18 @@
#include "platform\pjellfsh.h"
#endif
#ifndef __LEVEL_LEVEL_H__
#include "level\level.h"
#endif
#ifndef __VID_HEADER_
#include "system\vid.h"
#endif
#ifndef __UTILS_HEADER__
#include "utils\utils.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -346,6 +346,19 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
NPC_PLATFORM_TIMER_NONE,
},
{ // NPC_JELLYFISH_PLATFORM
1,
//512,
2048,
true,
DAMAGE__NONE,
0,
4,
NPC_PLATFORM_INFINITE_LIFE,
0,
NPC_PLATFORM_TIMER_NONE,
},
{ // NPC_PLAYER_BUBBLE_PLATFORM
3,
128,

View File

@ -135,6 +135,9 @@
#include "platform\psbarrel.h"
#endif
#include "fx\fx.h"
#include "fx\fxjfish.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -149,6 +152,7 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
case NPC_LINEAR_PLATFORM:
{
platform = new ("linear platform") CNpcLinearPlatform;
break;
}
@ -471,6 +475,15 @@ void CNpcPlatform::postInit()
sBBox boundingBox = m_modelGfx->GetBBox();
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );
setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 );
if ( m_type == NPC_LINEAR_PLATFORM )
{
if ( CLevel::getCurrentChapter() != 5 && CLevel::getCurrentChapterLevel() != 4 )
{
CFXJellyFishLegs *T=(CFXJellyFishLegs*)CFX::Create(CFX::FX_TYPE_JELLYFISH_LEGS,this);
T->SetUp(64,4,8,8);
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -805,6 +818,13 @@ void CNpcPlatform::collidedWith( CThing *_thisThing )
break;
}
case TYPE_HAZARD:
{
m_contact = true;
break;
}
default:
ASSERT(0);
break;

View File

@ -79,6 +79,7 @@ public:
NPC_LEAF_PLATFORM,
NPC_BIG_WHEEL_PLATFORM,
NPC_STEERABLE_BARREL_PLATFORM,
NPC_JELLYFISH_PLATFORM,
NPC_PLAYER_BUBBLE_PLATFORM,
NPC_PLATFORM_TYPE_MAX,
};

View File

@ -292,6 +292,31 @@ void CThingManager::thinkAllThings(int _frames)
thing1 = thing1->m_nextThing;
}
// Hazard -> Platform collision
thing1=s_thingLists[CThing::TYPE_PLATFORM];
while(thing1)
{
thing2=s_thingLists[CThing::TYPE_HAZARD];
while(thing2)
{
if ( thing1 != thing2 )
{
if ( thing1->canCollide() &&
thing2->canCollide() &&
thing1->checkCollisionAgainst( thing2, _frames ) )
{
thing1->collidedWith( thing2 );
//thing2->collidedWith( thing1 );
}
}
thing2 = thing2->m_nextThing;
}
thing1 = thing1->m_nextThing;
}
for(i=0;i<CThing::MAX_TYPE;i++)
{
thing=s_thingLists[i];

View File

@ -140,5 +140,6 @@ Fan=8
Spikes=9
Wheel=10
BarrelHazard=3
DualPlatformBarrelHazard=11

View File

@ -149,3 +149,13 @@ Collision=0
Health=0
AttackStrength=0
Respawn=2
[DualPlatformBarrelHazard]
Gfx=..\..\graphics\platforms\barrel\barrel.gin
WayPoints=16
Speed=0
TurnRate=0
Collision=0
Health=0
AttackStrength=0
Respawn=2

View File

@ -809,6 +809,14 @@ SOURCE=..\..\..\source\hazard\hcsaw.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\hazard\hdbarrel.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\hazard\hdbarrel.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\hazard\hfalling.cpp
# End Source File
# Begin Source File
@ -1249,6 +1257,14 @@ SOURCE=..\..\..\source\platform\pgeyser.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pjellfsh.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pjellfsh.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\plantern.cpp
# End Source File
# Begin Source File