From a74745a7b24956be45028bae543b2deeca8051f8 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 5 May 2001 13:54:34 +0000 Subject: [PATCH] --- makefile.gaz | 6 ++++-- source/hazard/hazard.cpp | 15 +++++++++++++++ source/hazard/hazard.h | 1 + source/hazard/hbwheel.cpp | 2 +- source/platform/pbounce.cpp | 2 ++ source/platform/pbranch.cpp | 2 ++ source/platform/pcart.cpp | 2 ++ source/platform/pcirculr.cpp | 2 ++ source/platform/pfalling.cpp | 2 ++ source/platform/pfallnor.cpp | 2 ++ source/platform/pfishhk.cpp | 2 ++ source/platform/pgeyser.cpp | 2 ++ source/platform/plantern.cpp | 2 ++ source/platform/platdata.cpp | 13 +++++++++++++ source/platform/platform.cpp | 10 ++++++++++ source/platform/platform.h | 1 + source/platform/pleaf.cpp | 2 ++ source/platform/plinear.cpp | 2 ++ source/platform/ppendulm.cpp | 2 ++ source/platform/praft.cpp | 2 ++ source/platform/pretract.cpp | 2 ++ tools/Data/bin/MkLevel.ini | 3 ++- tools/MapEdit/Hazard.ini | 18 +++++++++--------- tools/MapEdit/platform.ini | 3 +++ .../spongebob project/spongebob project.dsp | 16 ++++++++++++++++ 25 files changed, 103 insertions(+), 13 deletions(-) diff --git a/makefile.gaz b/makefile.gaz index a79fffd63..8e55e1883 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -112,7 +112,8 @@ platform_src := platform \ praft \ plantern \ pbgeyser \ - pleaf + pleaf \ + pbwheel hazard_src := hazard \ hfalling \ @@ -125,7 +126,8 @@ hazard_src := hazard \ hmower \ hmasher \ hfan \ - hspikes + hspikes \ + hbwheel fx_src := fx \ fxjfish diff --git a/source/hazard/hazard.cpp b/source/hazard/hazard.cpp index 1fc597e89..68ca224bd 100644 --- a/source/hazard/hazard.cpp +++ b/source/hazard/hazard.cpp @@ -71,6 +71,10 @@ #include "hazard\hspikes.h" #endif +#ifndef __HAZARD_HBWHEEL_H__ +#include "hazard\hbwheel.h" +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -86,6 +90,7 @@ CNpcHazard::NPC_HAZARD_UNIT_TYPE CNpcHazard::mapEditConvertTable[NPC_HAZARD_TYPE NPC_MASHER_HAZARD, NPC_FAN_HAZARD, NPC_SPIKES_HAZARD, + NPC_BIG_WHEEL_HAZARD, }; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -158,6 +163,12 @@ CNpcHazard *CNpcHazard::Create(sThingHazard *ThisHazard) break; } + case NPC_BIG_WHEEL_HAZARD: + { + hazard = new ("big wheel") CNpcBigWheelHazard; + break; + } + default: { hazard = NULL; @@ -257,6 +268,10 @@ void CNpcHazard::setGraphic( sThingHazard *ThisHazard ) { m_modelGfx = new ("ModelGfx") CModelGfx; m_modelGfx->SetModel( ThisHazard->Gfx ); + + 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 ); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hazard.h b/source/hazard/hazard.h index d5ec856b7..172cfc401 100644 --- a/source/hazard/hazard.h +++ b/source/hazard/hazard.h @@ -46,6 +46,7 @@ public: NPC_MASHER_HAZARD, NPC_FAN_HAZARD, NPC_SPIKES_HAZARD, + NPC_BIG_WHEEL_HAZARD, NPC_HAZARD_TYPE_MAX, }; diff --git a/source/hazard/hbwheel.cpp b/source/hazard/hbwheel.cpp index 36d7028a6..6a523d67c 100644 --- a/source/hazard/hbwheel.cpp +++ b/source/hazard/hbwheel.cpp @@ -37,7 +37,7 @@ void CNpcBigWheelHazard::init() void CNpcBigWheelHazard::processMovement( int _frames ) { - m_rotation += 10 * _frames; + m_rotation += 5 * _frames; m_rotation &= 4095; } diff --git a/source/platform/pbounce.cpp b/source/platform/pbounce.cpp index 8c1ef8967..9becfdd1d 100644 --- a/source/platform/pbounce.cpp +++ b/source/platform/pbounce.cpp @@ -30,6 +30,8 @@ void CNpcBouncePlatform::postInit() { + CNpcPlatform::postInit(); + m_vertScale = 0; m_vertVelocity = 0; } diff --git a/source/platform/pbranch.cpp b/source/platform/pbranch.cpp index ffbbafe6b..de58498c7 100644 --- a/source/platform/pbranch.cpp +++ b/source/platform/pbranch.cpp @@ -36,6 +36,8 @@ void CNpcBranchPlatform::postInit() { + CNpcPlatform::postInit(); + m_angularVelocity = 0; m_platformWidth <<= 1; } diff --git a/source/platform/pcart.cpp b/source/platform/pcart.cpp index 7d6ea3252..c98ffdb5f 100644 --- a/source/platform/pcart.cpp +++ b/source/platform/pcart.cpp @@ -23,6 +23,8 @@ void CNpcCartPlatform::postInit() { + CNpcPlatform::postInit(); + m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH ); m_carSpeed = m_data[m_type].speed << 8; diff --git a/source/platform/pcirculr.cpp b/source/platform/pcirculr.cpp index edee2815e..a6732f779 100644 --- a/source/platform/pcirculr.cpp +++ b/source/platform/pcirculr.cpp @@ -19,6 +19,8 @@ void CNpcCircularPlatform::postInit() { + CNpcPlatform::postInit(); + m_extension = 100; } diff --git a/source/platform/pfalling.cpp b/source/platform/pfalling.cpp index b6b23a723..881465aa7 100644 --- a/source/platform/pfalling.cpp +++ b/source/platform/pfalling.cpp @@ -27,6 +27,8 @@ void CNpcFallingPlatform::postInit() { + CNpcPlatform::postInit(); + m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH ); m_isActive = false; diff --git a/source/platform/pfallnor.cpp b/source/platform/pfallnor.cpp index 0318f1bc0..877c42ee1 100644 --- a/source/platform/pfallnor.cpp +++ b/source/platform/pfallnor.cpp @@ -27,6 +27,8 @@ void CNpcFallingNoRespawnPlatform::postInit() { + CNpcPlatform::postInit(); + m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH ); } diff --git a/source/platform/pfishhk.cpp b/source/platform/pfishhk.cpp index 3d1637921..69329dad0 100644 --- a/source/platform/pfishhk.cpp +++ b/source/platform/pfishhk.cpp @@ -28,6 +28,8 @@ void CNpcFishHookPlatform::postInit() { + CNpcPlatform::postInit(); + m_isMoving = false; m_isShuttingDown = false; } diff --git a/source/platform/pgeyser.cpp b/source/platform/pgeyser.cpp index 88ae172b6..00cf8d3f6 100644 --- a/source/platform/pgeyser.cpp +++ b/source/platform/pgeyser.cpp @@ -19,6 +19,8 @@ void CNpcGeyserPlatform::postInit() { + CNpcPlatform::postInit(); + m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH ); m_isFiring = false; diff --git a/source/platform/plantern.cpp b/source/platform/plantern.cpp index 10446b745..6334b2618 100644 --- a/source/platform/plantern.cpp +++ b/source/platform/plantern.cpp @@ -23,6 +23,8 @@ void CNpcLanternPlatform::postInit() { + CNpcPlatform::postInit(); + m_extension = 0; m_heading = 1024; } diff --git a/source/platform/platdata.cpp b/source/platform/platdata.cpp index fd367080b..614eb472e 100644 --- a/source/platform/platdata.cpp +++ b/source/platform/platdata.cpp @@ -322,6 +322,18 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] = NPC_PLATFORM_TIMER_NONE, }, + { // NPC_BIG_WHEEL_PLATFORM + 5, + 128, + true, + DAMAGE__NONE, + 0, + 4, + NPC_PLATFORM_INFINITE_LIFE, + 0, + NPC_PLATFORM_TIMER_NONE, + }, + { // NPC_PLAYER_BUBBLE_PLATFORM 3, 128, @@ -360,5 +372,6 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF NPC_VERTICAL_OILDRUM_GENERATOR, NPC_LANTERN_PLATFORM, NPC_BUBBLE_GEYSER_GENERATOR, + NPC_BIG_WHEEL_PLATFORM, NPC_PLAYER_BUBBLE_PLATFORM, }; diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index 3a6c9d561..2d4a9af91 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -127,6 +127,10 @@ #include "platform\pleaf.h" #endif +#ifndef __PLATFORM_PBWHEEL_H__ +#include "platform\pbwheel.h" +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -296,6 +300,12 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform) break; } + case NPC_BIG_WHEEL_PLATFORM: + { + platform = new ("big wheel platform") CNpcBigWheelPlatform; + break; + } + default: { ASSERT( 0 ); diff --git a/source/platform/platform.h b/source/platform/platform.h index 7d295626f..cd5dc396f 100644 --- a/source/platform/platform.h +++ b/source/platform/platform.h @@ -77,6 +77,7 @@ public: NPC_LANTERN_PLATFORM, NPC_BUBBLE_GEYSER_GENERATOR, NPC_LEAF_PLATFORM, + NPC_BIG_WHEEL_PLATFORM, NPC_PLAYER_BUBBLE_PLATFORM, NPC_PLATFORM_TYPE_MAX, }; diff --git a/source/platform/pleaf.cpp b/source/platform/pleaf.cpp index 8c2bec9e9..3638f108d 100644 --- a/source/platform/pleaf.cpp +++ b/source/platform/pleaf.cpp @@ -27,6 +27,8 @@ void CNpcLeafPlatform::postInit() { + CNpcPlatform::postInit(); + m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH ); m_isActive = false; diff --git a/source/platform/plinear.cpp b/source/platform/plinear.cpp index b8ac206b7..45dc04bbe 100644 --- a/source/platform/plinear.cpp +++ b/source/platform/plinear.cpp @@ -19,6 +19,8 @@ void CNpcLinearPlatform::postInit() { + CNpcPlatform::postInit(); + m_npcPath.setPathType( CNpcPath::PONG_PATH ); } diff --git a/source/platform/ppendulm.cpp b/source/platform/ppendulm.cpp index 99ae757e8..70e137e76 100644 --- a/source/platform/ppendulm.cpp +++ b/source/platform/ppendulm.cpp @@ -23,6 +23,8 @@ void CNpcPendulumPlatform::postInit() { + CNpcPlatform::postInit(); + m_extendDir = EXTEND_LEFT; m_extension = 0; m_heading = 1024; diff --git a/source/platform/praft.cpp b/source/platform/praft.cpp index a524d838f..be0753b1a 100644 --- a/source/platform/praft.cpp +++ b/source/platform/praft.cpp @@ -28,6 +28,8 @@ void CNpcRaftPlatform::postInit() { + CNpcPlatform::postInit(); + m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH ); m_isActivated = false; diff --git a/source/platform/pretract.cpp b/source/platform/pretract.cpp index a8b705c43..3b5e80c51 100644 --- a/source/platform/pretract.cpp +++ b/source/platform/pretract.cpp @@ -23,6 +23,8 @@ void CNpcRetractingPlatform::postInit() { + CNpcPlatform::postInit(); + m_timer = NPC_PLATFORM_TIMER_RETRACT; } diff --git a/tools/Data/bin/MkLevel.ini b/tools/Data/bin/MkLevel.ini index 78a7de841..a457ac391 100644 --- a/tools/Data/bin/MkLevel.ini +++ b/tools/Data/bin/MkLevel.ini @@ -104,6 +104,7 @@ Raft=19 VertOilDrumGenerator=20 SwingingLantern=21 BubbleGeyserGenerator=22 +BigWheelPlatform=23 ################################################ # Triggers @@ -134,6 +135,6 @@ SpinningBlades=6 Masher=7 Fan=8 Spikes=9 -#Wheel=10 +Wheel=10 diff --git a/tools/MapEdit/Hazard.ini b/tools/MapEdit/Hazard.ini index f2e7e585f..8f26c189c 100644 --- a/tools/MapEdit/Hazard.ini +++ b/tools/MapEdit/Hazard.ini @@ -130,12 +130,12 @@ Health=0 AttackStrength=0 Respawn=2 -#[Wheel] -#Gfx=..\..\graphics\hazards\wheel\wheel.gin -#WayPoints=0 -#Speed=0 -#TurnRate=0 -#Collision=0 -#Health=0 -#AttackStrength=0 -#Respawn=2 +[Wheel] +Gfx=..\..\graphics\hazards\wheel\wheel.gin +WayPoints=0 +Speed=0 +TurnRate=0 +Collision=0 +Health=0 +AttackStrength=0 +Respawn=2 diff --git a/tools/MapEdit/platform.ini b/tools/MapEdit/platform.ini index f7a429f6f..fa2e1a788 100644 --- a/tools/MapEdit/platform.ini +++ b/tools/MapEdit/platform.ini @@ -87,3 +87,6 @@ Gfx=..\..\Graphics\platforms\wooden\wooden.gin [BubbleGeyserGenerator] Gfx=..\..\Graphics\platforms\Bubble\bubble.gin + +[BigWheelPlatform] +Gfx=..\..\Graphics\platforms\carriage\carriage.gin diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index 2c34343b4..f9974b80f 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -793,6 +793,14 @@ SOURCE=..\..\..\source\hazard\hboat.h # End Source File # Begin Source File +SOURCE=..\..\..\source\hazard\hbwheel.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\hazard\hbwheel.h +# End Source File +# Begin Source File + SOURCE=..\..\..\source\hazard\hcsaw.cpp # End Source File # Begin Source File @@ -1165,6 +1173,14 @@ SOURCE=..\..\..\source\platform\pbubble.h # End Source File # Begin Source File +SOURCE=..\..\..\source\platform\pbwheel.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\platform\pbwheel.h +# End Source File +# Begin Source File + SOURCE=..\..\..\source\platform\pcart.cpp # End Source File # Begin Source File