From 7f3567eb4e3ac65e4d9d01136a58f11b014afa03 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 14 May 2001 16:43:48 +0000 Subject: [PATCH] --- makefile.gaz | 1 + source/player/player.cpp | 14 ++++++++ source/player/player.h | 2 ++ source/player/pmbubble.cpp | 2 ++ source/player/pmchop.cpp | 2 ++ source/player/pmcoral.cpp | 6 ++++ source/player/pmjelly.cpp | 4 +++ source/player/pmnet.cpp | 2 ++ source/player/pmodes.cpp | 10 ++++++ source/player/pscrouch.cpp | 32 ------------------- source/player/psidle.cpp | 2 +- source/player/psrun.cpp | 2 +- .../spongebob project/spongebob project.dsp | 8 +++++ 13 files changed, 53 insertions(+), 34 deletions(-) diff --git a/makefile.gaz b/makefile.gaz index e9cf12316..0ae266892 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -234,6 +234,7 @@ player_src := demoplay \ pmjelly \ pmnet \ psbutt \ + pscrouch \ psduck \ psfall \ pshitgnd \ diff --git a/source/player/player.cpp b/source/player/player.cpp index 15aecf393..f6d6d9cc4 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -334,6 +334,8 @@ static s8 s_animMapNet[NUM_PLAYER_ADDONS][NUM_ANIM_SPONGEBOB]= -1, // ANIM_SPONGEBOB_WALK, -1, // ANIM_SPONGEBOB_KARATE, ANIM_SPONGEBOB_NET_GETHIT, // ANIM_SPONGEBOB_GETHIT + ANIM_SPONGEBOB_NET_CROUCHDOWN, // ANIM_SPONGEBOB_CROUCHDOWN + ANIM_SPONGEBOB_NET_CROUCHUP, // ANIM_SPONGEBOB_CROUCHUP }, // PLAYER_ADDON_CORALBLOWER, @@ -363,6 +365,8 @@ static s8 s_animMapNet[NUM_PLAYER_ADDONS][NUM_ANIM_SPONGEBOB]= ANIM_SPONGEBOB_CORALBLOWER_WALK, // ANIM_SPONGEBOB_WALK, -1, // ANIM_SPONGEBOB_KARATE, ANIM_SPONGEBOB_CORALBLOWER_GETHIT, // ANIM_SPONGEBOB_GETHIT + ANIM_SPONGEBOB_CORALBLOWER_CROUCHDOWN, // ANIM_SPONGEBOB_CROUCHDOWN + ANIM_SPONGEBOB_CORALBLOWER_CROUCHUP, // ANIM_SPONGEBOB_CROUCHUP }, // PLAYER_ADDON_JELLYLAUNCHER, @@ -392,6 +396,8 @@ static s8 s_animMapNet[NUM_PLAYER_ADDONS][NUM_ANIM_SPONGEBOB]= -1, // ANIM_SPONGEBOB_WALK, -1, // ANIM_SPONGEBOB_KARATE, ANIM_SPONGEBOB_JELLYLAUNCHER_GETHIT, // ANIM_SPONGEBOB_GETHIT + ANIM_SPONGEBOB_JELLYLAUNCHER_CROUCHDOWN, // ANIM_SPONGEBOB_CROUCHDOWN + ANIM_SPONGEBOB_JELLYLAUNCHER_CROUCHUP, // ANIM_SPONGEBOB_CROUCHUP }, // PLAYER_ADDON_GLASSES, @@ -421,6 +427,8 @@ static s8 s_animMapNet[NUM_PLAYER_ADDONS][NUM_ANIM_SPONGEBOB]= ANIM_SPONGEBOB_GLASSES_WALK, // ANIM_SPONGEBOB_WALK, ANIM_SPONGEBOB_GLASSES_KARATE, // ANIM_SPONGEBOB_KARATE, ANIM_SPONGEBOB_GLASSES_GETHIT, // ANIM_SPONGEBOB_GETHIT + ANIM_SPONGEBOB_GLASSES_CROUCHDOWN, // ANIM_SPONGEBOB_CROUCHDOWN + ANIM_SPONGEBOB_GLASSES_CROUCHUP, // ANIM_SPONGEBOB_CROUCHUP }, // PLAYER_ADDON_BUBBLEWAND, @@ -450,6 +458,8 @@ static s8 s_animMapNet[NUM_PLAYER_ADDONS][NUM_ANIM_SPONGEBOB]= -1, // ANIM_SPONGEBOB_WALK, -1, // ANIM_SPONGEBOB_KARATE, -1, // ANIM_SPONGEBOB_GETHIT + -1, // ANIM_SPONGEBOB_CROUCHDOWN + -1, // ANIM_SPONGEBOB_CROUCHUP }, // PLAYER_ADDON_JELLYFISHINNET @@ -479,6 +489,8 @@ static s8 s_animMapNet[NUM_PLAYER_ADDONS][NUM_ANIM_SPONGEBOB]= -1, // ANIM_SPONGEBOB_WALK, -1, // ANIM_SPONGEBOB_KARATE, ANIM_SPONGEBOB_JELLYFISH_GETHIT, // ANIM_SPONGEBOB_GETHIT + ANIM_SPONGEBOB_JELLYFISH_CROUCHDOWN, // ANIM_SPONGEBOB_CROUCHDOWN + ANIM_SPONGEBOB_JELLYFISH_CROUCHUP, // ANIM_SPONGEBOB_CROUCHUP }, // PLAYER_ADDON_GLOVE @@ -508,6 +520,8 @@ static s8 s_animMapNet[NUM_PLAYER_ADDONS][NUM_ANIM_SPONGEBOB]= -1, // ANIM_SPONGEBOB_WALK, ANIM_SPONGEBOB_GLOVE_KARATE, // ANIM_SPONGEBOB_KARATE, -1, // ANIM_SPONGEBOB_GETHIT + -1, // ANIM_SPONGEBOB_CROUCHDOWN + -1, // ANIM_SPONGEBOB_CROUCHUP }, }; diff --git a/source/player/player.h b/source/player/player.h index 43e49c723..c57260335 100644 --- a/source/player/player.h +++ b/source/player/player.h @@ -79,6 +79,8 @@ typedef enum STATE_DUCK, STATE_SOAKUP, STATE_GETUP, + STATE_CROUCHDOWN, + STATE_CROUCHUP, STATE_JUMPBACK, NUM_STATES, diff --git a/source/player/pmbubble.cpp b/source/player/pmbubble.cpp index 1cca89196..b2e3041b5 100644 --- a/source/player/pmbubble.cpp +++ b/source/player/pmbubble.cpp @@ -209,6 +209,8 @@ int CPlayerModeBubbleMixture::canBlowBubbleFromThisState() case STATE_DUCK: case STATE_SOAKUP: case STATE_GETUP: + case STATE_CROUCHDOWN: + case STATE_CROUCHUP: case STATE_JUMPBACK: break; } diff --git a/source/player/pmchop.cpp b/source/player/pmchop.cpp index 4618a2037..dcd1564f5 100644 --- a/source/player/pmchop.cpp +++ b/source/player/pmchop.cpp @@ -191,6 +191,8 @@ int CPlayerModeChop::canAttackFromThisState() case STATE_DUCK: case STATE_SOAKUP: case STATE_GETUP: + case STATE_CROUCHDOWN: + case STATE_CROUCHUP: case STATE_JUMPBACK: break; } diff --git a/source/player/pmcoral.cpp b/source/player/pmcoral.cpp index 18c84f4e7..3f0b96950 100644 --- a/source/player/pmcoral.cpp +++ b/source/player/pmcoral.cpp @@ -22,6 +22,10 @@ #endif // States +#ifndef __PLAYER__PSCROUCH_H__ +#include "player\pscrouch.h" +#endif + #ifndef __PLAYER__PSJUMP_H__ #include "player\psjump.h" #endif @@ -119,6 +123,8 @@ static CPlayerState *s_stateTable[]= NULL, // STATE_DUCK NULL, // STATE_SOAKUP &s_stateGetUp, // STATE_GETUP + &s_stateCrouchDown, // STATE_CROUCHDOWN + &s_stateCrouchUp, // STATE_CROUCHUP &s_stateJumpBack, // STATE_JUMPBACK }; diff --git a/source/player/pmjelly.cpp b/source/player/pmjelly.cpp index 01c5232a5..7aadbee5c 100644 --- a/source/player/pmjelly.cpp +++ b/source/player/pmjelly.cpp @@ -214,6 +214,8 @@ int CPlayerModeJellyLauncher::setState(int _state) case STATE_DUCK: case STATE_SOAKUP: case STATE_GETUP: + case STATE_CROUCHDOWN: + case STATE_CROUCHUP: allowChange=false; break; } @@ -258,6 +260,8 @@ int CPlayerModeJellyLauncher::canFireFromThisState() case STATE_DUCK: case STATE_SOAKUP: case STATE_GETUP: + case STATE_CROUCHDOWN: + case STATE_CROUCHUP: case STATE_JUMPBACK: break; } diff --git a/source/player/pmnet.cpp b/source/player/pmnet.cpp index 32663b518..6dc0ae99d 100644 --- a/source/player/pmnet.cpp +++ b/source/player/pmnet.cpp @@ -326,6 +326,8 @@ int CPlayerModeNet::canSwingNetFromThisState() case STATE_DUCK: case STATE_SOAKUP: case STATE_GETUP: + case STATE_CROUCHDOWN: + case STATE_CROUCHUP: case STATE_JUMPBACK: break; } diff --git a/source/player/pmodes.cpp b/source/player/pmodes.cpp index 553c334a2..80ec2db4b 100644 --- a/source/player/pmodes.cpp +++ b/source/player/pmodes.cpp @@ -30,6 +30,10 @@ #endif // States +#ifndef __PLAYER__PSCROUCH_H__ +#include "player\pscrouch.h" +#endif + #ifndef __PLAYER__PSJUMP_H__ #include "player\psjump.h" #endif @@ -111,6 +115,8 @@ static CPlayerState *s_stateTable[]= &s_stateDuck, // STATE_DUCK &s_stateSoakUp, // STATE_SOAKUP &s_stateGetUp, // STATE_GETUP + &s_stateCrouchDown, // STATE_CROUCHDOWN + &s_stateCrouchUp, // STATE_CROUCHUP &s_stateJumpBack, // STATE_JUMPBACK }; @@ -216,6 +222,7 @@ int CPlayerModeBase::canDoLookAround() case STATE_IDLE: case STATE_IDLETEETER: case STATE_SOAKUP: + case STATE_CROUCHDOWN: ret=true; break; @@ -231,6 +238,7 @@ int CPlayerModeBase::canDoLookAround() case STATE_BUTTBOUNCEUP: case STATE_DUCK: case STATE_GETUP: + case STATE_CROUCHUP: case STATE_JUMPBACK: break; } @@ -267,6 +275,8 @@ ATTACK_STATE CPlayerModeBase::getAttackState() case STATE_DUCK: case STATE_SOAKUP: case STATE_GETUP: + case STATE_CROUCHDOWN: + case STATE_CROUCHUP: case STATE_JUMPBACK: break; } diff --git a/source/player/pscrouch.cpp b/source/player/pscrouch.cpp index 993ade260..81af886fd 100644 --- a/source/player/pscrouch.cpp +++ b/source/player/pscrouch.cpp @@ -98,38 +98,6 @@ void CPlayerStateCrouchDown::think(CPlayerModeBase *_playerMode) } -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerStateCrouchUp::enter(CPlayerModeBase *_playerMode) -{ - _playerMode->zeroMoveVelocity(); - _playerMode->setAnimNo(ANIM_SPONGEBOB_SOAKUP); - _playerMode->setAnimFrame(_playerMode->getAnimFrameCount()-1); - _playerMode->setPlayerCollisionSize(0,-10,60,20); -} - - -/* -void CPlayerStateSoakUp::think(CPlayerModeBase *_playerMode) -{ - int controlHeld; - - controlHeld=_playerMode->getPadInputHeld(); - if(!(controlHeld&PI_DOWN)) - { - _playerMode->setState(STATE_GETUP); - } - else - { - _playerMode->inSoakUpState(); - } -} -*/ - /*---------------------------------------------------------------------- Function: Purpose: diff --git a/source/player/psidle.cpp b/source/player/psidle.cpp index 89b3ec72e..570158e1b 100644 --- a/source/player/psidle.cpp +++ b/source/player/psidle.cpp @@ -87,7 +87,7 @@ void CPlayerStateBaseIdle::thinkControl(CPlayerModeBase *_playerMode) } else if(controlDown&PI_DOWN) { - _playerMode->setState(STATE_DUCK); + _playerMode->setState(STATE_CROUCHDOWN); } } diff --git a/source/player/psrun.cpp b/source/player/psrun.cpp index a639bbe07..eafe9604b 100644 --- a/source/player/psrun.cpp +++ b/source/player/psrun.cpp @@ -117,7 +117,7 @@ void CPlayerStateRun::think(CPlayerModeBase *_playerMode) } if(controlDown&PI_DOWN) { - switchedState=_playerMode->setState(STATE_DUCK); + switchedState=_playerMode->setState(STATE_CROUCHDOWN); } if(controlHeld&PI_LEFT) diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index bd5217671..4154c021a 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -1403,6 +1403,14 @@ SOURCE=..\..\..\source\player\psbutt.h # End Source File # Begin Source File +SOURCE=..\..\..\source\player\pscrouch.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\player\pscrouch.h +# End Source File +# Begin Source File + SOURCE=..\..\..\source\player\psduck.cpp # End Source File # Begin Source File