This commit is contained in:
parent
904214167c
commit
cb8f318494
13 changed files with 128 additions and 121 deletions
|
@ -159,6 +159,8 @@ eng=Set FULLUNARMED mode
|
|||
eng=Set SQUEAKYBOOTS mode
|
||||
[STR__DEBUG__BALLOON_MODE]
|
||||
eng=Set BALLOON mode
|
||||
[STR__DEBUG__BUBBLEMIXTURE_MODE]
|
||||
eng=Set BUBBLE MIXTURE mode
|
||||
[STR__DEBUG__NET_MODE]
|
||||
eng=Set NET mode
|
||||
[STR__DEBUG__CORALBLOWER_MODE]
|
||||
|
|
|
@ -144,6 +144,7 @@ paul_src := paul \
|
|||
|
||||
pickups_src := pickup \
|
||||
pballoon \
|
||||
pblower \
|
||||
pbubmix \
|
||||
pglasses \
|
||||
phealth \
|
||||
|
@ -159,7 +160,9 @@ player_src := demoplay \
|
|||
player \
|
||||
pmodes \
|
||||
pmbloon \
|
||||
pmbubble \
|
||||
pmchop \
|
||||
pmcoral \
|
||||
pmdead \
|
||||
pmfly \
|
||||
psbutt \
|
||||
|
|
|
@ -301,7 +301,7 @@ INGAMEFX_GFX_NONTRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_NONTRANS),$(INGAMEFX_N
|
|||
PICKUP_GFX_DIR := $(GRAF_DIR)/pickups
|
||||
PICKUP_GFX := +spatula +pants +health100 +health50 +health25 +glint1 +glint2 +glint3 +glint4 \
|
||||
+jellyammo +bubblemixture +glasses +shoe +balloon +helmet \
|
||||
+teeth
|
||||
+teeth +blower
|
||||
PICKUP_GFX_IN := $(foreach FILE,$(PICKUP_GFX),$(PICKUP_GFX_DIR)/$(FILE).bmp)
|
||||
|
||||
INGAMEFX_GFX_TRANS := +bubble_1 +bubble_2 +bubble_3
|
||||
|
|
|
@ -115,11 +115,16 @@ void CPauseMenu::init()
|
|||
STR__DEBUG__BALLOON_MODE,
|
||||
&newmode,PLAYER_MODE_BALLOON);
|
||||
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,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__BUBBLEMIXTURE_MODE,
|
||||
&newmode,PLAYER_MODE_BUBBLE_MIXTURE);
|
||||
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,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__DEAD_MODE,
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#include "utils\mathtab.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PLAYER_H__
|
||||
#include "player\player.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
@ -61,7 +65,7 @@
|
|||
---------------------------------------------------------------------- */
|
||||
void CBubbleMixturePickup::init()
|
||||
{
|
||||
CBasePickup::init();
|
||||
CBaseRespawningPickup::init();
|
||||
m_sin=0;
|
||||
}
|
||||
|
||||
|
@ -73,7 +77,19 @@ void CBubbleMixturePickup::init()
|
|||
---------------------------------------------------------------------- */
|
||||
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;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
Structure defintions
|
||||
-------------------- */
|
||||
|
||||
class CBubbleMixturePickup : public CBasePickup
|
||||
class CBubbleMixturePickup : public CBaseRespawningPickup
|
||||
{
|
||||
public:
|
||||
virtual void init();
|
||||
|
@ -42,6 +42,8 @@ public:
|
|||
virtual void collect(class CPlayer *_player);
|
||||
|
||||
protected:
|
||||
virtual int getRespawnTime();
|
||||
|
||||
virtual void thinkPickup(int _frames);
|
||||
virtual void renderPickup(DVECTOR *_pos);
|
||||
|
||||
|
|
|
@ -47,6 +47,10 @@
|
|||
#include "pickups\pbubmix.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PICKUPS_PBLOWER_H__
|
||||
#include "pickups\pblower.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PICKUPS_PGLASSES_H__
|
||||
#include "pickups\pglasses.h"
|
||||
#endif
|
||||
|
@ -323,6 +327,10 @@ CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos)
|
|||
pickup=new ("HelmetPickup") CHelmetPickup();
|
||||
break;
|
||||
|
||||
case PICKUP__CORAL_BLOWER:
|
||||
pickup=new ("CoralBlowerPickup") CCoralBlowerPickup();
|
||||
break;
|
||||
|
||||
case PICKUP__QUEST_ITEM__TEST:
|
||||
pickup=new ("QuestItemPickup") CTestQuestItemPickup();
|
||||
break;
|
||||
|
|
|
@ -43,6 +43,7 @@ typedef enum
|
|||
PICKUP__SQUEAKY_SHOES,
|
||||
PICKUP__BALLOON,
|
||||
PICKUP__HELMET,
|
||||
PICKUP__CORAL_BLOWER,
|
||||
PICKUP__QUEST_ITEM__TEST, // Needs to be one of these for each quest item ( I think )
|
||||
}
|
||||
PICKUP_TYPE;
|
||||
|
|
|
@ -33,12 +33,20 @@
|
|||
#include "player\pmodes.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PMBLOON_H__
|
||||
#include "player\pmbloon.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PMBUBBLE_H__
|
||||
#include "player\pmbubble.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PMCHOP_H__
|
||||
#include "player\pmchop.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PMBLOON_H__
|
||||
#include "player\pmbloon.h"
|
||||
#ifndef __PLAYER_PMCORAL_H__
|
||||
#include "player\pmcoral.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PMDEAD_H__
|
||||
|
@ -140,8 +148,9 @@ static const char *s_modeText[NUM_PLAYERMODES]=
|
|||
"BASICUNARMED",
|
||||
"FULLUNARMED",
|
||||
"BALLOON",
|
||||
// "NET",
|
||||
// "CORALBLOWER",
|
||||
"BUBBLE MIXTURE",
|
||||
"CORALBLOWER",
|
||||
"DEAD",
|
||||
"FLY",
|
||||
};
|
||||
#include "gfx\font.h"
|
||||
|
@ -173,6 +182,8 @@ int CAMERA_SCROLLSPEED=60; // Speed of the scroll ( 60=1 tile scrolled every
|
|||
CPlayerModeBase PLAYERMODE;
|
||||
CPlayerModeChop PLAYERMODECHOP;
|
||||
CPlayerModeBalloon PLAYERMODEBALLOON;
|
||||
CPlayerModeBubbleMixture PLAYERMODEBUBBLEMIXTURE;
|
||||
CPlayerModeCoralBlower PLAYERMODECORALBLOWER;
|
||||
CPlayerModeDead PLAYERMODEDEAD;
|
||||
CPlayerModeFly PLAYERMODEFLY;
|
||||
|
||||
|
@ -181,6 +192,8 @@ CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]=
|
|||
&PLAYERMODE, // PLAYER_MODE_BASICUNARMED
|
||||
&PLAYERMODECHOP, // PLAYER_MODE_FULLUNARMED
|
||||
&PLAYERMODEBALLOON, // PLAYER_MODE_BALLOON
|
||||
&PLAYERMODEBUBBLEMIXTURE, // PLAYER_MODE_BUBBLE_MIXTURE
|
||||
&PLAYERMODECORALBLOWER, // PLAYER_MODE_CORALBLOWER
|
||||
&PLAYERMODEDEAD, // PLAYER_MODE_DEAD
|
||||
&PLAYERMODEFLY, // PLAYER_MODE_FLY
|
||||
};
|
||||
|
|
|
@ -51,10 +51,9 @@ typedef enum
|
|||
PLAYER_MODE_BASICUNARMED,
|
||||
PLAYER_MODE_FULLUNARMED,
|
||||
PLAYER_MODE_BALLOON,
|
||||
//PLAYER_MODE_BUBBLE_MIXTURE,
|
||||
//PLAYER_MODE_HELMET,
|
||||
PLAYER_MODE_BUBBLE_MIXTURE,
|
||||
// PLAYER_MODE_NET,
|
||||
// PLAYER_MODE_CORALBLOWER,
|
||||
PLAYER_MODE_CORALBLOWER,
|
||||
//PLAYER_MODE_JELLY_LAUNCHER,
|
||||
|
||||
PLAYER_MODE_DEAD,
|
||||
|
|
|
@ -67,7 +67,8 @@ static PlayerMetrics s_playerMetrics=
|
|||
---------------------------------------------------------------------- */
|
||||
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:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int cbstate=0;
|
||||
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();
|
||||
|
||||
// Start to chop?
|
||||
if(!m_chopping&&getPadInputDown()&PI_ACTION&&canAttackFromThisState())
|
||||
switch(m_blowerState)
|
||||
{
|
||||
m_chopFrame=0;
|
||||
m_chopping=true;
|
||||
}
|
||||
|
||||
// Chopping?
|
||||
if(m_chopping)
|
||||
case BLOWER_STATE__EMPTY:
|
||||
if(getPadInputDown()&PI_ACTION&&getState()==STATE_IDLE)
|
||||
{
|
||||
m_player->setAnimNo(ANIM_SPONGEBOB_KARATE);
|
||||
m_player->setAnimFrame(m_chopFrame);
|
||||
m_chopFrame++;
|
||||
if(m_chopFrame>=m_player->getAnimFrameCount())
|
||||
m_blowerState=BLOWER_STATE__SUCKING;
|
||||
}
|
||||
break;
|
||||
case BLOWER_STATE__SUCKING:
|
||||
if(!(getPadInputHeld()&PI_ACTION&&getState()==STATE_IDLE))
|
||||
{
|
||||
PAUL_DBGMSG("restore %d,%d",m_savedAnimNo,m_savedAnimFrame);
|
||||
m_player->setAnimNo(m_savedAnimNo);
|
||||
m_player->setAnimFrame(m_savedAnimFrame);
|
||||
m_chopping=false;
|
||||
m_blowerState=BLOWER_STATE__EMPTY;
|
||||
}
|
||||
break;
|
||||
case BLOWER_STATE__FULL:
|
||||
if(getPadInputDown()&PI_ACTION&&getState()==STATE_IDLE)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
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 */
|
||||
|
|
|
@ -42,18 +42,16 @@ public:
|
|||
|
||||
virtual const struct PlayerMetrics *getPlayerMetrics();
|
||||
|
||||
virtual void setAnimNo(int _animNo);
|
||||
virtual void setAnimFrame(int _animFrame);
|
||||
|
||||
virtual int isInAttackState();
|
||||
|
||||
private:
|
||||
int canAttackFromThisState();
|
||||
|
||||
int m_savedAnimNo,m_savedAnimFrame;
|
||||
int m_chopFrame;
|
||||
int m_chopping;
|
||||
typedef enum
|
||||
{
|
||||
BLOWER_STATE__EMPTY,
|
||||
BLOWER_STATE__SUCKING,
|
||||
BLOWER_STATE__FULL,
|
||||
BLOWER_STATE__AIMING,
|
||||
} BlowerState;
|
||||
|
||||
BlowerState m_blowerState;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -832,6 +832,14 @@ SOURCE=..\..\..\source\player\pmbloon.h
|
|||
# End 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
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -840,6 +848,14 @@ SOURCE=..\..\..\source\player\pmchop.h
|
|||
# End 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
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue