This commit is contained in:
Paul 2001-03-31 02:05:24 +00:00
parent 5b944146d8
commit 337d6965ba
12 changed files with 133 additions and 24 deletions

View File

@ -151,6 +151,7 @@ pickups_src := pickup \
phelmet \
pjlammo \
plife \
pnet \
pquest \
pshoes \
pspatula
@ -165,6 +166,7 @@ player_src := demoplay \
pmcoral \
pmdead \
pmfly \
pmnet \
psbutt \
psduck \
psfall \

View File

@ -258,6 +258,8 @@ void CGameScene::initLevel()
pos.vx+=64; createPickup(PICKUP__SPATULA,&pos);
pos.vx+=64; createPickup(PICKUP__JELLY_LAUNCHER_AMMO,&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__SQUEAKY_SHOES,&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__QUEST_ITEM__TEST,&pos);
CNpcPlatform *platform;
platform=new ("test platform") CNpcPlatform;
platform->init();
platform->setLayerCollision( Level.getCollisionLayer() );
// CNpcPlatform *platform;
// platform=new ("test platform") CNpcPlatform;
// platform->init();
// platform->setLayerCollision( Level.getCollisionLayer() );
#endif
s_levelFinished=false;

View File

@ -77,7 +77,7 @@ void CBubbleMixturePickup::init()
---------------------------------------------------------------------- */
void CBubbleMixturePickup::collect(class CPlayer *_player)
{
_player->setMode(PLAYER_MODE_BUBBLE_MIXTURE);
_player->giveBubbleAmmo();
CBaseRespawningPickup::collect(_player);
}
@ -124,5 +124,61 @@ void CBubbleMixturePickup::renderPickup(DVECTOR *_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 */

View File

@ -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
------- */

View File

@ -67,6 +67,10 @@
#include "pickups\phelmet.h"
#endif
#ifndef __PICKUPS_PNET_H__
#include "pickups\pnet.h"
#endif
#ifndef __PICKUPS_PQUEST_H__
#include "pickups\pquest.h"
#endif
@ -311,6 +315,14 @@ CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos)
pickup=new ("BubbleAmmoPickup") CBubbleMixturePickup();
break;
case PICKUP__BUBBLE_WAND:
pickup=new ("BubbleWandPickup") CBubbleWandPickup();
break;
case PICKUP__NET:
pickup=new ("NetPickup") CNetPickup();
break;
case PICKUP__GLASSES:
pickup=new ("GlassesPickup") CGlassesPickup();
break;

View File

@ -39,6 +39,8 @@ typedef enum
PICKUP__SPATULA,
PICKUP__JELLY_LAUNCHER_AMMO,
PICKUP__BUBBLE_MIXTURE,
PICKUP__BUBBLE_WAND,
PICKUP__NET,
PICKUP__GLASSES,
PICKUP__SQUEAKY_SHOES,
PICKUP__BALLOON,

View File

@ -79,12 +79,12 @@ void CSpatulaPickup::collect(class CPlayer *_player)
Params:
Returns:
---------------------------------------------------------------------- */
int spat_glintspeed=3;
int spat_glintspeed=1;
int spat_maxglint=100;
int spat_glintrotspeed=50;
int spat_glintgrowspeed=5;
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};
void CSpatulaPickup::thinkPickup(int _frames)
{

View File

@ -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();
}

View File

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

View File

@ -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();
}
/*----------------------------------------------------------------------

View File

@ -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();

View File

@ -745,6 +745,14 @@ SOURCE=..\..\..\source\pickups\plife.h
# End 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
# End Source File
# Begin Source File