From 655939881a1ab6a03aebec9da701e820a00e7707 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 27 Jul 2001 16:00:58 +0000 Subject: [PATCH] --- source/pickups/pbubmix.cpp | 4 ++++ source/pickups/pickup.cpp | 1 + source/pickups/pickup.h | 4 ++++ source/pickups/pjlammo.cpp | 4 ++++ source/player/player.cpp | 5 +++-- source/player/player.h | 8 +++++--- source/player/pmjelly.cpp | 6 +----- 7 files changed, 22 insertions(+), 10 deletions(-) diff --git a/source/pickups/pbubmix.cpp b/source/pickups/pbubmix.cpp index 931e287a9..3da0c97ae 100644 --- a/source/pickups/pbubmix.cpp +++ b/source/pickups/pbubmix.cpp @@ -179,6 +179,10 @@ void CBubbleWandPickup::init() ---------------------------------------------------------------------- */ void CBubbleWandPickup::collect(class CPlayer *_player) { + if(!getHasBeenCollected()) + { + _player->giveBubbleAmmoFromWeapon(); + } _player->setMode(PLAYER_MODE_BUBBLE_MIXTURE); CBaseWeaponSimplePickup::collect(_player); } diff --git a/source/pickups/pickup.cpp b/source/pickups/pickup.cpp index cec272c38..3cc0c5c63 100644 --- a/source/pickups/pickup.cpp +++ b/source/pickups/pickup.cpp @@ -291,6 +291,7 @@ void CBaseWeaponPickup::init() m_dontAutoPickUpUntilPlayerMovesOffMe=true; m_collidedWithPlayer=true; + m_hasBeenCollected=false; } diff --git a/source/pickups/pickup.h b/source/pickups/pickup.h index 09efa0af4..5560524f1 100644 --- a/source/pickups/pickup.h +++ b/source/pickups/pickup.h @@ -126,10 +126,14 @@ public: virtual void init(); virtual void think(int _frames); + void setHasBeenCollected() {m_hasBeenCollected=true;} + int getHasBeenCollected() {return m_hasBeenCollected;} + protected: virtual void collidedWith(CThing *_thisThing); int m_dontAutoPickUpUntilPlayerMovesOffMe; int m_collidedWithPlayer; + int m_hasBeenCollected; private: virtual CSoundMediator::SFXID sfxToPlayWhenCollected(){return CSoundMediator::SFX_ITEM__POWER_UP_ITEM;} diff --git a/source/pickups/pjlammo.cpp b/source/pickups/pjlammo.cpp index 2caaab0a7..769ba965b 100644 --- a/source/pickups/pjlammo.cpp +++ b/source/pickups/pjlammo.cpp @@ -177,6 +177,10 @@ void CJellyLauncherPickup::init() ---------------------------------------------------------------------- */ void CJellyLauncherPickup::collect(class CPlayer *_player) { + if(!getHasBeenCollected()) + { + _player->giveJellyAmmoFromWeapon(); + } _player->setMode(PLAYER_MODE_JELLY_LAUNCHER); CBaseWeaponSimplePickup::collect(_player); } diff --git a/source/player/player.cpp b/source/player/player.cpp index edf43c6c5..276121097 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -823,6 +823,7 @@ if(newmode!=-1) pickupPos.vy=Pos.vy-30; pickup=createPickup((PICKUP_TYPE)pickupToDrop,&pickupPos); pickup->setPos(&pickupPos); + ((CBaseWeaponPickup*)pickup)->setHasBeenCollected(); } setMode(PLAYER_MODE_BASICUNARMED); } @@ -1939,8 +1940,8 @@ void CPlayer::respawn() m_squeakyBootsTimer=0; m_invincibilityRingTimer=0; - m_bubbleAmmo=INITIAL_BUBBLE_BLOWER_AMMO; - m_jellyAmmo=INITIAL_JELLY_LAUNCHER_AMMO; + m_bubbleAmmo=0; + m_jellyAmmo=0; m_jellyfishAmmoCount=0; m_pantFlashTimer=0; m_hasReceivedExtraLifeFor100Spats=false; diff --git a/source/player/player.h b/source/player/player.h index 3a292c7dc..0fd35c958 100644 --- a/source/player/player.h +++ b/source/player/player.h @@ -398,11 +398,11 @@ private: INITIAL_BUBBLE_BLOWER_AMMO=10, BUBBLE_BLOWER_AMMO_IN_PICKUP=10, - MAX_BUBBLE_BLOWER_AMMO=99, + MAX_BUBBLE_BLOWER_AMMO=20, INITIAL_JELLY_LAUNCHER_AMMO=6, JELLY_LAUNCHER_AMMO_IN_PICKUP=6, - MAX_JELLY_LAUNCHER_AMMO=99, + MAX_JELLY_LAUNCHER_AMMO=20, PANT_FLASH_TIME=128, PANT_FLASH_Y_OFFSET=-90, @@ -416,13 +416,15 @@ public: void giveDivingHelmet() {m_divingHelmet=true;} int isWearingDivingHelmet() {return m_divingHelmet;} - void giveBubbleAmmo() {m_bubbleAmmo+=INITIAL_BUBBLE_BLOWER_AMMO;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;} + void giveBubbleAmmo() {m_bubbleAmmo+=BUBBLE_BLOWER_AMMO_IN_PICKUP;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;} + void giveBubbleAmmoFromWeapon() {m_bubbleAmmo+=INITIAL_BUBBLE_BLOWER_AMMO;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;} void setBubbleAmmo(int _amount) {m_bubbleAmmo=_amount;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;} void useOneBubble() {m_bubbleAmmo--;} int getBubbleAmmo() {return m_bubbleAmmo;} int isHoldingBubbleWand() {return m_currentMode==PLAYER_MODE_BUBBLE_MIXTURE;} void giveJellyAmmo() {m_jellyAmmo+=JELLY_LAUNCHER_AMMO_IN_PICKUP;if(m_jellyAmmo>MAX_JELLY_LAUNCHER_AMMO)m_jellyAmmo=MAX_JELLY_LAUNCHER_AMMO;} + void giveJellyAmmoFromWeapon() {m_jellyAmmo+=INITIAL_JELLY_LAUNCHER_AMMO;if(m_jellyAmmo>MAX_JELLY_LAUNCHER_AMMO)m_jellyAmmo=MAX_JELLY_LAUNCHER_AMMO;} void useOneJelly() {m_jellyAmmo--;} int getJellyAmmo() {return m_jellyAmmo;} diff --git a/source/player/pmjelly.cpp b/source/player/pmjelly.cpp index 6d0b7a535..94365c241 100644 --- a/source/player/pmjelly.cpp +++ b/source/player/pmjelly.cpp @@ -388,9 +388,7 @@ void CPlayerModeJellyLauncher::launchProjectile() projectile->setRGB( 255 + ( 128 << 8 ) + ( 255 << 16 ) ); fireHeading+=512; -#ifndef __USER_paul__ m_player->useOneJelly(); -#endif } } else @@ -405,9 +403,7 @@ void CPlayerModeJellyLauncher::launchProjectile() 5*60); projectile->setRGB( 255 + ( 128 << 8 ) + ( 255 << 16 ) ); -#ifndef __USER_paul__ - m_player->useOneJelly(); -#endif + m_player->useOneJelly(); } }