- Reverted quake style jumping because of prediction errors.

- +attack2 is now +moveability.
- Switched the onos attacks charge and devour.
- Alien movement abilities invoked by +moveability now disable according to weapon availability.
- Changed the charge speed calculations. (Incomplete.)

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@364 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
tankefugl 2005-11-25 04:19:57 +00:00
parent 0d639b1476
commit 7bd9aab753
9 changed files with 79 additions and 29 deletions

View file

@ -357,7 +357,7 @@
#define kChargeMaxPushbackForce 100.0 #define kChargeMaxPushbackForce 100.0
#define kChargePushbackRadius 100.0 #define kChargePushbackRadius 100.0
#define kChargeSpeed 1.00 #define kChargeSpeed 1.00
#define kChargeThresholdTime 0.50 #define kChargeThresholdTime 0.75
#define kChargingEnergyScalar 2.80 #define kChargingEnergyScalar 2.80
#define kClawsEnergyCost 0.07 #define kClawsEnergyCost 0.07
#define kClawsROF 0.90 #define kClawsROF 0.90

View file

@ -41,6 +41,8 @@ WeaponsResource gWR;
int g_weaponselect = 0; int g_weaponselect = 0;
extern bool gCanMove;
//Equivalent to DECLARE_COMMAND(lastinv,LastInv) except we use gWR instead of gHud //Equivalent to DECLARE_COMMAND(lastinv,LastInv) except we use gWR instead of gHud
void __CmdFunc_LastInv(void) void __CmdFunc_LastInv(void)
{ gWR.UserCmd_LastInv(); } { gWR.UserCmd_LastInv(); }
@ -737,6 +739,9 @@ int CHudAmmo::MsgFunc_CurWeapon(const char *pszName, int iSize, void *pbuf )
if( !bIsCurrent ) if( !bIsCurrent )
{ return 1; } { return 1; }
if (iId == 22 || iId == 11 || iId == 21)
gCanMove = pWeapon->iEnabled;
m_pWeapon = pWeapon; m_pWeapon = pWeapon;
if ( !(gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL )) ) if ( !(gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL )) )

View file

@ -1503,8 +1503,8 @@ void InitInput (void)
gEngfuncs.pfnAddCommand ("-speed", IN_SpeedUp); gEngfuncs.pfnAddCommand ("-speed", IN_SpeedUp);
gEngfuncs.pfnAddCommand ("+attack", IN_AttackDown); gEngfuncs.pfnAddCommand ("+attack", IN_AttackDown);
gEngfuncs.pfnAddCommand ("-attack", IN_AttackUp); gEngfuncs.pfnAddCommand ("-attack", IN_AttackUp);
gEngfuncs.pfnAddCommand ("+attack2", IN_Attack2Down); gEngfuncs.pfnAddCommand ("+moveability", IN_Attack2Down);
gEngfuncs.pfnAddCommand ("-attack2", IN_Attack2Up); gEngfuncs.pfnAddCommand ("-moveability", IN_Attack2Up);
gEngfuncs.pfnAddCommand ("+use", IN_UseDown); gEngfuncs.pfnAddCommand ("+use", IN_UseDown);
gEngfuncs.pfnAddCommand ("-use", IN_UseUp); gEngfuncs.pfnAddCommand ("-use", IN_UseUp);
gEngfuncs.pfnAddCommand ("+jump", IN_JumpDown); gEngfuncs.pfnAddCommand ("+jump", IN_JumpDown);

View file

@ -127,6 +127,7 @@ MULTIDAMAGE gMultiDamage;
#define TRACER_FREQ 4 // Tracers fire every fourth bullet #define TRACER_FREQ 4 // Tracers fire every fourth bullet
extern bool gCanMove[];
//========================================================= //=========================================================
// MaxAmmoCarry - pass in a name and this function will tell // MaxAmmoCarry - pass in a name and this function will tell
@ -1171,6 +1172,9 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer )
bSend = TRUE; bSend = TRUE;
} }
if (m_iId == 22 || m_iId == 11 || m_iId == 21)
gCanMove[pPlayer->entindex() - 1] = m_iEnabled;
if ( bSend ) if ( bSend )
{ {
NetMsg_CurWeapon( pPlayer->pev, state, m_iId, m_iClip ); NetMsg_CurWeapon( pPlayer->pev, state, m_iId, m_iClip );

View file

@ -702,6 +702,7 @@ private:
HSPRITE mAlienUIEnergySprite; HSPRITE mAlienUIEnergySprite;
HSPRITE mBlackSprite; HSPRITE mBlackSprite;
HSPRITE mChargeSprite;
HSPRITE mMembraneSprite; HSPRITE mMembraneSprite;
HSPRITE mDigestingSprite; HSPRITE mDigestingSprite;

View file

@ -3650,8 +3650,27 @@ void AvHHud::RenderAlienMovementUIEffect()
if (isMoving && (iuser3 == AVH_USER3_ALIEN_PLAYER5)) if (isMoving && (iuser3 == AVH_USER3_ALIEN_PLAYER5))
{ {
float alpha = 1.0f;
float theChargeThresholdTime = (float)BALANCE_VAR(kChargeThresholdTime); float theChargeThresholdTime = (float)BALANCE_VAR(kChargeThresholdTime);
float factor = min(this->mMovementTimer / theChargeThresholdTime, 1.0f); float factor = min(this->mMovementTimer / theChargeThresholdTime, 1.0f);
// if (this->mMovementTimer > 0.0f)
// {
// alpha = min(this->mMovementTimer / theChargeThresholdTime, 1.0f);
//
// AvHSpriteSetColor(1, 1, 1, alpha);
// AvHSpriteSetRenderMode(kRenderTransAlpha);
//
// int theWidth = ScreenWidth();
// int theHeight = ScreenHeight();
//
// int theX = mViewport[0];
// int theY = mViewport[1];
// int theY1 = mViewport[1];
// int theY2 = mViewport[3];
//
// AvHSpriteDraw(mChargeSprite, 0, theX, theY, theX + theWidth, theY + theHeight, 0, 0, 1, 1);
// }
} }
if (isMoving && (iuser3 == AVH_USER3_ALIEN_PLAYER1)) if (isMoving && (iuser3 == AVH_USER3_ALIEN_PLAYER1))
{ {
@ -4306,6 +4325,9 @@ void AvHHud::VidInit(void)
// black sprite // black sprite
this->mBlackSprite = Safe_SPR_Load("sprites/black.spr"); this->mBlackSprite = Safe_SPR_Load("sprites/black.spr");
// charge sprite
this->mChargeSprite = Safe_SPR_Load("sprites/charge_tint.spr");
// Load background for topdown mode // Load background for topdown mode
this->mBackgroundSprite = Safe_SPR_Load(kTopDownBGSprite); this->mBackgroundSprite = Safe_SPR_Load(kTopDownBGSprite);

View file

@ -899,8 +899,8 @@ int AvHDivineWind::iItemSlot(void)
int AvHCharge::GetItemInfo(ItemInfo *p) const int AvHCharge::GetItemInfo(ItemInfo *p) const
{ {
p->iSlot = AVH_FOURTH_SLOT; p->iSlot = AVH_SECOND_SLOT; //AVH_FOURTH_SLOT;
p->iPosition = 6; p->iPosition = 5;
p->pszName = STRING(pev->classname); p->pszName = STRING(pev->classname);
p->pszAmmo1 = NULL; p->pszAmmo1 = NULL;
@ -908,7 +908,7 @@ int AvHCharge::GetItemInfo(ItemInfo *p) const
p->pszAmmo2 = NULL; p->pszAmmo2 = NULL;
p->iMaxAmmo2 = BALANCE_VAR(kChargeDamage); p->iMaxAmmo2 = BALANCE_VAR(kChargeDamage);
p->iMaxClip = WEAPON_NOCLIP; p->iMaxClip = WEAPON_NOCLIP;
p->iFlags = ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_NOAUTORELOAD | ONE_HIVE_REQUIRED | TWO_HIVES_REQUIRED | THREE_HIVES_REQUIRED; p->iFlags = ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_NOAUTORELOAD | ONE_HIVE_REQUIRED; // | TWO_HIVES_REQUIRED | THREE_HIVES_REQUIRED;
p->iId = AVH_ABILITY_CHARGE; p->iId = AVH_ABILITY_CHARGE;
p->iWeight = kDefaultPrimaryWeaponWeight; p->iWeight = kDefaultPrimaryWeaponWeight;
@ -917,7 +917,7 @@ int AvHCharge::GetItemInfo(ItemInfo *p) const
int AvHCharge::iItemSlot(void) int AvHCharge::iItemSlot(void)
{ {
return AVH_FOURTH_SLOT + 1; return AVH_SECOND_SLOT + 1;
} }
int AvHStomp::GetItemInfo(ItemInfo *p) const int AvHStomp::GetItemInfo(ItemInfo *p) const
@ -946,8 +946,8 @@ int AvHStomp::iItemSlot(void)
int AvHDevour::GetItemInfo(ItemInfo *p) const int AvHDevour::GetItemInfo(ItemInfo *p) const
{ {
p->iSlot = AVH_SECOND_SLOT; p->iSlot = AVH_FOURTH_SLOT; //AVH_SECOND_SLOT;
p->iPosition = 5; p->iPosition = 6;
p->pszName = STRING(pev->classname); p->pszName = STRING(pev->classname);
p->pszAmmo1 = NULL; p->pszAmmo1 = NULL;
@ -955,7 +955,7 @@ int AvHDevour::GetItemInfo(ItemInfo *p) const
p->pszAmmo2 = NULL; p->pszAmmo2 = NULL;
p->iMaxAmmo2 = BALANCE_VAR(kDevourDamage); p->iMaxAmmo2 = BALANCE_VAR(kDevourDamage);
p->iMaxClip = WEAPON_NOCLIP; p->iMaxClip = WEAPON_NOCLIP;
p->iFlags = ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_NOAUTORELOAD | ONE_HIVE_REQUIRED; p->iFlags = ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_NOAUTORELOAD | ONE_HIVE_REQUIRED | TWO_HIVES_REQUIRED | THREE_HIVES_REQUIRED;
p->iId = AVH_WEAPON_DEVOUR; p->iId = AVH_WEAPON_DEVOUR;
p->iWeight = kDefaultPrimaryWeaponWeight; p->iWeight = kDefaultPrimaryWeaponWeight;
@ -964,7 +964,7 @@ int AvHDevour::GetItemInfo(ItemInfo *p) const
int AvHDevour::iItemSlot(void) int AvHDevour::iItemSlot(void)
{ {
return AVH_SECOND_SLOT + 1; return AVH_FOURTH_SLOT + 1;
} }

View file

@ -311,6 +311,11 @@ int g_onladder[MAX_CLIENTS];
bool gIsJetpacking[MAX_CLIENTS]; bool gIsJetpacking[MAX_CLIENTS];
bool gCanJump[MAX_CLIENTS]; bool gCanJump[MAX_CLIENTS];
#ifdef AVH_SERVER
bool gCanMove[MAX_CLIENTS];
#else
bool gCanMove;
#endif
// Borrowed from Quake1. // Borrowed from Quake1.
@ -4601,22 +4606,28 @@ bool PM_ChargeMove()
if (pmove->onground != -1) if (pmove->onground != -1)
{ {
vec3_t forward; vec3_t forward;
vec3_t sideways;
float length = pmove->maxspeed * (1.0f + (float)BALANCE_VAR(kChargeSpeed) * pmove->fuser4 / theChargeThresholdTime); float length = pmove->maxspeed * (1.0f + (float)BALANCE_VAR(kChargeSpeed) * pmove->fuser4 / theChargeThresholdTime);
VectorCopy(pmove->forward, forward); VectorCopy(pmove->forward, forward);
VectorScale(forward, -1 * DotProduct(forward, pmove->velocity), forward);
VectorAdd(pmove->velocity, forward, sideways);
//VectorScale(sideways, 1.5f, sideways);
VectorCopy(pmove->forward, forward);
forward[2] = 0.0f;
VectorNormalize(forward); VectorNormalize(forward);
VectorScale(forward, length, forward); VectorScale(forward, length, forward);
float boostfactor = DotProduct(forward, pmove->velocity) / (length * length); VectorAdd(forward, sideways, pmove->velocity);
VectorScale(forward, (1.0f - boostfactor), forward); //VectorCopy(forward, pmove->velocity);
VectorAdd(forward, pmove->velocity, pmove->velocity);
// pmove->velocity[2] = 0.0f;
float velocity = Length(pmove->velocity); float velocity = Length(pmove->velocity);
float maxvel = (pmove->maxspeed * (1.0f + (float)BALANCE_VAR(kChargeSpeed)) * 1.6f); float maxvel = (pmove->maxspeed * (1.0f + theChargeSpeed));
if (velocity > maxvel) if (velocity > maxvel)
{ VectorScale(pmove->velocity, maxvel / velocity, pmove->velocity);
VectorNormalize(pmove->velocity);
VectorScale(pmove->velocity, maxvel, pmove->velocity);
}
} }
return true; return true;
@ -4688,23 +4699,30 @@ void PM_AlienAbilities()
} }
// Movement abilities // Movement abilities
bool canmove = false;
#ifdef AVH_SERVER
canmove = gCanMove[pmove->player_index];
#else
canmove = gCanMove;
#endif
bool success = false; bool success = false;
if ((pmove->cmd.buttons & IN_ATTACK2) && (AvHGetIsAlien(pmove->iuser3))) if ((pmove->cmd.buttons & IN_ATTACK2) && (AvHGetIsAlien(pmove->iuser3)))
{ {
switch (pmove->iuser3) switch (pmove->iuser3)
{ {
case AVH_USER3_ALIEN_PLAYER1: case AVH_USER3_ALIEN_PLAYER1:
success = PM_LeapMove(); success = canmove && PM_LeapMove();
break; break;
case AVH_USER3_ALIEN_PLAYER3: case AVH_USER3_ALIEN_PLAYER3:
pmove->cmd.buttons |= IN_JUMP; pmove->cmd.buttons |= IN_JUMP;
success = PM_FlapMove(); success = PM_FlapMove();
break; break;
case AVH_USER3_ALIEN_PLAYER4: case AVH_USER3_ALIEN_PLAYER4:
success = PM_BlinkMove(); success = canmove && PM_BlinkMove();
break; break;
case AVH_USER3_ALIEN_PLAYER5: case AVH_USER3_ALIEN_PLAYER5:
success = PM_ChargeMove(); success = canmove && PM_ChargeMove();
break; break;
default: default:
{ {
@ -5197,10 +5215,10 @@ void PM_Jump (void)
qboolean cansuperjump = false; qboolean cansuperjump = false;
if ((pmove->cmd.buttons & IN_JUMP) && !(pmove->oldbuttons & IN_JUMP)) // if ((pmove->cmd.buttons & IN_JUMP) && !(pmove->oldbuttons & IN_JUMP))
{ // {
gCanJump[pmove->player_index] = true; // gCanJump[pmove->player_index] = true;
} // }
if (pmove->dead || GetHasUpgrade(pmove->iuser4, MASK_ENSNARED)) if (pmove->dead || GetHasUpgrade(pmove->iuser4, MASK_ENSNARED))
{ {
@ -5321,8 +5339,8 @@ void PM_Jump (void)
// if ( pmove->oldbuttons & IN_JUMP && (pmove->velocity[0] == 0 || !theIsAlien || pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3) ) // if ( pmove->oldbuttons & IN_JUMP && (pmove->velocity[0] == 0 || !theIsAlien || pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3) )
//return; // don't pogo stick //return; // don't pogo stick
// if ( pmove->oldbuttons & IN_JUMP ) if ( pmove->oldbuttons & IN_JUMP )
if (gCanJump[pmove->player_index] == false) // if (gCanJump[pmove->player_index] == false)
return; // don't pogo stick return; // don't pogo stick
// In the air now. // In the air now.
@ -5371,7 +5389,7 @@ void PM_Jump (void)
{ {
pmove->velocity[2] = sqrt(2 * 800 * 45.0); pmove->velocity[2] = sqrt(2 * 800 * 45.0);
// Flag that we jumped. // Flag that we jumped.
gCanJump[pmove->player_index] = false; // gCanJump[pmove->player_index] = false;
} }
pmove->oldbuttons |= IN_JUMP; // don't jump again until released pmove->oldbuttons |= IN_JUMP; // don't jump again until released

Binary file not shown.