A bunch of mod changes contributed to by Xylemon, mixed together with

some of my FX code which is going places.
This commit is contained in:
Marco Cawthorne 2020-04-05 02:25:27 +02:00
parent 07a3b329df
commit 755eecfc34
58 changed files with 1247 additions and 1191 deletions

View file

@ -0,0 +1,4 @@
ammo_gass.pickup
{
sample player/pl_slosh1.wav
}

View file

@ -0,0 +1,55 @@
weapon_ap9.fire
{
sample weapons/ap9_fire.wav
}
weapon_chaingun.fire
{
sample weapons/asscan2.wav
}
weapon_chaingun.reload
{
sample weapons/reload3.wav
}
weapon_chaingun.spindown
{
sample weapons/asscan3.wav
}
weapon_chaingun.spinup
{
sample weapons/asscan1.wav
}
weapon_medkit.heal
{
sample items/smallmedkit1.wav
}
weapon_flame.fire
{
sample weapons/flmfire2.wav
}
weapon_silencer.fire
{
sample weapons/pl_gun1.wav
sample weapons/pl_gun2.wav
}
weapon_sniper.fire
{
sample weapons/sniper.wav
}
weapon_sniper.reload
{
sample weapons/reload3.wav
}
weapon_taurus.fire
{
sample weapons/tau_fire.wav
}

View file

@ -0,0 +1,10 @@
weapon_bradnailer.fire
{
sample weapons/bradnailer.wav
}
weapon_bradnailer.hitbody
{
sample weapons/brad_hit1.wav
sample weapons/brad_hit2.wav
}

View file

@ -79,6 +79,8 @@
../valve/player.c ../valve/player.c
entities.c entities.c
../entities.c ../entities.c
../fx_lensflare.c
../fx_gunsmoke.c
../valve/cmds.c ../valve/cmds.c
../valve/game_event.c ../valve/game_event.c
../events.c ../events.c

View file

@ -19,6 +19,7 @@ CSQC_Init(float apilevel, string enginename, float engineversion)
{ {
pSeat = &seats[0]; pSeat = &seats[0];
registercommand("fx_lenspos");
registercommand("titles_test"); registercommand("titles_test");
registercommand("vox_test"); registercommand("vox_test");
registercommand("+attack2"); registercommand("+attack2");
@ -117,6 +118,7 @@ CSQC_RendererRestarted(string rstr)
Sky_Update(); Sky_Update();
Decal_Reload(); Decal_Reload();
Game_RendererRestarted(rstr); Game_RendererRestarted(rstr);
FX_Init();
} }
void void
@ -292,6 +294,8 @@ CSQC_UpdateView(float w, float h, float focus)
renderscene(); renderscene();
} }
FX_LensFlare();
/* Run this on all players */ /* Run this on all players */
for (entity b = world; (b = find(b, ::classname, "player"));) { for (entity b = world; (b = find(b, ::classname, "player"));) {
player pf = (player) b; player pf = (player) b;
@ -694,6 +698,10 @@ CSQC_ConsoleCommand(string sCMD)
case "slot10": case "slot10":
HUD_SlotSelect(9); HUD_SlotSelect(9);
break; break;
case "fx_lenspos":
makevectors(getproperty(VF_ANGLES));
g_vecLensPos = vectoangles(v_forward);
break;
default: default:
return Game_ConsoleCommand(); return Game_ConsoleCommand();
} }

View file

@ -66,24 +66,27 @@ void Event_ProcessModel(float fTimeStamp, int iCode, string sData)
pSeat->eMuzzleflash.alpha = 1.0f; pSeat->eMuzzleflash.alpha = 1.0f;
pSeat->eMuzzleflash.scale = 0.25; pSeat->eMuzzleflash.scale = 0.25;
pSeat->eMuzzleflash.skin = pSeat->fNumBones; pSeat->eMuzzleflash.skin = pSeat->fNumBones;
//setmodel(pSeat->eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1))); FX_Gunsmoke(gettaginfo(pSeat->eMuzzleflash, pSeat->eMuzzleflash.skin));
Event_EjectShell(); Event_EjectShell();
} else if(iCode == 5011) { } else if(iCode == 5011) {
pSeat->eMuzzleflash.alpha = 1.0f; pSeat->eMuzzleflash.alpha = 1.0f;
pSeat->eMuzzleflash.scale = 0.25; pSeat->eMuzzleflash.scale = 0.25;
pSeat->eMuzzleflash.skin = pSeat->fNumBones + 1; pSeat->eMuzzleflash.skin = pSeat->fNumBones + 1;
FX_Gunsmoke(gettaginfo(pSeat->eMuzzleflash, pSeat->eMuzzleflash.skin));
//setmodel(pSeat->eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1))); //setmodel(pSeat->eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1)));
Event_EjectShell(); Event_EjectShell();
} else if (iCode == 5021) { } else if (iCode == 5021) {
pSeat->eMuzzleflash.alpha = 1.0f; pSeat->eMuzzleflash.alpha = 1.0f;
pSeat->eMuzzleflash.scale = 0.25; pSeat->eMuzzleflash.scale = 0.25;
pSeat->eMuzzleflash.skin = pSeat->fNumBones + 2; pSeat->eMuzzleflash.skin = pSeat->fNumBones + 2;
FX_Gunsmoke(gettaginfo(pSeat->eMuzzleflash, pSeat->eMuzzleflash.skin));
//setmodel(pSeat->eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1))); //setmodel(pSeat->eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1)));
Event_EjectShell(); Event_EjectShell();
} else if (iCode == 5031) { } else if (iCode == 5031) {
pSeat->eMuzzleflash.alpha = 1.0f; pSeat->eMuzzleflash.alpha = 1.0f;
pSeat->eMuzzleflash.scale = 0.25; pSeat->eMuzzleflash.scale = 0.25;
pSeat->eMuzzleflash.skin = pSeat->fNumBones + 3; pSeat->eMuzzleflash.skin = pSeat->fNumBones + 3;
FX_Gunsmoke(gettaginfo(pSeat->eMuzzleflash, pSeat->eMuzzleflash.skin));
//setmodel(pSeat->eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1))); //setmodel(pSeat->eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1)));
Event_EjectShell(); Event_EjectShell();
} }

View file

@ -34,3 +34,12 @@ CBaseFX::CBaseFX(void)
{ {
drawmask = MASK_ENGINE; drawmask = MASK_ENGINE;
} }
void FX_Init(void)
{
precache_pic("textures/fx/flare1");
precache_pic("textures/fx/flare2");
precache_pic("textures/fx/flare3");
precache_pic("textures/fx/flare4");
}

20
src/client/fx_gunsmoke.c Normal file
View file

@ -0,0 +1,20 @@
/*
* Copyright (c) 2016-2020 Marco Hladik <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.
*/
void FX_Gunsmoke(vector inworldpos)
{
}

73
src/client/fx_lensflare.c Normal file
View file

@ -0,0 +1,73 @@
/*
* Copyright (c) 2016-2020 Marco Hladik <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.
*/
int trace_surfaceflagsi;
var vector g_vecLensPos;
var float g_flLensAlpha;
int Util_IsSky(vector pos)
{
if (serverkeyfloat("*bspversion") == 30)
if (getsurfacetexture(world, getsurfacenearpoint(world, pos)) == "sky") {
return TRUE;
}
/* trace_surfaceflagsi & SURF_SKY */
return FALSE;
}
#define FLARE_SIZE [128,128]
void FX_LensFlare(void)
{
if (!g_vecLensPos) {
return;
}
makevectors(g_vecLensPos);
vector lens_pos = getproperty(VF_ORIGIN) + (v_forward * 16384);
vector lens_1 = project(lens_pos) - (FLARE_SIZE / 2);
makevectors(getproperty(VF_ANGLES));
vector v = normalize (lens_pos - getproperty(VF_ORIGIN));
float flDot = v * v_forward;
if (flDot < 0.15) {
return;
} else {
traceline(getproperty(VF_ORIGIN), lens_pos, TRUE, self);
if (Util_IsSky(trace_endpos) && flDot > 0.8) {
/* this never happens because the above trace fails. */
g_flLensAlpha = bound(0.0, g_flLensAlpha + (clframetime * 2), 1.0);
} else {
g_flLensAlpha = bound(0.0, g_flLensAlpha - (clframetime * 2), 1.0);
}
}
if (g_flLensAlpha <= 0.0f) {
return;
}
makevectors(getproperty(VF_CL_VIEWANGLES));
vector lens_m = project(getproperty(VF_ORIGIN) + (v_forward * 16384));
vector c = (lens_1 - lens_m) * 1.5;
drawpic(lens_1, "textures/fx/flare1", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
drawpic(lens_1 - c * 0.1, "textures/fx/flare2", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
drawpic(lens_1 + c * 0.2, "textures/fx/flare3", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
drawpic(lens_1 - c * 0.3, "textures/fx/flare4", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
drawpic(lens_1 + c * 0.4, "textures/fx/flare2", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
drawpic(lens_1 - c * 0.5, "textures/fx/flare3", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
}

View file

@ -72,6 +72,8 @@ init.c
../valve/player.c ../valve/player.c
../valve/entities.c ../valve/entities.c
../entities.c ../entities.c
../fx_lensflare.c
../fx_gunsmoke.c
../valve/cmds.c ../valve/cmds.c
../valve/game_event.c ../valve/game_event.c
../events.c ../events.c

View file

@ -45,7 +45,10 @@ init.c
../../shared/hunger/weapons.h ../../shared/hunger/weapons.h
../../shared/valve/w_crossbow.c ../../shared/valve/w_crossbow.c
../../shared/valve/w_crowbar.c ../../shared/valve/w_crowbar.c
../../shared/valve/w_egon.c
../../shared/valve/w_gauss.c ../../shared/valve/w_gauss.c
../../shared/valve/w_glock.c
../../shared/valve/w_handgrenade.c
../../shared/valve/w_mp5.c ../../shared/valve/w_mp5.c
../../shared/valve/w_python.c ../../shared/valve/w_python.c
../../shared/valve/w_rpg.c ../../shared/valve/w_rpg.c
@ -56,19 +59,21 @@ init.c
../../shared/hunger/w_ap9.c ../../shared/hunger/w_ap9.c
../../shared/hunger/w_chaingun.c ../../shared/hunger/w_chaingun.c
../../shared/hunger/w_flame.c ../../shared/hunger/w_flame.c
../../shared/hunger/w_glock.c ../../shared/hunger/w_silencer.c
../../shared/hunger/w_handgrenade.c
../../shared/hunger/w_medkit.c ../../shared/hunger/w_medkit.c
../../shared/hunger/w_shovel.c ../../shared/hunger/w_shovel.c
../../shared/hunger/w_sniper.c ../../shared/hunger/w_sniper.c
../../shared/hunger/w_sniper2.c ../../shared/hunger/w_sniper2.c
../../shared/hunger/w_spanner.c ../../shared/hunger/w_spanner.c
../../shared/hunger/w_taurus.c ../../shared/hunger/w_taurus.c
../../shared/hunger/w_tnt.c
../../shared/hunger/weapons.c ../../shared/hunger/weapons.c
../../shared/valve/weapon_common.c ../../shared/valve/weapon_common.c
../valve/player.c ../valve/player.c
../valve/entities.c ../valve/entities.c
../entities.c ../entities.c
../fx_lensflare.c
../fx_gunsmoke.c
../valve/cmds.c ../valve/cmds.c
../valve/game_event.c ../valve/game_event.c
../events.c ../events.c

View file

@ -43,6 +43,7 @@
init.c init.c
../../shared/poke646/items.h ../../shared/poke646/items.h
../../shared/valve/weapon_common.h ../../shared/valve/weapon_common.h
../../shared/valve/w_satchel.c
../../shared/poke646/weapons.h ../../shared/poke646/weapons.h
../../shared/poke646/w_bradnailer.c ../../shared/poke646/w_bradnailer.c
../../shared/poke646/w_cmlwbr.c ../../shared/poke646/w_cmlwbr.c
@ -56,6 +57,8 @@ init.c
../valve/player.c ../valve/player.c
entities.c entities.c
../entities.c ../entities.c
../fx_lensflare.c
../fx_gunsmoke.c
../valve/cmds.c ../valve/cmds.c
../valve/game_event.c ../valve/game_event.c
../events.c ../events.c

View file

@ -66,6 +66,8 @@ decore.cpp
../valve/player.c ../valve/player.c
entities.c entities.c
../entities.c ../entities.c
../fx_lensflare.c
../fx_gunsmoke.c
../valve/cmds.c ../valve/cmds.c
../valve/game_event.c ../valve/game_event.c

View file

@ -71,6 +71,8 @@ init.c
../valve/player.c ../valve/player.c
../valve/entities.c ../valve/entities.c
../entities.c ../entities.c
../fx_lensflare.c
../fx_gunsmoke.c
../valve/cmds.c ../valve/cmds.c
../valve/game_event.c ../valve/game_event.c

View file

@ -76,6 +76,8 @@ init.c
../valve/player.c ../valve/player.c
entities.c entities.c
../entities.c ../entities.c
../fx_lensflare.c
../fx_gunsmoke.c
../valve/cmds.c ../valve/cmds.c
../valve/game_event.c ../valve/game_event.c

View file

@ -68,7 +68,8 @@
../valve/player.c ../valve/player.c
../valve/entities.c ../valve/entities.c
../entities.c ../entities.c
../fx_lensflare.c
../fx_gunsmoke.c
../valve/cmds.c ../valve/cmds.c
../valve/game_event.c ../valve/game_event.c
../events.c ../events.c

View file

@ -25,14 +25,14 @@ If TP_ONCE is set, It'll only emit a single push once before disabling itself.
If TP_STARTOFF is set, it needs to be triggered first in order to function. If TP_STARTOFF is set, it needs to be triggered first in order to function.
*/ */
#define TP_ONCE 1 enumflags {
#define TP_STARTOFF 2 TP_ONCE,
#define TP_AAAA 4 TP_STARTOFF
};
class trigger_push:CBaseTrigger class trigger_push:CBaseTrigger
{ {
vector m_vecMoveDir; vector m_vecMoveDir;
float m_flDelay;
float m_flSpeed; float m_flSpeed;
void() trigger_push; void() trigger_push;
@ -45,12 +45,12 @@ class trigger_push:CBaseTrigger
void trigger_push::SetMovementDirection(void) void trigger_push::SetMovementDirection(void)
{ {
if (angles == [0,-1,0]) { if (m_oldAngle == [0,-1,0]) {
m_vecMoveDir = [0,0,1]; m_vecMoveDir = [0,0,1];
} else if (angles == [0,-2,0]) { } else if (angles == [0,-2,0]) {
m_vecMoveDir = [0,0,-1]; m_vecMoveDir = [0,0,-1];
} else { } else {
makevectors(angles); makevectors(m_oldAngle);
m_vecMoveDir = v_forward; m_vecMoveDir = v_forward;
} }
@ -79,42 +79,33 @@ void trigger_push::touch(void)
} }
if (other.solid != SOLID_NOT && other.solid != SOLID_BSP) { if (other.solid != SOLID_NOT && other.solid != SOLID_BSP) {
vector vecPush;
vecPush = (m_flSpeed * m_vecMoveDir);
if (spawnflags & TP_ONCE) { if (spawnflags & TP_ONCE) {
other.velocity = other.velocity + (m_flSpeed * m_vecMoveDir); other.velocity += vecPush;
if (other.velocity[2] > 0) { if (other.velocity[2] > 0) {
other.flags &= ~FL_ONGROUND; other.flags &= ~FL_ONGROUND;
} }
Hide(); Hide();
} else { } else {
/*vector vecPush = m_flSpeed * m_vecMoveDir; other.basevelocity += vecPush;
if (other.flags & FL_BASEVELOCITY) {
vecPush = vecPush + other.basevelocity;
}
other.basevelocity = vecPush;
other.flags |= FL_BASEVELOCITY;*/
} }
} }
} }
void trigger_push::Respawn(void) void trigger_push::Respawn(void)
{ {
if (angles == [0,0,0]) {
angles[1] = 360;
}
SetMovementDirection(); SetMovementDirection();
if (m_flSpeed == 0) {
m_flSpeed = 100;
}
if (spawnflags & TP_STARTOFF) { if (spawnflags & TP_STARTOFF) {
solid = SOLID_NOT; solid = SOLID_NOT;
} }
} }
void trigger_push::trigger_push(void) void trigger_push::trigger_push(void)
{ {
m_flSpeed = 100;
for (int i = 1; i < (tokenize(__fullspawndata) - 1); i += 2) { for (int i = 1; i < (tokenize(__fullspawndata) - 1); i += 2) {
switch (argv(i)) { switch (argv(i)) {
case "speed": case "speed":

View file

@ -106,7 +106,7 @@ ammo_spore::ammo_spore(void)
} }
void void
ammo_spore::Death(int) ammo_spore::Death(int a)
{ {
makevectors(m_oldAngle); makevectors(m_oldAngle);
Sporelauncher_AltFire(this, origin, v_forward); Sporelauncher_AltFire(this, origin, v_forward);
@ -166,7 +166,6 @@ ammo_spore::touch(void)
player pl = (player)other; player pl = (player)other;
if (pl.ammo_spore < 20) { if (pl.ammo_spore < 20) {
pl.ammo_spore = bound(0, pl.ammo_spore + 1, 20); pl.ammo_spore = bound(0, pl.ammo_spore + 1, 20);
player pl = (player)other;
Weapons_RefreshAmmo(pl); Weapons_RefreshAmmo(pl);
Logging_Pickup(other, this, __NULL__); Logging_Pickup(other, this, __NULL__);
frame = 2; frame = 2;

View file

@ -15,12 +15,13 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/*QUAKED ammo_th_ap9 (0 0 0.8) (-16 -16 0) (16 16 32)
THEY HUNGER (1999) ENTITY
Ammo for the Flamethrower.
A single ammo_egonclip will provide 25, er, gas.
/*
* Ammo for the Flamethrower.
* A single ammo_egonclip will provide 25, er, gas.
*/ */
class ammo_egonclip:item_ammo class ammo_egonclip:item_ammo
{ {
@ -42,15 +43,20 @@ void ammo_egonclip::touch(void)
player pl = (player)other; player pl = (player)other;
if (pl.ammo_gas < MAX_A_GAS) { if (pl.ammo_gas < MAX_A_GAS) {
pl.ammo_gas = bound(0, pl.ammo_gas + 25, MAX_A_GAS); pl.ammo_gas = bound(0, pl.ammo_gas + 25, MAX_A_GAS);
Sound_Play(other, CHAN_ITEM, "ammo_gas.pickup");
item_ammo::touch(); item_ammo::touch();
} }
} }
} }
/* /*QUAKED ammo_th_ap9 (0 0 0.8) (-16 -16 0) (16 16 32)
* Ammo for the AP9.
* A single ammo_th_ap9 will provide 40 bullets. THEY HUNGER (1999) ENTITY
*/
Ammo for the AP9.
A single ammo_th_ap9 will provide 40 bullets.
*/
class ammo_th_ap9:item_ammo class ammo_th_ap9:item_ammo
{ {
void() ammo_th_ap9; void() ammo_th_ap9;
@ -76,34 +82,27 @@ void ammo_th_ap9::touch(void)
} }
} }
/*
* Ammo for the Snipers.
* A single ammo_th_sniper will provide 5 bullets.
*/
class ammo_einar1:item_ammo
{
void() ammo_einar1;
virtual void() touch;
};
void ammo_einar1::ammo_einar1(void) /*QUAKED ammo_einar1 (0 0 0.8) (-16 -16 0) (16 16 32)
{
model = "models/w_antidote.mdl"; THEY HUNGER (1999) ENTITY
item_ammo::item_ammo();
} Ammo for the Snipers.
void ammo_einar1::touch(void) A single ammo_th_sniper will provide 5 bullets.
{
if not (other.flags & FL_CLIENT) { Same as ammo_th_sniper
return;
} */
if (other.classname == "player") { /*QUAKED ammo_th_sniper (0 0 0.8) (-16 -16 0) (16 16 32)
player pl = (player)other;
if (pl.ammo_sniper < MAX_A_SNIPER) { THEY HUNGER (1999) ENTITY
pl.ammo_sniper = bound(0, pl.ammo_sniper + 5, MAX_A_SNIPER);
item_ammo::touch(); Ammo for the Snipers.
} A single ammo_th_sniper will provide 5 bullets.
}
} Same as ammo_einar1
*/
class ammo_th_sniper:item_ammo class ammo_th_sniper:item_ammo
{ {
@ -130,3 +129,4 @@ void ammo_th_sniper::touch(void)
} }
} }
CLASSEXPORT(ammo_einar1, ammo_th_sniper)

View file

@ -63,7 +63,7 @@ void Game_Input(void)
Weapons_AddItem(pl, WEAPON_SNIPER2); Weapons_AddItem(pl, WEAPON_SNIPER2);
Weapons_AddItem(pl, WEAPON_RPG); Weapons_AddItem(pl, WEAPON_RPG);
Weapons_AddItem(pl, WEAPON_GAUSS); Weapons_AddItem(pl, WEAPON_GAUSS);
Weapons_AddItem(pl, WEAPON_FLAME); Weapons_AddItem(pl, WEAPON_EGON);
Weapons_AddItem(pl, WEAPON_CHAINGUN); Weapons_AddItem(pl, WEAPON_CHAINGUN);
Weapons_AddItem(pl, WEAPON_HANDGRENADE); Weapons_AddItem(pl, WEAPON_HANDGRENADE);
Weapons_AddItem(pl, WEAPON_SATCHEL); Weapons_AddItem(pl, WEAPON_SATCHEL);

View file

@ -70,7 +70,10 @@
../../shared/hunger/weapons.h ../../shared/hunger/weapons.h
../../shared/valve/w_crossbow.c ../../shared/valve/w_crossbow.c
../../shared/valve/w_crowbar.c ../../shared/valve/w_crowbar.c
../../shared/valve/w_egon.c
../../shared/valve/w_gauss.c ../../shared/valve/w_gauss.c
../../shared/valve/w_glock.c
../../shared/valve/w_handgrenade.c
../../shared/valve/w_mp5.c ../../shared/valve/w_mp5.c
../../shared/valve/w_python.c ../../shared/valve/w_python.c
../../shared/valve/w_rpg.c ../../shared/valve/w_rpg.c
@ -81,14 +84,14 @@
../../shared/hunger/w_ap9.c ../../shared/hunger/w_ap9.c
../../shared/hunger/w_chaingun.c ../../shared/hunger/w_chaingun.c
../../shared/hunger/w_flame.c ../../shared/hunger/w_flame.c
../../shared/hunger/w_glock.c ../../shared/hunger/w_silencer.c
../../shared/hunger/w_handgrenade.c
../../shared/hunger/w_medkit.c ../../shared/hunger/w_medkit.c
../../shared/hunger/w_shovel.c ../../shared/hunger/w_shovel.c
../../shared/hunger/w_sniper.c ../../shared/hunger/w_sniper.c
../../shared/hunger/w_sniper2.c ../../shared/hunger/w_sniper2.c
../../shared/hunger/w_spanner.c ../../shared/hunger/w_spanner.c
../../shared/hunger/w_taurus.c ../../shared/hunger/w_taurus.c
../../shared/hunger/w_tnt.c
../valve/items.cpp ../valve/items.cpp
../valve/item_longjump.cpp ../valve/item_longjump.cpp
../valve/item_suit.cpp ../valve/item_suit.cpp

View file

@ -23,12 +23,12 @@ class item_ammo:CBaseEntity
void item_ammo::touch(void) void item_ammo::touch(void)
{ {
if (other.classname != "player") { if not (other.flags & FL_CLIENT) {
return; return;
} }
player pl = (player)other; player pl = (player)other;
sound(other, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_NORM); Sound_Play(other, CHAN_ITEM, "ammo.pickup");
Weapons_RefreshAmmo(pl); Weapons_RefreshAmmo(pl);
Logging_Pickup(other, this, __NULL__); Logging_Pickup(other, this, __NULL__);
@ -55,7 +55,7 @@ void item_ammo::Respawn(void)
think = __NULL__; think = __NULL__;
nextthink = -1; nextthink = -1;
sound(this, CHAN_ITEM, "items/suitchargeok1.wav", 1, ATTN_NORM, 150); Sound_Play(this, CHAN_ITEM, "ammo.respawn");
droptofloor(); droptofloor();
} }
@ -64,7 +64,6 @@ void item_ammo::item_ammo(void)
m_oldModel = model; m_oldModel = model;
setmodel(this, m_oldModel); setmodel(this, m_oldModel);
CBaseEntity::CBaseEntity(); CBaseEntity::CBaseEntity();
item_ammo::Respawn();
} }
/* /*
@ -84,53 +83,102 @@ ammo_bolts::ammo_bolts(void)
model = "models/w_crossbow_clip.mdl"; model = "models/w_crossbow_clip.mdl";
} }
/* /*QUAKED ammo_nailclip (0 0 0.8) (-16 -16 0) (16 16 32)
* Ammo for the nailguns.
* A single ammo_nailclip will provide 25 nails.
*/
class Poke646 (2001) ENTITY
ammo_nailclip:item_ammo
Ammo for the nailguns.
A single ammo_nailclip will provide 25 nails.
*/
class ammo_nailclip:item_ammo
{ {
void() ammo_nailclip; void() ammo_nailclip;
virtual void() touch;
}; };
void void ammo_nailclip::ammo_nailclip(void)
ammo_nailclip::ammo_nailclip(void)
{ {
model = "models/w_nailclip.mdl"; model = "models/w_nailclip.mdl";
item_ammo::item_ammo();
}
void ammo_nailclip::touch(void)
{
if not (other.flags & FL_CLIENT) {
return;
}
if (other.classname == "player") {
player pl = (player)other;
if (pl.ammo_nail < MAX_A_NAIL) {
pl.ammo_nail = bound(0, pl.ammo_nail + 25, MAX_A_NAIL);
item_ammo::touch();
}
}
} }
/* /*QUAKED ammo_nailround (0 0 0.8) (-16 -16 0) (16 16 32)
* Ammo for the Nailgun.
* A single ammo_nailround will provide 50 nails.
*/
class Poke646 (2001) ENTITY
ammo_nailround:item_ammo
Ammo for the nailguns.
A single ammo_nailround will provide 50 nails.
*/
class ammo_nailround:item_ammo
{ {
void() ammo_nailround; void() ammo_nailround;
virtual void() touch;
}; };
void void ammo_nailround::ammo_nailround(void)
ammo_nailround::ammo_nailround(void)
{ {
model = "models/w_nailround.mdl"; model = "models/w_nailround.mdl";
item_ammo::item_ammo();
}
void ammo_nailround::touch(void)
{
if not (other.flags & FL_CLIENT) {
return;
}
if (other.classname == "player") {
player pl = (player)other;
if (pl.ammo_nail < MAX_A_NAIL) {
pl.ammo_nail = bound(0, pl.ammo_nail + 50, MAX_A_NAIL);
item_ammo::touch();
}
}
} }
/* /*QUAKED ammo_xencandy (0 0 0.8) (-16 -16 0) (16 16 32)
* Ammo for the alien.
* A single ammo_xencandy will provide 20 snacks.
*/
class Poke646 (2001) ENTITY
ammo_xencandy:item_ammo
Ammo for the alien.
A single ammo_xencandy will provide 20 snacks.
*/
class ammo_xencandy:item_ammo
{ {
void() ammo_xencandy; void() ammo_xencandy;
virtual void() touch;
}; };
void void ammo_xencandy::ammo_xencandy(void)
ammo_xencandy::ammo_xencandy(void)
{ {
model = "models/w_xencandy.mdl"; model = "models/w_xencandy.mdl";
item_ammo::item_ammo();
}
void ammo_xencandy::touch(void)
{
if not (other.flags & FL_CLIENT) {
return;
}
if (other.classname == "player") {
player pl = (player)other;
if (pl.ammo_xencandy < MAX_A_XENCANDY) {
pl.ammo_xencandy = bound(0, pl.ammo_xencandy + 20, MAX_A_XENCANDY);
item_ammo::touch();
}
}
} }

View file

@ -30,6 +30,19 @@ Gamerules_DecodeChangeParms(player pl)
pl.velocity[2] = parm9; pl.velocity[2] = parm9;
pl.g_items = parm10; pl.g_items = parm10;
pl.activeweapon = parm11; pl.activeweapon = parm11;
pl.ammo_nail = parm12;
pl.ammo_buckshot = parm13;
pl.ammo_bolts = parm14;
pl.ammo_xencandy = parm15;
pl.ammo_satchel = parm16;
pl.bradnailer_mag = parm17;
pl.nailgun_mag = parm18;
pl.shotgun_mag = parm19;
pl.cmlwbr_mag = parm20;
pl.xs_mag = parm21;
pl.satchel_chg = parm22;
} }
/* prepare the client-info for level-transition */ /* prepare the client-info for level-transition */
@ -47,6 +60,17 @@ Gamerules_SetChangeParms(player pl)
parm9 = pl.velocity[2]; parm9 = pl.velocity[2];
parm10 = pl.g_items; parm10 = pl.g_items;
parm11 = pl.activeweapon; parm11 = pl.activeweapon;
parm12 = pl.ammo_nail;
parm13 = pl.ammo_buckshot;
parm14 = pl.ammo_bolts;
parm15 = pl.ammo_xencandy;
parm16 = pl.ammo_satchel;
parm17 = pl.bradnailer_mag;
parm18 = pl.nailgun_mag;
parm19 = pl.shotgun_mag;
parm20 = pl.cmlwbr_mag;
parm21 = pl.xs_mag;
parm22 = pl.satchel_chg;
} }
/* yuck, whenever 'changelevel' does not happen. */ /* yuck, whenever 'changelevel' does not happen. */

View file

@ -48,7 +48,7 @@ Game_Input(void)
Weapons_AddItem(pl, WEAPON_SHOTGUN); Weapons_AddItem(pl, WEAPON_SHOTGUN);
Weapons_AddItem(pl, WEAPON_CMLWBR); Weapons_AddItem(pl, WEAPON_CMLWBR);
Weapons_AddItem(pl, WEAPON_XS); Weapons_AddItem(pl, WEAPON_XS);
Weapons_AddItem(pl, WEAPON_PIPEBOMB); Weapons_AddItem(pl, WEAPON_SATCHEL);
} }
if (self.impulse == 102) { if (self.impulse == 102) {

View file

@ -22,19 +22,54 @@
../skill.c ../skill.c
../sentences.c ../sentences.c
../../gs-entbase/server.src ../../gs-entbase/server.src
../valve/monster_apache.cpp
../valve/monster_alien_controller.cpp
../valve/monster_alien_grunt.cpp
../valve/monster_alien_slave.cpp
../valve/monster_barnacle.cpp
../valve/monster_barney.cpp
../valve/monster_barney_dead.cpp
../valve/monster_bigmomma.cpp
../valve/monster_bloater.cpp
../valve/monster_bullchicken.cpp
../valve/monster_cockroach.cpp
../valve/monster_flyer_flock.cpp
../valve/monster_gargantua.cpp
../valve/monster_gman.cpp
../valve/monster_headcrab.cpp
../valve/monster_babycrab.cpp
../valve/monster_hevsuit_dead.cpp
../valve/monster_houndeye.cpp
../valve/monster_human_grunt.cpp
../valve/monster_hgrunt_dead.cpp
../valve/monster_human_assassin.cpp
../valve/monster_ichthyosaur.cpp
../valve/monster_leech.cpp
../valve/monster_miniturret.cpp
../valve/monster_nihilanth.cpp
../valve/monster_osprey.cpp
../valve/monster_rat.cpp ../valve/monster_rat.cpp
../valve/monster_scientist.cpp
../valve/monster_scientist_dead.cpp ../valve/monster_scientist_dead.cpp
../valve/monster_sitting_scientist.cpp
../valve/monster_scientist.cpp
../valve/monster_sentry.cpp
../valve/monster_tentacle.cpp
../valve/monster_turret.cpp
../valve/monster_zombie.cpp
../../shared/decals.c ../../shared/decals.c
../../shared/effects.c ../../shared/effects.c
../../shared/spraylogo.cpp ../../shared/spraylogo.cpp
../../shared/valve/player.cpp ../../shared/poke646/player.cpp
../valve/player.c ../valve/player.c
../../shared/pmove.c ../../shared/pmove.c
../valve/spectator.c ../valve/spectator.c
../../shared/poke646/items.h ../../shared/poke646/items.h
../../shared/valve/weapon_common.h ../../shared/valve/weapon_common.h
../../shared/poke646/weapons.h ../../shared/poke646/weapons.h
../../shared/valve/w_satchel.c
../../shared/poke646/weapons.h
../../shared/poke646/w_bradnailer.c ../../shared/poke646/w_bradnailer.c
../../shared/poke646/w_cmlwbr.c ../../shared/poke646/w_cmlwbr.c
../../shared/poke646/w_heaterpipe.c ../../shared/poke646/w_heaterpipe.c
@ -43,7 +78,6 @@
../../shared/poke646/w_shotgun.c ../../shared/poke646/w_shotgun.c
../../shared/poke646/w_xs.c ../../shared/poke646/w_xs.c
../valve/items.cpp ../valve/items.cpp
../valve/item_longjump.cpp
../valve/item_suit.cpp ../valve/item_suit.cpp
../valve/item_healthkit.cpp ../valve/item_healthkit.cpp
../valve/item_battery.cpp ../valve/item_battery.cpp
@ -53,14 +87,13 @@
../valve/xen_spore_large.cpp ../valve/xen_spore_large.cpp
../valve/xen_hair.cpp ../valve/xen_hair.cpp
../valve/xen_plantlight.cpp ../valve/xen_plantlight.cpp
../poke646/ammo_p646.cpp ../poke646/ammo_p646.cpp
../../shared/poke646/weapons.c ../../shared/poke646/weapons.c
../../shared/valve/weapon_common.c ../../shared/valve/weapon_common.c
../spawn.c ../spawn.c
../vox.c ../vox.c
../../shared/valve/animations.c ../../shared/valve/animations.c
../poke646/gamerules.c gamerules.c
../valve/client.c ../valve/client.c
../client.c ../client.c
../valve/server.c ../valve/server.c

View file

@ -28,7 +28,7 @@ void item_ammo::touch(void)
} }
player pl = (player)other; player pl = (player)other;
sound(other, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_NORM); Sound_Play(other, CHAN_ITEM, "ammo.pickup");
Weapons_RefreshAmmo(pl); Weapons_RefreshAmmo(pl);
Logging_Pickup(other, this, __NULL__); Logging_Pickup(other, this, __NULL__);
@ -55,7 +55,7 @@ void item_ammo::Respawn(void)
think = __NULL__; think = __NULL__;
nextthink = -1; nextthink = -1;
sound(this, CHAN_ITEM, "items/suitchargeok1.wav", 1, ATTN_NORM, 150); Sound_Play(this, CHAN_ITEM, "ammo.respawn");
droptofloor(); droptofloor();
} }

View file

@ -114,6 +114,7 @@ enumflags
.float jumptime; .float jumptime;
.float teleport_time; .float teleport_time;
.vector basevelocity;
void* memrealloc( __variant *oldptr, int elementsize, int oldelements, int newelements ) void* memrealloc( __variant *oldptr, int elementsize, int oldelements, int newelements )
{ {

View file

@ -23,7 +23,7 @@
#define ITEM_RPG 0x00000040 #define ITEM_RPG 0x00000040
#define ITEM_GAUSS 0x00000080 #define ITEM_GAUSS 0x00000080
#define ITEM_FLAME 0x00000100 #define ITEM_EGON 0x00000100
#define ITEM_CHAINGUN 0x00000200 #define ITEM_CHAINGUN 0x00000200
#define ITEM_HANDGRENADE 0x00000400 #define ITEM_HANDGRENADE 0x00000400
#define ITEM_TRIPMINE 0x00000800 #define ITEM_TRIPMINE 0x00000800

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org> * Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net> * Copyright (c) 2019-2020 Gethyn ThomasQuail <xylemon@posteo.net>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -25,17 +25,18 @@ enum
AP9_SHOOT3 AP9_SHOOT3
}; };
void void
w_ap9_precache(void) w_ap9_precache(void)
{ {
#ifdef SSQC
Sound_Precache("weapon_ap9.fire");
#endif
precache_model("models/v_ap9.mdl"); precache_model("models/v_ap9.mdl");
precache_model("models/w_ap9.mdl"); precache_model("models/w_ap9.mdl");
precache_model("models/p_ap9.mdl"); precache_model("models/p_ap9.mdl");
precache_sound("weapons/ap9_bolt.wav"); precache_sound("weapons/ap9_bolt.wav");
precache_sound("weapons/ap9_clipin.wav"); precache_sound("weapons/ap9_clipin.wav");
precache_sound("weapons/ap9_clipout.wav"); precache_sound("weapons/ap9_clipout.wav");
precache_sound("weapons/ap9_fire.wav");
} }
void void
@ -61,7 +62,7 @@ w_ap9_pmodel(void)
string string
w_ap9_deathmsg(void) w_ap9_deathmsg(void)
{ {
return ""; return "%s was unloaded into from %s's AP9.";
} }
int int
@ -140,7 +141,7 @@ w_ap9_primary(void)
#else #else
pl.ap9_mag--; pl.ap9_mag--;
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8, [0.1,0.1], WEAPON_AP9); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8, [0.1,0.1], WEAPON_AP9);
sound(pl, CHAN_WEAPON, "weapons/ap9_fire.wav", 1.0f, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_ap9.fire");
if (self.flags & FL_CROUCHING) if (self.flags & FL_CROUCHING)
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f); Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
@ -192,7 +193,7 @@ w_ap9_secondary(void)
#else #else
pl.ap9_mag -= 3; pl.ap9_mag -= 3;
TraceAttack_FireBullets(3, pl.origin + pl.view_ofs, 8, [0.02,0.02], WEAPON_AP9); TraceAttack_FireBullets(3, pl.origin + pl.view_ofs, 8, [0.02,0.02], WEAPON_AP9);
sound(pl, CHAN_WEAPON, "weapons/ap9_fire.wav", 1.0f, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_ap9.fire");
if (self.flags & FL_CROUCHING) if (self.flags & FL_CROUCHING)
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f); Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
@ -252,44 +253,13 @@ w_ap9_release(void)
float float
w_ap9_aimanim(void) w_ap9_aimanim(void)
{ {
return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; return w_glock_aimanim();
} }
void void
w_ap9_hud(void) w_ap9_hud(void)
{ {
#ifdef CSQC w_glock_hud();
vector cross_pos;
vector aicon_pos;
cross_pos = (g_hudres / 2) + [-12,-12];
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(
cross_pos,
[24,24],
"sprites/crosshairs.spr_0.tga",
[0.1875,0],
[0.1875, 0.1875],
[1,1,1],
1.0f,
DRAWFLAG_NORMAL
);
HUD_DrawAmmo1();
HUD_DrawAmmo2();
drawsubpic(
aicon_pos,
[24,24],
"sprites/640hud7.spr_0.tga",
[0,72/128],
[24/256, 24/128],
g_hud_color,
pSeat->ammo2_alpha,
DRAWFLAG_ADDITIVE
);
#endif
} }
void void
@ -300,8 +270,8 @@ w_ap9_hudpic(int selected, vector pos, float a)
drawsubpic( drawsubpic(
pos, pos,
[170,45], [170,45],
"sprites/tfchud04.spr_0.tga", "sprites/tfchud05.spr_0.tga",
[0,90/256], [0,0],
[170/256,45/256], [170/256,45/256],
g_hud_color, g_hud_color,
a, a,
@ -350,7 +320,8 @@ weapon_t w_ap9 =
/* pickups */ /* pickups */
#ifdef SSQC #ifdef SSQC
void void
weapon_th_ap9(void) { weapon_th_ap9(void)
{
Weapons_InitItem(WEAPON_AP9); Weapons_InitItem(WEAPON_AP9);
} }
#endif #endif

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org> * Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net> * Copyright (c) 2019-2020 Gethyn ThomasQuail <xylemon@posteo.net>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -29,11 +29,15 @@ enum {
void void
w_chaingun_precache(void) w_chaingun_precache(void)
{ {
#ifdef SSQC
Sound_Precache("weapon_chaingun.fire");
Sound_Precache("weapon_chaingun.reload");
Sound_Precache("weapon_chaingun.spindown");
Sound_Precache("weapon_chaingun.spinup");
#endif
precache_model("models/v_tfac.mdl"); precache_model("models/v_tfac.mdl");
precache_model("models/w_tfac.mdl"); precache_model("models/w_tfac.mdl");
precache_model("models/p_tfac.mdl"); precache_model("models/p_tfac.mdl");
precache_sound("weapons/asscan1.wav");
precache_sound("weapons/asscan3.wav");
} }
int int
@ -78,7 +82,7 @@ w_chaingun_pmodel(void)
string string
w_chaingun_deathmsg(void) w_chaingun_deathmsg(void)
{ {
return ""; return "%s was rolled over by %s' Chaingun.";
} }
void void
@ -108,6 +112,7 @@ w_chaingun_release(void)
/* end firing */ /* end firing */
if (pl.a_ammo3 == 1) { if (pl.a_ammo3 == 1) {
pl.a_ammo3 = 0; pl.a_ammo3 = 0;
Sound_Play(pl, CHAN_WEAPON, "weapon_chaingun.spindown");
Weapons_ViewAnimation(CHAINGUN_SPINDOWN); Weapons_ViewAnimation(CHAINGUN_SPINDOWN);
pl.w_attack_next = 1.0f; pl.w_attack_next = 1.0f;
pl.w_idle_next = pl.w_attack_next; pl.w_idle_next = pl.w_attack_next;
@ -163,7 +168,7 @@ w_chaingun_primary(void)
if (pl.a_ammo3 == 0) { if (pl.a_ammo3 == 0) {
pl.a_ammo3 = 1; pl.a_ammo3 = 1;
Weapons_ViewAnimation(CHAINGUN_SPINUP); Weapons_ViewAnimation(CHAINGUN_SPINUP);
sound(pl, CHAN_WEAPON, "weapons/asscan1.wav", 1.0f, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_chaingun.spinup");
pl.w_attack_next = 0.5f; pl.w_attack_next = 0.5f;
pl.w_idle_next = pl.w_attack_next; pl.w_idle_next = pl.w_attack_next;
return; return;
@ -178,7 +183,7 @@ w_chaingun_primary(void)
#else #else
pl.chaingun_mag--; pl.chaingun_mag--;
TraceAttack_FireBullets(1, Weapons_GetCameraPos(), 8, [0.15,0.15], WEAPON_CHAINGUN); TraceAttack_FireBullets(1, Weapons_GetCameraPos(), 8, [0.15,0.15], WEAPON_CHAINGUN);
sound(pl, CHAN_WEAPON, "weapons/asscan3.wav", 1.0f, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_chaingun.fire");
#endif #endif
pl.w_attack_next = 0.1f; pl.w_attack_next = 0.1f;
@ -214,7 +219,7 @@ w_chaingun_reload(void)
#ifdef CSQC #ifdef CSQC
Weapons_ViewAnimation(CHAINGUN_HOLSTER); Weapons_ViewAnimation(CHAINGUN_HOLSTER);
#else #else
sound(pl, CHAN_WEAPON, "weapons/reload3.wav", 1, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_chaingun.reload");
Weapons_ReloadWeapon(pl, player::chaingun_mag, player::ammo_9mm, 100); Weapons_ReloadWeapon(pl, player::chaingun_mag, player::ammo_9mm, 100);
#endif #endif
@ -226,40 +231,13 @@ w_chaingun_reload(void)
void void
w_chaingun_hud(void) w_chaingun_hud(void)
{ {
#ifdef CSQC w_glock_hud();
/* crosshair */
drawsubpic(
g_hudmins + (g_hudres / 2) + [-12,-12],
[24,24],
"sprites/crosshairs.spr_0.tga",
[24/128,0],
[24/128, 24/128],
[1,1,1],
1,
DRAWFLAG_NORMAL
);
/* ammo icon */
drawsubpic(
g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42],
[24,24],
"sprites/640hud7.spr_0.tga",
[0,72/128],
[24/256, 24/128],
g_hud_color,
pSeat->ammo2_alpha,
DRAWFLAG_ADDITIVE
);
HUD_DrawAmmo1();
HUD_DrawAmmo2();
#endif
} }
float float
w_chaingun_aimanim(void) w_chaingun_aimanim(void)
{ {
return self.flags & FL_CROUCHING ? ANIM_CR_AIMMP5 : ANIM_AIMMP5; return w_mp5_aimanim();
} }
void void

View file

@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org> * Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019-2020 Gethyn ThomasQuail <xylemon@posteo.net>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -16,28 +17,31 @@
enum enum
{ {
FLAME_IDLE1, EGON_IDLE1,
FLAME_FIDGET1, EGON_FIDGET1,
FLAME_ALTFIREON, EGON_ALTFIREON,
FLAME_ALTFIRECYCLE, EGON_ALTFIRECYCLE,
FLAME_ALTFIREOFF, EGON_ALTFIREOFF,
FLAME_FIRE1, EGON_FIRE1,
FLAME_FIRE2, EGON_FIRE2,
FLAME_FIRE3, EGON_FIRE3,
FLAME_FIRE4, EGON_FIRE4,
FLAME_DRAW, EGON_DRAW,
FLAME_HOLSTER EGON_HOLSTER
}; };
void void
w_flame_precache(void) w_flame_precache(void)
{ {
precache_model("sound/weapons/flmfire2.wav"); #ifdef SSQC
Sound_Precache("weapon_flame.fire");
#endif
precache_model("sprites/fthrow.spr"); precache_model("sprites/fthrow.spr");
precache_model("models/v_egon.mdl"); precache_model("models/v_egon.mdl");
precache_model("models/w_egon.mdl"); precache_model("models/w_egon.mdl");
precache_model("models/p_egon.mdl"); precache_model("models/p_egon.mdl");
} }
void void
w_flame_updateammo(player pl) w_flame_updateammo(player pl)
{ {
@ -45,20 +49,23 @@ w_flame_updateammo(player pl)
Weapons_UpdateAmmo(pl, __NULL__, pl.ammo_gas, __NULL__); Weapons_UpdateAmmo(pl, __NULL__, pl.ammo_gas, __NULL__);
#endif #endif
} }
string string
w_flame_wmodel(void) w_flame_wmodel(void)
{ {
return "models/w_egon.mdl"; return w_egon_wmodel();
} }
string string
w_flame_pmodel(void) w_flame_pmodel(void)
{ {
return "models/p_egon.mdl"; return w_egon_pmodel();
} }
string string
w_flame_deathmsg(void) w_flame_deathmsg(void)
{ {
return ""; return "%s burned to a crisp by %s's Flamethrower.";
} }
int int
@ -66,7 +73,6 @@ w_flame_pickup(int new)
{ {
#ifdef SSQC #ifdef SSQC
player pl = (player)self; player pl = (player)self;
if (pl.ammo_gas < MAX_A_GAS) { if (pl.ammo_gas < MAX_A_GAS) {
pl.ammo_gas = bound(0, pl.ammo_gas + 20, MAX_A_GAS); pl.ammo_gas = bound(0, pl.ammo_gas + 20, MAX_A_GAS);
} else { } else {
@ -79,38 +85,34 @@ w_flame_pickup(int new)
void void
w_flame_draw(void) w_flame_draw(void)
{ {
player pl = (player)self; w_egon_draw();
Weapons_SetModel("models/v_egon.mdl");
Weapons_ViewAnimation(FLAME_DRAW);
pl.w_idle_next = 1.0f;
} }
void void
w_flame_holster(void) w_flame_holster(void)
{ {
Weapons_ViewAnimation(FLAME_HOLSTER); w_egon_holster();
} }
#ifdef SSQC #ifdef SSQC
void void
Flame_Touch(void) { Flame_Touch(void)
{
if (other.takedamage != DAMAGE_YES) { if (other.takedamage != DAMAGE_YES) {
remove(self); remove(self);
return; return;
} }
/* anything else that can take damage */ /* anything else that can take damage */
Damage_Apply(other, self.owner, 40, WEAPON_FLAME, DMG_BURN); Damage_Apply(other, self.owner, 40, WEAPON_EGON, DMG_BURN);
remove(self); remove(self);
} }
#endif #endif
void w_flame_primary(void) void
w_flame_primary(void)
{ {
player pl = (player)self; player pl = (player)self;
if (pl.w_attack_next > 0.0) { if (pl.w_attack_next > 0.0) {
@ -129,15 +131,15 @@ void w_flame_primary(void)
#endif #endif
#ifdef CSQC #ifdef CSQC
if (Weapons_GetAnimation() == FLAME_IDLE1) if (Weapons_GetAnimation() == EGON_IDLE1)
Weapons_ViewAnimation(FLAME_ALTFIREON); Weapons_ViewAnimation(EGON_ALTFIREON);
else if (Weapons_GetAnimation() == FLAME_ALTFIREON) else if (Weapons_GetAnimation() == EGON_ALTFIREON)
Weapons_ViewAnimation(FLAME_ALTFIRECYCLE); Weapons_ViewAnimation(EGON_ALTFIRECYCLE);
pl.a_ammo2--; pl.a_ammo2--;
#else #else
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/flmfire2.wav", 1, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_flame.fire");
Weapons_MakeVectors(); Weapons_MakeVectors();
entity flame = spawn(); entity flame = spawn();
setmodel(flame, "sprites/fthrow.spr"); setmodel(flame, "sprites/fthrow.spr");
@ -160,32 +162,24 @@ void w_flame_primary(void)
pl.w_attack_next = 0.2f; pl.w_attack_next = 0.2f;
pl.w_idle_next = 2.5f; pl.w_idle_next = 2.5f;
} }
void void
w_flame_secondary(void) w_flame_secondary(void)
{ {
w_egon_secondary();
} }
void void
w_flame_reload(void) w_flame_reload(void)
{ {
} }
void void
w_flame_release(void) w_flame_release(void)
{ {
#ifdef CSQC w_egon_release();
player pl = (player)self;
if (Weapons_GetAnimation() == FLAME_ALTFIRECYCLE) {
Weapons_ViewAnimation(FLAME_ALTFIREOFF);
pl.w_idle_next = 1.0f;
} else {
if (pl.w_idle_next > 0.0f) {
return;
}
Weapons_ViewAnimation(FLAME_IDLE1);
}
#endif
} }
void void
w_flame_crosshair(void) w_flame_crosshair(void)
{ {
@ -202,15 +196,14 @@ w_flame_crosshair(void)
float float
w_flame_aimanim(void) w_flame_aimanim(void)
{ {
return self.flags & FL_CROUCHING ? ANIM_CR_AIMEGON : ANIM_AIMEGON; return w_egon_aimanim();
} }
void void
w_flame_hudpic(int selected, vector pos, float a) w_flame_hudpic(int selected, vector pos, float a)
{ {
#ifdef CSQC #ifdef CSQC
if (selected) {
if (selected) {
drawsubpic( drawsubpic(
pos, pos,
[170,45], [170,45],
@ -238,16 +231,16 @@ if (selected) {
weapon_t w_flame = weapon_t w_flame =
{ {
.id = ITEM_FLAME, .id = ITEM_EGON,
.slot = 3, .slot = 3,
.slot_pos = 2, .slot_pos = 2,
.ki_spr = "sprites/640hud1.spr_0.tga", .ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [32,16], .ki_size = [32,16],
.ki_xy = [0,192], .ki_xy = [0,192],
.draw = w_flame_draw, .draw = w_flame_draw,
.holster = __NULL__, .holster = w_egon_holster,
.primary = w_flame_primary, .primary = w_flame_primary,
.secondary = __NULL__, .secondary = w_flame_secondary,
.reload = __NULL__, .reload = __NULL__,
.release = w_flame_release, .release = w_flame_release,
.crosshair = w_flame_crosshair, .crosshair = w_flame_crosshair,
@ -260,11 +253,3 @@ weapon_t w_flame =
.aimanim = w_flame_aimanim, .aimanim = w_flame_aimanim,
.hudpic = w_flame_hudpic .hudpic = w_flame_hudpic
}; };
#ifdef SSQC
void
weapon_egon(void) {
Weapons_InitItem(WEAPON_FLAME);
}
#endif

View file

@ -1,361 +0,0 @@
/*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net>
*
* 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.
*/
enum
{
GLOCK_IDLE1,
GLOCK_IDLE2,
GLOCK_IDLE3,
GLOCK_SHOOT,
GLOCK_SHOOT_EMPTY,
GLOCK_RELOAD_EMPTY,
GLOCK_RELOAD,
GLOCK_DRAW,
GLOCK_HOLSTER,
GLOCK_SILENCER
};
void
w_glock_precache(void)
{
precache_model("models/v_9mmhandgun.mdl");
precache_model("models/w_silencer.mdl");
precache_model("models/p_9mmhandgun.mdl");
precache_sound("weapons/pl_gun1.wav");
precache_sound("weapons/pl_gun3.wav");
}
void
w_glock_updateammo(player pl)
{
#ifdef SSQC
Weapons_UpdateAmmo(pl, pl.glock_mag, pl.ammo_9mm, -1);
#endif
}
string
w_glock_wmodel(void)
{
return "models/w_silencer.mdl";
}
string
w_glock_pmodel(void)
{
return "models/p_9mmhandgun.mdl";
}
string
w_glock_deathmsg(void)
{
return "";
}
int
w_glock_pickup(int new)
{
#ifdef SSQC
player pl = (player)self;
if (new) {
pl.glock_mag = 18;
} else {
if (pl.ammo_9mm < 250) {
pl.ammo_9mm = bound(0, pl.ammo_9mm + 18, 250);
} else {
return FALSE;
}
}
#endif
return TRUE;
}
void
w_glock_draw(void)
{
#ifdef CSQC
Weapons_SetModel("models/v_9mmhandgun.mdl");
Weapons_ViewAnimation(GLOCK_DRAW);
#endif
}
void
w_glock_holster(void)
{
Weapons_ViewAnimation(GLOCK_HOLSTER);
}
void
w_glock_primary(void)
{
player pl = (player)self;
if (pl.w_attack_next > 0.0) {
return;
}
#ifdef CSQC
if (!pl.a_ammo1) {
return;
}
if (pl.a_ammo3 == 1) {
View_SetMuzzleflash(0);
} else {
View_SetMuzzleflash(MUZZLE_SMALL);
}
Weapons_ViewPunchAngle([-2,0,0]);
#else
if (!pl.glock_mag) {
return;
}
#endif
#ifdef SSQC
/* Different sound & accuracy without silencer */
if (pl.a_ammo3 == 1) {
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 34, [0.01, 0.01], WEAPON_GLOCK);
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/pl_gun1.wav", 1, ATTN_NORM);
} else {
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 34, [0.1,0.1], WEAPON_GLOCK);
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/pl_gun3.wav", 1, ATTN_NORM);
}
#endif
#ifdef CSQC
pl.a_ammo1--;
#else
pl.glock_mag--;
if (self.flags & FL_CROUCHING)
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
else
Animation_PlayerTopTemp(ANIM_CR_SHOOT1HAND, 0.45f);
#endif
if (pl.a_ammo1) {
Weapons_ViewAnimation(GLOCK_SHOOT);
} else {
Weapons_ViewAnimation(GLOCK_SHOOT_EMPTY);
}
/* Fires faster without silencer */
if (pl.a_ammo3 == 1) {
pl.w_attack_next = 0.3f;
} else {
pl.w_attack_next = 0.2f;
}
pl.w_idle_next = 5.0f;
}
void
w_glock_release(void)
{
player pl = (player)self;
int r;
if (pl.w_idle_next > 0.0) {
return;
}
r = floor(random(0,3));
switch (r) {
case 1:
Weapons_ViewAnimation(GLOCK_IDLE2);
pl.w_idle_next = 2.5f;
break;
case 2:
Weapons_ViewAnimation(GLOCK_IDLE3);
pl.w_idle_next = 3.5f;
break;
default:
Weapons_ViewAnimation(GLOCK_IDLE1);
pl.w_idle_next = 3.75f;
break;
}
}
void
w_glock_secondary(void)
{
player pl = (player)self;
if (pl.w_attack_next > 0.0) {
return;
}
/* toggle silencer */
pl.a_ammo3 = 1 - pl.a_ammo3;
if (pl.a_ammo3) {
Weapons_ViewAnimation(GLOCK_SILENCER);
pl.w_attack_next = 3.3f;
pl.w_idle_next = pl.w_attack_next;
} else {
Weapons_ViewAnimation(GLOCK_HOLSTER);
pl.w_attack_next = 0.94f;
pl.w_idle_next = pl.w_attack_next;
}
/* toggle silencer on client */
#ifdef CSQC
if (pl.a_ammo3) {
Weapons_SetGeomset("geomset 1 2\n");
} else {
Weapons_SetGeomset("geomset 1 0\n");
}
#endif
}
void
w_glock_reload(void)
{
player pl = (player)self;
if (pl.w_attack_next > 0.0) {
return;
}
#ifdef CSQC
if (pl.a_ammo1 >= 18) {
return;
}
if (pl.a_ammo2 <= 0) {
return;
}
if (pl.a_ammo1) {
Weapons_ViewAnimation(GLOCK_RELOAD);
} else {
Weapons_ViewAnimation(GLOCK_RELOAD_EMPTY);
}
#else
if (pl.glock_mag >= 18) {
return;
}
if (pl.ammo_9mm <= 0) {
return;
}
Weapons_ReloadWeapon(pl, player::glock_mag, player::ammo_9mm, 18);
#endif
pl.w_attack_next = 2.0f;
pl.w_idle_next = 10.0f;
}
float
w_glock_aimanim(void)
{
return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND;
}
void
w_glock_hud(void)
{
#ifdef CSQC
static vector cross_pos;
cross_pos = (g_hudres / 2) + [-12,-12];
drawsubpic(
cross_pos,
[24,24],
"sprites/crosshairs.spr_0.tga",
[0.1875,0], [0.1875, 0.1875],
[1,1,1], 1, DRAWFLAG_NORMAL
);
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(
aicon_pos,
[24,24],
"sprites/640hud7.spr_0.tga",
[0,72/128],
[24/256, 24/128],
g_hud_color,
pSeat->ammo2_alpha,
DRAWFLAG_ADDITIVE
);
#endif
}
void
w_glock_hudpic(int selected, vector pos, float a)
{
#ifdef CSQC
if (selected) {
drawsubpic(
pos,
[170,45],
"sprites/tfchud05.spr_0.tga",
[0,135/256],
[170/256,45/256],
g_hud_color,
a,
DRAWFLAG_ADDITIVE
);
} else {
drawsubpic(
pos,
[170,45],
"sprites/tfchud06.spr_0.tga",
[0,45/256],
[170/256,45/256],
g_hud_color,
a,
DRAWFLAG_ADDITIVE
);
}
#endif
}
weapon_t w_glock =
{
.id = ITEM_GLOCK,
.slot = 1,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [32,16],
.ki_xy = [192,16],
.draw = w_glock_draw,
.holster = w_glock_holster,
.primary = w_glock_primary,
.secondary = w_glock_secondary,
.reload = w_glock_reload,
.release = w_glock_release,
.crosshair = w_glock_hud,
.precache = w_glock_precache,
.pickup = w_glock_pickup,
.updateammo = w_glock_updateammo,
.wmodel = w_glock_wmodel,
.pmodel = w_glock_pmodel,
.deathmsg = w_glock_deathmsg,
.aimanim = w_glock_aimanim,
.hudpic = w_glock_hudpic
};
#ifdef SSQC
void
weapon_9mmhandgun(void) {
Weapons_InitItem(WEAPON_GLOCK);
}
void
weapon_glock(void) {
Weapons_InitItem(WEAPON_GLOCK);
}
#endif

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org> * Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net> * Copyright (c) 2019-2020 Gethyn ThomasQuail <xylemon@posteo.net>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -28,6 +28,9 @@ enum
void void
w_medkit_precache(void) w_medkit_precache(void)
{ {
#ifdef SSQC
Sound_Precache("weapon_medkit.heal");
#endif
precache_model("models/v_tfc_medkit.mdl"); precache_model("models/v_tfc_medkit.mdl");
precache_model("models/w_tfc_medkit.mdl"); precache_model("models/w_tfc_medkit.mdl");
precache_model("models/p_tfc_medkit.mdl"); precache_model("models/p_tfc_medkit.mdl");
@ -46,6 +49,7 @@ w_medkit_wmodel(void)
{ {
return "models/w_tfc_medkit.mdl"; return "models/w_tfc_medkit.mdl";
} }
string string
w_medkit_pmodel(void) w_medkit_pmodel(void)
{ {
@ -55,7 +59,7 @@ w_medkit_pmodel(void)
string string
w_medkit_deathmsg(void) w_medkit_deathmsg(void)
{ {
return "%s was somehow killed by %s's Medkit."; return "%s was somehow healed to death by %s's Medkit.";
} }
int int
@ -105,15 +109,15 @@ w_medkit_primary(void)
} }
/* We want to only give health to the player & skip armor */ /* We want to only give health to the player & skip armor */
Damage_Apply(pl, pl, -15, WEAPON_MEDKIT, DMG_GENERIC ); Damage_Apply(pl, pl, -15, WEAPON_MEDKIT, DMG_GENERIC);
pl.ammo_medkit--; pl.ammo_medkit--;
if (self.flags & FL_CROUCHING) if (self.flags & FL_CROUCHING)
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f); Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
else else
Animation_PlayerTopTemp(ANIM_CR_SHOOT1HAND, 0.45f); Animation_PlayerTopTemp(ANIM_CR_SHOOT1HAND, 0.45f);
Weapons_PlaySound(pl, CHAN_WEAPON, "items/smallmedkit1.wav", 1, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_medkit.heal");
#endif #endif
if (pl.health >= 100) { if (pl.health >= 100) {
@ -136,13 +140,13 @@ w_medkit_release(void)
return; return;
} }
r = floor(random(0,2)); int r = (float)input_sequence % 2;
switch (r) { switch (r) {
case 1: case 0:
Weapons_ViewAnimation(MEDKIT_IDLE1); Weapons_ViewAnimation(MEDKIT_IDLE1);
pl.w_idle_next = 1.16f; pl.w_idle_next = 1.16f;
break; break;
case 2: default:
Weapons_ViewAnimation(MEDKIT_IDLE2); Weapons_ViewAnimation(MEDKIT_IDLE2);
pl.w_idle_next = 2.36f; pl.w_idle_next = 2.36f;
break; break;
@ -152,7 +156,7 @@ w_medkit_release(void)
float float
w_medkit_aimanim(void) w_medkit_aimanim(void)
{ {
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSQUEAK : ANIM_AIMSQUEAK; return w_snark_aimanim();
} }
void void
@ -160,7 +164,6 @@ w_medkit_crosshair(void)
{ {
#ifdef CSQC #ifdef CSQC
vector aicon_pos; vector aicon_pos;
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42]; aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
HUD_DrawAmmo2(); HUD_DrawAmmo2();
@ -210,7 +213,7 @@ w_medkit_hudpic(int selected, vector pos, float a)
weapon_t w_medkit = weapon_t w_medkit =
{ {
.id = ITEM_MEDKIT2, .id = ITEM_MEDKIT2,
.slot = 4, .slot = 4,
.slot_pos = 4, .slot_pos = 4,
.ki_spr = "sprites/tfc_dmsg.spr_0.tga", .ki_spr = "sprites/tfc_dmsg.spr_0.tga",
@ -235,7 +238,8 @@ weapon_t w_medkit =
#ifdef SSQC #ifdef SSQC
void void
weapon_th_medkit(void) { weapon_th_medkit(void)
{
Weapons_InitItem(WEAPON_MEDKIT); Weapons_InitItem(WEAPON_MEDKIT);
} }
#endif #endif

View file

@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org> * Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019-2020 Gethyn ThomasQuail <xylemon@posteo.net>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -16,26 +17,25 @@
enum enum
{ {
SHOVEL_IDLE, CBAR_IDLE,
SHOVEL_DRAW, CBAR_DRAW,
SHOVEL_HOLSTER, CBAR_HOLSTER,
SHOVEL_ATTACK1HIT, CBAR_ATTACK1HIT,
SHOVEL_ATTACK1MISS, CBAR_ATTACK1MISS,
SHOVEL_ATTACK2MISS, CBAR_ATTACK2MISS,
SHOVEL_ATTACK2HIT, CBAR_ATTACK2HIT,
SHOVEL_ATTACK3MISS, CBAR_ATTACK3MISS,
SHOVEL_ATTACK3HIT CBAR_ATTACK3HIT
}; };
void void
w_shovel_precache(void) w_shovel_precache(void)
{ {
precache_sound("weapons/cbar_miss1.wav"); #ifdef SSQC
precache_sound("weapons/cbar_hit1.wav"); Sound_Precache("weapon_crowbar.hit");
precache_sound("weapons/cbar_hit2.wav"); Sound_Precache("weapon_crowbar.miss");
precache_sound("weapons/cbar_hitbod1.wav"); Sound_Precache("weapon_crowbar.hitbody");
precache_sound("weapons/cbar_hitbod2.wav"); #endif
precache_sound("weapons/cbar_hitbod3.wav");
precache_model("models/v_shovel.mdl"); precache_model("models/v_shovel.mdl");
precache_model("models/w_shovel.mdl"); precache_model("models/w_shovel.mdl");
precache_model("models/p_shovel.mdl"); precache_model("models/p_shovel.mdl");
@ -44,9 +44,7 @@ w_shovel_precache(void)
void void
w_shovel_updateammo(player pl) w_shovel_updateammo(player pl)
{ {
#ifdef SSQC w_crowbar_updateammo(pl);
Weapons_UpdateAmmo(pl, -1, -1, -1);
#endif
} }
string string
@ -63,124 +61,38 @@ w_shovel_pmodel(void)
string string
w_shovel_deathmsg(void) w_shovel_deathmsg(void)
{ {
return "%s was assaulted by %s's Crowbar."; return "%s was buried by %s's Shovel.";
} }
void void
w_shovel_draw(void) w_shovel_draw(void)
{ {
Weapons_SetModel("models/v_shovel.mdl"); Weapons_SetModel("models/v_shovel.mdl");
Weapons_ViewAnimation(SHOVEL_DRAW); Weapons_ViewAnimation(CBAR_DRAW);
} }
void void
w_shovel_holster(void) w_shovel_holster(void)
{ {
Weapons_ViewAnimation(SHOVEL_HOLSTER); w_crowbar_holster();
} }
void void
w_shovel_primary(void) w_shovel_primary(void)
{ {
int anim = 0; w_crowbar_primary();
int r;
vector src;
player pl = (player)self;
if (pl.w_attack_next) {
return;
}
Weapons_MakeVectors();
src = pl.origin + pl.view_ofs;
traceline(src, src + (v_forward * 32), FALSE, pl);
if (trace_fraction >= 1.0) {
pl.w_attack_next = 0.5f;
} else {
pl.w_attack_next = 0.25f;
}
pl.w_idle_next = 2.5f;
#ifdef CSQC
r = floor(random(0,3));
switch (r) {
case 0:
anim = trace_fraction >= 1 ? SHOVEL_ATTACK1MISS:SHOVEL_ATTACK1HIT;
break;
case 1:
anim = trace_fraction >= 1 ? SHOVEL_ATTACK2MISS:SHOVEL_ATTACK2HIT;
break;
default:
anim = trace_fraction >= 1 ? SHOVEL_ATTACK3MISS:SHOVEL_ATTACK3HIT;
}
Weapons_ViewAnimation(anim);
#else
if (pl.flags & FL_CROUCHING) {
Animation_PlayerTopTemp(ANIM_SHOOTCROWBAR, 0.5f);
} else {
Animation_PlayerTopTemp(ANIM_CR_SHOOTCROWBAR, 0.42f);
}
sound(pl, CHAN_WEAPON, "weapons/cbar_miss1.wav", 1, ATTN_NORM);
if (trace_fraction >= 1.0) {
return;
}
/* don't bother with decals, we got squibs */
if (trace_ent.iBleeds) {
Effect_CreateBlood(trace_endpos, [1,0,0]);
} else {
Effect_Impact(IMPACT_MELEE, trace_endpos, trace_plane_normal);
}
if (trace_ent.takedamage) {
Damage_Apply(trace_ent, self, 10, WEAPON_SHOVEL, DMG_BLUNT );
if (!trace_ent.iBleeds) {
return;
}
r = floor(random(0,3));
switch (r) {
case 0:
sound(pl, 8, "weapons/cbar_hitbod1.wav", 1, ATTN_NORM);
break;
case 1:
sound(pl, 8, "weapons/cbar_hitbod2.wav", 1, ATTN_NORM);
break;
case 2:
sound(pl, 8, "weapons/cbar_hitbod3.wav", 1, ATTN_NORM);
break;
}
} else {
if (random() < 0.5) {
sound(pl, 8, "weapons/cbar_hit1.wav", 1, ATTN_NORM);
} else {
sound(pl, 8, "weapons/cbar_hit2.wav", 1, ATTN_NORM);
}
}
#endif
} }
void void
w_shovel_release(void) w_shovel_release(void)
{ {
player pl = (player)self; w_crowbar_release();
if (pl.w_idle_next) {
return;
}
Weapons_ViewAnimation(SHOVEL_IDLE);
pl.w_idle_next = 15.0f;
} }
float float
w_shovel_aimanim(void) w_shovel_aimanim(void)
{ {
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR; return w_crowbar_aimanim();
} }
void void

View file

@ -0,0 +1,264 @@
/*
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019-2020 Gethyn ThomasQuail <xylemon@posteo.net>
*
* 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.
*/
enum
{
GLOCK_IDLE1,
GLOCK_IDLE2,
GLOCK_IDLE3,
GLOCK_SHOOT,
GLOCK_SHOOT_EMPTY,
GLOCK_RELOAD_EMPTY,
GLOCK_RELOAD,
GLOCK_DRAW,
GLOCK_HOLSTER,
GLOCK_SILENCER
};
void
w_silencer_precache(void)
{
#ifdef SSQC
Sound_Precache("weapon_glock.fire");
Sound_Precache("weapon_silencer.fire");
#endif
precache_model("models/v_9mmhandgun.mdl");
precache_model("models/w_9mmhandgun.mdl");
precache_model("models/p_9mmhandgun.mdl");
}
void
w_silencer_updateammo(player pl)
{
w_glock_updateammo(pl);
}
string
w_silencer_wmodel(void)
{
return "models/w_silencer.mdl";
}
string
w_silencer_pmodel(void)
{
return w_glock_pmodel();
}
string
w_silencer_deathmsg(void)
{
return "%s was silenced by %s's Beretta.";
}
int
w_silencer_pickup(int new)
{
return w_glock_pickup(new);
}
void
w_silencer_draw(void)
{
w_glock_draw();
}
void
w_silencer_holster(void)
{
w_glock_holster();
}
void
w_silencer_primary(void)
{
player pl = (player)self;
if (pl.w_attack_next > 0.0) {
return;
}
/* ammo check */
#ifdef CSQC
if (!pl.a_ammo1) {
return;
}
if (pl.a_ammo3 == 1) {
View_SetMuzzleflash(0);
} else {
View_SetMuzzleflash(MUZZLE_SMALL);
}
Weapons_ViewPunchAngle([-2,0,0]);
#else
if (!pl.glock_mag) {
return;
}
#endif
/* actual firing */
#ifdef CSQC
pl.a_ammo1--;
View_SetMuzzleflash(MUZZLE_SMALL);
Weapons_ViewPunchAngle([-2,0,0]);
if (pl.a_ammo1) {
Weapons_ViewAnimation(GLOCK_SHOOT);
} else {
Weapons_ViewAnimation(GLOCK_SHOOT_EMPTY);
}
#else
pl.glock_mag--;
/* Different sound & accuracy without silencer */
if (pl.a_ammo3 == 1) {
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_9mm_bullet"), [0.01, 0.01], WEAPON_GLOCK);
Sound_Play(pl, CHAN_WEAPON, "weapon_silencer.fire");
} else {
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_9mm_bullet"), [0.1,0.1], WEAPON_GLOCK);
Sound_Play(pl, CHAN_WEAPON, "weapon_glock.fire");
}
if (self.flags & FL_CROUCHING)
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
else
Animation_PlayerTopTemp(ANIM_CR_SHOOT1HAND, 0.45f);
#endif
/* Fires faster without silencer */
if (pl.a_ammo3 == 1) {
pl.w_attack_next = 0.3f;
} else {
pl.w_attack_next = 0.2f;
}
pl.w_idle_next = 5.0f;
}
void
w_silencer_secondary(void)
{
player pl = (player)self;
if (pl.w_attack_next > 0) {
return;
}
/* toggle silencer */
pl.a_ammo3 = 1 - pl.a_ammo3;
/* the sub model isn't setting right, need the right values */
#ifdef CSQC
if (pl.a_ammo3) {
Weapons_SetGeomset("geomset 1 3\n");
Weapons_ViewAnimation(GLOCK_SILENCER);
} else {
Weapons_SetGeomset("geomset 0 1\n");
Weapons_ViewAnimation(GLOCK_HOLSTER);
}
#endif
if (pl.a_ammo3) {
pl.w_attack_next = 3.3f;
pl.w_idle_next = pl.w_attack_next;
} else {
pl.w_attack_next = 0.94f;
pl.w_idle_next = pl.w_attack_next;
}
}
void
w_silencer_reload(void)
{
w_glock_reload();
}
void
w_silencer_release(void)
{
w_glock_release();
}
float
w_silencer_aimanim(void)
{
return w_glock_aimanim();
}
void
w_silencer_hud(void)
{
w_glock_hud();
}
void
w_silencer_hudpic(int selected, vector pos, float a)
{
#ifdef CSQC
if (selected) {
drawsubpic(
pos,
[170,45],
"sprites/tfchud05.spr_0.tga",
[0,135/256],
[170/256,45/256],
g_hud_color,
a,
DRAWFLAG_ADDITIVE
);
} else {
drawsubpic(
pos,
[170,45],
"sprites/tfchud06.spr_0.tga",
[0,45/256],
[170/256,45/256],
g_hud_color,
a,
DRAWFLAG_ADDITIVE
);
}
#endif
}
weapon_t w_silencer =
{
.id = ITEM_GLOCK,
.slot = 1,
.slot_pos = 0,
.ki_spr = "sprites/640hud1.spr_0.tga",
.ki_size = [32,16],
.ki_xy = [192,16],
.draw = w_silencer_draw,
.holster = w_silencer_holster,
.primary = w_silencer_primary,
.secondary = w_silencer_secondary,
.reload = w_silencer_reload,
.release = w_silencer_release,
.crosshair = w_silencer_hud,
.precache = w_silencer_precache,
.pickup = w_silencer_pickup,
.updateammo = w_silencer_updateammo,
.wmodel = w_silencer_wmodel,
.pmodel = w_silencer_pmodel,
.deathmsg = w_silencer_deathmsg,
.aimanim = w_silencer_aimanim,
.hudpic = w_silencer_hudpic
};

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org> * Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net> * Copyright (c) 2019-2020 Gethyn ThomasQuail <xylemon@posteo.net>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -28,12 +28,13 @@ enum
void void
w_sniper_precache(void) w_sniper_precache(void)
{ {
#ifdef SSQC
Sound_Precache("weapon_sniper.fire");
Sound_Precache("weapon_sniper.reload");
#endif
precache_model("models/v_tfc_sniper.mdl"); precache_model("models/v_tfc_sniper.mdl");
precache_model("models/w_isotopebox.mdl"); precache_model("models/w_isotopebox.mdl");
precache_model("models/p_sniper.mdl"); precache_model("models/p_sniper.mdl");
precache_sound("weapons/sniper.wav");
precache_sound("weapons/reload3.wav");
} }
int int
@ -78,7 +79,7 @@ w_sniper_pmodel(void)
string string
w_sniper_deathmsg(void) w_sniper_deathmsg(void)
{ {
return ""; return "%s was taken out by %s's Sniper.";
} }
void void
@ -160,7 +161,7 @@ w_sniper_primary(void)
pl.sniper_mag--; pl.sniper_mag--;
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 40, [0.008, 0.008], WEAPON_SNIPER); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 40, [0.008, 0.008], WEAPON_SNIPER);
sound(pl, CHAN_WEAPON, "weapons/sniper.wav", 1, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_sniper.fire");
#endif #endif
@ -217,7 +218,7 @@ w_sniper_reload(void)
if (pl.ammo_sniper <= 0) { if (pl.ammo_sniper <= 0) {
return; return;
} }
sound(pl, CHAN_WEAPON, "weapons/reload3.wav", 1, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_sniper.reload");
Weapons_ReloadWeapon(pl, player::sniper_mag, player::ammo_sniper, 5); Weapons_ReloadWeapon(pl, player::sniper_mag, player::ammo_sniper, 5);
#endif #endif
@ -286,7 +287,7 @@ w_sniper_crosshair(void)
float float
w_sniper_aimanim(void) w_sniper_aimanim(void)
{ {
return self.flags & FL_CROUCHING ? ANIM_CR_AIMPYTHON : ANIM_AIMPYTHON; return w_crossbow_aimanim();
} }
void void

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org> * Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net> * Copyright (c) 2019-2020 Gethyn ThomasQuail <xylemon@posteo.net>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -26,11 +26,12 @@ enum
void void
w_sniper2_precache(void) w_sniper2_precache(void)
{ {
#ifdef SSQC
Sound_Precache("weapon_sniper.fire");
#endif
precache_model("models/v_hkg36.mdl"); precache_model("models/v_hkg36.mdl");
precache_model("models/w_hkg36.mdl"); precache_model("models/w_hkg36.mdl");
precache_model("models/p_hkg36.mdl"); precache_model("models/p_hkg36.mdl");
precache_sound("weapons/sniper.wav");
} }
int int
@ -75,7 +76,7 @@ w_sniper2_pmodel(void)
string string
w_sniper2_deathmsg(void) w_sniper2_deathmsg(void)
{ {
return ""; return "%s was taken out by %s's Sniper.";
} }
void void
@ -146,7 +147,7 @@ w_sniper2_primary(void)
pl.sniper_mag--; pl.sniper_mag--;
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 40, [0.008, 0.008], WEAPON_SNIPER); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 40, [0.008, 0.008], WEAPON_SNIPER);
sound(pl, CHAN_WEAPON, "weapons/sniper.wav", 1, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_sniper.fire");
#endif #endif
@ -163,20 +164,7 @@ w_sniper2_primary(void)
void void
w_sniper2_secondary(void) w_sniper2_secondary(void)
{ {
player pl = (player)self; w_sniper_secondary();
if (pl.w_attack_next > 0.0) {
return;
}
/* Simple toggle of fovs */
if (pl.viewzoom == 1.0f) {
pl.viewzoom = 0.25f;
} else {
pl.viewzoom = 1.0f;
}
pl.w_attack_next = 0.5f;
} }
void void
@ -213,98 +201,25 @@ void
w_sniper2_crosshair(void) w_sniper2_crosshair(void)
{ {
#ifdef CSQC #ifdef CSQC
player pl = (player)self; w_sniper_crosshair();
static vector cross_pos;
vector aicon_pos;
if (pl.viewzoom < 1.0f) {
drawfill(
g_hudmins,
g_hudres,
[0.2,0,0],
1.0f,
DRAWFLAG_ADDITIVE
);
cross_pos = g_hudmins + (g_hudres / 2) + [-128,-104];
drawpic(
cross_pos,
"sprites/nmxhair2.spr_0.tga",
[256,208],
[1,1,1],
1.0f,
DRAWFLAG_NORMAL
);
} else {
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
drawsubpic(
cross_pos,
[24,24],
"sprites/crosshairs.spr_0.tga",
[48/128,0],
[24/128,24/128],
[1,1,1],
1.0f,
DRAWFLAG_NORMAL
);
}
HUD_DrawAmmo1();
HUD_DrawAmmo2();
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(
aicon_pos,
[24,24],
"sprites/640hud7.spr_0.tga",
[24/256,72/128],
[24/256, 24/128],
g_hud_color,
pSeat->ammo2_alpha,
DRAWFLAG_ADDITIVE
);
#endif #endif
} }
float float
w_sniper2_aimanim(void) w_sniper2_aimanim(void)
{ {
return self.flags & FL_CROUCHING ? ANIM_CR_AIMPYTHON : ANIM_AIMPYTHON; return w_crossbow_aimanim();
} }
void void
w_sniper2_hudpic(int selected, vector pos, float a) w_sniper2_hudpic(int selected, vector pos, float a)
{ {
#ifdef CSQC w_sniper_hudpic(selected, pos, a);
if (selected) {
drawsubpic(
pos,
[170,45],
"sprites/tfchud02.spr_0.tga",
[0,45/256],
[170/256,45/256],
g_hud_color,
a,
DRAWFLAG_ADDITIVE
);
} else {
drawsubpic(
pos,
[170,45],
"sprites/tfchud01.spr_0.tga",
[0,45/256],
[170/256,45/256],
g_hud_color,
a,
DRAWFLAG_ADDITIVE
);
}
#endif
} }
weapon_t w_sniper2 = weapon_t w_sniper2 =
{ {
.id = ITEM_SNIPER2, .id = ITEM_SNIPER2,
.slot = 2, .slot = 2,
.slot_pos = 4, .slot_pos = 4,
.ki_spr = "sprites/tfc_dmsg.spr_0.tga", .ki_spr = "sprites/tfc_dmsg.spr_0.tga",

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org> * Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net> * Copyright (c) 2019-2020 Gethyn ThomasQuail <xylemon@posteo.net>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -17,23 +17,22 @@
enum enum
{ {
SPAN_IDLE, CBAR_IDLE,
SPAN_ATTACK1, CBAR_ATTACK1,
SPAN_ATTACK2, CBAR_ATTACK2,
SPAN_UNUSED, CBAR_UNUSED,
SPAN_DRAW, CBAR_DRAW,
SPAN_HOLSTER CBAR_HOLSTER
}; };
void void
w_spanner_precache(void) w_spanner_precache(void)
{ {
precache_sound("weapons/cbar_miss1.wav"); #ifdef SSQC
precache_sound("weapons/cbar_hit1.wav"); Sound_Precache("weapon_crowbar.hit");
precache_sound("weapons/cbar_hit2.wav"); Sound_Precache("weapon_crowbar.miss");
precache_sound("weapons/cbar_hitbod1.wav"); Sound_Precache("weapon_crowbar.hitbody");
precache_sound("weapons/cbar_hitbod2.wav"); #endif
precache_sound("weapons/cbar_hitbod3.wav");
precache_model("models/v_tfc_spanner.mdl"); precache_model("models/v_tfc_spanner.mdl");
precache_model("models/backpack.mdl"); precache_model("models/backpack.mdl");
precache_model("models/p_spanner.mdl"); precache_model("models/p_spanner.mdl");
@ -42,9 +41,7 @@ w_spanner_precache(void)
void void
w_spanner_updateammo(player pl) w_spanner_updateammo(player pl)
{ {
#ifdef SSQC w_crowbar_updateammo(pl);
Weapons_UpdateAmmo(pl, -1, -1, -1);
#endif
} }
string string
@ -61,20 +58,20 @@ w_spanner_pmodel(void)
string string
w_spanner_deathmsg(void) w_spanner_deathmsg(void)
{ {
return "%s was assaulted by %s's Crowbar."; return "%s was retooled by %'s Wrench.";
} }
void void
w_spanner_draw(void) w_spanner_draw(void)
{ {
Weapons_SetModel("models/v_tfc_spanner.mdl"); Weapons_SetModel("models/v_tfc_spanner.mdl");
Weapons_ViewAnimation(SPAN_DRAW); Weapons_ViewAnimation(CBAR_DRAW);
} }
void void
w_spanner_holster(void) w_spanner_holster(void)
{ {
Weapons_ViewAnimation(SPAN_HOLSTER); w_crowbar_holster();
} }
void void
@ -100,12 +97,11 @@ w_spanner_primary(void)
pl.w_idle_next = 2.5f; pl.w_idle_next = 2.5f;
#ifdef CSQC #ifdef CSQC
if (random() < 0.5) { if (random() < 0.5) {
Weapons_ViewAnimation(SPAN_ATTACK1); Weapons_ViewAnimation(CBAR_ATTACK1);
} else { } else {
Weapons_ViewAnimation(SPAN_ATTACK2); Weapons_ViewAnimation(CBAR_ATTACK2);
} }
#else #else
if (pl.flags & FL_CROUCHING) { if (pl.flags & FL_CROUCHING) {
Animation_PlayerTopTemp(ANIM_SHOOTCROWBAR, 0.5f); Animation_PlayerTopTemp(ANIM_SHOOTCROWBAR, 0.5f);
@ -113,7 +109,7 @@ w_spanner_primary(void)
Animation_PlayerTopTemp(ANIM_CR_SHOOTCROWBAR, 0.42f); Animation_PlayerTopTemp(ANIM_CR_SHOOTCROWBAR, 0.42f);
} }
sound(pl, CHAN_WEAPON, "weapons/cbar_miss1.wav", 1, ATTN_NORM); Sound_Play(self, CHAN_WEAPON, "weapon_crowbar.miss");
if (trace_fraction >= 1.0) { if (trace_fraction >= 1.0) {
return; return;
@ -127,31 +123,15 @@ w_spanner_primary(void)
} }
if (trace_ent.takedamage) { if (trace_ent.takedamage) {
int r; Damage_Apply(trace_ent, pl, Skill_GetValue("plr_crowbar"), WEAPON_CROWBAR, DMG_BLUNT);
Damage_Apply(trace_ent, self, 10, WEAPON_SPANNER, DMG_BLUNT );
if (!trace_ent.iBleeds) { if (!trace_ent.iBleeds) {
return; return;
} }
r = floor(random(0,3)); Sound_Play(self, CHAN_WEAPON, "weapon_crowbar.hitbody");
switch (r) {
case 0:
sound(pl, 8, "weapons/cbar_hitbod1.wav", 1, ATTN_NORM);
break;
case 1:
sound(pl, 8, "weapons/cbar_hitbod2.wav", 1, ATTN_NORM);
break;
case 2:
sound(pl, 8, "weapons/cbar_hitbod3.wav", 1, ATTN_NORM);
break;
}
} else { } else {
if (random() < 0.5) { Sound_Play(self, CHAN_WEAPON, "weapon_crowbar.hit");
sound(pl, 8, "weapons/cbar_hit1.wav", 1, ATTN_NORM);
} else {
sound(pl, 8, "weapons/cbar_hit2.wav", 1, ATTN_NORM);
}
} }
#endif #endif
} }
@ -159,20 +139,13 @@ w_spanner_primary(void)
void void
w_spanner_release(void) w_spanner_release(void)
{ {
player pl = (player)self; w_crowbar_release();
if (pl.w_idle_next) {
return;
}
Weapons_ViewAnimation(SPAN_IDLE);
pl.w_idle_next = 15.0f;
} }
float float
w_spanner_aimanim(void) w_spanner_aimanim(void)
{ {
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR; return w_crowbar_aimanim();
} }
void void

View file

@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org> * Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019-2020 Gethyn ThomasQuail <xylemon@posteo.net>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -32,10 +33,12 @@ enum
void void
w_taurus_precache(void) w_taurus_precache(void)
{ {
#ifdef SSQC
Sound_Precache("weapon_taurus.fire");
#endif
precache_model("models/v_taurus.mdl"); precache_model("models/v_taurus.mdl");
precache_model("models/w_taurus.mdl"); precache_model("models/w_taurus.mdl");
precache_model("models/p_taurus.mdl"); precache_model("models/p_taurus.mdl");
precache_sound("weapons/tau_fire.wav");
} }
void void
@ -61,7 +64,7 @@ w_taurus_pmodel(void)
string string
w_taurus_deathmsg(void) w_taurus_deathmsg(void)
{ {
return ""; return "%s is seeing blue from %s's Taurus.";
} }
int int
@ -134,7 +137,7 @@ w_taurus_primary(void)
#else #else
pl.taurus_mag--; pl.taurus_mag--;
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 12, [0.01,0,01], WEAPON_TAURUS); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 12, [0.01,0,01], WEAPON_TAURUS);
sound(pl, CHAN_WEAPON, "weapons/tau_fire.wav", 1.0f, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_taurus.fire");
if (self.flags & FL_CROUCHING) if (self.flags & FL_CROUCHING)
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f); Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
@ -219,74 +222,19 @@ w_taurus_release(void)
float float
w_taurus_aimanim(void) w_taurus_aimanim(void)
{ {
return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; return w_glock_aimanim();
} }
void void
w_taurus_hud(void) w_taurus_hud(void)
{ {
#ifdef CSQC w_glock_hud();
vector cross_pos;
vector aicon_pos;
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(
cross_pos,
[24,24],
"sprites/crosshairs.spr_0.tga",
[0.1875,0],
[0.1875, 0.1875],
[1,1,1],
1.0f,
DRAWFLAG_NORMAL
);
HUD_DrawAmmo1();
HUD_DrawAmmo2();
drawsubpic(
aicon_pos,
[24,24],
"sprites/640hud7.spr_0.tga",
[0,72/128],
[24/256, 24/128],
g_hud_color,
pSeat->ammo2_alpha,
DRAWFLAG_ADDITIVE
);
#endif
} }
void void
w_taurus_hudpic(int selected, vector pos, float a) w_taurus_hudpic(int selected, vector pos, float a)
{ {
#ifdef CSQC w_glock_hudpic(selected, pos, a);
if (selected) {
drawsubpic(
pos,
[170,45],
"sprites/640hud4.spr_0.tga",
[0,45/256],
[170/256,45/256],
g_hud_color,
a,
DRAWFLAG_ADDITIVE
);
} else {
drawsubpic(
pos,
[170,45],
"sprites/640hud1.spr_0.tga",
[0,45/256],
[170/256,45/256],
g_hud_color,
a,
DRAWFLAG_ADDITIVE
);
}
#endif
} }
weapon_t w_taurus = weapon_t w_taurus =

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org> * Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -26,61 +26,50 @@ enum
HANDGRENADE_DRAW HANDGRENADE_DRAW
}; };
/* It's just the grenade with a different model, they could void w_tnt_precache(void)
* have just renamed the model itself... why.
*/
void w_handgrenade_precache(void)
{ {
precache_sound("weapons/g_bounce1.wav"); #ifdef SSQC
precache_sound("weapons/g_bounce2.wav"); Sound_Precache("weapon_handgrenade.bounce");
precache_sound("weapons/g_bounce3.wav"); #endif
precache_sound("weapons/g_bounce4.wav");
precache_sound("weapons/g_bounce5.wav");
precache_model("models/v_tnt.mdl"); precache_model("models/v_tnt.mdl");
precache_model("models/w_tnt.mdl"); precache_model("models/w_tnt.mdl");
precache_model("models/p_tnt.mdl"); precache_model("models/p_tnt.mdl");
} }
void w_handgrenade_updateammo(player pl)
void w_tnt_updateammo(player pl)
{ {
#ifdef SSQC w_handgrenade_updateammo(pl);
Weapons_UpdateAmmo(pl, -1, pl.ammo_handgrenade, -1);
#endif
} }
string w_handgrenade_wmodel(void)
string w_tnt_wmodel(void)
{ {
return "models/w_tnt.mdl"; return "models/w_tnt.mdl";
} }
string w_handgrenade_pmodel(void)
string w_tnt_pmodel(void)
{ {
return "models/p_tnt.mdl"; return "models/p_tnt.mdl";
} }
string w_handgrenade_deathmsg(void)
string w_tnt_deathmsg(void)
{ {
return ""; return w_handgrenade_deathmsg();
} }
int w_handgrenade_pickup(int new) int w_tnt_pickup(int new)
{ {
#ifdef SSQC return w_handgrenade_pickup(new);
player pl = (player)self;
if (pl.ammo_handgrenade < MAX_A_HANDGRENADE) {
pl.ammo_handgrenade = bound(0, pl.ammo_handgrenade + 1, MAX_A_HANDGRENADE);
} else {
return FALSE;
}
#endif
return TRUE;
} }
#ifdef SSQC #ifdef SSQC
void w_handgrenade_throw(void) void w_tnt_throw(void)
{ {
static void WeaponFrag_Throw_Explode( void ) static void WeaponFrag_Throw_Explode( void )
{ {
float dmg = Skill_GetValue("plr_hand_grenade");
Effect_CreateExplosion(self.origin); Effect_CreateExplosion(self.origin);
Damage_Radius(self.origin, self.owner, 150, 150 * 2.5f, TRUE, WEAPON_HANDGRENADE); Damage_Radius(self.origin, self.owner, dmg, dmg * 2.5f, TRUE, WEAPON_HANDGRENADE);
sound(self, CHAN_WEAPON, sprintf( "weapons/explode%d.wav", floor( random() * 2 ) + 3 ), 1, ATTN_NORM); sound(self, CHAN_WEAPON, sprintf( "weapons/explode%d.wav", floor( random() * 2 ) + 3 ), 1, ATTN_NORM);
remove(self); remove(self);
} }
@ -89,10 +78,9 @@ void w_handgrenade_throw(void)
{ {
if (other.takedamage == DAMAGE_YES) { if (other.takedamage == DAMAGE_YES) {
Damage_Apply(other, self.owner, 15, WEAPON_HANDGRENADE, DMG_BLUNT); Damage_Apply(other, self.owner, 15, WEAPON_HANDGRENADE, DMG_BLUNT);
} else {
Sound_Play(self, CHAN_BODY, "weapon_handgrenade.bounce");
} }
int r = floor(random(0,6));
string sample = sprintf("weapons/g_bounce%i.wav", r);
sound( self, CHAN_BODY, sample, 1, ATTN_NORM );
self.frame = 0; self.frame = 0;
} }
@ -129,7 +117,7 @@ void w_handgrenade_throw(void)
} }
#endif #endif
void w_handgrenade_draw(void) void w_tnt_draw(void)
{ {
#ifdef CSQC #ifdef CSQC
Weapons_SetModel("models/v_tnt.mdl"); Weapons_SetModel("models/v_tnt.mdl");
@ -137,43 +125,16 @@ void w_handgrenade_draw(void)
#endif #endif
} }
void w_handgrenade_holster(void) void w_tnt_holster(void)
{ {
} }
void w_handgrenade_primary(void) void w_tnt_primary(void)
{ {
player pl = (player)self; w_handgrenade_primary();
if (pl.w_attack_next > 0.0) {
return;
}
/* We're abusing this network variable for the holding check */
if (pl.a_ammo3 > 0) {
return;
}
/* Ammo check */
#ifdef CSQC
if (pl.a_ammo2 <= 0) {
return;
}
#else
if (pl.ammo_handgrenade <= 0) {
return;
}
#endif
#ifdef CSQC
Weapons_ViewAnimation(HANDGRENADE_PULLPIN);
#endif
pl.a_ammo3 = 1;
pl.w_attack_next = 0.5f;
pl.w_idle_next = 0.5f;
} }
void w_handgrenade_hud(void) void w_tnt_hud(void)
{ {
#ifdef CSQC #ifdef CSQC
HUD_DrawAmmo2(); HUD_DrawAmmo2();
@ -183,7 +144,7 @@ void w_handgrenade_hud(void)
} }
void w_handgrenade_release(void) void w_tnt_release(void)
{ {
player pl = (player)self; player pl = (player)self;
@ -197,7 +158,7 @@ void w_handgrenade_release(void)
Weapons_ViewAnimation(HANDGRENADE_THROW1); Weapons_ViewAnimation(HANDGRENADE_THROW1);
#else #else
pl.ammo_handgrenade--; pl.ammo_handgrenade--;
w_handgrenade_throw(); w_tnt_throw();
#endif #endif
pl.a_ammo3 = 2; pl.a_ammo3 = 2;
pl.w_attack_next = 1.0f; pl.w_attack_next = 1.0f;
@ -213,54 +174,51 @@ void w_handgrenade_release(void)
pl.w_attack_next = 0.5f; pl.w_attack_next = 0.5f;
pl.w_idle_next = 0.5f; pl.w_idle_next = 0.5f;
pl.a_ammo3 = 0; pl.a_ammo3 = 0;
} else {
int r = (float)input_sequence % 8;
if (r == 1) {
Weapons_ViewAnimation(HANDGRENADE_FIDGET);
pl.w_idle_next = 2.5f;
} else {
Weapons_ViewAnimation(HANDGRENADE_IDLE);
pl.w_idle_next = 3.0f;
}
} }
} }
float float
w_handgrenade_aimanim(void) w_tnt_aimanim(void)
{ {
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR; return w_handgrenade_aimanim();
} }
void void
w_handgrenade_hudpic(int s, vector pos, float a) w_tnt_hudpic(int selected, vector pos, float a)
{ {
#ifdef CSQC w_handgrenade_hudpic(selected, pos, a);
if (s) {
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
} else {
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
}
#endif
} }
weapon_t w_handgrenade = weapon_t w_tnt =
{ {
ITEM_HANDGRENADE, .id = ITEM_HANDGRENADE,
4, .slot = 4,
0, .slot_pos = 0,
"sprites/640hud1.spr_0.tga", .ki_spr = "sprites/640hud1.spr_0.tga",
[32,16], .ki_size = [32,16],
[192,160], .ki_xy = [192,160],
w_handgrenade_draw, .draw = w_tnt_draw,
w_handgrenade_holster, .holster = w_tnt_holster,
w_handgrenade_primary, .primary = w_tnt_primary,
w_handgrenade_release, .secondary = w_tnt_release,
w_handgrenade_release, .reload = w_tnt_release,
w_handgrenade_release, .release = w_tnt_release,
w_handgrenade_hud, .crosshair = w_tnt_hud,
w_handgrenade_precache, .precache = w_tnt_precache,
w_handgrenade_pickup, .pickup = w_tnt_pickup,
w_handgrenade_updateammo, .updateammo = w_tnt_updateammo,
w_handgrenade_wmodel, .wmodel = w_tnt_wmodel,
w_handgrenade_pmodel, .pmodel = w_tnt_pmodel,
w_handgrenade_deathmsg, .deathmsg = w_tnt_deathmsg,
w_handgrenade_aimanim, .aimanim = w_tnt_aimanim,
w_handgrenade_hudpic .hudpic = w_tnt_hudpic
}; };
#ifdef SSQC
void weapon_handgrenade(void) {
Weapons_InitItem(WEAPON_HANDGRENADE);
}
#endif

View file

@ -20,7 +20,7 @@ weapon_t g_weapons[] = {
w_crowbar, w_crowbar,
w_shovel, w_shovel,
w_spanner, w_spanner,
w_glock, w_silencer,
w_python, w_python,
w_ap9, w_ap9,
w_taurus, w_taurus,
@ -33,7 +33,7 @@ weapon_t g_weapons[] = {
w_gauss, w_gauss,
w_flame, w_flame,
w_chaingun, w_chaingun,
w_handgrenade, w_tnt,
w_satchel, w_satchel,
w_tripmine, w_tripmine,
w_snark, w_snark,

View file

@ -32,7 +32,7 @@ enum
WEAPON_SNIPER2, WEAPON_SNIPER2,
WEAPON_RPG, WEAPON_RPG,
WEAPON_GAUSS, WEAPON_GAUSS,
WEAPON_FLAME, WEAPON_EGON,
WEAPON_CHAINGUN, WEAPON_CHAINGUN,
WEAPON_HANDGRENADE, WEAPON_HANDGRENADE,
WEAPON_SATCHEL, WEAPON_SATCHEL,
@ -57,4 +57,4 @@ enum
#define MAX_A_TRIPMINE 10 #define MAX_A_TRIPMINE 10
#define MAX_A_SNARK 10 #define MAX_A_SNARK 10
#define MAX_A_HORNET 8 #define MAX_A_HORNET 8
#define MAX_A_MEDKIT 12 #define MAX_A_MEDKIT 12

View file

@ -75,7 +75,6 @@ float Math_CRandom( void ) {
} }
#if defined(SSQC) || defined(CSQC) #if defined(SSQC) || defined(CSQC)
//.vector basevelocity;
int QPhysics_IsStuck( entity eTarget, vector vOffset, vector vecMins, vector vecMaxs ) int QPhysics_IsStuck( entity eTarget, vector vOffset, vector vecMins, vector vecMaxs )
{ {
if ( eTarget.solid != SOLID_SLIDEBOX ) { if ( eTarget.solid != SOLID_SLIDEBOX ) {
@ -92,7 +91,6 @@ void QPhysics_Run ( entity eTarget )
self = eTarget; self = eTarget;
float flFallVel = ( self.flags & FL_ONGROUND ) ? 0 : -self.velocity[2]; float flFallVel = ( self.flags & FL_ONGROUND ) ? 0 : -self.velocity[2];
#ifdef CSTRIKE #ifdef CSTRIKE
self.maxspeed = Game_GetMaxSpeed( self ); self.maxspeed = Game_GetMaxSpeed( self );
#endif #endif

View file

@ -15,8 +15,8 @@
*/ */
#define PHY_JUMP_CHAINWINDOW 0.5 #define PHY_JUMP_CHAINWINDOW 0.5
#define PHY_JUMP_CHAIN 100 #define PHY_JUMP_CHAIN 100
#define PHY_JUMP_CHAINDECAY 50 #define PHY_JUMP_CHAINDECAY 50
/* FIXME: jumptime should use the time global, as time intervals are not /* FIXME: jumptime should use the time global, as time intervals are not
* predictable - decrement it based upon input_timelength */ * predictable - decrement it based upon input_timelength */
@ -102,12 +102,12 @@ PMove_Categorize(void)
self.view_ofs = VEC_PLAYER_VIEWPOS; self.view_ofs = VEC_PLAYER_VIEWPOS;
} }
tracebox(self.origin, self.mins, self.maxs, self.origin - [0,0,0.25], tracebox(self.origin, self.mins, self.maxs, self.origin - [0,0,0.25], FALSE, self);
FALSE, self);
if (!trace_startsolid) { if (!trace_startsolid) {
if ((trace_fraction < 1) && (trace_plane_normal[2] > 0.7)) { if ((trace_fraction < 1) && (trace_plane_normal[2] > 0.7)) {
self.flags |= FL_ONGROUND; self.flags |= FL_ONGROUND;
self.flags &= ~FL_WATERJUMP;
self.groundentity = trace_ent; self.groundentity = trace_ent;
if (self.groundentity) { if (self.groundentity) {
@ -118,8 +118,8 @@ PMove_Categorize(void)
} }
} }
if (self.basevelocity[2] > 0) /*if (self.basevelocity[2] > 0)
self.flags &= ~FL_ONGROUND; self.flags &= ~FL_ONGROUND;*/
/* ladder content testing */ /* ladder content testing */
int oldhitcontents = self.hitcontentsmaski; int oldhitcontents = self.hitcontentsmaski;
@ -258,7 +258,7 @@ PMove_CheckWaterJump(void)
traceline(vStart, vEnd, TRUE, self); traceline(vStart, vEnd, TRUE, self);
if (trace_fraction == 1) { if (trace_fraction == 1) {
//self.flags = self.flags | FL_WATERJUMP; self.flags |= FL_WATERJUMP;
self.velocity[2] = 350; self.velocity[2] = 350;
self.flags &= ~FL_JUMPRELEASED; self.flags &= ~FL_JUMPRELEASED;
return; return;
@ -390,7 +390,6 @@ void
PMove_AccelFriction(float move_time, float premove, vector wish_dir, float wish_speed) PMove_AccelFriction(float move_time, float premove, vector wish_dir, float wish_speed)
{ {
float flFriction; float flFriction;
vector vecWishVel;
vector vecTemp; vector vecTemp;
// friction // friction
@ -459,10 +458,16 @@ PMove_AccelJump(float move_time, float premove)
float flJumptimeDelta; float flJumptimeDelta;
float flChainBonus; float flChainBonus;
if (!(self.flags & FL_ONGROUND)) /* unset jump-key whenever it's not set */
if (!(input_buttons & INPUT_BUTTON2)) {
self.flags |= FL_JUMPRELEASED;
return; return;
}
if (self.flags & FL_WATERJUMP) if (self.flags & FL_WATERJUMP)
return; return;
if (!(self.flags & FL_ONGROUND))
return;
if (!(self.flags & FL_JUMPRELEASED)) if (!(self.flags & FL_JUMPRELEASED))
return; return;
@ -480,6 +485,7 @@ PMove_AccelJump(float move_time, float premove)
self.velocity[2] = 50; self.velocity[2] = 50;
} }
} else { } else {
/* Half-Life: Longjump module */
#ifdef VALVE #ifdef VALVE
if (self.flags & FL_CROUCHING && Items_CheckItem(self, 0x00008000)) { if (self.flags & FL_CROUCHING && Items_CheckItem(self, 0x00008000)) {
self.velocity = v_forward * 512; self.velocity = v_forward * 512;
@ -507,23 +513,22 @@ PMove_Acceleration(float move_time, float premove)
vector vecWishVel; vector vecWishVel;
vector wish_dir; vector wish_dir;
float wish_speed; float wish_speed;
float flFriction;
self.jumptime -= move_time; self.jumptime -= move_time;
self.teleport_time -= move_time; self.teleport_time -= move_time;
makevectors(input_angles); makevectors(input_angles);
/* figure out where we are in the world */
PMove_Categorize(); PMove_Categorize();
/* everything but MOVETYPE_NOCLIP has acceleration */
if (self.movetype != MOVETYPE_NOCLIP) { if (self.movetype != MOVETYPE_NOCLIP) {
if (self.movetype == MOVETYPE_TOSS) { if (self.movetype == MOVETYPE_TOSS) {
PMove_AccelToss(move_time, premove); PMove_AccelToss(move_time, premove);
return; return;
} } else if (self.movetype == MOVETYPE_WALK) {
if (self.movetype == MOVETYPE_WALK) {
PMove_AccelMove(move_time, premove); PMove_AccelMove(move_time, premove);
} }
if (self.waterlevel >= 2) { if (self.waterlevel >= 2) {
@ -531,11 +536,12 @@ PMove_Acceleration(float move_time, float premove)
} }
} }
if (self.teleport_time > 0 && input_movevalues[0] < 0) { /*if (self.teleport_time > 0 && input_movevalues[0] < 0) {
vecWishVel = v_right * input_movevalues[1]; vecWishVel = v_right * input_movevalues[1];
} else { } else */ {
/* on the ground, only yaw matters in terms of direction */
if (self.flags & FL_ONGROUND) { if (self.flags & FL_ONGROUND) {
makevectors (input_angles[1] * [0,1,0]); makevectors(input_angles[1] * [0,1,0]);
} }
vecWishVel = v_forward * input_movevalues[0] + v_right * input_movevalues[1]; vecWishVel = v_forward * input_movevalues[0] + v_right * input_movevalues[1];
} }
@ -559,11 +565,6 @@ PMove_Acceleration(float move_time, float premove)
} else { } else {
PMove_AccelJump(move_time, premove); PMove_AccelJump(move_time, premove);
/* unset jump-key whenever it's not set */
if (!(input_buttons & INPUT_BUTTON2)) {
self.flags |= FL_JUMPRELEASED;
}
if (self.flags & FL_ONLADDER) { if (self.flags & FL_ONLADDER) {
PMove_AccelLadder(move_time, premove, wish_dir, wish_speed); PMove_AccelLadder(move_time, premove, wish_dir, wish_speed);
} else if (self.flags & FL_ONGROUND) { } else if (self.flags & FL_ONGROUND) {
@ -574,6 +575,7 @@ PMove_Acceleration(float move_time, float premove)
} }
} }
/* touch other solid entities */
void void
PMove_DoTouch(entity tother) PMove_DoTouch(entity tother)
{ {
@ -634,14 +636,14 @@ PMove_Move(void)
return; return;
} }
/* hacky attempt at base-velocity, this needs to be cleared/wiped at the end */
if (!(self.flags & FL_ONGROUND)) { if (!(self.flags & FL_ONGROUND)) {
self.basevelocity[2] = 0; self.basevelocity[2] = 0;
} }
self.velocity += self.basevelocity; self.velocity += self.basevelocity;
/* we need to bounce off surfaces (in order to slide along them), /* we need to bounce off surfaces (in order to slide along them),
* so we need at 2 attempts * so we need at 2 attempts */
*/
for (i = 3, move_time = input_timelength; move_time > 0 && i; i--) { for (i = 3, move_time = input_timelength; move_time > 0 && i; i--) {
dest = self.origin + (self.velocity * move_time); dest = self.origin + (self.velocity * move_time);
@ -730,8 +732,10 @@ PMove_Move(void)
} }
}*/ }*/
PMove_DoTouch(trace_ent); PMove_DoTouch(trace_ent);
self.groundentity = trace_ent;
} }
/* make sure that the basevelocity we've applied is discarded by next frame */
self.velocity -= self.basevelocity; self.velocity -= self.basevelocity;
} }
@ -741,22 +745,29 @@ PMove_Run(void)
{ {
float punch; float punch;
player pl = (player)self; player pl = (player)self;
#ifdef VALVE
/* maxspeed changes when crouching, TODO: make this game-specific */
self.maxspeed = (self.flags & FL_CROUCHING) ? 135 : 270; self.maxspeed = (self.flags & FL_CROUCHING) ? 135 : 270;
/* when pressing the 'use' button, we also walk slower for precision */
if (input_buttons & INPUT_BUTTON5) { if (input_buttons & INPUT_BUTTON5) {
input_movevalues *= 0.25; input_movevalues *= 0.25;
} }
#endif
/* establish which water elements we're dealing in */
PMove_WaterMove(); PMove_WaterMove();
/* we might need to apply extra-velocity to get out of water-volumes */
if (self.waterlevel >= 2) { if (self.waterlevel >= 2) {
PMove_CheckWaterJump(); PMove_CheckWaterJump();
} }
/* move camera up (noclip, fly) when holding jump */
if (input_buttons & INPUT_BUTTON2) { if (input_buttons & INPUT_BUTTON2) {
input_movevalues[2] = 240; input_movevalues[2] = 240;
} }
/* move camera down (noclip, fly) when holding crouching */
if (input_buttons & INPUT_BUTTON8) { if (input_buttons & INPUT_BUTTON8) {
input_movevalues[2] = -240; input_movevalues[2] = -240;
} }
@ -769,8 +780,7 @@ PMove_Run(void)
/* call accelerate before and after the actual move, /* call accelerate before and after the actual move,
* with half the move each time. this reduces framerate dependence. * with half the move each time. this reduces framerate dependence.
* and makes controlling jumps slightly easier * and makes controlling jumps slightly easier */
*/
PMove_Acceleration(input_timelength / 2, TRUE); PMove_Acceleration(input_timelength / 2, TRUE);
PMove_Move(); PMove_Move();
PMove_Acceleration(input_timelength / 2, FALSE); PMove_Acceleration(input_timelength / 2, FALSE);
@ -783,18 +793,18 @@ PMove_Run(void)
self.basevelocity = [0,0,0]; self.basevelocity = [0,0,0];
self.groundentity = __NULL__; self.groundentity = __NULL__;
touchtriggers(); /* timers, these are predicted and shared across client and server */
#ifdef VALVE
pl.w_attack_next = max(0, pl.w_attack_next - input_timelength); pl.w_attack_next = max(0, pl.w_attack_next - input_timelength);
pl.w_idle_next = max(0, pl.w_idle_next - input_timelength); pl.w_idle_next = max(0, pl.w_idle_next - input_timelength);
#endif
pl.weapontime += input_timelength; pl.weapontime += input_timelength;
punch = max(0, 1.0f - (input_timelength * 4)); punch = max(0, 1.0f - (input_timelength * 4));
pl.punchangle[0] *= punch; pl.punchangle[0] *= punch;
pl.punchangle[1] *= punch; pl.punchangle[1] *= punch;
pl.punchangle[2] *= punch; pl.punchangle[2] *= punch;
/* weapon/item logic of what the player controls */
Game_Input(); Game_Input();
/* activate any SOLID_TRIGGER entities */
touchtriggers();
} }

View file

@ -20,7 +20,7 @@
#define ITEM_SHOTGUN 0x00000008i #define ITEM_SHOTGUN 0x00000008i
#define ITEM_CMLWBR 0x00000010i #define ITEM_CMLWBR 0x00000010i
#define ITEM_XS 0x00000020i #define ITEM_XS 0x00000020i
#define ITEM_PIPEBOMB 0x00000040i #define ITEM_SATCHEL 0x00000040i
#define ITEM_UNUSED8 0x00000080i #define ITEM_UNUSED8 0x00000080i
#define ITEM_UNUSED9 0x00000100i #define ITEM_UNUSED9 0x00000100i

View file

@ -0,0 +1,114 @@
/*
* Copyright (c) 2016-2019 Marco Hladik <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.
*/
int input_sequence;
class player:CBaseEntity
{
float health;
float armor;
/* When the weapon is done firing */
float w_attack_next;
/* When to play the next idle animation */
float w_idle_next;
/* Magazine/Clip */
int a_ammo1;
/* Rest in the inventory */
int a_ammo2;
/* Special ammo */
int a_ammo3;
/* We can't use the default .items field, because FTE will assume
* effects of some bits. Such as invisibility, quad, etc.
* also, modders probably want 32 bits for items. */
int g_items;
float activeweapon;
float viewzoom;
vector punchangle;
vector view_ofs;
float weapontime;
/* any mods that use hooks */
entity hook;
/* Weapon specific */
int bradnailer_mag;
int nailgun_mag;
int shotgun_mag;
int cmlwbr_mag;
int xs_mag;
int satchel_chg;
#ifdef CSQC
/* External model */
entity p_model;
int p_hand_bone;
int p_model_bone;
float pitch;
float lastweapon;
/* Prediction */
vector net_origin;
vector net_velocity;
float net_flags;
float net_w_attack_next;
float net_w_idle_next;
float net_jumptime;
float net_teleport_time;
float net_weapontime;
float net_viewzoom;
vector net_punchangle;
int net_ammo1;
int net_ammo2;
int net_ammo3;
int sequence;
virtual void() gun_offset;
virtual void() draw;
virtual float() predraw;
virtual void() postdraw;
#else
int ammo_nail;
int ammo_buckshot;
int ammo_bolts;
int ammo_xencandy;
int ammo_satchel;
/* conditional networking */
int old_modelindex;
vector old_origin;
vector old_angles;
vector old_velocity;
int old_flags;
int old_activeweapon;
int old_items;
int old_health;
int old_armor;
int old_movetype;
float old_viewofs;
int old_baseframe;
int old_frame;
int old_a_ammo1;
int old_a_ammo2;
int old_a_ammo3;
virtual void(int) Pain;
virtual void(int) Death;
#endif
};

View file

@ -14,6 +14,15 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/*QUAKED weapon_bradnailer (0 0 1) (-16 -16 0) (16 16 32)
"model" "models/w_bradnailer.mdl"
Poke646 (2001) ENTITY
Handheld Nailgun that kills like a pistol
*/
enum enum
{ {
BNAIL_IDLE1, BNAIL_IDLE1,
@ -34,10 +43,10 @@ enum
void void
w_bradnailer_precache(void) w_bradnailer_precache(void)
{ {
precache_sound("weapons/brad_hit1.wav"); #ifdef SSQC
precache_sound("weapons/brad_hit2.wav"); Sound_Precache("weapon_bradnailer.fire");
precache_sound("weapons/bradnailer.wav"); Sound_Precache("weapon_bradnailer.hitbody");
#endif
precache_model("models/nail.mdl"); precache_model("models/nail.mdl");
precache_model("models/v_bradnailer.mdl"); precache_model("models/v_bradnailer.mdl");
@ -48,7 +57,7 @@ void
w_bradnailer_updateammo(player pl) w_bradnailer_updateammo(player pl)
{ {
#ifdef SSQC #ifdef SSQC
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__); Weapons_UpdateAmmo(pl, pl.bradnailer_mag, pl.ammo_nail, -1);
#endif #endif
} }

View file

@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org> * Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
* Copyright (c) 2019-2020 Gethyn ThomasQuail <xylemon@posteo.net>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -14,61 +15,68 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/*QUAKED weapon_pipebomb (0 0 1) (-16 -16 0) (16 16 32)
"model" "models/w_pipebomb.mdl"
Poke646 (2001) ENTITY
Pipebomb Weapon, literal copy of Half-Life's Satchel Weapon
*/
enum enum
{ {
PIPEB_IDLE, SATCHEL_IDLE,
PIPEB_FIDGET, SATCHEL_FIDGET,
PIPEB_DRAW, SATCHEL_DRAW,
PIPEB_THROW SATCHEL_THROW
}; };
enum enum
{ {
WATCH_IDLE, RADIO_IDLE,
WATCH_FIDGET, RADIO_FIDGET,
WATCH_DRAW, RADIO_DRAW,
WATCH_USE, RADIO_USE,
WATCH_HOLSTER RADIO_HOLSTER
}; };
void w_pipebomb_updateammo(player pl) void w_pipebomb_updateammo(player pl)
{ {
#ifdef SSQC w_satchel_updateammo(pl);
Weapons_UpdateAmmo(pl, pl.satchel_chg, pl.ammo_satchel, __NULL__);
#endif
} }
string w_pipebomb_wmodel(void) string w_pipebomb_wmodel(void)
{ {
return "models/w_pipebomb.mdl"; return "models/w_pipebomb.mdl";
} }
string w_pipebomb_pmodel(void)
{
return "models/p_pipebomb.mdl";
}
string w_pipebomb_deathmsg(void)
{
return "%s blew up %s with a pipebomb.";
}
void w_pipebomb_precache(void) void w_pipebomb_precache(void)
{ {
precache_sound("weapons/pb_bounce1.wav"); #ifdef SSQC
precache_sound("weapons/pb_bounce2.wav"); precache_sound("weapons/pb_bounce3.wav"); Sound_Precache("weapon_satchel.bounce");
#endif
precache_model("models/w_pipebomb.mdl");
precache_model("models/v_pipebomb.mdl"); precache_model("models/v_pipebomb.mdl");
precache_model("models/v_pipebomb_watch.mdl"); precache_model("models/v_pipebomb_watch.mdl");
precache_model("models/w_pipebomb.mdl"); precache_model("models/p_pipebomb.mdl");
} }
int w_pipebomb_pickup(int new) int w_pipebomb_pickup(int new)
{ {
#ifdef SSQC return w_satchel_pickup(new);
player pl = (player)self;
if (pl.ammo_satchel < 5) {
pl.ammo_satchel = bound(0, pl.ammo_satchel + 1, 5);
} else {
return FALSE;
}
#endif
return TRUE;
} }
void w_pipebomb_draw(void) void w_pipebomb_draw(void)
{ {
Weapons_SetModel("models/v_pipebomb.mdl"); Weapons_SetModel("models/v_pipebomb.mdl");
Weapons_ViewAnimation(PIPEB_DRAW); Weapons_ViewAnimation(SATCHEL_DRAW);
#ifdef SSQC #ifdef SSQC
player pl = (player)self; player pl = (player)self;
Weapons_UpdateAmmo(pl, pl.satchel_chg, pl.ammo_satchel, __NULL__); Weapons_UpdateAmmo(pl, pl.satchel_chg, pl.ammo_satchel, __NULL__);
@ -83,6 +91,11 @@ void w_pipebomb_holster(void)
#ifdef SSQC #ifdef SSQC
void s_pipebomb_drop(entity master, vector src, vector vel) void s_pipebomb_drop(entity master, vector src, vector vel)
{ {
static void s_pipebomb_touch(void)
{
if (other == world)
Sound_Play(self, CHAN_BODY, "weapon_satchel.bounce");
}
entity satch; entity satch;
satch = spawn(); satch = spawn();
satch.owner = master; satch.owner = master;
@ -94,7 +107,8 @@ void s_pipebomb_drop(entity master, vector src, vector vel)
satch.friction = 0.8f; satch.friction = 0.8f;
satch.velocity = vel; satch.velocity = vel;
satch.avelocity = [0,400,0]; satch.avelocity = [0,400,0];
setmodel(satch, "models/w_pipebomb.mdl"); satch.touch = s_pipebomb_touch;
setmodel(satch, "models/w_satchel.mdl");
setsize(satch, [-4,-4,-4], [4,4,4]); setsize(satch, [-4,-4,-4], [4,4,4]);
setorigin(satch, src); setorigin(satch, src);
} }
@ -102,8 +116,9 @@ void s_pipebomb_detonate(entity master)
{ {
for (entity b = world; (b = find(b, ::classname, "satchel"));) { for (entity b = world; (b = find(b, ::classname, "satchel"));) {
if (b.owner == master) { if (b.owner == master) {
float dmg = Skill_GetValue("plr_satchel");
Effect_CreateExplosion(b.origin); Effect_CreateExplosion(b.origin);
Damage_Radius(b.origin, master, 150, 150 * 2.5f, TRUE, WEAPON_PIPEBOMB); Damage_Radius(b.origin, master, dmg, dmg * 2.5f, TRUE, WEAPON_SATCHEL);
sound(b, CHAN_WEAPON, sprintf( "weapons/explode%d.wav", floor( random() * 2 ) + 3 ), 1, ATTN_NORM); sound(b, CHAN_WEAPON, sprintf( "weapons/explode%d.wav", floor( random() * 2 ) + 3 ), 1, ATTN_NORM);
remove(b); remove(b);
} }
@ -131,9 +146,9 @@ void w_pipebomb_primary(void)
#endif #endif
if (pl.a_ammo1 <= 0) { if (pl.a_ammo1 <= 0) {
Weapons_ViewAnimation(WATCH_DRAW); Weapons_ViewAnimation(RADIO_DRAW);
} else { } else {
Weapons_ViewAnimation(WATCH_USE); Weapons_ViewAnimation(RADIO_USE);
} }
#ifdef SSQC #ifdef SSQC
@ -150,7 +165,7 @@ void w_pipebomb_primary(void)
pl.satchel_chg = 0; pl.satchel_chg = 0;
if (pl.ammo_satchel <= 0) { if (pl.ammo_satchel <= 0) {
Weapons_RemoveItem(pl, WEAPON_PIPEBOMB); Weapons_RemoveItem(pl, WEAPON_SATCHEL);
} }
} }
Weapons_UpdateAmmo(pl, pl.satchel_chg, pl.ammo_satchel, __NULL__); Weapons_UpdateAmmo(pl, pl.satchel_chg, pl.ammo_satchel, __NULL__);
@ -196,54 +211,34 @@ void w_pipebomb_secondary(void)
setmodel(pSeat->eViewModel, "models/v_pipebomb_watch.mdl"); setmodel(pSeat->eViewModel, "models/v_pipebomb_watch.mdl");
#endif #endif
Weapons_ViewAnimation(WATCH_DRAW); Weapons_ViewAnimation(RADIO_DRAW);
pl.w_attack_next = 1.0f; pl.w_attack_next = 1.0f;
pl.w_idle_next = 2.5f; pl.w_idle_next = 2.5f;
} }
void void w_pipebomb_reload(void)
w_pipebomb_reload(void)
{ {
} }
void void w_pipebomb_release(void)
w_pipebomb_release(void)
{ {
player pl = (player)self; w_satchel_release();
if (pl.w_idle_next > 0.0) {
return;
}
if (pl.a_ammo1 <= 0) {
Weapons_ViewAnimation(PIPEB_FIDGET);
} else {
Weapons_ViewAnimation(WATCH_FIDGET);
}
pl.w_idle_next = 15.0f;
} }
float float w_pipebomb_aimanim(void)
w_pipebomb_aimanim(void)
{ {
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSQUEAK : ANIM_AIMSQUEAK; return w_satchel_aimanim();
} }
void void w_pipebomb_hud(void)
w_pipebomb_hud(void) {
w_satchel_holster();
}
void w_pipebomb_hudpic(int selected, vector pos, float a)
{ {
#ifdef CSQC #ifdef CSQC
HUD_DrawAmmo2(); if (selected) {
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], "sprites/640hud7.spr_0.tga", [72/256,96/128], [24/256, 24/128], g_hud_color, pSeat->ammo2_alpha, DRAWFLAG_ADDITIVE);
#endif
}
void
w_pipebomb_hudpic(int s, vector pos, float a)
{
#ifdef CSQC
if (s) {
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE); drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
} else { } else {
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE); drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
@ -253,9 +248,9 @@ w_pipebomb_hudpic(int s, vector pos, float a)
weapon_t w_pipebomb = weapon_t w_pipebomb =
{ {
.id = ITEM_PIPEBOMB, .id = ITEM_SATCHEL,
.slot = 4, .slot = 4,
.slot_pos = 0, .slot_pos = 1,
.ki_spr = __NULL__, .ki_spr = __NULL__,
.ki_size = __NULL__, .ki_size = __NULL__,
.ki_xy = __NULL__, .ki_xy = __NULL__,
@ -265,20 +260,19 @@ weapon_t w_pipebomb =
.secondary = w_pipebomb_secondary, .secondary = w_pipebomb_secondary,
.reload = __NULL__, .reload = __NULL__,
.release = w_pipebomb_release, .release = w_pipebomb_release,
.crosshair = __NULL__, .crosshair = w_pipebomb_hud,
.precache = w_pipebomb_precache, .precache = w_pipebomb_precache,
.pickup = __NULL__, .pickup = w_pipebomb_pickup,
.updateammo = w_pipebomb_updateammo, .updateammo = w_pipebomb_updateammo,
.wmodel = w_pipebomb_wmodel, .wmodel = w_pipebomb_wmodel,
.pmodel = __NULL__, .pmodel = __NULL__,
.deathmsg = __NULL__, .deathmsg = __NULL__,
.aimanim = __NULL__, .aimanim = w_pipebomb_aimanim,
.hudpic = w_pipebomb_hudpic .hudpic = w_pipebomb_hudpic
}; };
#ifdef SSQC #ifdef SSQC
void weapon_pipebomb(void) { void weapon_pipebomb(void) {
Weapons_InitItem(WEAPON_PIPEBOMB); Weapons_InitItem(WEAPON_SATCHEL);
} }
#endif #endif

View file

@ -247,7 +247,7 @@ weapon_t w_shotgun =
{ {
.id = ITEM_SHOTGUN, .id = ITEM_SHOTGUN,
.slot = 2, .slot = 2,
.slot_pos = 0, .slot_pos = 1,
.ki_spr = __NULL__, .ki_spr = __NULL__,
.ki_size = __NULL__, .ki_size = __NULL__,
.ki_xy = __NULL__, .ki_xy = __NULL__,

View file

@ -24,5 +24,11 @@ enum
WEAPON_SHOTGUN, WEAPON_SHOTGUN,
WEAPON_CMLWBR, WEAPON_CMLWBR,
WEAPON_XS, WEAPON_XS,
WEAPON_PIPEBOMB WEAPON_SATCHEL
}; };
#define MAX_A_NAIL 250
#define MAX_A_BUCKSHOT 125
#define MAX_A_BOLT 50
#define MAX_A_XENCANDY 15
#define MAX_A_SATCHEL 5

View file

@ -42,15 +42,18 @@ enum
void void
w_crossbow_precache(void) w_crossbow_precache(void)
{ {
#ifdef SSQC
Sound_Precache("weapon_crossbow.fire");
Sound_Precache("weapon_crossbow.hit");
Sound_Precache("weapon_crossbow.hitbody");
Sound_Precache("weapon_crossbow.reload");
#endif
precache_model("models/crossbow_bolt.mdl"); precache_model("models/crossbow_bolt.mdl");
precache_model("models/v_crossbow.mdl"); precache_model("models/v_crossbow.mdl");
precache_model("models/w_crossbow.mdl"); precache_model("models/w_crossbow.mdl");
precache_model("models/p_crossbow.mdl"); precache_model("models/p_crossbow.mdl");
precache_sound("weapons/xbow_reload1.wav"); precache_sound("weapons/xbow_reload1.wav");
precache_sound("weapons/xbow_fire1.wav"); precache_sound("weapons/xbow_fire1.wav");
precache_sound("weapons/xbow_hit1.wav");
precache_sound("weapons/xbow_hitbod1.wav");
precache_sound("weapons/xbow_hitbod2.wav");
} }
void void
@ -134,18 +137,14 @@ void Crossbolt_Touch(void) {
/* walls, etc. */ /* walls, etc. */
if (other.takedamage != DAMAGE_YES) { if (other.takedamage != DAMAGE_YES) {
Effect_CreateSpark(self.origin, trace_plane_normal); Effect_CreateSpark(self.origin, trace_plane_normal);
sound(self, 1, "weapons/xbow_hit1.wav", 1.0f, ATTN_NORM); Sound_Play(self, 1, "weapon_crossbow.hit");
remove(self); remove(self);
return; return;
} }
/* anything else that can take damage */ /* anything else that can take damage */
Damage_Apply(other, self.owner, Skill_GetValue("plr_xbow_bolt_monster"), WEAPON_CROSSBOW, DMG_BLUNT); Damage_Apply(other, self.owner, Skill_GetValue("plr_xbow_bolt_monster"), WEAPON_CROSSBOW, DMG_BLUNT);
if (random() < 0.5) { Sound_Play(self, 1, "weapon_crossbow.hitbody");
sound(self, 1, "weapons/xbow_hitbod1.wav", 1.0f, ATTN_NORM);
} else {
sound(self, 1, "weapons/xbow_hitbod2.wav", 1.0f, ATTN_NORM);
}
if (other.iBleeds == FALSE) { if (other.iBleeds == FALSE) {
Effect_CreateSpark(self.origin, trace_plane_normal); Effect_CreateSpark(self.origin, trace_plane_normal);
@ -206,10 +205,10 @@ w_crossbow_primary(void)
pl.crossbow_mag--; pl.crossbow_mag--;
if (pl.crossbow_mag > 0) { if (pl.crossbow_mag > 0) {
sound(pl, 8, "weapons/xbow_reload1.wav", 1.0f, ATTN_NORM); Sound_Play(pl, 8, "weapon_crossbow.hitbody");
} }
sound(pl, CHAN_WEAPON, "weapons/xbow_fire1.wav", 1.0f, ATTN_NORM); Sound_Play(pl, CHAN_WEAPON, "weapon_crossbow.fire");
Weapons_UpdateAmmo(pl, pl.crossbow_mag, pl.ammo_bolt, -1); Weapons_UpdateAmmo(pl, pl.crossbow_mag, pl.ammo_bolt, -1);
#endif #endif

View file

@ -0,0 +1,48 @@
r_part view_spark
{
type texturedspark
texture ball
scale 1
count 4
scalefactor 1
alpha 0.5
die 0.8
rgb 255 180 0
blend add
spawnmode ball
spawnvel 15
veladd 150
gravity 800
}
r_part gunsmoke
{
texture ball
count 1
scale 16
die 1
rgb 25 25 25
spawnmode ball
blend add
gravity -50
veladd -20
spawnorg 0.25
randomvel 2.25 -15
scalefactor 1
}
r_part gunsmoke2
{
texture ball
count 1
scale 64
die 5 3
rgb 255 255 255
alpha 0.1
blend add
spawnmode ball
gravity -20
viewspace 0.9
spawnorg 0.1
randomvel -1 -15
}

View file

@ -0,0 +1,9 @@
ammo.pickup
{
sample items/9mmclip1.wav
}
ammo.respawn
{
sample items/suitchargeok1.wav
}

View file

@ -9,6 +9,27 @@ weapon_357.reload
sample weapons/357_reload1.wav sample weapons/357_reload1.wav
} }
weapon_crossbow.fire
{
sample weapons/xbow_fire1.wav
}
weapon_crossbow.hit
{
sample weapons/xbow_hit1.wav
}
weapon_crossbow.hitbody
{
sample weapons/xbow_hitbod1.wav
sample weapons/xbow_hitbod2.wav
}
weapon_crossbow.reload
{
sample weapons/xbow_reload1.wav
}
weapon_crowbar.hit weapon_crowbar.hit
{ {
sample weapons/cbar_hit1.wav sample weapons/cbar_hit1.wav

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.