This commit is contained in:
parent
68dd88f3ea
commit
d498db0e34
2 changed files with 55 additions and 50 deletions
|
@ -812,58 +812,66 @@ if(newmode!=-1)
|
||||||
|
|
||||||
// Only do the weapon change stuff on the first frame. As the buttons pressed do not
|
// Only do the weapon change stuff on the first frame. As the buttons pressed do not
|
||||||
// change over these frames there is no point in doing it every frame
|
// change over these frames there is no point in doing it every frame
|
||||||
if(i==0&&m_currentPlayerModeClass->getState()!=STATE_CELEBRATE)
|
if(m_currentMode!=PLAYER_MODE_DEAD)
|
||||||
{
|
{
|
||||||
m_tryingToManuallyPickupWeapon=false;
|
if(i==0&&m_currentPlayerModeClass->getState()!=STATE_CELEBRATE)
|
||||||
m_tryingToAutomaticallyPickupWeapon=false;
|
{
|
||||||
|
m_tryingToManuallyPickupWeapon=false;
|
||||||
|
m_tryingToAutomaticallyPickupWeapon=false;
|
||||||
|
|
||||||
// Weapon collect/drop/swap stuff..
|
// Weapon collect/drop/swap stuff..
|
||||||
if(m_currentMode==PLAYER_MODE_BASICUNARMED)
|
if(m_currentMode==PLAYER_MODE_BASICUNARMED)
|
||||||
{
|
|
||||||
// Always trying to pick up weapon if unarmed... means that when SB walks
|
|
||||||
// over an item whilst unarmed, he automatically picks it up
|
|
||||||
m_tryingToAutomaticallyPickupWeapon=true;
|
|
||||||
}
|
|
||||||
if(m_currentMode!=PLAYER_MODE_CART && getPadInputDown()&PI_WEAPONCHANGE)
|
|
||||||
{
|
|
||||||
// If already armed then drop current weapon
|
|
||||||
if(m_currentMode!=PLAYER_MODE_BASICUNARMED&&
|
|
||||||
m_currentMode!=PLAYER_MODE_DEAD)
|
|
||||||
{
|
{
|
||||||
static const int s_pickupsToDrop[NUM_PLAYERMODES]=
|
// Always trying to pick up weapon if unarmed... means that when SB walks
|
||||||
{
|
// over an item whilst unarmed, he automatically picks it up
|
||||||
-1, // PLAYER_MODE_BASICUNARMED
|
m_tryingToAutomaticallyPickupWeapon=true;
|
||||||
-1, // PLAYER_MODE_FULLUNARMED
|
|
||||||
-1, // PLAYER_MODE_BALLOON
|
|
||||||
PICKUP__BUBBLE_WAND, // PLAYER_MODE_BUBBLE_MIXTURE
|
|
||||||
PICKUP__NET, // PLAYER_MODE_NET
|
|
||||||
PICKUP__CORAL_BLOWER, // PLAYER_MODE_CORALBLOWER
|
|
||||||
PICKUP__JELLY_LAUNCHER, // PLAYER_MODE_JELLY_LAUNCHER
|
|
||||||
-1, // PLAYER_MODE_DEAD
|
|
||||||
-1, // PLAYER_MODE_FLY
|
|
||||||
-1, // PLAYER_MODE_CART
|
|
||||||
-1, // PLAYER_MODE_SWALLOW
|
|
||||||
};
|
|
||||||
|
|
||||||
int pickupToDrop;
|
|
||||||
pickupToDrop=s_pickupsToDrop[m_currentMode];
|
|
||||||
if(pickupToDrop!=-1)
|
|
||||||
{
|
|
||||||
DVECTOR pickupPos;
|
|
||||||
CBasePickup *pickup;
|
|
||||||
pickupPos.vx=Pos.vx;
|
|
||||||
pickupPos.vy=Pos.vy-30;
|
|
||||||
pickup=createPickup((PICKUP_TYPE)pickupToDrop,&pickupPos);
|
|
||||||
pickup->setPos(&pickupPos);
|
|
||||||
((CBaseWeaponPickup*)pickup)->setHasBeenCollected();
|
|
||||||
}
|
|
||||||
setMode(PLAYER_MODE_BASICUNARMED);
|
|
||||||
}
|
}
|
||||||
|
if(m_currentMode!=PLAYER_MODE_CART && getPadInputDown()&PI_WEAPONCHANGE)
|
||||||
|
{
|
||||||
|
// If already armed then drop current weapon
|
||||||
|
if(m_currentMode!=PLAYER_MODE_BASICUNARMED)
|
||||||
|
{
|
||||||
|
static const int s_pickupsToDrop[NUM_PLAYERMODES]=
|
||||||
|
{
|
||||||
|
-1, // PLAYER_MODE_BASICUNARMED
|
||||||
|
-1, // PLAYER_MODE_FULLUNARMED
|
||||||
|
-1, // PLAYER_MODE_BALLOON
|
||||||
|
PICKUP__BUBBLE_WAND, // PLAYER_MODE_BUBBLE_MIXTURE
|
||||||
|
PICKUP__NET, // PLAYER_MODE_NET
|
||||||
|
PICKUP__CORAL_BLOWER, // PLAYER_MODE_CORALBLOWER
|
||||||
|
PICKUP__JELLY_LAUNCHER, // PLAYER_MODE_JELLY_LAUNCHER
|
||||||
|
-1, // PLAYER_MODE_DEAD
|
||||||
|
-1, // PLAYER_MODE_FLY
|
||||||
|
-1, // PLAYER_MODE_CART
|
||||||
|
-1, // PLAYER_MODE_SWALLOW
|
||||||
|
};
|
||||||
|
|
||||||
// Now trying to pick up a weapon..
|
int pickupToDrop;
|
||||||
m_tryingToManuallyPickupWeapon=true;
|
pickupToDrop=s_pickupsToDrop[m_currentMode];
|
||||||
|
if(pickupToDrop!=-1)
|
||||||
|
{
|
||||||
|
DVECTOR pickupPos;
|
||||||
|
CBasePickup *pickup;
|
||||||
|
pickupPos.vx=Pos.vx;
|
||||||
|
pickupPos.vy=Pos.vy-30;
|
||||||
|
pickup=createPickup((PICKUP_TYPE)pickupToDrop,&pickupPos);
|
||||||
|
pickup->setPos(&pickupPos);
|
||||||
|
((CBaseWeaponPickup*)pickup)->setHasBeenCollected();
|
||||||
|
}
|
||||||
|
setMode(PLAYER_MODE_BASICUNARMED);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now trying to pick up a weapon..
|
||||||
|
m_tryingToManuallyPickupWeapon=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Don't try to pick up weapons when dead.. doh!
|
||||||
|
m_tryingToAutomaticallyPickupWeapon=false;
|
||||||
|
m_tryingToManuallyPickupWeapon=false;
|
||||||
|
}
|
||||||
|
|
||||||
int level=GameScene.getLevelNumber();
|
int level=GameScene.getLevelNumber();
|
||||||
// Out of spats?
|
// Out of spats?
|
||||||
|
@ -1009,7 +1017,7 @@ if(newmode!=-1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Stop the player vanishing off the edge of the telly..
|
// Stop the player vanishing off the edge of the telly..
|
||||||
if(!m_lockCamera)
|
if(m_currentMode!=PLAYER_MODE_DEAD) // Lock camera when player is dead
|
||||||
{
|
{
|
||||||
if(Pos.vx<m_playerPosLimitBox.x1) Pos.vx=m_playerPosLimitBox.x1;
|
if(Pos.vx<m_playerPosLimitBox.x1) Pos.vx=m_playerPosLimitBox.x1;
|
||||||
else if(Pos.vx>m_playerPosLimitBox.x2) Pos.vx=m_playerPosLimitBox.x2;
|
else if(Pos.vx>m_playerPosLimitBox.x2) Pos.vx=m_playerPosLimitBox.x2;
|
||||||
|
@ -1228,7 +1236,7 @@ if(newmode!=-1)
|
||||||
yoff=m_cameraLookOffset+(m_ledgeLookOffset>>ledgeShift);
|
yoff=m_cameraLookOffset+(m_ledgeLookOffset>>ledgeShift);
|
||||||
if(yoff<-camerahardlockup)yoff=-camerahardlockup;
|
if(yoff<-camerahardlockup)yoff=-camerahardlockup;
|
||||||
else if(yoff>camerahardlockdown)yoff=camerahardlockdown;
|
else if(yoff>camerahardlockdown)yoff=camerahardlockdown;
|
||||||
if(!m_lockCamera)
|
if(m_currentMode!=PLAYER_MODE_DEAD) // Lock camera when player is dead
|
||||||
{
|
{
|
||||||
m_cameraPos.vx=m_currentCamFocusPoint.vx;
|
m_cameraPos.vx=m_currentCamFocusPoint.vx;
|
||||||
m_cameraPos.vy=m_currentCamFocusPoint.vy+yoff;
|
m_cameraPos.vy=m_currentCamFocusPoint.vy+yoff;
|
||||||
|
@ -1965,7 +1973,6 @@ void CPlayer::respawn()
|
||||||
Pos=m_respawnPos;
|
Pos=m_respawnPos;
|
||||||
m_cameraLookOffset=0;
|
m_cameraLookOffset=0;
|
||||||
|
|
||||||
m_lockCamera=false;
|
|
||||||
m_cameraXScrollDir=0;
|
m_cameraXScrollDir=0;
|
||||||
m_cameraXScrollPos=0;
|
m_cameraXScrollPos=0;
|
||||||
|
|
||||||
|
@ -2382,7 +2389,6 @@ void CPlayer::dieYouPorousFreak(DEATH_TYPE _deathType)
|
||||||
m_deathType=_deathType;
|
m_deathType=_deathType;
|
||||||
CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_DEFEATED_JINGLE);
|
CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_DEFEATED_JINGLE);
|
||||||
setMode(PLAYER_MODE_DEAD);
|
setMode(PLAYER_MODE_DEAD);
|
||||||
m_lockCamera=true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -336,7 +336,6 @@ private:
|
||||||
|
|
||||||
int m_cartCamActive;
|
int m_cartCamActive;
|
||||||
int m_reverseCameraMovement;
|
int m_reverseCameraMovement;
|
||||||
int m_lockCamera;
|
|
||||||
DVECTOR m_cameraPos;
|
DVECTOR m_cameraPos;
|
||||||
DVECTOR m_currentCamFocusPointTarget;
|
DVECTOR m_currentCamFocusPointTarget;
|
||||||
DVECTOR m_currentCamFocusPoint;
|
DVECTOR m_currentCamFocusPoint;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue