This commit is contained in:
Paul 2001-03-30 17:47:00 +00:00
parent 904214167c
commit cb8f318494
13 changed files with 128 additions and 121 deletions

View file

@ -159,6 +159,8 @@ eng=Set FULLUNARMED mode
eng=Set SQUEAKYBOOTS mode eng=Set SQUEAKYBOOTS mode
[STR__DEBUG__BALLOON_MODE] [STR__DEBUG__BALLOON_MODE]
eng=Set BALLOON mode eng=Set BALLOON mode
[STR__DEBUG__BUBBLEMIXTURE_MODE]
eng=Set BUBBLE MIXTURE mode
[STR__DEBUG__NET_MODE] [STR__DEBUG__NET_MODE]
eng=Set NET mode eng=Set NET mode
[STR__DEBUG__CORALBLOWER_MODE] [STR__DEBUG__CORALBLOWER_MODE]

View file

@ -144,6 +144,7 @@ paul_src := paul \
pickups_src := pickup \ pickups_src := pickup \
pballoon \ pballoon \
pblower \
pbubmix \ pbubmix \
pglasses \ pglasses \
phealth \ phealth \
@ -159,7 +160,9 @@ player_src := demoplay \
player \ player \
pmodes \ pmodes \
pmbloon \ pmbloon \
pmbubble \
pmchop \ pmchop \
pmcoral \
pmdead \ pmdead \
pmfly \ pmfly \
psbutt \ psbutt \

View file

@ -301,7 +301,7 @@ INGAMEFX_GFX_NONTRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_NONTRANS),$(INGAMEFX_N
PICKUP_GFX_DIR := $(GRAF_DIR)/pickups PICKUP_GFX_DIR := $(GRAF_DIR)/pickups
PICKUP_GFX := +spatula +pants +health100 +health50 +health25 +glint1 +glint2 +glint3 +glint4 \ PICKUP_GFX := +spatula +pants +health100 +health50 +health25 +glint1 +glint2 +glint3 +glint4 \
+jellyammo +bubblemixture +glasses +shoe +balloon +helmet \ +jellyammo +bubblemixture +glasses +shoe +balloon +helmet \
+teeth +teeth +blower
PICKUP_GFX_IN := $(foreach FILE,$(PICKUP_GFX),$(PICKUP_GFX_DIR)/$(FILE).bmp) PICKUP_GFX_IN := $(foreach FILE,$(PICKUP_GFX),$(PICKUP_GFX_DIR)/$(FILE).bmp)
INGAMEFX_GFX_TRANS := +bubble_1 +bubble_2 +bubble_3 INGAMEFX_GFX_TRANS := +bubble_1 +bubble_2 +bubble_3

View file

@ -115,11 +115,16 @@ void CPauseMenu::init()
STR__DEBUG__BALLOON_MODE, STR__DEBUG__BALLOON_MODE,
&newmode,PLAYER_MODE_BALLOON); &newmode,PLAYER_MODE_BALLOON);
xpos+=TEXT_SPACING; xpos+=TEXT_SPACING;
// CGUIFactory::createValueButtonFrame(m_guiFrame, CGUIFactory::createValueButtonFrame(m_guiFrame,
// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
// STR__DEBUG__CORALBLOWER_MODE, STR__DEBUG__BUBBLEMIXTURE_MODE,
// &newmode,PLAYER_MODE_CORALBLOWER); &newmode,PLAYER_MODE_BUBBLE_MIXTURE);
// xpos+=TEXT_SPACING; xpos+=TEXT_SPACING;
CGUIFactory::createValueButtonFrame(m_guiFrame,
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
STR__DEBUG__CORALBLOWER_MODE,
&newmode,PLAYER_MODE_CORALBLOWER);
xpos+=TEXT_SPACING;
CGUIFactory::createValueButtonFrame(m_guiFrame, CGUIFactory::createValueButtonFrame(m_guiFrame,
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
STR__DEBUG__DEAD_MODE, STR__DEBUG__DEAD_MODE,

View file

@ -25,6 +25,10 @@
#include "utils\mathtab.h" #include "utils\mathtab.h"
#endif #endif
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
/* Std Lib /* Std Lib
------- */ ------- */
@ -61,7 +65,7 @@
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CBubbleMixturePickup::init() void CBubbleMixturePickup::init()
{ {
CBasePickup::init(); CBaseRespawningPickup::init();
m_sin=0; m_sin=0;
} }
@ -73,7 +77,19 @@ void CBubbleMixturePickup::init()
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CBubbleMixturePickup::collect(class CPlayer *_player) void CBubbleMixturePickup::collect(class CPlayer *_player)
{ {
CBasePickup::collect(_player); _player->setMode(PLAYER_MODE_BUBBLE_MIXTURE);
CBaseRespawningPickup::collect(_player);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int CBubbleMixturePickup::getRespawnTime()
{
return 60*10;
} }
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------

View file

@ -34,7 +34,7 @@
Structure defintions Structure defintions
-------------------- */ -------------------- */
class CBubbleMixturePickup : public CBasePickup class CBubbleMixturePickup : public CBaseRespawningPickup
{ {
public: public:
virtual void init(); virtual void init();
@ -42,6 +42,8 @@ public:
virtual void collect(class CPlayer *_player); virtual void collect(class CPlayer *_player);
protected: protected:
virtual int getRespawnTime();
virtual void thinkPickup(int _frames); virtual void thinkPickup(int _frames);
virtual void renderPickup(DVECTOR *_pos); virtual void renderPickup(DVECTOR *_pos);

View file

@ -47,6 +47,10 @@
#include "pickups\pbubmix.h" #include "pickups\pbubmix.h"
#endif #endif
#ifndef __PICKUPS_PBLOWER_H__
#include "pickups\pblower.h"
#endif
#ifndef __PICKUPS_PGLASSES_H__ #ifndef __PICKUPS_PGLASSES_H__
#include "pickups\pglasses.h" #include "pickups\pglasses.h"
#endif #endif
@ -323,6 +327,10 @@ CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos)
pickup=new ("HelmetPickup") CHelmetPickup(); pickup=new ("HelmetPickup") CHelmetPickup();
break; break;
case PICKUP__CORAL_BLOWER:
pickup=new ("CoralBlowerPickup") CCoralBlowerPickup();
break;
case PICKUP__QUEST_ITEM__TEST: case PICKUP__QUEST_ITEM__TEST:
pickup=new ("QuestItemPickup") CTestQuestItemPickup(); pickup=new ("QuestItemPickup") CTestQuestItemPickup();
break; break;

View file

@ -43,6 +43,7 @@ typedef enum
PICKUP__SQUEAKY_SHOES, PICKUP__SQUEAKY_SHOES,
PICKUP__BALLOON, PICKUP__BALLOON,
PICKUP__HELMET, PICKUP__HELMET,
PICKUP__CORAL_BLOWER,
PICKUP__QUEST_ITEM__TEST, // Needs to be one of these for each quest item ( I think ) PICKUP__QUEST_ITEM__TEST, // Needs to be one of these for each quest item ( I think )
} }
PICKUP_TYPE; PICKUP_TYPE;

View file

@ -33,12 +33,20 @@
#include "player\pmodes.h" #include "player\pmodes.h"
#endif #endif
#ifndef __PLAYER_PMBLOON_H__
#include "player\pmbloon.h"
#endif
#ifndef __PLAYER_PMBUBBLE_H__
#include "player\pmbubble.h"
#endif
#ifndef __PLAYER_PMCHOP_H__ #ifndef __PLAYER_PMCHOP_H__
#include "player\pmchop.h" #include "player\pmchop.h"
#endif #endif
#ifndef __PLAYER_PMBLOON_H__ #ifndef __PLAYER_PMCORAL_H__
#include "player\pmbloon.h" #include "player\pmcoral.h"
#endif #endif
#ifndef __PLAYER_PMDEAD_H__ #ifndef __PLAYER_PMDEAD_H__
@ -140,8 +148,9 @@ static const char *s_modeText[NUM_PLAYERMODES]=
"BASICUNARMED", "BASICUNARMED",
"FULLUNARMED", "FULLUNARMED",
"BALLOON", "BALLOON",
// "NET", "BUBBLE MIXTURE",
// "CORALBLOWER", "CORALBLOWER",
"DEAD",
"FLY", "FLY",
}; };
#include "gfx\font.h" #include "gfx\font.h"
@ -170,17 +179,21 @@ int CAMERA_SCROLLSPEED=60; // Speed of the scroll ( 60=1 tile scrolled every
CPlayerModeBase PLAYERMODE; CPlayerModeBase PLAYERMODE;
CPlayerModeChop PLAYERMODECHOP; CPlayerModeChop PLAYERMODECHOP;
CPlayerModeBalloon PLAYERMODEBALLOON; CPlayerModeBalloon PLAYERMODEBALLOON;
CPlayerModeDead PLAYERMODEDEAD; CPlayerModeBubbleMixture PLAYERMODEBUBBLEMIXTURE;
CPlayerModeFly PLAYERMODEFLY; CPlayerModeCoralBlower PLAYERMODECORALBLOWER;
CPlayerModeDead PLAYERMODEDEAD;
CPlayerModeFly PLAYERMODEFLY;
CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]= CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]=
{ {
&PLAYERMODE, // PLAYER_MODE_BASICUNARMED &PLAYERMODE, // PLAYER_MODE_BASICUNARMED
&PLAYERMODECHOP, // PLAYER_MODE_FULLUNARMED &PLAYERMODECHOP, // PLAYER_MODE_FULLUNARMED
&PLAYERMODEBALLOON, // PLAYER_MODE_BALLOON &PLAYERMODEBALLOON, // PLAYER_MODE_BALLOON
&PLAYERMODEBUBBLEMIXTURE, // PLAYER_MODE_BUBBLE_MIXTURE
&PLAYERMODECORALBLOWER, // PLAYER_MODE_CORALBLOWER
&PLAYERMODEDEAD, // PLAYER_MODE_DEAD &PLAYERMODEDEAD, // PLAYER_MODE_DEAD
&PLAYERMODEFLY, // PLAYER_MODE_FLY &PLAYERMODEFLY, // PLAYER_MODE_FLY
}; };

View file

@ -51,10 +51,9 @@ typedef enum
PLAYER_MODE_BASICUNARMED, PLAYER_MODE_BASICUNARMED,
PLAYER_MODE_FULLUNARMED, PLAYER_MODE_FULLUNARMED,
PLAYER_MODE_BALLOON, PLAYER_MODE_BALLOON,
//PLAYER_MODE_BUBBLE_MIXTURE, PLAYER_MODE_BUBBLE_MIXTURE,
//PLAYER_MODE_HELMET,
// PLAYER_MODE_NET, // PLAYER_MODE_NET,
// PLAYER_MODE_CORALBLOWER, PLAYER_MODE_CORALBLOWER,
//PLAYER_MODE_JELLY_LAUNCHER, //PLAYER_MODE_JELLY_LAUNCHER,
PLAYER_MODE_DEAD, PLAYER_MODE_DEAD,

View file

@ -67,7 +67,8 @@ static PlayerMetrics s_playerMetrics=
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CPlayerModeCoralBlower::enter() void CPlayerModeCoralBlower::enter()
{ {
m_chopping=false; m_blowerState=BLOWER_STATE__FULL;//BLOWER_STATE__EMPTY;
CSoundMediator::playSfx(CSoundMediator::SFX_ITEM__CORAL_BLOWER);
} }
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
@ -76,39 +77,44 @@ void CPlayerModeCoralBlower::enter()
Params: Params:
Returns: Returns:
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
int cbstate=0;
void CPlayerModeCoralBlower::think() void CPlayerModeCoralBlower::think()
{ {
// If we're chopping then restore the 'real' anim number/frame before
// doing the think so that the rest of the code doesn't know what
// is going on ;)
if(m_chopping)
{
setAnimNo(m_savedAnimNo);
setAnimFrame(m_savedAnimFrame);
}
CPlayerModeBase::think(); CPlayerModeBase::think();
// Start to chop? switch(m_blowerState)
if(!m_chopping&&getPadInputDown()&PI_ACTION&&canAttackFromThisState())
{ {
m_chopFrame=0; case BLOWER_STATE__EMPTY:
m_chopping=true; if(getPadInputDown()&PI_ACTION&&getState()==STATE_IDLE)
} {
m_blowerState=BLOWER_STATE__SUCKING;
// Chopping? }
if(m_chopping) break;
{ case BLOWER_STATE__SUCKING:
m_player->setAnimNo(ANIM_SPONGEBOB_KARATE); if(!(getPadInputHeld()&PI_ACTION&&getState()==STATE_IDLE))
m_player->setAnimFrame(m_chopFrame); {
m_chopFrame++; m_blowerState=BLOWER_STATE__EMPTY;
if(m_chopFrame>=m_player->getAnimFrameCount()) }
{ break;
PAUL_DBGMSG("restore %d,%d",m_savedAnimNo,m_savedAnimFrame); case BLOWER_STATE__FULL:
m_player->setAnimNo(m_savedAnimNo); if(getPadInputDown()&PI_ACTION&&getState()==STATE_IDLE)
m_player->setAnimFrame(m_savedAnimFrame); {
m_chopping=false; m_blowerState=BLOWER_STATE__AIMING;
} }
break;
case BLOWER_STATE__AIMING:
if(getState()==STATE_IDLE)
{
m_blowerState=BLOWER_STATE__EMPTY;
}
if(!getPadInputHeld()&PI_ACTION)
{
// Fire!
m_blowerState=BLOWER_STATE__EMPTY;
}
break;
} }
cbstate=m_blowerState;
} }
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
@ -122,67 +128,5 @@ const struct PlayerMetrics *CPlayerModeCoralBlower::getPlayerMetrics()
return &s_playerMetrics; return &s_playerMetrics;
} }
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerModeCoralBlower::setAnimNo(int _animNo)
{
CPlayerModeBase::setAnimNo(_animNo);
m_savedAnimNo=_animNo;
}
void CPlayerModeCoralBlower::setAnimFrame(int _animFrame)
{
CPlayerModeBase::setAnimFrame(_animFrame);
m_savedAnimFrame=_animFrame;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int CPlayerModeCoralBlower::isInAttackState()
{
return m_chopping||CPlayerModeBase::isInAttackState();
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int CPlayerModeCoralBlower::canAttackFromThisState()
{
int ret=false;
switch(getState())
{
case STATE_IDLE:
case STATE_IDLETEETER:
case STATE_JUMP:
case STATE_RUN:
case STATE_FALL:
ret=true;
break;
case STATE_FALLFAR:
case STATE_BUTTBOUNCE:
case STATE_BUTTFALL:
case STATE_BUTTLAND:
case STATE_DUCK:
case STATE_SOAKUP:
case STATE_GETUP:
break;
}
return ret;
}
/*=========================================================================== /*===========================================================================
end */ end */

View file

@ -42,18 +42,16 @@ public:
virtual const struct PlayerMetrics *getPlayerMetrics(); virtual const struct PlayerMetrics *getPlayerMetrics();
virtual void setAnimNo(int _animNo);
virtual void setAnimFrame(int _animFrame);
virtual int isInAttackState();
private: private:
int canAttackFromThisState(); typedef enum
{
int m_savedAnimNo,m_savedAnimFrame; BLOWER_STATE__EMPTY,
int m_chopFrame; BLOWER_STATE__SUCKING,
int m_chopping; BLOWER_STATE__FULL,
BLOWER_STATE__AIMING,
} BlowerState;
BlowerState m_blowerState;
}; };

View file

@ -832,6 +832,14 @@ SOURCE=..\..\..\source\player\pmbloon.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\player\pmbubble.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\pmbubble.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\pmchop.cpp SOURCE=..\..\..\source\player\pmchop.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -840,6 +848,14 @@ SOURCE=..\..\..\source\player\pmchop.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\player\pmcoral.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\pmcoral.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\pmdead.cpp SOURCE=..\..\..\source\player\pmdead.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File