This commit is contained in:
parent
a06ff07997
commit
e04b50e0bf
@ -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;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:
|
||||
|
@ -354,6 +354,9 @@ private:
|
||||
{
|
||||
SQUEAKY_BOOTS_TIME=60*10,
|
||||
INVINCIBILITY_RING_TIME=60*10,
|
||||
MAX_BUBBLE_BLOWER_AMMO=99,
|
||||
MAX_JELLY_LAUNCHER_AMMO=99,
|
||||
MAX_JELLFISH_IN_NET=5,
|
||||
};
|
||||
public:
|
||||
void giveGlasses() {m_glassesFlag=true;}
|
||||
@ -364,18 +367,19 @@ public:
|
||||
void giveDivingHelmet() {m_divingHelmet=true;}
|
||||
int isWearingDivingHelmet() {return m_divingHelmet;}
|
||||
|
||||
void giveBubbleAmmo() {m_bubbleAmmo+=10;if(m_bubbleAmmo>99)m_bubbleAmmo=99;}
|
||||
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>99)m_jellyAmmo=99;}
|
||||
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() {if(!isJellyFishAmmoFull())m_jellyfishAmmo++;}
|
||||
void useOneJellyFishAmmo() {m_jellyfishAmmo--;}
|
||||
int isJellyFishAmmoFull() {return m_jellyfishAmmo==5;}
|
||||
int getJellyFishAmmo() {return m_jellyfishAmmo;}
|
||||
void giveJellyFishAmmo(u32 _colour);
|
||||
void useOneJellyFishAmmo();
|
||||
int isJellyFishAmmoFull();
|
||||
int getJellyFishAmmo();
|
||||
u32 getColourOfNextJellyfishAmmo();
|
||||
|
||||
void setIsInWater(int _in) {m_isInWater=_in;}
|
||||
int getIsInWater() {return m_isInWater;}
|
||||
@ -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
|
||||
|
@ -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();
|
||||
@ -290,10 +289,12 @@ void CPlayerModeNet::think()
|
||||
|
||||
// Net has a jellyfish inside
|
||||
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
|
||||
{
|
||||
|
@ -60,7 +60,6 @@ private:
|
||||
int m_netFrame;
|
||||
NetState m_netState;
|
||||
int m_netSin;
|
||||
u32 m_RGB;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user