This commit is contained in:
parent
366b611e2e
commit
2a6beb64f7
1 changed files with 50 additions and 41 deletions
|
@ -749,9 +749,6 @@ if(newmode!=-1)
|
||||||
|
|
||||||
m_allowConversation=false;
|
m_allowConversation=false;
|
||||||
|
|
||||||
m_tryingToManuallyPickupWeapon=false;
|
|
||||||
m_tryingToAutomaticallyPickupWeapon=false;
|
|
||||||
|
|
||||||
m_xMove = Pos.vx;
|
m_xMove = Pos.vx;
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -768,49 +765,58 @@ if(PadGetDown(0)&PAD_TRIANGLE)
|
||||||
{
|
{
|
||||||
updatePadInput();
|
updatePadInput();
|
||||||
|
|
||||||
// Weapon collect/drop/swap stuff..
|
|
||||||
if(m_currentMode==PLAYER_MODE_BASICUNARMED)
|
|
||||||
{
|
|
||||||
// Always trying to pickup weapon if unarmed... means that when SB walks
|
|
||||||
// over an item whilst unarmed, he automatically picks it up
|
|
||||||
m_tryingToAutomaticallyPickupWeapon=true;
|
|
||||||
}
|
|
||||||
if(getPadInputDown()&PI_WEAPONCHANGE)
|
|
||||||
{
|
|
||||||
// Trying to pick up a weapon
|
|
||||||
m_tryingToManuallyPickupWeapon=true;
|
|
||||||
|
|
||||||
// If already armed then drop current weapon
|
// Only do the weapon change stuff on the first frame. As the buttons pressed do not
|
||||||
if(m_currentMode!=PLAYER_MODE_BASICUNARMED&&
|
// change over these frames there is no point in doing it every frame
|
||||||
m_currentMode!=PLAYER_MODE_DEAD)
|
if(i==0)
|
||||||
|
{
|
||||||
|
m_tryingToManuallyPickupWeapon=false;
|
||||||
|
m_tryingToAutomaticallyPickupWeapon=false;
|
||||||
|
|
||||||
|
// Weapon collect/drop/swap stuff..
|
||||||
|
if(m_currentMode==PLAYER_MODE_BASICUNARMED)
|
||||||
{
|
{
|
||||||
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
|
||||||
|
m_tryingToAutomaticallyPickupWeapon=true;
|
||||||
|
}
|
||||||
|
if(getPadInputDown()&PI_WEAPONCHANGE)
|
||||||
|
{
|
||||||
|
// If already armed then drop current weapon
|
||||||
|
if(m_currentMode!=PLAYER_MODE_BASICUNARMED&&
|
||||||
|
m_currentMode!=PLAYER_MODE_DEAD)
|
||||||
{
|
{
|
||||||
-1, // PLAYER_MODE_BASICUNARMED
|
static const int s_pickupsToDrop[NUM_PLAYERMODES]=
|
||||||
-1, // PLAYER_MODE_FULLUNARMED
|
{
|
||||||
-1, // PLAYER_MODE_BALLOON
|
-1, // PLAYER_MODE_BASICUNARMED
|
||||||
PICKUP__BUBBLE_WAND, // PLAYER_MODE_BUBBLE_MIXTURE
|
-1, // PLAYER_MODE_FULLUNARMED
|
||||||
PICKUP__NET, // PLAYER_MODE_NET
|
-1, // PLAYER_MODE_BALLOON
|
||||||
PICKUP__CORAL_BLOWER, // PLAYER_MODE_CORALBLOWER
|
PICKUP__BUBBLE_WAND, // PLAYER_MODE_BUBBLE_MIXTURE
|
||||||
PICKUP__JELLY_LAUNCHER, // PLAYER_MODE_JELLY_LAUNCHER
|
PICKUP__NET, // PLAYER_MODE_NET
|
||||||
-1, // PLAYER_MODE_DEAD
|
PICKUP__CORAL_BLOWER, // PLAYER_MODE_CORALBLOWER
|
||||||
-1, // PLAYER_MODE_FLY
|
PICKUP__JELLY_LAUNCHER, // PLAYER_MODE_JELLY_LAUNCHER
|
||||||
-1, // PLAYER_MODE_CART
|
-1, // PLAYER_MODE_DEAD
|
||||||
-1, // PLAYER_MODE_SWALLOW
|
-1, // PLAYER_MODE_FLY
|
||||||
};
|
-1, // PLAYER_MODE_CART
|
||||||
|
-1, // PLAYER_MODE_SWALLOW
|
||||||
|
};
|
||||||
|
|
||||||
int pickupToDrop;
|
int pickupToDrop;
|
||||||
pickupToDrop=s_pickupsToDrop[m_currentMode];
|
pickupToDrop=s_pickupsToDrop[m_currentMode];
|
||||||
if(pickupToDrop!=-1)
|
if(pickupToDrop!=-1)
|
||||||
{
|
{
|
||||||
DVECTOR pickupPos;
|
DVECTOR pickupPos;
|
||||||
CBasePickup *pickup;
|
CBasePickup *pickup;
|
||||||
pickupPos.vx=Pos.vx;
|
pickupPos.vx=Pos.vx;
|
||||||
pickupPos.vy=Pos.vy-30;
|
pickupPos.vy=Pos.vy-30;
|
||||||
pickup=createPickup((PICKUP_TYPE)pickupToDrop,&pickupPos);
|
pickup=createPickup((PICKUP_TYPE)pickupToDrop,&pickupPos);
|
||||||
pickup->setPos(&pickupPos);
|
pickup->setPos(&pickupPos);
|
||||||
|
}
|
||||||
|
setMode(PLAYER_MODE_BASICUNARMED);
|
||||||
}
|
}
|
||||||
setMode(PLAYER_MODE_BASICUNARMED);
|
|
||||||
|
// Now trying to pick up a weapon..
|
||||||
|
m_tryingToManuallyPickupWeapon=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1623,6 +1629,9 @@ void CPlayer::setMode(PLAYER_MODE _mode)
|
||||||
m_moveVelocity.vx=m_moveVelocity.vy=0;
|
m_moveVelocity.vx=m_moveVelocity.vy=0;
|
||||||
}
|
}
|
||||||
m_currentPlayerModeClass->enter();
|
m_currentPlayerModeClass->enter();
|
||||||
|
|
||||||
|
m_tryingToManuallyPickupWeapon=false;
|
||||||
|
m_tryingToAutomaticallyPickupWeapon=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue