This commit is contained in:
parent
a06ff07997
commit
e04b50e0bf
4 changed files with 78 additions and 32 deletions
|
@ -1645,7 +1645,7 @@ void CPlayer::respawn()
|
||||||
m_invincibilityRingTimer=0;
|
m_invincibilityRingTimer=0;
|
||||||
m_bubbleAmmo=0;
|
m_bubbleAmmo=0;
|
||||||
m_jellyAmmo=0;
|
m_jellyAmmo=0;
|
||||||
m_jellyfishAmmo=0;
|
m_jellyfishAmmoCount=0;
|
||||||
|
|
||||||
m_moveVelocity.vx=m_moveVelocity.vy=0;
|
m_moveVelocity.vx=m_moveVelocity.vy=0;
|
||||||
|
|
||||||
|
@ -1719,8 +1719,10 @@ void CPlayer::renderSb(DVECTOR *_pos,int _animNo,int _animFrame)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
u32 colour;
|
||||||
|
colour=getColourOfNextJellyfishAmmo();
|
||||||
ft4=addonGfx->Render(*_pos,addonAnimNo,_animFrame,m_facing==FACING_RIGHT?0:1);
|
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);
|
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:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
|
|
@ -354,6 +354,9 @@ private:
|
||||||
{
|
{
|
||||||
SQUEAKY_BOOTS_TIME=60*10,
|
SQUEAKY_BOOTS_TIME=60*10,
|
||||||
INVINCIBILITY_RING_TIME=60*10,
|
INVINCIBILITY_RING_TIME=60*10,
|
||||||
|
MAX_BUBBLE_BLOWER_AMMO=99,
|
||||||
|
MAX_JELLY_LAUNCHER_AMMO=99,
|
||||||
|
MAX_JELLFISH_IN_NET=5,
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
void giveGlasses() {m_glassesFlag=true;}
|
void giveGlasses() {m_glassesFlag=true;}
|
||||||
|
@ -364,18 +367,19 @@ 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+=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--;}
|
void useOneBubble() {m_bubbleAmmo--;}
|
||||||
int getBubbleAmmo() {return 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--;}
|
void useOneJelly() {m_jellyAmmo--;}
|
||||||
int getJellyAmmo() {return m_jellyAmmo;}
|
int getJellyAmmo() {return m_jellyAmmo;}
|
||||||
|
|
||||||
void giveJellyFishAmmo() {if(!isJellyFishAmmoFull())m_jellyfishAmmo++;}
|
void giveJellyFishAmmo(u32 _colour);
|
||||||
void useOneJellyFishAmmo() {m_jellyfishAmmo--;}
|
void useOneJellyFishAmmo();
|
||||||
int isJellyFishAmmoFull() {return m_jellyfishAmmo==5;}
|
int isJellyFishAmmoFull();
|
||||||
int getJellyFishAmmo() {return m_jellyfishAmmo;}
|
int getJellyFishAmmo();
|
||||||
|
u32 getColourOfNextJellyfishAmmo();
|
||||||
|
|
||||||
void setIsInWater(int _in) {m_isInWater=_in;}
|
void setIsInWater(int _in) {m_isInWater=_in;}
|
||||||
int getIsInWater() {return m_isInWater;}
|
int getIsInWater() {return m_isInWater;}
|
||||||
|
@ -393,7 +397,8 @@ private:
|
||||||
int m_divingHelmet;
|
int m_divingHelmet;
|
||||||
int m_bubbleAmmo;
|
int m_bubbleAmmo;
|
||||||
int m_jellyAmmo;
|
int m_jellyAmmo;
|
||||||
int m_jellyfishAmmo;
|
int m_jellyfishAmmoCount;
|
||||||
|
u32 m_jellyfishAmmoColours[MAX_JELLFISH_IN_NET];
|
||||||
int m_isInWater;
|
int m_isInWater;
|
||||||
|
|
||||||
// Platforms
|
// Platforms
|
||||||
|
|
|
@ -192,15 +192,14 @@ void CPlayerModeNet::think()
|
||||||
{
|
{
|
||||||
if(((CNpcEnemy*)thing)->canBeCaughtByNet())
|
if(((CNpcEnemy*)thing)->canBeCaughtByNet())
|
||||||
{
|
{
|
||||||
((CNpcEnemy*)thing)->caughtWithNet();
|
|
||||||
m_RGB = ((CNpcEnemy*)thing)->getRGB();
|
|
||||||
m_netState=NET_STATE__JUST_CAUGHT_SOMETHING;
|
m_netState=NET_STATE__JUST_CAUGHT_SOMETHING;
|
||||||
thing=NULL;
|
|
||||||
if(m_player->getJellyFishAmmo()==0)
|
if(m_player->getJellyFishAmmo()==0)
|
||||||
{
|
{
|
||||||
m_netSin=0;
|
m_netSin=0;
|
||||||
}
|
}
|
||||||
m_player->giveJellyFishAmmo();
|
m_player->giveJellyFishAmmo(((CNpcEnemy*)thing)->getRGB());
|
||||||
|
((CNpcEnemy*)thing)->caughtWithNet();
|
||||||
|
thing=NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -239,7 +238,7 @@ void CPlayerModeNet::think()
|
||||||
5*60);
|
5*60);
|
||||||
|
|
||||||
projectile->updateCollisionArea();
|
projectile->updateCollisionArea();
|
||||||
projectile->setRGB( m_RGB );
|
projectile->setRGB(m_player->getColourOfNextJellyfishAmmo());
|
||||||
|
|
||||||
m_netState=NET_STATE__JUST_LAUNCHED_SOMETHING;
|
m_netState=NET_STATE__JUST_LAUNCHED_SOMETHING;
|
||||||
m_player->useOneJellyFishAmmo();
|
m_player->useOneJellyFishAmmo();
|
||||||
|
@ -290,10 +289,12 @@ void CPlayerModeNet::think()
|
||||||
|
|
||||||
// Net has a jellyfish inside
|
// 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);
|
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);
|
ft4=sb->printFT4Scaled(FRM__NETBLOB,CPlayer::POWERUPUI_ICONX+17,CPlayer::POWERUPUI_ICONY,0,0,CPlayer::POWERUPUI_OT,size);
|
||||||
setShadeTex(ft4,0);
|
setShadeTex(ft4,0);
|
||||||
setRGB0(ft4,255,128,255);
|
colour=m_player->getColourOfNextJellyfishAmmo();
|
||||||
|
setRGB0(ft4,(colour)&0xff,(colour>>8)&0x0ff,(colour>>16)&0xff);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,7 +60,6 @@ private:
|
||||||
int m_netFrame;
|
int m_netFrame;
|
||||||
NetState m_netState;
|
NetState m_netState;
|
||||||
int m_netSin;
|
int m_netSin;
|
||||||
u32 m_RGB;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue