diff --git a/makefile.gaz b/makefile.gaz index f43400066..97c8f7d9a 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -123,7 +123,8 @@ platform_src := platform \ pjellfsh \ pclam \ pfishhk3 \ - prbridge + prbridge \ + pbaloon hazard_src := hazard \ hfalling \ @@ -483,7 +484,7 @@ ifeq ($(USER_NAME),CDBUILD) @$(CP) -u Data/CdData/$(TERRITORY).ccs $(CD_BUILD_DIR)/$(TERRITORY).ccs @$(CP) -u Data/CdData/thq.str $(CD_DIR)/thq.str @$(CP) -u Data/CdData/intro.str $(CD_DIR)/intro.str - @$(CP) -u Data/CdData/track1.ixa $(CD_DIR)/track1.ixa + @$(CP) -u Data/CdData/track1.ixa $(CD_DIR)/track1.ixa @$(RAR) x data/CDData/ZZZZZZZ.RAR $(CD_DIR)/ -y >nul @$(ECHO) HERE diff --git a/source/platform/platdata.cpp b/source/platform/platdata.cpp index 8eceb1e99..f4f0a7134 100644 --- a/source/platform/platdata.cpp +++ b/source/platform/platdata.cpp @@ -383,6 +383,18 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] = NPC_PLATFORM_TIMER_NONE, }, + { // NPC_BALLOON_BRIDGE_PLATFORM + 3, + 128, + true, + DAMAGE__NONE, + 0, + 4, + NPC_PLATFORM_INFINITE_LIFE, + 0, + NPC_PLATFORM_TIMER_NONE, + }, + { // NPC_PLAYER_BUBBLE_PLATFORM 3, 128, @@ -438,6 +450,7 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF NPC_JELLYFISH_PLATFORM, NPC_FISH_HOOK_3_PLATFORM, NPC_RISING_BRIDGE_PLATFORM, + NPC_BALLOON_BRIDGE_PLATFORM, NPC_PLAYER_BUBBLE_PLATFORM, NPC_CLAM_PLATFORM, }; diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index bbb060dc0..6e0350be6 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -151,6 +151,10 @@ #include "platform\prbridge.h" #endif +#ifndef __PLATFORM_PBALOON_H__ +#include "platform\pbaloon.h" +#endif + #include "fx\fx.h" #include "fx\fxjfish.h" @@ -354,6 +358,12 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform) break; } + case NPC_BALLOON_BRIDGE_PLATFORM: + { + platform = new ("balloon bridge platform") CNpcBalloonBridgePlatform; + break; + } + default: { ASSERT( 0 ); @@ -991,33 +1001,42 @@ void CNpcPlatform::render() int CNpcPlatform::checkCollisionAgainst(CThing *_thisThing, int _frames) { - int collided = false; - - if ( m_detectCollision && m_isActive && !isSetToShutdown() ) + switch(_thisThing->getThingType()) { - CRECT thisRect, thatRect; + case TYPE_PLAYERPROJECTILE: + return( false ); - thisRect = getCollisionArea(); - thatRect = _thisThing->getCollisionArea(); - - DVECTOR posDelta = getPosDelta(); - - thisRect.y1 -= abs( posDelta.vy ) >> 1; - thisRect.y2 += abs( posDelta.vy ) >> 1; - - posDelta = _thisThing->getPosDelta(); - - thatRect.y1 -= abs( posDelta.vy ) >> 1; - thatRect.y2 += abs( posDelta.vy ) >> 1; - - if(((thisRect.x1>=thatRect.x1&&thisRect.x1<=thatRect.x2)||(thisRect.x2>=thatRect.x1&&thisRect.x2<=thatRect.x2)||(thisRect.x1<=thatRect.x1&&thisRect.x2>=thatRect.x2))&& - ((thisRect.y1>=thatRect.y1&&thisRect.y1<=thatRect.y2)||(thisRect.y2>=thatRect.y1&&thisRect.y2<=thatRect.y2)||(thisRect.y1<=thatRect.y1&&thisRect.y2>=thatRect.y2))) + default: { - collided = true; + int collided = false; + + if ( m_detectCollision && m_isActive && !isSetToShutdown() ) + { + CRECT thisRect, thatRect; + + thisRect = getCollisionArea(); + thatRect = _thisThing->getCollisionArea(); + + DVECTOR posDelta = getPosDelta(); + + thisRect.y1 -= abs( posDelta.vy ) >> 1; + thisRect.y2 += abs( posDelta.vy ) >> 1; + + posDelta = _thisThing->getPosDelta(); + + thatRect.y1 -= abs( posDelta.vy ) >> 1; + thatRect.y2 += abs( posDelta.vy ) >> 1; + + if(((thisRect.x1>=thatRect.x1&&thisRect.x1<=thatRect.x2)||(thisRect.x2>=thatRect.x1&&thisRect.x2<=thatRect.x2)||(thisRect.x1<=thatRect.x1&&thisRect.x2>=thatRect.x2))&& + ((thisRect.y1>=thatRect.y1&&thisRect.y1<=thatRect.y2)||(thisRect.y2>=thatRect.y1&&thisRect.y2<=thatRect.y2)||(thisRect.y1<=thatRect.y1&&thisRect.y2>=thatRect.y2))) + { + collided = true; + } + } + + return( collided ); } } - - return( collided ); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/platform.h b/source/platform/platform.h index e05c2cbd9..9774239e2 100644 --- a/source/platform/platform.h +++ b/source/platform/platform.h @@ -82,6 +82,7 @@ public: NPC_JELLYFISH_PLATFORM, NPC_FISH_HOOK_3_PLATFORM, NPC_RISING_BRIDGE_PLATFORM, + NPC_BALLOON_BRIDGE_PLATFORM, NPC_PLAYER_BUBBLE_PLATFORM, NPC_CLAM_PLATFORM, NPC_PLATFORM_TYPE_MAX, @@ -91,7 +92,7 @@ public: void init( DVECTOR initPos ); void init( DVECTOR initPos, s32 initLifetime ); virtual void postInit(); - void shutdown(); + virtual void shutdown(); virtual void think(int _frames); virtual void render(); virtual u8 canDrop() {return true;} diff --git a/source/thing/thing.cpp b/source/thing/thing.cpp index 7ec9be6ac..ab795b86a 100644 --- a/source/thing/thing.cpp +++ b/source/thing/thing.cpp @@ -441,6 +441,22 @@ DVECTOR const &CamPos=CLevel::getCameraPos(); thing1 = thing1->m_nextCollisionThing; } + + // Platform -> Player projectile collision + thing1=s_CollisionLists[CThing::TYPE_PLATFORM]; + while(thing1) + { + thing2=s_CollisionLists[CThing::TYPE_PLAYERPROJECTILE]; + while(thing2) + { + if(thing1->checkCollisionAgainst(thing2, _frames)) + { + thing1->collidedWith(thing2); + } + thing2=thing2->m_nextCollisionThing; + } + thing1=thing1->m_nextCollisionThing; + } } // Shut emm down, sh sh shut em down, we shutem down for(i=0;i