diff --git a/source/player/player.cpp b/source/player/player.cpp index 73431d26a..aa5d2b415 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -1645,7 +1645,7 @@ void CPlayer::respawn() m_invincibilityRingTimer=0; m_bubbleAmmo=0; m_jellyAmmo=0; - m_jellyfishAmmo=0; + m_jellyfishAmmoCount=0; m_moveVelocity.vx=m_moveVelocity.vy=0; @@ -1719,8 +1719,10 @@ 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,255,128,255); + setRGB0(ft4,(colour)&0xff,(colour>>8)&0x0ff,(colour>>16)&0xff); setSemiTrans(ft4,trans); } } @@ -2075,6 +2077,45 @@ 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;i99)m_bubbleAmmo=99;} - void useOneBubble() {m_bubbleAmmo--;} - int getBubbleAmmo() {return m_bubbleAmmo;} - - void giveJellyAmmo() {m_jellyAmmo+=6;if(m_jellyAmmo>99)m_jellyAmmo=99;} - void useOneJelly() {m_jellyAmmo--;} - int getJellyAmmo() {return m_jellyAmmo;} - - void giveJellyFishAmmo() {if(!isJellyFishAmmoFull())m_jellyfishAmmo++;} - void useOneJellyFishAmmo() {m_jellyfishAmmo--;} - int isJellyFishAmmoFull() {return m_jellyfishAmmo==5;} - int getJellyFishAmmo() {return m_jellyfishAmmo;} + void giveGlasses() {m_glassesFlag=true;} + int isWearingGlasses() {return m_glassesFlag;} + void giveSqueakyBoots() {m_squeakyBootsTimer=SQUEAKY_BOOTS_TIME;} + int isWearingBoots() {return m_squeakyBootsTimer;} + void giveInvincibilityRing() {m_invincibilityRingTimer=INVINCIBILITY_RING_TIME;} + void giveDivingHelmet() {m_divingHelmet=true;} + int isWearingDivingHelmet() {return m_divingHelmet;} + + void giveBubbleAmmo() {m_bubbleAmmo+=10;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 useOneJelly() {m_jellyAmmo--;} + int getJellyAmmo() {return m_jellyAmmo;} + + void giveJellyFishAmmo(u32 _colour); + void useOneJellyFishAmmo(); + int isJellyFishAmmoFull(); + int getJellyFishAmmo(); + u32 getColourOfNextJellyfishAmmo(); void setIsInWater(int _in) {m_isInWater=_in;} int getIsInWater() {return m_isInWater;} int getIsHealthFullSoICanStopSoakingUp() {return m_healthWaterLevel==WATERMAXHEALTH;} int getIsHealthSoFullThatIDontNeedToSoakUp(){return m_healthWaterLevel>=WATERMINSOACKUPLEVEL;} - int isHoldingNet() {return m_currentMode==PLAYER_MODE_NET;} + int isHoldingNet() {return m_currentMode==PLAYER_MODE_NET;} void justButtBouncedABadGuy(); // Also fugly.. :/ @@ -393,7 +397,8 @@ private: int m_divingHelmet; int m_bubbleAmmo; int m_jellyAmmo; - int m_jellyfishAmmo; + int m_jellyfishAmmoCount; + u32 m_jellyfishAmmoColours[MAX_JELLFISH_IN_NET]; int m_isInWater; // Platforms diff --git a/source/player/pmnet.cpp b/source/player/pmnet.cpp index 767225801..da276f8c9 100644 --- a/source/player/pmnet.cpp +++ b/source/player/pmnet.cpp @@ -192,15 +192,14 @@ void CPlayerModeNet::think() { if(((CNpcEnemy*)thing)->canBeCaughtByNet()) { - ((CNpcEnemy*)thing)->caughtWithNet(); - m_RGB = ((CNpcEnemy*)thing)->getRGB(); m_netState=NET_STATE__JUST_CAUGHT_SOMETHING; - thing=NULL; if(m_player->getJellyFishAmmo()==0) { m_netSin=0; } - m_player->giveJellyFishAmmo(); + m_player->giveJellyFishAmmo(((CNpcEnemy*)thing)->getRGB()); + ((CNpcEnemy*)thing)->caughtWithNet(); + thing=NULL; } else { @@ -239,7 +238,7 @@ void CPlayerModeNet::think() 5*60); projectile->updateCollisionArea(); - projectile->setRGB( m_RGB ); + projectile->setRGB(m_player->getColourOfNextJellyfishAmmo()); m_netState=NET_STATE__JUST_LAUNCHED_SOMETHING; m_player->useOneJellyFishAmmo(); @@ -289,11 +288,13 @@ void CPlayerModeNet::think() POLY_FT4 *ft4; // Net has a jellyfish inside - int size=256+128+((msin(m_netSin)*npsize)>>12); + int size=256+128+((msin(m_netSin)*npsize)>>12); + u32 colour; 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); - setRGB0(ft4,255,128,255); + colour=m_player->getColourOfNextJellyfishAmmo(); + setRGB0(ft4,(colour)&0xff,(colour>>8)&0x0ff,(colour>>16)&0xff); } else { diff --git a/source/player/pmnet.h b/source/player/pmnet.h index f2e8f4344..44204375f 100644 --- a/source/player/pmnet.h +++ b/source/player/pmnet.h @@ -60,7 +60,6 @@ private: int m_netFrame; NetState m_netState; int m_netSin; - u32 m_RGB; };