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 \ pmfly \
pmjelly \ pmjelly \
pmnet \ pmnet \
pmcart \
psbutt \ psbutt \
pslook \ pslook \
psduck \ psduck \
@ -279,7 +280,8 @@ player_src := demoplay \
psjmpbck \ psjmpbck \
psjump \ psjump \
psrun \ psrun \
psspring psspring \
pscart
script_src := script \ script_src := script \
function function

View file

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

View file

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

View file

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

View file

@ -158,6 +158,7 @@ public:
int canMoveRight(); int canMoveRight();
virtual void setPlayerCollisionSize(int _x,int _y,int _w,int _h); virtual void setPlayerCollisionSize(int _x,int _y,int _w,int _h);
virtual void getPlayerCollisionSize(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 getIsInWater() {return m_player->getIsInWater();}
int getIsHealthFullSoICanStopSoakingUp() {return m_player->getIsHealthFullSoICanStopSoakingUp();} int getIsHealthFullSoICanStopSoakingUp() {return m_player->getIsHealthFullSoICanStopSoakingUp();}

View file

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

View file

@ -1703,6 +1703,14 @@ SOURCE=..\..\..\source\player\psbutt.h
# End Source File # End Source File
# Begin 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 SOURCE=..\..\..\source\player\psduck.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -1796,6 +1804,14 @@ SOURCE=..\..\..\source\player\pmbubble.h
# End Source File # End Source File
# Begin 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 SOURCE=..\..\..\source\player\pmchop.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File