From 8b28dcc764ac5e6681982391e23d41893a790db4 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 12 Jul 2001 16:47:11 +0000 Subject: [PATCH] --- source/player/player.cpp | 48 +++----------------------------------- source/player/player.h | 21 ++++++++++------- source/player/pmbubble.cpp | 1 - source/player/pmjelly.cpp | 1 - source/player/pmnet.cpp | 7 +++--- 5 files changed, 19 insertions(+), 59 deletions(-) diff --git a/source/player/player.cpp b/source/player/player.cpp index a16dfcb8b..a11b8dab0 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -1842,8 +1842,8 @@ void CPlayer::respawn() m_squeakyBootsTimer=0; m_invincibilityRingTimer=0; - m_bubbleAmmo=0; - m_jellyAmmo=0; + m_bubbleAmmo=INITIAL_BUBBLE_BLOWER_AMMO; + m_jellyAmmo=INITIAL_JELLY_LAUNCHER_AMMO; m_jellyfishAmmoCount=0; m_moveVelocity.vx=m_moveVelocity.vy=0; @@ -1918,10 +1918,8 @@ void CPlayer::renderSb(DVECTOR *_pos,int _animNo,int _animFrame) } else { - u32 colour; - colour=getColourOfNextJellyfishAmmo(); ft4=addonGfx->Render(*_pos,addonAnimNo,_animFrame,m_facing==FACING_RIGHT?0:1); - setRGB0(ft4,(colour)&0xff,(colour>>8)&0x0ff,(colour>>16)&0xff); + setRGB0(ft4,255,128,255); setSemiTrans(ft4,trans); } } @@ -2312,46 +2310,6 @@ PLAYERINPUT CPlayer::readPadInput() } - - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayer::giveJellyFishAmmo(u32 _colour) -{ - ASSERT(!isJellyFishAmmoFull()); - m_jellyfishAmmoColours[m_jellyfishAmmoCount]=_colour; - m_jellyfishAmmoCount++; -} -void CPlayer::useOneJellyFishAmmo() -{ - ASSERT(m_jellyfishAmmoCount!=0); - - int i; - - m_jellyfishAmmoCount--; - for(i=0;iMAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;} + void giveBubbleAmmo() {m_bubbleAmmo+=INITIAL_BUBBLE_BLOWER_AMMO;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;} void useOneBubble() {m_bubbleAmmo--;} int getBubbleAmmo() {return m_bubbleAmmo;} - void giveJellyAmmo() {m_jellyAmmo+=6;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 useOneJelly() {m_jellyAmmo--;} int getJellyAmmo() {return m_jellyAmmo;} - void giveJellyFishAmmo(u32 _colour); - void useOneJellyFishAmmo(); - int isJellyFishAmmoFull(); - int getJellyFishAmmo(); - u32 getColourOfNextJellyfishAmmo(); + void giveJellyFishAmmo() {m_jellyfishAmmoCount++;if(m_jellyfishAmmoCount>MAX_JELLFISH_IN_NET)m_jellyfishAmmoCount=MAX_JELLFISH_IN_NET;} + void useOneJellyFishAmmo() {m_jellyfishAmmoCount--;} + int isJellyFishAmmoFull() {return m_jellyfishAmmoCount==MAX_JELLFISH_IN_NET;} + int getJellyFishAmmo() {return m_jellyfishAmmoCount;} void setIsInWater(int _in) {m_isInWater=_in;m_helmetSoundTimer=0;} int getIsInWater() {return m_isInWater;} @@ -433,7 +439,6 @@ private: int m_bubbleAmmo; int m_jellyAmmo; int m_jellyfishAmmoCount; - u32 m_jellyfishAmmoColours[MAX_JELLFISH_IN_NET]; int m_isInWater; // Platforms diff --git a/source/player/pmbubble.cpp b/source/player/pmbubble.cpp index fa4109c82..888163612 100644 --- a/source/player/pmbubble.cpp +++ b/source/player/pmbubble.cpp @@ -157,7 +157,6 @@ void CPlayerModeBubbleMixture::enter() CPlayerModeBase::enter(); m_blowing=false; m_bubbleDelay=0; - m_player->giveBubbleAmmo(); } /*---------------------------------------------------------------------- diff --git a/source/player/pmjelly.cpp b/source/player/pmjelly.cpp index 466701626..8fa897330 100644 --- a/source/player/pmjelly.cpp +++ b/source/player/pmjelly.cpp @@ -168,7 +168,6 @@ void CPlayerModeJellyLauncher::enter() { CPlayerModeBase::enter(); m_firingState=FIRING_STATE__NONE; - m_player->giveJellyAmmo(); } /*---------------------------------------------------------------------- diff --git a/source/player/pmnet.cpp b/source/player/pmnet.cpp index 33e0bb166..e99e00ee0 100644 --- a/source/player/pmnet.cpp +++ b/source/player/pmnet.cpp @@ -274,7 +274,7 @@ void CPlayerModeNet::think() { m_netSin=0; } - m_player->giveJellyFishAmmo(((CNpcEnemy*)thing)->getRGB()); + m_player->giveJellyFishAmmo(); ((CNpcEnemy*)thing)->caughtWithNet(); thing=NULL; } @@ -315,7 +315,7 @@ void CPlayerModeNet::think() 5*60); projectile->updateCollisionArea(); - projectile->setRGB(m_player->getColourOfNextJellyfishAmmo()); + projectile->setRGB(255+(128<<8)+(255<<16)); m_netState=NET_STATE__JUST_LAUNCHED_SOMETHING; m_player->useOneJellyFishAmmo(); @@ -370,8 +370,7 @@ void CPlayerModeNet::think() sb->printFT4Scaled(fh,CPlayer::POWERUPUI_ICONX,CPlayer::POWERUPUI_ICONY,0,0,CPlayer::POWERUPUI_OT,size); ft4=sb->printFT4Scaled(FRM__NETBLOB,CPlayer::POWERUPUI_ICONX+17,CPlayer::POWERUPUI_ICONY,0,0,CPlayer::POWERUPUI_OT,size); setShadeTex(ft4,0); - colour=m_player->getColourOfNextJellyfishAmmo(); - setRGB0(ft4,(colour)&0xff,(colour>>8)&0x0ff,(colour>>16)&0xff); + setRGB0(ft4,255,128,255); } else {