This commit is contained in:
parent
5b944146d8
commit
337d6965ba
12 changed files with 133 additions and 24 deletions
|
@ -151,6 +151,7 @@ pickups_src := pickup \
|
||||||
phelmet \
|
phelmet \
|
||||||
pjlammo \
|
pjlammo \
|
||||||
plife \
|
plife \
|
||||||
|
pnet \
|
||||||
pquest \
|
pquest \
|
||||||
pshoes \
|
pshoes \
|
||||||
pspatula
|
pspatula
|
||||||
|
@ -165,6 +166,7 @@ player_src := demoplay \
|
||||||
pmcoral \
|
pmcoral \
|
||||||
pmdead \
|
pmdead \
|
||||||
pmfly \
|
pmfly \
|
||||||
|
pmnet \
|
||||||
psbutt \
|
psbutt \
|
||||||
psduck \
|
psduck \
|
||||||
psfall \
|
psfall \
|
||||||
|
|
|
@ -258,6 +258,8 @@ void CGameScene::initLevel()
|
||||||
pos.vx+=64; createPickup(PICKUP__SPATULA,&pos);
|
pos.vx+=64; createPickup(PICKUP__SPATULA,&pos);
|
||||||
pos.vx+=64; createPickup(PICKUP__JELLY_LAUNCHER_AMMO,&pos);
|
pos.vx+=64; createPickup(PICKUP__JELLY_LAUNCHER_AMMO,&pos);
|
||||||
pos.vx+=64; createPickup(PICKUP__BUBBLE_MIXTURE,&pos);
|
pos.vx+=64; createPickup(PICKUP__BUBBLE_MIXTURE,&pos);
|
||||||
|
pos.vx+=64; createPickup(PICKUP__BUBBLE_WAND,&pos);
|
||||||
|
pos.vx+=64; createPickup(PICKUP__NET,&pos);
|
||||||
pos.vx+=64; createPickup(PICKUP__GLASSES,&pos);
|
pos.vx+=64; createPickup(PICKUP__GLASSES,&pos);
|
||||||
pos.vx+=64; createPickup(PICKUP__SQUEAKY_SHOES,&pos);
|
pos.vx+=64; createPickup(PICKUP__SQUEAKY_SHOES,&pos);
|
||||||
pos.vx+=64; createPickup(PICKUP__BALLOON,&pos);
|
pos.vx+=64; createPickup(PICKUP__BALLOON,&pos);
|
||||||
|
@ -265,10 +267,10 @@ void CGameScene::initLevel()
|
||||||
pos.vx+=64; createPickup(PICKUP__CORAL_BLOWER,&pos);
|
pos.vx+=64; createPickup(PICKUP__CORAL_BLOWER,&pos);
|
||||||
pos.vx+=64; createPickup(PICKUP__QUEST_ITEM__TEST,&pos);
|
pos.vx+=64; createPickup(PICKUP__QUEST_ITEM__TEST,&pos);
|
||||||
|
|
||||||
CNpcPlatform *platform;
|
// CNpcPlatform *platform;
|
||||||
platform=new ("test platform") CNpcPlatform;
|
// platform=new ("test platform") CNpcPlatform;
|
||||||
platform->init();
|
// platform->init();
|
||||||
platform->setLayerCollision( Level.getCollisionLayer() );
|
// platform->setLayerCollision( Level.getCollisionLayer() );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
s_levelFinished=false;
|
s_levelFinished=false;
|
||||||
|
|
|
@ -77,7 +77,7 @@ void CBubbleMixturePickup::init()
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CBubbleMixturePickup::collect(class CPlayer *_player)
|
void CBubbleMixturePickup::collect(class CPlayer *_player)
|
||||||
{
|
{
|
||||||
_player->setMode(PLAYER_MODE_BUBBLE_MIXTURE);
|
_player->giveBubbleAmmo();
|
||||||
CBaseRespawningPickup::collect(_player);
|
CBaseRespawningPickup::collect(_player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,5 +124,61 @@ void CBubbleMixturePickup::renderPickup(DVECTOR *_pos)
|
||||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CBubbleWandPickup::init()
|
||||||
|
{
|
||||||
|
CBaseRespawningPickup::init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CBubbleWandPickup::collect(class CPlayer *_player)
|
||||||
|
{
|
||||||
|
_player->setMode(PLAYER_MODE_BUBBLE_MIXTURE);
|
||||||
|
CBaseRespawningPickup::collect(_player);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
int CBubbleWandPickup::getRespawnTime()
|
||||||
|
{
|
||||||
|
return 60*10;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CBubbleWandPickup::renderPickup(DVECTOR *_pos)
|
||||||
|
{
|
||||||
|
SpriteBank *sprites;
|
||||||
|
sFrameHdr *fh;
|
||||||
|
int x,y;
|
||||||
|
|
||||||
|
sprites=getSpriteBank();
|
||||||
|
fh=sprites->getFrameHeader(FRM__BUBBLEWAND);
|
||||||
|
x=_pos->vx-(fh->W/2);
|
||||||
|
y=_pos->vy-(fh->H/2);
|
||||||
|
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
||||||
|
}
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
end */
|
end */
|
||||||
|
|
|
@ -53,6 +53,21 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class CBubbleWandPickup : public CBaseRespawningPickup
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void init();
|
||||||
|
|
||||||
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual int getRespawnTime();
|
||||||
|
|
||||||
|
virtual void renderPickup(DVECTOR *_pos);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Globals
|
Globals
|
||||||
------- */
|
------- */
|
||||||
|
|
|
@ -67,6 +67,10 @@
|
||||||
#include "pickups\phelmet.h"
|
#include "pickups\phelmet.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PICKUPS_PNET_H__
|
||||||
|
#include "pickups\pnet.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __PICKUPS_PQUEST_H__
|
#ifndef __PICKUPS_PQUEST_H__
|
||||||
#include "pickups\pquest.h"
|
#include "pickups\pquest.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -311,6 +315,14 @@ CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos)
|
||||||
pickup=new ("BubbleAmmoPickup") CBubbleMixturePickup();
|
pickup=new ("BubbleAmmoPickup") CBubbleMixturePickup();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PICKUP__BUBBLE_WAND:
|
||||||
|
pickup=new ("BubbleWandPickup") CBubbleWandPickup();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PICKUP__NET:
|
||||||
|
pickup=new ("NetPickup") CNetPickup();
|
||||||
|
break;
|
||||||
|
|
||||||
case PICKUP__GLASSES:
|
case PICKUP__GLASSES:
|
||||||
pickup=new ("GlassesPickup") CGlassesPickup();
|
pickup=new ("GlassesPickup") CGlassesPickup();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -39,6 +39,8 @@ typedef enum
|
||||||
PICKUP__SPATULA,
|
PICKUP__SPATULA,
|
||||||
PICKUP__JELLY_LAUNCHER_AMMO,
|
PICKUP__JELLY_LAUNCHER_AMMO,
|
||||||
PICKUP__BUBBLE_MIXTURE,
|
PICKUP__BUBBLE_MIXTURE,
|
||||||
|
PICKUP__BUBBLE_WAND,
|
||||||
|
PICKUP__NET,
|
||||||
PICKUP__GLASSES,
|
PICKUP__GLASSES,
|
||||||
PICKUP__SQUEAKY_SHOES,
|
PICKUP__SQUEAKY_SHOES,
|
||||||
PICKUP__BALLOON,
|
PICKUP__BALLOON,
|
||||||
|
|
|
@ -79,12 +79,12 @@ void CSpatulaPickup::collect(class CPlayer *_player)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
int spat_glintspeed=3;
|
int spat_glintspeed=1;
|
||||||
int spat_maxglint=100;
|
int spat_maxglint=100;
|
||||||
int spat_glintrotspeed=50;
|
int spat_glintrotspeed=50;
|
||||||
int spat_glintgrowspeed=5;
|
int spat_glintgrowspeed=5;
|
||||||
DVECTOR spat_gxy1={0,28};
|
DVECTOR spat_gxy1={0,28};
|
||||||
DVECTOR spat_gxy2={20,0};
|
DVECTOR spat_gxy2={50,-35};
|
||||||
static const int spat_glintFrames[]={FRM__GLINT1,FRM__GLINT2,FRM__GLINT3,FRM__GLINT4,FRM__GLINT4,FRM__GLINT3,FRM__GLINT2,FRM__GLINT1};
|
static const int spat_glintFrames[]={FRM__GLINT1,FRM__GLINT2,FRM__GLINT3,FRM__GLINT4,FRM__GLINT4,FRM__GLINT3,FRM__GLINT2,FRM__GLINT1};
|
||||||
void CSpatulaPickup::thinkPickup(int _frames)
|
void CSpatulaPickup::thinkPickup(int _frames)
|
||||||
{
|
{
|
||||||
|
|
|
@ -250,9 +250,6 @@ m_animFrame=0;
|
||||||
setCollisionSize(25,50);
|
setCollisionSize(25,50);
|
||||||
setCollisionCentreOffset(0,-25);
|
setCollisionCentreOffset(0,-25);
|
||||||
|
|
||||||
m_glassesFlag=0;
|
|
||||||
m_squeakyBootsTimer=0;
|
|
||||||
m_invinvibilityRingTimer=0;
|
|
||||||
m_divingHelmet=false;
|
m_divingHelmet=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -708,6 +705,11 @@ void CPlayer::respawn()
|
||||||
m_invincibleFrameCount=INVINCIBLE_FRAMES__START;
|
m_invincibleFrameCount=INVINCIBLE_FRAMES__START;
|
||||||
Pos=m_respawnPos;
|
Pos=m_respawnPos;
|
||||||
|
|
||||||
|
m_glassesFlag=0;
|
||||||
|
m_squeakyBootsTimer=0;
|
||||||
|
m_invinvibilityRingTimer=0;
|
||||||
|
m_bubbleAmmo=0;
|
||||||
|
|
||||||
clearPlatform();
|
clearPlatform();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -246,11 +246,16 @@ public:
|
||||||
void giveSqueakyBoots() {m_squeakyBootsTimer=SQUEAKY_BOOTS_TIME;}
|
void giveSqueakyBoots() {m_squeakyBootsTimer=SQUEAKY_BOOTS_TIME;}
|
||||||
void giveInvinvibilityRing() {m_invinvibilityRingTimer=INVINCIBILITY_RING_TIME;}
|
void giveInvinvibilityRing() {m_invinvibilityRingTimer=INVINCIBILITY_RING_TIME;}
|
||||||
void giveDivingHelmet() {m_divingHelmet=true;}
|
void giveDivingHelmet() {m_divingHelmet=true;}
|
||||||
|
|
||||||
|
void giveBubbleAmmo() {m_bubbleAmmo+=10;}
|
||||||
|
void useOneBubble() {m_bubbleAmmo--;}
|
||||||
|
int getBubbleAmmo() {return m_bubbleAmmo;}
|
||||||
private:
|
private:
|
||||||
int m_glassesFlag;
|
int m_glassesFlag;
|
||||||
int m_squeakyBootsTimer;
|
int m_squeakyBootsTimer;
|
||||||
int m_invinvibilityRingTimer;
|
int m_invinvibilityRingTimer;
|
||||||
int m_divingHelmet;
|
int m_divingHelmet;
|
||||||
|
int m_bubbleAmmo;
|
||||||
|
|
||||||
// Platforms
|
// Platforms
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -57,7 +57,7 @@ void CPlayerModeBubbleMixture::enter()
|
||||||
CSoundMediator::playSfx(CSoundMediator::SFX_BUBBLE_WAND);
|
CSoundMediator::playSfx(CSoundMediator::SFX_BUBBLE_WAND);
|
||||||
m_blowing=false;
|
m_blowing=false;
|
||||||
m_bubbleDelay=0;
|
m_bubbleDelay=0;
|
||||||
m_bubbleCount=BUBBLE_AMMO;
|
m_player->giveBubbleAmmo();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -66,6 +66,8 @@ void CPlayerModeBubbleMixture::enter()
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
|
DVECTOR buboff={-40,-40};
|
||||||
|
int bubam;
|
||||||
void CPlayerModeBubbleMixture::think()
|
void CPlayerModeBubbleMixture::think()
|
||||||
{
|
{
|
||||||
// If we're blowing then restore the 'real' anim number/frame before
|
// If we're blowing then restore the 'real' anim number/frame before
|
||||||
|
@ -86,19 +88,24 @@ void CPlayerModeBubbleMixture::think()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Start to blow?
|
// 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..!
|
// Spawn the bubbly platform thingy..!
|
||||||
// pos is m_player->getPos();
|
CNpcPlatform *bubble;
|
||||||
// dir is m_player->getFacing();
|
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_blowFrame=0;
|
||||||
m_blowing=true;
|
m_blowing=true;
|
||||||
|
|
||||||
CNpcPlatform *bubble = new ("bubble platform") CNpcPlatform;
|
// One less bubble..
|
||||||
bubble->setType( CNpcPlatform::NPC_BUBBLE_PLATFORM );
|
m_player->useOneBubble();
|
||||||
bubble->init( m_player->getPos(), 4 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,12 +121,9 @@ void CPlayerModeBubbleMixture::think()
|
||||||
m_player->setAnimFrame(m_savedAnimFrame);
|
m_player->setAnimFrame(m_savedAnimFrame);
|
||||||
m_blowing=false;
|
m_blowing=false;
|
||||||
m_bubbleDelay=BUBBLE_DELAY;
|
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 setAnimNo(int _animNo);
|
||||||
virtual void setAnimFrame(int _animFrame);
|
virtual void setAnimFrame(int _animFrame);
|
||||||
|
|
||||||
|
void giveBubbleAmmo(int _amount) {m_bubbleCount+=_amount;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
BUBBLE_AMMO=10,
|
BUBBLE_DELAY=30*1,
|
||||||
BUBBLE_DELAY=60*1,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int canBlowBubbleFromThisState();
|
int canBlowBubbleFromThisState();
|
||||||
|
|
|
@ -745,6 +745,14 @@ SOURCE=..\..\..\source\pickups\plife.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\pickups\pnet.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\pickups\pnet.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\source\pickups\pquest.cpp
|
SOURCE=..\..\..\source\pickups\pquest.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue