This commit is contained in:
parent
5b944146d8
commit
337d6965ba
12 changed files with 133 additions and 24 deletions
|
@ -250,9 +250,6 @@ m_animFrame=0;
|
|||
setCollisionSize(25,50);
|
||||
setCollisionCentreOffset(0,-25);
|
||||
|
||||
m_glassesFlag=0;
|
||||
m_squeakyBootsTimer=0;
|
||||
m_invinvibilityRingTimer=0;
|
||||
m_divingHelmet=false;
|
||||
}
|
||||
|
||||
|
@ -708,6 +705,11 @@ void CPlayer::respawn()
|
|||
m_invincibleFrameCount=INVINCIBLE_FRAMES__START;
|
||||
Pos=m_respawnPos;
|
||||
|
||||
m_glassesFlag=0;
|
||||
m_squeakyBootsTimer=0;
|
||||
m_invinvibilityRingTimer=0;
|
||||
m_bubbleAmmo=0;
|
||||
|
||||
clearPlatform();
|
||||
}
|
||||
|
||||
|
|
|
@ -246,11 +246,16 @@ public:
|
|||
void giveSqueakyBoots() {m_squeakyBootsTimer=SQUEAKY_BOOTS_TIME;}
|
||||
void giveInvinvibilityRing() {m_invinvibilityRingTimer=INVINCIBILITY_RING_TIME;}
|
||||
void giveDivingHelmet() {m_divingHelmet=true;}
|
||||
|
||||
void giveBubbleAmmo() {m_bubbleAmmo+=10;}
|
||||
void useOneBubble() {m_bubbleAmmo--;}
|
||||
int getBubbleAmmo() {return m_bubbleAmmo;}
|
||||
private:
|
||||
int m_glassesFlag;
|
||||
int m_squeakyBootsTimer;
|
||||
int m_invinvibilityRingTimer;
|
||||
int m_divingHelmet;
|
||||
int m_bubbleAmmo;
|
||||
|
||||
// Platforms
|
||||
public:
|
||||
|
|
|
@ -57,7 +57,7 @@ void CPlayerModeBubbleMixture::enter()
|
|||
CSoundMediator::playSfx(CSoundMediator::SFX_BUBBLE_WAND);
|
||||
m_blowing=false;
|
||||
m_bubbleDelay=0;
|
||||
m_bubbleCount=BUBBLE_AMMO;
|
||||
m_player->giveBubbleAmmo();
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -66,6 +66,8 @@ void CPlayerModeBubbleMixture::enter()
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
DVECTOR buboff={-40,-40};
|
||||
int bubam;
|
||||
void CPlayerModeBubbleMixture::think()
|
||||
{
|
||||
// If we're blowing then restore the 'real' anim number/frame before
|
||||
|
@ -86,19 +88,24 @@ void CPlayerModeBubbleMixture::think()
|
|||
else
|
||||
{
|
||||
// Start to blow?
|
||||
if(!m_blowing&&getPadInputDown()&PI_ACTION&&canBlowBubbleFromThisState())
|
||||
if(!m_blowing&&getPadInputDown()&PI_ACTION&&canBlowBubbleFromThisState()&&m_player->getBubbleAmmo())
|
||||
{
|
||||
// Spawn the bubbly platform thingy..!
|
||||
// pos is m_player->getPos();
|
||||
// dir is m_player->getFacing();
|
||||
CNpcPlatform *bubble;
|
||||
DVECTOR pos;
|
||||
bubble=new ("bubble platform") CNpcPlatform;
|
||||
bubble->setType( CNpcPlatform::NPC_BUBBLE_PLATFORM );
|
||||
pos=m_player->getPos();
|
||||
pos.vx+=buboff.vx*m_player->getFacing();
|
||||
pos.vy+=buboff.vy;
|
||||
bubble->init(pos,4);
|
||||
|
||||
// Start the anim off
|
||||
// Start the blowing anim off
|
||||
m_blowFrame=0;
|
||||
m_blowing=true;
|
||||
|
||||
CNpcPlatform *bubble = new ("bubble platform") CNpcPlatform;
|
||||
bubble->setType( CNpcPlatform::NPC_BUBBLE_PLATFORM );
|
||||
bubble->init( m_player->getPos(), 4 );
|
||||
// One less bubble..
|
||||
m_player->useOneBubble();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,12 +121,9 @@ void CPlayerModeBubbleMixture::think()
|
|||
m_player->setAnimFrame(m_savedAnimFrame);
|
||||
m_blowing=false;
|
||||
m_bubbleDelay=BUBBLE_DELAY;
|
||||
if(--m_bubbleCount==0)
|
||||
{
|
||||
m_player->setMode(PLAYER_MODE_FULLUNARMED);
|
||||
}
|
||||
}
|
||||
}
|
||||
bubam=m_player->getBubbleAmmo();
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
|
|
@ -43,11 +43,12 @@ public:
|
|||
virtual void setAnimNo(int _animNo);
|
||||
virtual void setAnimFrame(int _animFrame);
|
||||
|
||||
void giveBubbleAmmo(int _amount) {m_bubbleCount+=_amount;}
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
BUBBLE_AMMO=10,
|
||||
BUBBLE_DELAY=60*1,
|
||||
BUBBLE_DELAY=30*1,
|
||||
};
|
||||
|
||||
int canBlowBubbleFromThisState();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue