diff --git a/makefile.gaz b/makefile.gaz index c843a14f0..874758b8e 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -105,7 +105,9 @@ platform_src := platform \ ppendulm \ pseesaw \ pbounce \ - pdual + pdual \ + pfgen \ + pfallnor hazard_src := hazard \ hfalling \ diff --git a/source/platform/platdata.cpp b/source/platform/platdata.cpp index 92fceb24b..226e5063d 100644 --- a/source/platform/platdata.cpp +++ b/source/platform/platdata.cpp @@ -260,6 +260,34 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] = NPC_PLATFORM_TIMER_NONE, }, + { // NPC_OILDRUM_GENERATOR + ACTORS_CLAM_SBK, + ANIM_CLAM_SIDESNAP, + 2, + 128, + true, + DAMAGE__NONE, + 0, + 4, + NPC_PLATFORM_INFINITE_LIFE, + 4, + NPC_PLATFORM_TIMER_NONE, + }, + + { // NPC_CRATE_GENERATOR + ACTORS_CLAM_SBK, + ANIM_CLAM_SIDESNAP, + 3, + 128, + true, + DAMAGE__NONE, + 0, + 4, + NPC_PLATFORM_INFINITE_LIFE, + 4, + NPC_PLATFORM_TIMER_NONE, + }, + { // NPC_PLAYER_BUBBLE_PLATFORM ACTORS_CLAM_SBK, ANIM_CLAM_SIDESNAP, @@ -294,5 +322,7 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF NPC_CRATE_PLATFORM, NPC_BOUNCE_PLATFORM, NPC_DUAL_PLATFORM, + NPC_OILDRUM_GENERATOR, + NPC_CRATE_GENERATOR, NPC_PLAYER_BUBBLE_PLATFORM, }; diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index 1a98b7b42..53569fbb2 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -107,6 +107,10 @@ #include "platform\pplayer.h" #endif +#ifndef __PLATFORM_PFGEN_H__ +#include "platform\pfgen.h" +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -227,6 +231,24 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform) break; } + case NPC_OILDRUM_GENERATOR: + { + CNpcFallingPlatformGenerator *generator; + generator = new ("oildrum generator") CNpcFallingPlatformGenerator; + generator->setTargetType( NPC_OILDRUM_PLATFORM ); + platform = generator; + break; + } + + case NPC_CRATE_GENERATOR: + { + CNpcFallingPlatformGenerator *generator; + generator = new ("crate generator") CNpcFallingPlatformGenerator; + generator->setTargetType( NPC_CRATE_PLATFORM ); + platform = generator; + break; + } + default: { ASSERT( 0 ); @@ -287,14 +309,16 @@ void CNpcPlatform::setWaypoints( sThingPlatform *ThisPlatform ) void CNpcPlatform::setGraphic( sThingPlatform *ThisPlatform ) { + m_graphicNum = ThisPlatform->Gfx; m_modelGfx = new ("ModelGfx") CModelGfx; - m_modelGfx->SetModel( ThisPlatform->Gfx ); + m_modelGfx->SetModel( m_graphicNum ); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void CNpcPlatform::setGraphic( u8 graphicNum ) { + m_graphicNum = graphicNum; m_modelGfx = new ("ModelGfx") CModelGfx; m_modelGfx->SetModel( graphicNum ); } @@ -1101,6 +1125,13 @@ void CNpcPlatform::setTypeFromMapEdit( u16 newType ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +void CNpcPlatform::setLayerCollision( class CLayerCollision *_layer ) +{ + m_layerCollision=_layer; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::getTypeFromMapEdit( u16 newType ) { return( mapEditConvertTable[newType] ); diff --git a/source/platform/platform.h b/source/platform/platform.h index 3713d568e..67cf70c8d 100644 --- a/source/platform/platform.h +++ b/source/platform/platform.h @@ -69,6 +69,8 @@ public: NPC_CRATE_PLATFORM, NPC_BOUNCE_PLATFORM, NPC_DUAL_PLATFORM, + NPC_OILDRUM_GENERATOR, + NPC_CRATE_GENERATOR, NPC_PLAYER_BUBBLE_PLATFORM, NPC_PLATFORM_TYPE_MAX, }; @@ -78,9 +80,9 @@ public: void init( DVECTOR initPos, s32 initLifetime ); virtual void postInit(); void shutdown(); - void think(int _frames); + virtual void think(int _frames); virtual void render(); - void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;} + void setLayerCollision( class CLayerCollision *_layer ); void setType( NPC_PLATFORM_UNIT_TYPE newType ) {m_type = newType;} void setTypeFromMapEdit( u16 newType ); #ifdef REMOVETHIS @@ -202,6 +204,8 @@ protected: u8 m_platformWidth; + int m_graphicNum; + virtual void collidedWith(CThing *_thisThing); static NPC_PLATFORM_UNIT_TYPE mapEditConvertTable[NPC_PLATFORM_TYPE_MAX]; diff --git a/tools/Data/bin/MkLevel.ini b/tools/Data/bin/MkLevel.ini index a91fa182d..bfdb463e9 100644 --- a/tools/Data/bin/MkLevel.ini +++ b/tools/Data/bin/MkLevel.ini @@ -92,7 +92,9 @@ Seesaw=12 GhostTrain=9 Barrel=2 OilDrum=13 +OilDrumGenerator=17 Crate=14 +CrateGenerator=18 Loveboat=9 BouncyRing=15 BouncyTyre=15 diff --git a/tools/MapEdit/platform.ini b/tools/MapEdit/platform.ini index abb34d481..d08ccfcd6 100644 --- a/tools/MapEdit/platform.ini +++ b/tools/MapEdit/platform.ini @@ -44,6 +44,9 @@ Gfx=..\..\Graphics\platforms\Barrel\Barrel.gin [Crate] Gfx=..\..\Graphics\platforms\Crate\Crate.gin +[CrateGenerator] +Gfx=..\..\Graphics\platforms\Crate\Crate.gin + [ghosttrain] Gfx=..\..\Graphics\platforms\ghosttrain\ghosttrain.gin @@ -53,6 +56,9 @@ Gfx=..\..\Graphics\platforms\Loveboat\loveboat.gin [Oildrum] Gfx=..\..\Graphics\platforms\Oildrum\Oildrum.gin +[OildrumGenerator] +Gfx=..\..\Graphics\platforms\Oildrum\Oildrum.gin + [seesaw] Gfx=..\..\Graphics\platforms\seesaw\seesaw_wooden.gin diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index 347ddf7d8..9ffc1960e 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -1153,6 +1153,22 @@ SOURCE=..\..\..\source\platform\pfalling.h # End Source File # Begin Source File +SOURCE=..\..\..\source\platform\pfallnor.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\platform\pfallnor.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\platform\pfgen.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\platform\pfgen.h +# End Source File +# Begin Source File + SOURCE=..\..\..\source\platform\pfishhk.cpp # End Source File # Begin Source File