w_nailgun: add primary sound, add hit effects and decal, adjust missile start position and velocity

weapons_tfc.sndshd: add nailgun fire sound

vgui_chooseteam.qc: fix bug where class selection menu doesn't hide after picking a class

mark install_patches.sh as executable
This commit is contained in:
Preston Thompson 2022-12-31 13:43:37 -08:00
parent 3e47775ccb
commit 938d67443d
4 changed files with 19 additions and 2 deletions

0
install_patches.sh Normal file → Executable file
View File

View File

@ -28,6 +28,7 @@ void
VGUI_TeamJoin(float i) VGUI_TeamJoin(float i)
{ {
sendevent("TeamJoin", "f", i); sendevent("TeamJoin", "f", i);
winCTTeam.Hide();
} }
void void

View File

@ -33,6 +33,7 @@ w_nailgun_precache(void)
precache_model("models/w_nailgun.mdl"); precache_model("models/w_nailgun.mdl");
precache_model("models/p_nailgun.mdl"); precache_model("models/p_nailgun.mdl");
precache_model("models/nail.mdl"); precache_model("models/nail.mdl");
Sound_Precache("weapon_nailgun.fire");
} }
void void
@ -75,18 +76,25 @@ void
w_nailgun_shootnail(player pl) w_nailgun_shootnail(player pl)
{ {
static void w_rpg_shootrocket_touch(void) { static void w_rpg_shootrocket_touch(void) {
#ifndef CLIENT
/* impact per bullet */
if (trace_ent.iBleeds == 0) {
DecalGroups_Place("Impact.BigShot", trace_endpos + (v_forward * -2));
SurfData_Impact(trace_ent, trace_surfaceflagsi, trace_endpos, trace_plane_normal);
}
#endif
remove(self); remove(self);
} }
Weapons_MakeVectors(pl); Weapons_MakeVectors(pl);
entity p = spawn(); entity p = spawn();
setmodel(p, "models/nail.mdl"); setmodel(p, "models/nail.mdl");
setorigin(p, Weapons_GetCameraPos(pl) + (v_forward * 8)); setorigin(p, Weapons_GetCameraPos(pl) + (v_forward * 14) + (v_up * -4) + (v_right * 2));
p.owner = self; p.owner = self;
p.movetype = MOVETYPE_FLYMISSILE; p.movetype = MOVETYPE_FLYMISSILE;
p.solid = SOLID_BBOX; p.solid = SOLID_BBOX;
p.gravity = 0.5f; p.gravity = 0.5f;
p.velocity = (v_forward * 1000); p.velocity = (v_forward * 1000) + (v_up * 4) + (v_right * -2);
p.angles = vectoangles(p.velocity); p.angles = vectoangles(p.velocity);
p.touch = w_rpg_shootrocket_touch; p.touch = w_rpg_shootrocket_touch;
p.think = Util_Destroy; p.think = Util_Destroy;
@ -114,6 +122,9 @@ w_nailgun_primary(player pl)
} }
Weapons_ViewAnimation(pl, NAILGUN_SHOOT2); Weapons_ViewAnimation(pl, NAILGUN_SHOOT2);
Weapons_ViewPunchAngle(pl, [-1,0,0]); Weapons_ViewPunchAngle(pl, [-1,0,0]);
#ifndef CLIENT
Sound_Play(pl, CHAN_WEAPON, "weapon_nailgun.fire");
#endif
pl.w_attack_next = 0.1f; pl.w_attack_next = 0.1f;
break; break;
case AUTO_EMPTY: case AUTO_EMPTY:

View File

@ -18,6 +18,11 @@ weapon_sbs.reload
sample weapons/reload3.wav sample weapons/reload3.wav
} }
weapon_nailgun.fire
{
sample weapons/airgun_1.wav
}
engineer.build engineer.build
{ {
sample weapons/building.wav sample weapons/building.wav