This commit is contained in:
Charles 2001-06-12 16:28:39 +00:00
parent 6da99378f2
commit ccdfbb881f
7 changed files with 46 additions and 31 deletions

View File

@ -270,6 +270,7 @@ player_src := demoplay \
pmfly \
pmjelly \
pmnet \
pmcart \
psbutt \
pslook \
psduck \
@ -279,7 +280,8 @@ player_src := demoplay \
psjmpbck \
psjump \
psrun \
psspring
psspring \
pscart
script_src := script \
function

View File

@ -65,6 +65,10 @@
#include "player\pmjelly.h"
#endif
#ifndef __PLAYER_PMCART_H__
#include "player\pmcart.h"
#endif
#ifndef __GFX_FONT_H__
#include "gfx\font.h"
#endif
@ -212,6 +216,7 @@ static const char *s_modeText[NUM_PLAYERMODES]=
"JELLY LAUNCHER",
"DEAD",
"FLY",
"CART",
};
#endif
@ -232,6 +237,7 @@ CPlayerModeCoralBlower PLAYERMODECORALBLOWER;
CPlayerModeJellyLauncher PLAYERMODEJELLYLAUNCHER;
CPlayerModeDead PLAYERMODEDEAD;
CPlayerModeFly PLAYERMODEFLY;
CPlayerModeCart PLAYERMODECART;
CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]=
{
@ -244,6 +250,7 @@ CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]=
&PLAYERMODEJELLYLAUNCHER, // PLAYER_MODE_JELLY_LAUNCHER
&PLAYERMODEDEAD, // PLAYER_MODE_DEAD
&PLAYERMODEFLY, // PLAYER_MODE_FLY
&PLAYERMODECART, // PLAYER_MODE_CART
};
@ -307,6 +314,7 @@ PLAYER_ADDONS s_addonNumbers[NUM_PLAYERMODES]=
PLAYER_ADDON_JELLYLAUNCHER, // PLAYER_MODE_JELLY_LAUNCHER
NO_ADDON, // PLAYER_MODE_DEAD
NO_ADDON, // PLAYER_MODE_FLY
NO_ADDON, // PLAYER_MODE_CART
};
static s8 s_animMapNet[NUM_PLAYER_ADDONS][NUM_ANIM_SPONGEBOB]=
@ -730,11 +738,10 @@ if(newmode!=-1)
{
if ( ( (CNpcPlatform *) platform )->isCart() )
{
Pos.vx = platform->getPos().vx;
Pos.vy = platform->getPos().vy;
int platformOffset = ( ( CNpcPlatform* ) platform )->getHeightFromPlatformAtPosition( Pos.vx, Pos.vy );
Pos.vy += platformOffset;
if ( m_currentMode != PLAYER_MODE_CART )
{
setMode( PLAYER_MODE_CART );
}
}
else
{
@ -811,6 +818,7 @@ if(PadGetDown(0)&PAD_TRIANGLE)
PICKUP__JELLY_LAUNCHER, // PLAYER_MODE_JELLY_LAUNCHER,
-1, // PLAYER_MODE_DEAD,
-1, // PLAYER_MODE_FLY,
-1, // PLAYER_MODE_CART,
};
int pickupToDrop;

View File

@ -59,6 +59,8 @@ typedef enum
PLAYER_MODE_FLY,
PLAYER_MODE_CART,
NUM_PLAYERMODES,
}PLAYER_MODE;
@ -82,6 +84,7 @@ typedef enum
STATE_LOOKDOWN,
STATE_LOOKDOWNRELAX,
STATE_JUMPBACK,
STATE_CART,
NUM_STATES,
}PLAYER_STATE;

View File

@ -70,6 +70,10 @@
#include "player\psspring.h"
#endif
#ifndef __PLAYER_PSCART_H__
#include "player\pscart.h"
#endif
#ifndef __PLATFORM_PLATFORM_H__
#include "platform\platform.h"
#endif
@ -122,6 +126,7 @@ static CPlayerState *s_stateTable[]=
&s_stateLookDown, // STATE_LOOKDOWN
&s_stateLookDownRelax, // STATE_LOOKDOWNRELAX
&s_stateJumpBack, // STATE_JUMPBACK
&s_stateCart, // STATE_CART
};
static PlayerMetrics s_playerMetrics=
@ -199,19 +204,7 @@ void CPlayerModeBase::think()
{
getStateTable()[m_currentState]->think(this);
thinkVerticalMovement();
if ( m_player->isOnPlatform() )
{
CNpcPlatform *platform = (CNpcPlatform *) m_player->isOnPlatform();
if ( !platform->isCart() )
{
thinkHorizontalMovement();
}
}
else
{
thinkHorizontalMovement();
}
thinkHorizontalMovement();
// Teeter if on an edge
if(canTeeter()&&isOnEdge())
@ -634,18 +627,6 @@ int CPlayerModeBase::slowdown()
}
void CPlayerModeBase::jump()
{
CNpcPlatform *platform;
platform = (CNpcPlatform *) m_player->isOnPlatform();
if(platform)
{
if ( platform->isCart() )
{
platform->jump();
return;
}
}
DVECTOR moveVel;
moveVel=*m_player->getMoveVelocity();
moveVel.vy=-getPlayerMetrics()->m_metric[PM__JUMP_VELOCITY]<<VELOCITY_SHIFT;

View File

@ -158,6 +158,7 @@ public:
int canMoveRight();
virtual void setPlayerCollisionSize(int _x,int _y,int _w,int _h);
virtual void getPlayerCollisionSize(int *_x,int *_y,int *_w,int *_h);
CPlayer *getPlayer() { return( m_player ); }
int getIsInWater() {return m_player->getIsInWater();}
int getIsHealthFullSoICanStopSoakingUp() {return m_player->getIsHealthFullSoICanStopSoakingUp();}

View File

@ -85,6 +85,10 @@ void CPlayerStateCart::think(CPlayerModeBase *_playerMode)
{
int controlDown;
if ( _playerMode->advanceAnimFrameAndCheckForEndOfAnim() )
{
_playerMode->setAnimNo( ANIM_SPONGEBOB_IDLEBREATH );
}
controlDown=_playerMode->getPadInputDown();
if(controlDown&PI_JUMP)

View File

@ -1703,6 +1703,14 @@ SOURCE=..\..\..\source\player\psbutt.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\pscart.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\pscart.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\psduck.cpp
# End Source File
# Begin Source File
@ -1796,6 +1804,14 @@ SOURCE=..\..\..\source\player\pmbubble.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\pmcart.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\pmcart.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\player\pmchop.cpp
# End Source File
# Begin Source File