This commit is contained in:
Paul 2001-07-12 16:47:11 +00:00
parent 522a83596d
commit 8b28dcc764
5 changed files with 19 additions and 59 deletions

View File

@ -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;i<m_jellyfishAmmoCount;i++)
{
m_jellyfishAmmoColours[i]=m_jellyfishAmmoColours[i+1];
}
}
int CPlayer::isJellyFishAmmoFull()
{
return m_jellyfishAmmoCount==MAX_JELLFISH_IN_NET;
}
int CPlayer::getJellyFishAmmo()
{
return m_jellyfishAmmoCount;
}
u32 CPlayer::getColourOfNextJellyfishAmmo()
{
ASSERT(m_jellyfishAmmoCount!=0);
return m_jellyfishAmmoColours[0];
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -390,8 +390,15 @@ private:
SQUEAKY_BOOTS_TIME=60*10,
SQUEAKY_BOOTS_FLASH_TIME=60*2,
INVINCIBILITY_RING_TIME=60*10,
INITIAL_BUBBLE_BLOWER_AMMO=10,
BUBBLE_BLOWER_AMMO_IN_PICKUP=10,
MAX_BUBBLE_BLOWER_AMMO=99,
INITIAL_JELLY_LAUNCHER_AMMO=6,
JELLY_LAUNCHER_AMMO_IN_PICKUP=6,
MAX_JELLY_LAUNCHER_AMMO=99,
MAX_JELLFISH_IN_NET=5,
};
public:
@ -401,19 +408,18 @@ public:
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 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

View File

@ -157,7 +157,6 @@ void CPlayerModeBubbleMixture::enter()
CPlayerModeBase::enter();
m_blowing=false;
m_bubbleDelay=0;
m_player->giveBubbleAmmo();
}
/*----------------------------------------------------------------------

View File

@ -168,7 +168,6 @@ void CPlayerModeJellyLauncher::enter()
{
CPlayerModeBase::enter();
m_firingState=FIRING_STATE__NONE;
m_player->giveJellyAmmo();
}
/*----------------------------------------------------------------------

View File

@ -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
{