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

@ -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];