Server: Add jumping sound to the players
This commit is contained in:
parent
69381dcc32
commit
ffc68d32c4
5 changed files with 61 additions and 1 deletions
|
@ -28,6 +28,8 @@ Game_Worldspawn(void)
|
|||
Sound_Precache("player.fall");
|
||||
Sound_Precache("player.lightfall");
|
||||
Sound_Precache("player_tfc.death");
|
||||
Sound_Precache("player_tfc.jump");
|
||||
|
||||
precache_model("models/player.mdl");
|
||||
precache_model("models/w_weaponbox.mdl");
|
||||
Weapons_Init();
|
||||
|
|
|
@ -9,7 +9,7 @@ player.qc
|
|||
../../../base/src/shared/weapon_common.h
|
||||
../../../valve/src/shared/animations.h
|
||||
../../../valve/src/shared/animations.qc
|
||||
../../../valve/src/shared/pmove.qc
|
||||
pmove.qc
|
||||
../../../valve/src/shared/pmove_water.qc
|
||||
|
||||
../../../valve/src/shared/fx_blood.qc
|
||||
|
|
|
@ -70,6 +70,8 @@ class player:NSClientPlayer
|
|||
/* ammo 3 */
|
||||
PREDICTED_INT(mode_tempstate);
|
||||
|
||||
virtual void(void) Physics_Jump;
|
||||
|
||||
#ifdef CLIENT
|
||||
virtual void(void) draw;
|
||||
virtual float() predraw;
|
||||
|
|
51
src/shared/pmove.qc
Normal file
51
src/shared/pmove.qc
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#define PMOVE_AIRSTEPHEIGHT 0
|
||||
#define PMOVE_STEPHEIGHT 18
|
||||
#define PMOVE_FRICTION 4
|
||||
#define PMOVE_EDGEFRICTION 1
|
||||
#define PMOVE_STOPSPEED 100
|
||||
#define PMOVE_GRAVITY 800
|
||||
#define PMOVE_AIRACCELERATE 10
|
||||
#define PMOVE_WATERACCELERATE 10
|
||||
#define PMOVE_ACCELERATE 10
|
||||
#define PMOVE_MAXSPEED 320
|
||||
#define PMOVE_STEP_WALKSPEED 135
|
||||
#define PMOVE_STEP_RUNSPEED 220
|
||||
#define PHY_VIEWPOS [0,0,28]
|
||||
#define PHY_VIEWPOS_CROUCHED [0,0,12]
|
||||
|
||||
void
|
||||
player::Physics_Jump(void)
|
||||
{
|
||||
if (waterlevel >= 2) {
|
||||
if (watertype == CONTENT_WATER) {
|
||||
velocity[2] = 100;
|
||||
} else if (watertype == CONTENT_SLIME) {
|
||||
velocity[2] = 80;
|
||||
} else {
|
||||
velocity[2] = 50;
|
||||
}
|
||||
} else {
|
||||
if (flags & FL_ONGROUND) {
|
||||
#ifdef SERVER
|
||||
Sound_Play(this, CHAN_VOICE, "player_tfc.jump");
|
||||
#endif
|
||||
velocity[2] += 265;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,3 +6,8 @@ player_tfc.death
|
|||
sample player/death4.wav
|
||||
sample player/death5.wav
|
||||
}
|
||||
|
||||
player_tfc.jump
|
||||
{
|
||||
sample player/plyrjmp8.wav
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue