This commit is contained in:
parent
fa7ca199a8
commit
655939881a
@ -179,6 +179,10 @@ void CBubbleWandPickup::init()
|
|||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CBubbleWandPickup::collect(class CPlayer *_player)
|
void CBubbleWandPickup::collect(class CPlayer *_player)
|
||||||
{
|
{
|
||||||
|
if(!getHasBeenCollected())
|
||||||
|
{
|
||||||
|
_player->giveBubbleAmmoFromWeapon();
|
||||||
|
}
|
||||||
_player->setMode(PLAYER_MODE_BUBBLE_MIXTURE);
|
_player->setMode(PLAYER_MODE_BUBBLE_MIXTURE);
|
||||||
CBaseWeaponSimplePickup::collect(_player);
|
CBaseWeaponSimplePickup::collect(_player);
|
||||||
}
|
}
|
||||||
|
@ -291,6 +291,7 @@ void CBaseWeaponPickup::init()
|
|||||||
|
|
||||||
m_dontAutoPickUpUntilPlayerMovesOffMe=true;
|
m_dontAutoPickUpUntilPlayerMovesOffMe=true;
|
||||||
m_collidedWithPlayer=true;
|
m_collidedWithPlayer=true;
|
||||||
|
m_hasBeenCollected=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -126,10 +126,14 @@ public:
|
|||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void think(int _frames);
|
virtual void think(int _frames);
|
||||||
|
|
||||||
|
void setHasBeenCollected() {m_hasBeenCollected=true;}
|
||||||
|
int getHasBeenCollected() {return m_hasBeenCollected;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void collidedWith(CThing *_thisThing);
|
virtual void collidedWith(CThing *_thisThing);
|
||||||
int m_dontAutoPickUpUntilPlayerMovesOffMe;
|
int m_dontAutoPickUpUntilPlayerMovesOffMe;
|
||||||
int m_collidedWithPlayer;
|
int m_collidedWithPlayer;
|
||||||
|
int m_hasBeenCollected;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual CSoundMediator::SFXID sfxToPlayWhenCollected(){return CSoundMediator::SFX_ITEM__POWER_UP_ITEM;}
|
virtual CSoundMediator::SFXID sfxToPlayWhenCollected(){return CSoundMediator::SFX_ITEM__POWER_UP_ITEM;}
|
||||||
|
@ -177,6 +177,10 @@ void CJellyLauncherPickup::init()
|
|||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CJellyLauncherPickup::collect(class CPlayer *_player)
|
void CJellyLauncherPickup::collect(class CPlayer *_player)
|
||||||
{
|
{
|
||||||
|
if(!getHasBeenCollected())
|
||||||
|
{
|
||||||
|
_player->giveJellyAmmoFromWeapon();
|
||||||
|
}
|
||||||
_player->setMode(PLAYER_MODE_JELLY_LAUNCHER);
|
_player->setMode(PLAYER_MODE_JELLY_LAUNCHER);
|
||||||
CBaseWeaponSimplePickup::collect(_player);
|
CBaseWeaponSimplePickup::collect(_player);
|
||||||
}
|
}
|
||||||
|
@ -823,6 +823,7 @@ if(newmode!=-1)
|
|||||||
pickupPos.vy=Pos.vy-30;
|
pickupPos.vy=Pos.vy-30;
|
||||||
pickup=createPickup((PICKUP_TYPE)pickupToDrop,&pickupPos);
|
pickup=createPickup((PICKUP_TYPE)pickupToDrop,&pickupPos);
|
||||||
pickup->setPos(&pickupPos);
|
pickup->setPos(&pickupPos);
|
||||||
|
((CBaseWeaponPickup*)pickup)->setHasBeenCollected();
|
||||||
}
|
}
|
||||||
setMode(PLAYER_MODE_BASICUNARMED);
|
setMode(PLAYER_MODE_BASICUNARMED);
|
||||||
}
|
}
|
||||||
@ -1939,8 +1940,8 @@ void CPlayer::respawn()
|
|||||||
|
|
||||||
m_squeakyBootsTimer=0;
|
m_squeakyBootsTimer=0;
|
||||||
m_invincibilityRingTimer=0;
|
m_invincibilityRingTimer=0;
|
||||||
m_bubbleAmmo=INITIAL_BUBBLE_BLOWER_AMMO;
|
m_bubbleAmmo=0;
|
||||||
m_jellyAmmo=INITIAL_JELLY_LAUNCHER_AMMO;
|
m_jellyAmmo=0;
|
||||||
m_jellyfishAmmoCount=0;
|
m_jellyfishAmmoCount=0;
|
||||||
m_pantFlashTimer=0;
|
m_pantFlashTimer=0;
|
||||||
m_hasReceivedExtraLifeFor100Spats=false;
|
m_hasReceivedExtraLifeFor100Spats=false;
|
||||||
|
@ -398,11 +398,11 @@ private:
|
|||||||
|
|
||||||
INITIAL_BUBBLE_BLOWER_AMMO=10,
|
INITIAL_BUBBLE_BLOWER_AMMO=10,
|
||||||
BUBBLE_BLOWER_AMMO_IN_PICKUP=10,
|
BUBBLE_BLOWER_AMMO_IN_PICKUP=10,
|
||||||
MAX_BUBBLE_BLOWER_AMMO=99,
|
MAX_BUBBLE_BLOWER_AMMO=20,
|
||||||
|
|
||||||
INITIAL_JELLY_LAUNCHER_AMMO=6,
|
INITIAL_JELLY_LAUNCHER_AMMO=6,
|
||||||
JELLY_LAUNCHER_AMMO_IN_PICKUP=6,
|
JELLY_LAUNCHER_AMMO_IN_PICKUP=6,
|
||||||
MAX_JELLY_LAUNCHER_AMMO=99,
|
MAX_JELLY_LAUNCHER_AMMO=20,
|
||||||
|
|
||||||
PANT_FLASH_TIME=128,
|
PANT_FLASH_TIME=128,
|
||||||
PANT_FLASH_Y_OFFSET=-90,
|
PANT_FLASH_Y_OFFSET=-90,
|
||||||
@ -416,13 +416,15 @@ public:
|
|||||||
void giveDivingHelmet() {m_divingHelmet=true;}
|
void giveDivingHelmet() {m_divingHelmet=true;}
|
||||||
int isWearingDivingHelmet() {return m_divingHelmet;}
|
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 setBubbleAmmo(int _amount) {m_bubbleAmmo=_amount;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;}
|
||||||
void useOneBubble() {m_bubbleAmmo--;}
|
void useOneBubble() {m_bubbleAmmo--;}
|
||||||
int getBubbleAmmo() {return m_bubbleAmmo;}
|
int getBubbleAmmo() {return m_bubbleAmmo;}
|
||||||
int isHoldingBubbleWand() {return m_currentMode==PLAYER_MODE_BUBBLE_MIXTURE;}
|
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 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--;}
|
void useOneJelly() {m_jellyAmmo--;}
|
||||||
int getJellyAmmo() {return m_jellyAmmo;}
|
int getJellyAmmo() {return m_jellyAmmo;}
|
||||||
|
|
||||||
|
@ -388,9 +388,7 @@ void CPlayerModeJellyLauncher::launchProjectile()
|
|||||||
|
|
||||||
projectile->setRGB( 255 + ( 128 << 8 ) + ( 255 << 16 ) );
|
projectile->setRGB( 255 + ( 128 << 8 ) + ( 255 << 16 ) );
|
||||||
fireHeading+=512;
|
fireHeading+=512;
|
||||||
#ifndef __USER_paul__
|
|
||||||
m_player->useOneJelly();
|
m_player->useOneJelly();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -405,9 +403,7 @@ void CPlayerModeJellyLauncher::launchProjectile()
|
|||||||
5*60);
|
5*60);
|
||||||
|
|
||||||
projectile->setRGB( 255 + ( 128 << 8 ) + ( 255 << 16 ) );
|
projectile->setRGB( 255 + ( 128 << 8 ) + ( 255 << 16 ) );
|
||||||
#ifndef __USER_paul__
|
m_player->useOneJelly();
|
||||||
m_player->useOneJelly();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user