From 7943f99cbbf3cc5956c720641be7b9f2523d19ee Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 5 May 2001 19:08:02 +0000 Subject: [PATCH] --- makefile.gaz | 6 +++-- source/hazard/hazard.cpp | 11 ++++++++ source/hazard/hazard.h | 1 + source/platform/pjellfsh.cpp | 12 +++++++++ source/platform/platdata.cpp | 13 ++++++++++ source/platform/platform.cpp | 20 +++++++++++++++ source/platform/platform.h | 1 + source/thing/thing.cpp | 25 +++++++++++++++++++ tools/Data/bin/MkLevel.ini | 1 + tools/MapEdit/Hazard.ini | 10 ++++++++ .../spongebob project/spongebob project.dsp | 16 ++++++++++++ 11 files changed, 114 insertions(+), 2 deletions(-) diff --git a/makefile.gaz b/makefile.gaz index 4fb609f24..740ef3e5e 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -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 diff --git a/source/hazard/hazard.cpp b/source/hazard/hazard.cpp index 28a68ad16..68344be61 100644 --- a/source/hazard/hazard.cpp +++ b/source/hazard/hazard.cpp @@ -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; diff --git a/source/hazard/hazard.h b/source/hazard/hazard.h index 172cfc401..eaa2eecc9 100644 --- a/source/hazard/hazard.h +++ b/source/hazard/hazard.h @@ -47,6 +47,7 @@ public: NPC_FAN_HAZARD, NPC_SPIKES_HAZARD, NPC_BIG_WHEEL_HAZARD, + NPC_DUAL_PLATFORM_BARREL_HAZARD, NPC_HAZARD_TYPE_MAX, }; diff --git a/source/platform/pjellfsh.cpp b/source/platform/pjellfsh.cpp index 7f81884b5..808543b18 100644 --- a/source/platform/pjellfsh.cpp +++ b/source/platform/pjellfsh.cpp @@ -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 + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/platdata.cpp b/source/platform/platdata.cpp index b2f894fce..de82fc4d1 100644 --- a/source/platform/platdata.cpp +++ b/source/platform/platdata.cpp @@ -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, diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index 910a9bb9b..65fd46074 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -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; diff --git a/source/platform/platform.h b/source/platform/platform.h index 4fd6469a1..4c0b53e9e 100644 --- a/source/platform/platform.h +++ b/source/platform/platform.h @@ -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, }; diff --git a/source/thing/thing.cpp b/source/thing/thing.cpp index 5a3af699c..dcb3b990b 100644 --- a/source/thing/thing.cpp +++ b/source/thing/thing.cpp @@ -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