diff --git a/makefile.gaz b/makefile.gaz index 5ec1b97be..121ba4d97 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -151,6 +151,7 @@ pickups_src := pickup \ phelmet \ pjlammo \ plife \ + pnet \ pquest \ pshoes \ pspatula @@ -165,6 +166,7 @@ player_src := demoplay \ pmcoral \ pmdead \ pmfly \ + pmnet \ psbutt \ psduck \ psfall \ diff --git a/source/game/game.cpp b/source/game/game.cpp index de49ea229..cc2f985b5 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -258,6 +258,8 @@ void CGameScene::initLevel() pos.vx+=64; createPickup(PICKUP__SPATULA,&pos); pos.vx+=64; createPickup(PICKUP__JELLY_LAUNCHER_AMMO,&pos); pos.vx+=64; createPickup(PICKUP__BUBBLE_MIXTURE,&pos); + pos.vx+=64; createPickup(PICKUP__BUBBLE_WAND,&pos); + pos.vx+=64; createPickup(PICKUP__NET,&pos); pos.vx+=64; createPickup(PICKUP__GLASSES,&pos); pos.vx+=64; createPickup(PICKUP__SQUEAKY_SHOES,&pos); pos.vx+=64; createPickup(PICKUP__BALLOON,&pos); @@ -265,10 +267,10 @@ void CGameScene::initLevel() pos.vx+=64; createPickup(PICKUP__CORAL_BLOWER,&pos); pos.vx+=64; createPickup(PICKUP__QUEST_ITEM__TEST,&pos); - CNpcPlatform *platform; - platform=new ("test platform") CNpcPlatform; - platform->init(); - platform->setLayerCollision( Level.getCollisionLayer() ); +// CNpcPlatform *platform; +// platform=new ("test platform") CNpcPlatform; +// platform->init(); +// platform->setLayerCollision( Level.getCollisionLayer() ); #endif s_levelFinished=false; diff --git a/source/pickups/pbubmix.cpp b/source/pickups/pbubmix.cpp index dca5e9d15..4007773aa 100644 --- a/source/pickups/pbubmix.cpp +++ b/source/pickups/pbubmix.cpp @@ -77,7 +77,7 @@ void CBubbleMixturePickup::init() ---------------------------------------------------------------------- */ void CBubbleMixturePickup::collect(class CPlayer *_player) { - _player->setMode(PLAYER_MODE_BUBBLE_MIXTURE); + _player->giveBubbleAmmo(); CBaseRespawningPickup::collect(_player); } @@ -124,5 +124,61 @@ void CBubbleMixturePickup::renderPickup(DVECTOR *_pos) sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS); } + + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CBubbleWandPickup::init() +{ + CBaseRespawningPickup::init(); +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CBubbleWandPickup::collect(class CPlayer *_player) +{ + _player->setMode(PLAYER_MODE_BUBBLE_MIXTURE); + CBaseRespawningPickup::collect(_player); +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +int CBubbleWandPickup::getRespawnTime() +{ + return 60*10; +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CBubbleWandPickup::renderPickup(DVECTOR *_pos) +{ + SpriteBank *sprites; + sFrameHdr *fh; + int x,y; + + sprites=getSpriteBank(); + fh=sprites->getFrameHeader(FRM__BUBBLEWAND); + x=_pos->vx-(fh->W/2); + y=_pos->vy-(fh->H/2); + sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS); +} + /*=========================================================================== end */ diff --git a/source/pickups/pbubmix.h b/source/pickups/pbubmix.h index 980eb9cdf..f54996fe2 100644 --- a/source/pickups/pbubmix.h +++ b/source/pickups/pbubmix.h @@ -53,6 +53,21 @@ private: }; +class CBubbleWandPickup : public CBaseRespawningPickup +{ +public: + virtual void init(); + + virtual void collect(class CPlayer *_player); + +protected: + virtual int getRespawnTime(); + + virtual void renderPickup(DVECTOR *_pos); + +}; + + /*---------------------------------------------------------------------- Globals ------- */ diff --git a/source/pickups/pickup.cpp b/source/pickups/pickup.cpp index 2e08f58e4..d84ef6d44 100644 --- a/source/pickups/pickup.cpp +++ b/source/pickups/pickup.cpp @@ -67,6 +67,10 @@ #include "pickups\phelmet.h" #endif +#ifndef __PICKUPS_PNET_H__ +#include "pickups\pnet.h" +#endif + #ifndef __PICKUPS_PQUEST_H__ #include "pickups\pquest.h" #endif @@ -311,6 +315,14 @@ CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos) pickup=new ("BubbleAmmoPickup") CBubbleMixturePickup(); break; + case PICKUP__BUBBLE_WAND: + pickup=new ("BubbleWandPickup") CBubbleWandPickup(); + break; + + case PICKUP__NET: + pickup=new ("NetPickup") CNetPickup(); + break; + case PICKUP__GLASSES: pickup=new ("GlassesPickup") CGlassesPickup(); break; diff --git a/source/pickups/pickup.h b/source/pickups/pickup.h index 80ac14aa7..c44ba2218 100644 --- a/source/pickups/pickup.h +++ b/source/pickups/pickup.h @@ -39,6 +39,8 @@ typedef enum PICKUP__SPATULA, PICKUP__JELLY_LAUNCHER_AMMO, PICKUP__BUBBLE_MIXTURE, + PICKUP__BUBBLE_WAND, + PICKUP__NET, PICKUP__GLASSES, PICKUP__SQUEAKY_SHOES, PICKUP__BALLOON, diff --git a/source/pickups/pspatula.cpp b/source/pickups/pspatula.cpp index 18dcf7a29..02d9106c0 100644 --- a/source/pickups/pspatula.cpp +++ b/source/pickups/pspatula.cpp @@ -79,12 +79,12 @@ void CSpatulaPickup::collect(class CPlayer *_player) Params: Returns: ---------------------------------------------------------------------- */ -int spat_glintspeed=3; +int spat_glintspeed=1; int spat_maxglint=100; int spat_glintrotspeed=50; int spat_glintgrowspeed=5; DVECTOR spat_gxy1={0,28}; -DVECTOR spat_gxy2={20,0}; +DVECTOR spat_gxy2={50,-35}; static const int spat_glintFrames[]={FRM__GLINT1,FRM__GLINT2,FRM__GLINT3,FRM__GLINT4,FRM__GLINT4,FRM__GLINT3,FRM__GLINT2,FRM__GLINT1}; void CSpatulaPickup::thinkPickup(int _frames) { diff --git a/source/player/player.cpp b/source/player/player.cpp index 1094fb037..e79696e63 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -250,9 +250,6 @@ m_animFrame=0; setCollisionSize(25,50); setCollisionCentreOffset(0,-25); - m_glassesFlag=0; - m_squeakyBootsTimer=0; - m_invinvibilityRingTimer=0; m_divingHelmet=false; } @@ -708,6 +705,11 @@ void CPlayer::respawn() m_invincibleFrameCount=INVINCIBLE_FRAMES__START; Pos=m_respawnPos; + m_glassesFlag=0; + m_squeakyBootsTimer=0; + m_invinvibilityRingTimer=0; + m_bubbleAmmo=0; + clearPlatform(); } diff --git a/source/player/player.h b/source/player/player.h index 2ec174a61..1c668ab87 100644 --- a/source/player/player.h +++ b/source/player/player.h @@ -246,11 +246,16 @@ public: void giveSqueakyBoots() {m_squeakyBootsTimer=SQUEAKY_BOOTS_TIME;} void giveInvinvibilityRing() {m_invinvibilityRingTimer=INVINCIBILITY_RING_TIME;} void giveDivingHelmet() {m_divingHelmet=true;} + + void giveBubbleAmmo() {m_bubbleAmmo+=10;} + void useOneBubble() {m_bubbleAmmo--;} + int getBubbleAmmo() {return m_bubbleAmmo;} private: int m_glassesFlag; int m_squeakyBootsTimer; int m_invinvibilityRingTimer; int m_divingHelmet; + int m_bubbleAmmo; // Platforms public: diff --git a/source/player/pmbubble.cpp b/source/player/pmbubble.cpp index 1e333f6f3..bce2c9fc3 100644 --- a/source/player/pmbubble.cpp +++ b/source/player/pmbubble.cpp @@ -57,7 +57,7 @@ void CPlayerModeBubbleMixture::enter() CSoundMediator::playSfx(CSoundMediator::SFX_BUBBLE_WAND); m_blowing=false; m_bubbleDelay=0; - m_bubbleCount=BUBBLE_AMMO; + m_player->giveBubbleAmmo(); } /*---------------------------------------------------------------------- @@ -66,6 +66,8 @@ void CPlayerModeBubbleMixture::enter() Params: Returns: ---------------------------------------------------------------------- */ +DVECTOR buboff={-40,-40}; +int bubam; void CPlayerModeBubbleMixture::think() { // If we're blowing then restore the 'real' anim number/frame before @@ -86,19 +88,24 @@ void CPlayerModeBubbleMixture::think() else { // Start to blow? - if(!m_blowing&&getPadInputDown()&PI_ACTION&&canBlowBubbleFromThisState()) + if(!m_blowing&&getPadInputDown()&PI_ACTION&&canBlowBubbleFromThisState()&&m_player->getBubbleAmmo()) { // Spawn the bubbly platform thingy..! - // pos is m_player->getPos(); - // dir is m_player->getFacing(); + CNpcPlatform *bubble; + DVECTOR pos; + bubble=new ("bubble platform") CNpcPlatform; + bubble->setType( CNpcPlatform::NPC_BUBBLE_PLATFORM ); + pos=m_player->getPos(); + pos.vx+=buboff.vx*m_player->getFacing(); + pos.vy+=buboff.vy; + bubble->init(pos,4); - // Start the anim off + // Start the blowing anim off m_blowFrame=0; m_blowing=true; - CNpcPlatform *bubble = new ("bubble platform") CNpcPlatform; - bubble->setType( CNpcPlatform::NPC_BUBBLE_PLATFORM ); - bubble->init( m_player->getPos(), 4 ); + // One less bubble.. + m_player->useOneBubble(); } } @@ -114,12 +121,9 @@ void CPlayerModeBubbleMixture::think() m_player->setAnimFrame(m_savedAnimFrame); m_blowing=false; m_bubbleDelay=BUBBLE_DELAY; - if(--m_bubbleCount==0) - { - m_player->setMode(PLAYER_MODE_FULLUNARMED); - } } } + bubam=m_player->getBubbleAmmo(); } /*---------------------------------------------------------------------- diff --git a/source/player/pmbubble.h b/source/player/pmbubble.h index 51fe62356..af6862ac8 100644 --- a/source/player/pmbubble.h +++ b/source/player/pmbubble.h @@ -43,11 +43,12 @@ public: virtual void setAnimNo(int _animNo); virtual void setAnimFrame(int _animFrame); + void giveBubbleAmmo(int _amount) {m_bubbleCount+=_amount;} + private: enum { - BUBBLE_AMMO=10, - BUBBLE_DELAY=60*1, + BUBBLE_DELAY=30*1, }; int canBlowBubbleFromThisState(); diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index f030a6a92..7fe62e850 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -745,6 +745,14 @@ SOURCE=..\..\..\source\pickups\plife.h # End Source File # Begin Source File +SOURCE=..\..\..\source\pickups\pnet.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\pickups\pnet.h +# End Source File +# Begin Source File + SOURCE=..\..\..\source\pickups\pquest.cpp # End Source File # Begin Source File