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:
parent
07a3b329df
commit
755eecfc34
58 changed files with 1247 additions and 1191 deletions
4
hunger/data.pk3dir/sound/items_hunger.sndshd
Normal file
4
hunger/data.pk3dir/sound/items_hunger.sndshd
Normal file
|
@ -0,0 +1,4 @@
|
|||
ammo_gass.pickup
|
||||
{
|
||||
sample player/pl_slosh1.wav
|
||||
}
|
55
hunger/data.pk3dir/sound/weapons_hunger.sndshd
Normal file
55
hunger/data.pk3dir/sound/weapons_hunger.sndshd
Normal 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
|
||||
}
|
10
poke646/data.pk3dir/sound/weapons_poke646.sndshd
Normal file
10
poke646/data.pk3dir/sound/weapons_poke646.sndshd
Normal 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
|
||||
}
|
|
@ -79,6 +79,8 @@
|
|||
../valve/player.c
|
||||
entities.c
|
||||
../entities.c
|
||||
../fx_lensflare.c
|
||||
../fx_gunsmoke.c
|
||||
../valve/cmds.c
|
||||
../valve/game_event.c
|
||||
../events.c
|
||||
|
|
|
@ -19,6 +19,7 @@ CSQC_Init(float apilevel, string enginename, float engineversion)
|
|||
{
|
||||
pSeat = &seats[0];
|
||||
|
||||
registercommand("fx_lenspos");
|
||||
registercommand("titles_test");
|
||||
registercommand("vox_test");
|
||||
registercommand("+attack2");
|
||||
|
@ -117,6 +118,7 @@ CSQC_RendererRestarted(string rstr)
|
|||
Sky_Update();
|
||||
Decal_Reload();
|
||||
Game_RendererRestarted(rstr);
|
||||
FX_Init();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -292,6 +294,8 @@ CSQC_UpdateView(float w, float h, float focus)
|
|||
renderscene();
|
||||
}
|
||||
|
||||
FX_LensFlare();
|
||||
|
||||
/* Run this on all players */
|
||||
for (entity b = world; (b = find(b, ::classname, "player"));) {
|
||||
player pf = (player) b;
|
||||
|
@ -694,6 +698,10 @@ CSQC_ConsoleCommand(string sCMD)
|
|||
case "slot10":
|
||||
HUD_SlotSelect(9);
|
||||
break;
|
||||
case "fx_lenspos":
|
||||
makevectors(getproperty(VF_ANGLES));
|
||||
g_vecLensPos = vectoangles(v_forward);
|
||||
break;
|
||||
default:
|
||||
return Game_ConsoleCommand();
|
||||
}
|
||||
|
|
|
@ -66,24 +66,27 @@ void Event_ProcessModel(float fTimeStamp, int iCode, string sData)
|
|||
pSeat->eMuzzleflash.alpha = 1.0f;
|
||||
pSeat->eMuzzleflash.scale = 0.25;
|
||||
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();
|
||||
} else if(iCode == 5011) {
|
||||
pSeat->eMuzzleflash.alpha = 1.0f;
|
||||
pSeat->eMuzzleflash.scale = 0.25;
|
||||
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)));
|
||||
Event_EjectShell();
|
||||
} else if (iCode == 5021) {
|
||||
pSeat->eMuzzleflash.alpha = 1.0f;
|
||||
pSeat->eMuzzleflash.scale = 0.25;
|
||||
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)));
|
||||
Event_EjectShell();
|
||||
} else if (iCode == 5031) {
|
||||
pSeat->eMuzzleflash.alpha = 1.0f;
|
||||
pSeat->eMuzzleflash.scale = 0.25;
|
||||
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)));
|
||||
Event_EjectShell();
|
||||
}
|
||||
|
|
|
@ -34,3 +34,12 @@ CBaseFX::CBaseFX(void)
|
|||
{
|
||||
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
20
src/client/fx_gunsmoke.c
Normal 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
73
src/client/fx_lensflare.c
Normal 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);
|
||||
}
|
|
@ -72,6 +72,8 @@ init.c
|
|||
../valve/player.c
|
||||
../valve/entities.c
|
||||
../entities.c
|
||||
../fx_lensflare.c
|
||||
../fx_gunsmoke.c
|
||||
../valve/cmds.c
|
||||
../valve/game_event.c
|
||||
../events.c
|
||||
|
|
|
@ -45,7 +45,10 @@ init.c
|
|||
../../shared/hunger/weapons.h
|
||||
../../shared/valve/w_crossbow.c
|
||||
../../shared/valve/w_crowbar.c
|
||||
../../shared/valve/w_egon.c
|
||||
../../shared/valve/w_gauss.c
|
||||
../../shared/valve/w_glock.c
|
||||
../../shared/valve/w_handgrenade.c
|
||||
../../shared/valve/w_mp5.c
|
||||
../../shared/valve/w_python.c
|
||||
../../shared/valve/w_rpg.c
|
||||
|
@ -56,19 +59,21 @@ init.c
|
|||
../../shared/hunger/w_ap9.c
|
||||
../../shared/hunger/w_chaingun.c
|
||||
../../shared/hunger/w_flame.c
|
||||
../../shared/hunger/w_glock.c
|
||||
../../shared/hunger/w_handgrenade.c
|
||||
../../shared/hunger/w_silencer.c
|
||||
../../shared/hunger/w_medkit.c
|
||||
../../shared/hunger/w_shovel.c
|
||||
../../shared/hunger/w_sniper.c
|
||||
../../shared/hunger/w_sniper2.c
|
||||
../../shared/hunger/w_spanner.c
|
||||
../../shared/hunger/w_taurus.c
|
||||
../../shared/hunger/w_tnt.c
|
||||
../../shared/hunger/weapons.c
|
||||
../../shared/valve/weapon_common.c
|
||||
../valve/player.c
|
||||
../valve/entities.c
|
||||
../entities.c
|
||||
../fx_lensflare.c
|
||||
../fx_gunsmoke.c
|
||||
../valve/cmds.c
|
||||
../valve/game_event.c
|
||||
../events.c
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
init.c
|
||||
../../shared/poke646/items.h
|
||||
../../shared/valve/weapon_common.h
|
||||
../../shared/valve/w_satchel.c
|
||||
../../shared/poke646/weapons.h
|
||||
../../shared/poke646/w_bradnailer.c
|
||||
../../shared/poke646/w_cmlwbr.c
|
||||
|
@ -56,6 +57,8 @@ init.c
|
|||
../valve/player.c
|
||||
entities.c
|
||||
../entities.c
|
||||
../fx_lensflare.c
|
||||
../fx_gunsmoke.c
|
||||
../valve/cmds.c
|
||||
../valve/game_event.c
|
||||
../events.c
|
||||
|
|
|
@ -66,6 +66,8 @@ decore.cpp
|
|||
../valve/player.c
|
||||
entities.c
|
||||
../entities.c
|
||||
../fx_lensflare.c
|
||||
../fx_gunsmoke.c
|
||||
|
||||
../valve/cmds.c
|
||||
../valve/game_event.c
|
||||
|
|
|
@ -71,6 +71,8 @@ init.c
|
|||
../valve/player.c
|
||||
../valve/entities.c
|
||||
../entities.c
|
||||
../fx_lensflare.c
|
||||
../fx_gunsmoke.c
|
||||
|
||||
../valve/cmds.c
|
||||
../valve/game_event.c
|
||||
|
|
|
@ -76,6 +76,8 @@ init.c
|
|||
../valve/player.c
|
||||
entities.c
|
||||
../entities.c
|
||||
../fx_lensflare.c
|
||||
../fx_gunsmoke.c
|
||||
|
||||
../valve/cmds.c
|
||||
../valve/game_event.c
|
||||
|
|
|
@ -68,7 +68,8 @@
|
|||
../valve/player.c
|
||||
../valve/entities.c
|
||||
../entities.c
|
||||
|
||||
../fx_lensflare.c
|
||||
../fx_gunsmoke.c
|
||||
../valve/cmds.c
|
||||
../valve/game_event.c
|
||||
../events.c
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
#define TP_ONCE 1
|
||||
#define TP_STARTOFF 2
|
||||
#define TP_AAAA 4
|
||||
enumflags {
|
||||
TP_ONCE,
|
||||
TP_STARTOFF
|
||||
};
|
||||
|
||||
class trigger_push:CBaseTrigger
|
||||
{
|
||||
vector m_vecMoveDir;
|
||||
float m_flDelay;
|
||||
float m_flSpeed;
|
||||
|
||||
void() trigger_push;
|
||||
|
@ -45,12 +45,12 @@ class trigger_push:CBaseTrigger
|
|||
|
||||
void trigger_push::SetMovementDirection(void)
|
||||
{
|
||||
if (angles == [0,-1,0]) {
|
||||
if (m_oldAngle == [0,-1,0]) {
|
||||
m_vecMoveDir = [0,0,1];
|
||||
} else if (angles == [0,-2,0]) {
|
||||
m_vecMoveDir = [0,0,-1];
|
||||
} else {
|
||||
makevectors(angles);
|
||||
makevectors(m_oldAngle);
|
||||
m_vecMoveDir = v_forward;
|
||||
}
|
||||
|
||||
|
@ -79,42 +79,33 @@ void trigger_push::touch(void)
|
|||
}
|
||||
|
||||
if (other.solid != SOLID_NOT && other.solid != SOLID_BSP) {
|
||||
vector vecPush;
|
||||
vecPush = (m_flSpeed * m_vecMoveDir);
|
||||
|
||||
if (spawnflags & TP_ONCE) {
|
||||
other.velocity = other.velocity + (m_flSpeed * m_vecMoveDir);
|
||||
other.velocity += vecPush;
|
||||
if (other.velocity[2] > 0) {
|
||||
other.flags &= ~FL_ONGROUND;
|
||||
}
|
||||
Hide();
|
||||
} else {
|
||||
/*vector vecPush = m_flSpeed * m_vecMoveDir;
|
||||
if (other.flags & FL_BASEVELOCITY) {
|
||||
vecPush = vecPush + other.basevelocity;
|
||||
}
|
||||
|
||||
other.basevelocity = vecPush;
|
||||
other.flags |= FL_BASEVELOCITY;*/
|
||||
other.basevelocity += vecPush;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void trigger_push::Respawn(void)
|
||||
{
|
||||
if (angles == [0,0,0]) {
|
||||
angles[1] = 360;
|
||||
}
|
||||
SetMovementDirection();
|
||||
|
||||
if (m_flSpeed == 0) {
|
||||
m_flSpeed = 100;
|
||||
}
|
||||
|
||||
if (spawnflags & TP_STARTOFF) {
|
||||
solid = SOLID_NOT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void trigger_push::trigger_push(void)
|
||||
{
|
||||
m_flSpeed = 100;
|
||||
for (int i = 1; i < (tokenize(__fullspawndata) - 1); i += 2) {
|
||||
switch (argv(i)) {
|
||||
case "speed":
|
||||
|
|
|
@ -106,7 +106,7 @@ ammo_spore::ammo_spore(void)
|
|||
}
|
||||
|
||||
void
|
||||
ammo_spore::Death(int)
|
||||
ammo_spore::Death(int a)
|
||||
{
|
||||
makevectors(m_oldAngle);
|
||||
Sporelauncher_AltFire(this, origin, v_forward);
|
||||
|
@ -166,7 +166,6 @@ ammo_spore::touch(void)
|
|||
player pl = (player)other;
|
||||
if (pl.ammo_spore < 20) {
|
||||
pl.ammo_spore = bound(0, pl.ammo_spore + 1, 20);
|
||||
player pl = (player)other;
|
||||
Weapons_RefreshAmmo(pl);
|
||||
Logging_Pickup(other, this, __NULL__);
|
||||
frame = 2;
|
||||
|
|
|
@ -15,12 +15,13 @@
|
|||
* 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
|
||||
{
|
||||
|
@ -42,15 +43,20 @@ void ammo_egonclip::touch(void)
|
|||
player pl = (player)other;
|
||||
if (pl.ammo_gas < 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Ammo for the AP9.
|
||||
* A single ammo_th_ap9 will provide 40 bullets.
|
||||
*/
|
||||
/*QUAKED ammo_th_ap9 (0 0 0.8) (-16 -16 0) (16 16 32)
|
||||
|
||||
THEY HUNGER (1999) ENTITY
|
||||
|
||||
Ammo for the AP9.
|
||||
A single ammo_th_ap9 will provide 40 bullets.
|
||||
|
||||
*/
|
||||
class ammo_th_ap9:item_ammo
|
||||
{
|
||||
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)
|
||||
{
|
||||
model = "models/w_antidote.mdl";
|
||||
item_ammo::item_ammo();
|
||||
}
|
||||
void ammo_einar1::touch(void)
|
||||
{
|
||||
if not (other.flags & FL_CLIENT) {
|
||||
return;
|
||||
}
|
||||
if (other.classname == "player") {
|
||||
player pl = (player)other;
|
||||
if (pl.ammo_sniper < MAX_A_SNIPER) {
|
||||
pl.ammo_sniper = bound(0, pl.ammo_sniper + 5, MAX_A_SNIPER);
|
||||
item_ammo::touch();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*QUAKED ammo_einar1 (0 0 0.8) (-16 -16 0) (16 16 32)
|
||||
|
||||
THEY HUNGER (1999) ENTITY
|
||||
|
||||
Ammo for the Snipers.
|
||||
A single ammo_th_sniper will provide 5 bullets.
|
||||
|
||||
Same as ammo_th_sniper
|
||||
|
||||
*/
|
||||
/*QUAKED ammo_th_sniper (0 0 0.8) (-16 -16 0) (16 16 32)
|
||||
|
||||
THEY HUNGER (1999) ENTITY
|
||||
|
||||
Ammo for the Snipers.
|
||||
A single ammo_th_sniper will provide 5 bullets.
|
||||
|
||||
Same as ammo_einar1
|
||||
|
||||
*/
|
||||
|
||||
class ammo_th_sniper:item_ammo
|
||||
{
|
||||
|
@ -130,3 +129,4 @@ void ammo_th_sniper::touch(void)
|
|||
}
|
||||
}
|
||||
|
||||
CLASSEXPORT(ammo_einar1, ammo_th_sniper)
|
||||
|
|
|
@ -63,7 +63,7 @@ void Game_Input(void)
|
|||
Weapons_AddItem(pl, WEAPON_SNIPER2);
|
||||
Weapons_AddItem(pl, WEAPON_RPG);
|
||||
Weapons_AddItem(pl, WEAPON_GAUSS);
|
||||
Weapons_AddItem(pl, WEAPON_FLAME);
|
||||
Weapons_AddItem(pl, WEAPON_EGON);
|
||||
Weapons_AddItem(pl, WEAPON_CHAINGUN);
|
||||
Weapons_AddItem(pl, WEAPON_HANDGRENADE);
|
||||
Weapons_AddItem(pl, WEAPON_SATCHEL);
|
||||
|
|
|
@ -70,7 +70,10 @@
|
|||
../../shared/hunger/weapons.h
|
||||
../../shared/valve/w_crossbow.c
|
||||
../../shared/valve/w_crowbar.c
|
||||
../../shared/valve/w_egon.c
|
||||
../../shared/valve/w_gauss.c
|
||||
../../shared/valve/w_glock.c
|
||||
../../shared/valve/w_handgrenade.c
|
||||
../../shared/valve/w_mp5.c
|
||||
../../shared/valve/w_python.c
|
||||
../../shared/valve/w_rpg.c
|
||||
|
@ -81,14 +84,14 @@
|
|||
../../shared/hunger/w_ap9.c
|
||||
../../shared/hunger/w_chaingun.c
|
||||
../../shared/hunger/w_flame.c
|
||||
../../shared/hunger/w_glock.c
|
||||
../../shared/hunger/w_handgrenade.c
|
||||
../../shared/hunger/w_silencer.c
|
||||
../../shared/hunger/w_medkit.c
|
||||
../../shared/hunger/w_shovel.c
|
||||
../../shared/hunger/w_sniper.c
|
||||
../../shared/hunger/w_sniper2.c
|
||||
../../shared/hunger/w_spanner.c
|
||||
../../shared/hunger/w_taurus.c
|
||||
../../shared/hunger/w_tnt.c
|
||||
../valve/items.cpp
|
||||
../valve/item_longjump.cpp
|
||||
../valve/item_suit.cpp
|
||||
|
|
|
@ -23,12 +23,12 @@ class item_ammo:CBaseEntity
|
|||
|
||||
void item_ammo::touch(void)
|
||||
{
|
||||
if (other.classname != "player") {
|
||||
if not (other.flags & FL_CLIENT) {
|
||||
return;
|
||||
}
|
||||
|
||||
player pl = (player)other;
|
||||
sound(other, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_NORM);
|
||||
Sound_Play(other, CHAN_ITEM, "ammo.pickup");
|
||||
Weapons_RefreshAmmo(pl);
|
||||
Logging_Pickup(other, this, __NULL__);
|
||||
|
||||
|
@ -55,7 +55,7 @@ void item_ammo::Respawn(void)
|
|||
|
||||
think = __NULL__;
|
||||
nextthink = -1;
|
||||
sound(this, CHAN_ITEM, "items/suitchargeok1.wav", 1, ATTN_NORM, 150);
|
||||
Sound_Play(this, CHAN_ITEM, "ammo.respawn");
|
||||
droptofloor();
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,6 @@ void item_ammo::item_ammo(void)
|
|||
m_oldModel = model;
|
||||
setmodel(this, m_oldModel);
|
||||
CBaseEntity::CBaseEntity();
|
||||
item_ammo::Respawn();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -84,53 +83,102 @@ ammo_bolts::ammo_bolts(void)
|
|||
model = "models/w_crossbow_clip.mdl";
|
||||
}
|
||||
|
||||
/*
|
||||
* Ammo for the nailguns.
|
||||
* A single ammo_nailclip will provide 25 nails.
|
||||
*/
|
||||
/*QUAKED ammo_nailclip (0 0 0.8) (-16 -16 0) (16 16 32)
|
||||
|
||||
class
|
||||
ammo_nailclip:item_ammo
|
||||
Poke646 (2001) ENTITY
|
||||
|
||||
Ammo for the nailguns.
|
||||
A single ammo_nailclip will provide 25 nails.
|
||||
|
||||
*/
|
||||
class ammo_nailclip:item_ammo
|
||||
{
|
||||
void() ammo_nailclip;
|
||||
virtual void() touch;
|
||||
};
|
||||
|
||||
void
|
||||
ammo_nailclip::ammo_nailclip(void)
|
||||
void ammo_nailclip::ammo_nailclip(void)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Ammo for the Nailgun.
|
||||
* A single ammo_nailround will provide 50 nails.
|
||||
*/
|
||||
/*QUAKED ammo_nailround (0 0 0.8) (-16 -16 0) (16 16 32)
|
||||
|
||||
class
|
||||
ammo_nailround:item_ammo
|
||||
Poke646 (2001) ENTITY
|
||||
|
||||
Ammo for the nailguns.
|
||||
A single ammo_nailround will provide 50 nails.
|
||||
|
||||
*/
|
||||
class ammo_nailround:item_ammo
|
||||
{
|
||||
void() ammo_nailround;
|
||||
virtual void() touch;
|
||||
};
|
||||
|
||||
void
|
||||
ammo_nailround::ammo_nailround(void)
|
||||
void ammo_nailround::ammo_nailround(void)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Ammo for the alien.
|
||||
* A single ammo_xencandy will provide 20 snacks.
|
||||
*/
|
||||
/*QUAKED ammo_xencandy (0 0 0.8) (-16 -16 0) (16 16 32)
|
||||
|
||||
class
|
||||
ammo_xencandy:item_ammo
|
||||
Poke646 (2001) ENTITY
|
||||
|
||||
Ammo for the alien.
|
||||
A single ammo_xencandy will provide 20 snacks.
|
||||
|
||||
*/
|
||||
|
||||
class ammo_xencandy:item_ammo
|
||||
{
|
||||
void() ammo_xencandy;
|
||||
virtual void() touch;
|
||||
};
|
||||
|
||||
void
|
||||
ammo_xencandy::ammo_xencandy(void)
|
||||
void ammo_xencandy::ammo_xencandy(void)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,19 @@ Gamerules_DecodeChangeParms(player pl)
|
|||
pl.velocity[2] = parm9;
|
||||
pl.g_items = parm10;
|
||||
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 */
|
||||
|
@ -47,6 +60,17 @@ Gamerules_SetChangeParms(player pl)
|
|||
parm9 = pl.velocity[2];
|
||||
parm10 = pl.g_items;
|
||||
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. */
|
||||
|
|
|
@ -48,7 +48,7 @@ Game_Input(void)
|
|||
Weapons_AddItem(pl, WEAPON_SHOTGUN);
|
||||
Weapons_AddItem(pl, WEAPON_CMLWBR);
|
||||
Weapons_AddItem(pl, WEAPON_XS);
|
||||
Weapons_AddItem(pl, WEAPON_PIPEBOMB);
|
||||
Weapons_AddItem(pl, WEAPON_SATCHEL);
|
||||
}
|
||||
|
||||
if (self.impulse == 102) {
|
||||
|
|
|
@ -22,19 +22,54 @@
|
|||
../skill.c
|
||||
../sentences.c
|
||||
../../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_scientist.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/effects.c
|
||||
../../shared/spraylogo.cpp
|
||||
../../shared/valve/player.cpp
|
||||
../../shared/poke646/player.cpp
|
||||
../valve/player.c
|
||||
../../shared/pmove.c
|
||||
../valve/spectator.c
|
||||
../../shared/poke646/items.h
|
||||
../../shared/valve/weapon_common.h
|
||||
../../shared/poke646/weapons.h
|
||||
../../shared/valve/w_satchel.c
|
||||
../../shared/poke646/weapons.h
|
||||
../../shared/poke646/w_bradnailer.c
|
||||
../../shared/poke646/w_cmlwbr.c
|
||||
../../shared/poke646/w_heaterpipe.c
|
||||
|
@ -43,7 +78,6 @@
|
|||
../../shared/poke646/w_shotgun.c
|
||||
../../shared/poke646/w_xs.c
|
||||
../valve/items.cpp
|
||||
../valve/item_longjump.cpp
|
||||
../valve/item_suit.cpp
|
||||
../valve/item_healthkit.cpp
|
||||
../valve/item_battery.cpp
|
||||
|
@ -53,14 +87,13 @@
|
|||
../valve/xen_spore_large.cpp
|
||||
../valve/xen_hair.cpp
|
||||
../valve/xen_plantlight.cpp
|
||||
|
||||
../poke646/ammo_p646.cpp
|
||||
../../shared/poke646/weapons.c
|
||||
../../shared/valve/weapon_common.c
|
||||
../spawn.c
|
||||
../vox.c
|
||||
../../shared/valve/animations.c
|
||||
../poke646/gamerules.c
|
||||
gamerules.c
|
||||
../valve/client.c
|
||||
../client.c
|
||||
../valve/server.c
|
||||
|
|
|
@ -28,7 +28,7 @@ void item_ammo::touch(void)
|
|||
}
|
||||
|
||||
player pl = (player)other;
|
||||
sound(other, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_NORM);
|
||||
Sound_Play(other, CHAN_ITEM, "ammo.pickup");
|
||||
Weapons_RefreshAmmo(pl);
|
||||
Logging_Pickup(other, this, __NULL__);
|
||||
|
||||
|
@ -55,7 +55,7 @@ void item_ammo::Respawn(void)
|
|||
|
||||
think = __NULL__;
|
||||
nextthink = -1;
|
||||
sound(this, CHAN_ITEM, "items/suitchargeok1.wav", 1, ATTN_NORM, 150);
|
||||
Sound_Play(this, CHAN_ITEM, "ammo.respawn");
|
||||
droptofloor();
|
||||
}
|
||||
|
||||
|
|
|
@ -114,6 +114,7 @@ enumflags
|
|||
|
||||
.float jumptime;
|
||||
.float teleport_time;
|
||||
.vector basevelocity;
|
||||
|
||||
void* memrealloc( __variant *oldptr, int elementsize, int oldelements, int newelements )
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#define ITEM_RPG 0x00000040
|
||||
#define ITEM_GAUSS 0x00000080
|
||||
|
||||
#define ITEM_FLAME 0x00000100
|
||||
#define ITEM_EGON 0x00000100
|
||||
#define ITEM_CHAINGUN 0x00000200
|
||||
#define ITEM_HANDGRENADE 0x00000400
|
||||
#define ITEM_TRIPMINE 0x00000800
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net>
|
||||
* 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
|
||||
|
@ -25,17 +25,18 @@ enum
|
|||
AP9_SHOOT3
|
||||
};
|
||||
|
||||
|
||||
void
|
||||
w_ap9_precache(void)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_ap9.fire");
|
||||
#endif
|
||||
precache_model("models/v_ap9.mdl");
|
||||
precache_model("models/w_ap9.mdl");
|
||||
precache_model("models/p_ap9.mdl");
|
||||
precache_sound("weapons/ap9_bolt.wav");
|
||||
precache_sound("weapons/ap9_clipin.wav");
|
||||
precache_sound("weapons/ap9_clipout.wav");
|
||||
precache_sound("weapons/ap9_fire.wav");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -61,7 +62,7 @@ w_ap9_pmodel(void)
|
|||
string
|
||||
w_ap9_deathmsg(void)
|
||||
{
|
||||
return "";
|
||||
return "%s was unloaded into from %s's AP9.";
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -140,7 +141,7 @@ w_ap9_primary(void)
|
|||
#else
|
||||
pl.ap9_mag--;
|
||||
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)
|
||||
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
|
||||
|
@ -192,7 +193,7 @@ w_ap9_secondary(void)
|
|||
#else
|
||||
pl.ap9_mag -= 3;
|
||||
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)
|
||||
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
|
||||
|
@ -252,44 +253,13 @@ w_ap9_release(void)
|
|||
float
|
||||
w_ap9_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND;
|
||||
return w_glock_aimanim();
|
||||
}
|
||||
|
||||
void
|
||||
w_ap9_hud(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
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
|
||||
w_glock_hud();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -300,8 +270,8 @@ w_ap9_hudpic(int selected, vector pos, float a)
|
|||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud04.spr_0.tga",
|
||||
[0,90/256],
|
||||
"sprites/tfchud05.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
a,
|
||||
|
@ -350,7 +320,8 @@ weapon_t w_ap9 =
|
|||
/* pickups */
|
||||
#ifdef SSQC
|
||||
void
|
||||
weapon_th_ap9(void) {
|
||||
weapon_th_ap9(void)
|
||||
{
|
||||
Weapons_InitItem(WEAPON_AP9);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net>
|
||||
* 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
|
||||
|
@ -29,11 +29,15 @@ enum {
|
|||
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/w_tfac.mdl");
|
||||
precache_model("models/p_tfac.mdl");
|
||||
precache_sound("weapons/asscan1.wav");
|
||||
precache_sound("weapons/asscan3.wav");
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -78,7 +82,7 @@ w_chaingun_pmodel(void)
|
|||
string
|
||||
w_chaingun_deathmsg(void)
|
||||
{
|
||||
return "";
|
||||
return "%s was rolled over by %s' Chaingun.";
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -108,6 +112,7 @@ w_chaingun_release(void)
|
|||
/* end firing */
|
||||
if (pl.a_ammo3 == 1) {
|
||||
pl.a_ammo3 = 0;
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_chaingun.spindown");
|
||||
Weapons_ViewAnimation(CHAINGUN_SPINDOWN);
|
||||
pl.w_attack_next = 1.0f;
|
||||
pl.w_idle_next = pl.w_attack_next;
|
||||
|
@ -163,7 +168,7 @@ w_chaingun_primary(void)
|
|||
if (pl.a_ammo3 == 0) {
|
||||
pl.a_ammo3 = 1;
|
||||
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_idle_next = pl.w_attack_next;
|
||||
return;
|
||||
|
@ -178,7 +183,7 @@ w_chaingun_primary(void)
|
|||
#else
|
||||
pl.chaingun_mag--;
|
||||
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
|
||||
|
||||
pl.w_attack_next = 0.1f;
|
||||
|
@ -214,7 +219,7 @@ w_chaingun_reload(void)
|
|||
#ifdef CSQC
|
||||
Weapons_ViewAnimation(CHAINGUN_HOLSTER);
|
||||
#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);
|
||||
#endif
|
||||
|
||||
|
@ -226,40 +231,13 @@ w_chaingun_reload(void)
|
|||
void
|
||||
w_chaingun_hud(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
/* 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
|
||||
w_glock_hud();
|
||||
}
|
||||
|
||||
float
|
||||
w_chaingun_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMMP5 : ANIM_AIMMP5;
|
||||
return w_mp5_aimanim();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -16,28 +17,31 @@
|
|||
|
||||
enum
|
||||
{
|
||||
FLAME_IDLE1,
|
||||
FLAME_FIDGET1,
|
||||
FLAME_ALTFIREON,
|
||||
FLAME_ALTFIRECYCLE,
|
||||
FLAME_ALTFIREOFF,
|
||||
FLAME_FIRE1,
|
||||
FLAME_FIRE2,
|
||||
FLAME_FIRE3,
|
||||
FLAME_FIRE4,
|
||||
FLAME_DRAW,
|
||||
FLAME_HOLSTER
|
||||
EGON_IDLE1,
|
||||
EGON_FIDGET1,
|
||||
EGON_ALTFIREON,
|
||||
EGON_ALTFIRECYCLE,
|
||||
EGON_ALTFIREOFF,
|
||||
EGON_FIRE1,
|
||||
EGON_FIRE2,
|
||||
EGON_FIRE3,
|
||||
EGON_FIRE4,
|
||||
EGON_DRAW,
|
||||
EGON_HOLSTER
|
||||
};
|
||||
|
||||
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("models/v_egon.mdl");
|
||||
precache_model("models/w_egon.mdl");
|
||||
precache_model("models/p_egon.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_flame_updateammo(player pl)
|
||||
{
|
||||
|
@ -45,20 +49,23 @@ w_flame_updateammo(player pl)
|
|||
Weapons_UpdateAmmo(pl, __NULL__, pl.ammo_gas, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_flame_wmodel(void)
|
||||
{
|
||||
return "models/w_egon.mdl";
|
||||
return w_egon_wmodel();
|
||||
}
|
||||
|
||||
string
|
||||
w_flame_pmodel(void)
|
||||
{
|
||||
return "models/p_egon.mdl";
|
||||
return w_egon_pmodel();
|
||||
}
|
||||
|
||||
string
|
||||
w_flame_deathmsg(void)
|
||||
{
|
||||
return "";
|
||||
return "%s burned to a crisp by %s's Flamethrower.";
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -66,7 +73,6 @@ w_flame_pickup(int new)
|
|||
{
|
||||
#ifdef SSQC
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.ammo_gas < MAX_A_GAS) {
|
||||
pl.ammo_gas = bound(0, pl.ammo_gas + 20, MAX_A_GAS);
|
||||
} else {
|
||||
|
@ -79,38 +85,34 @@ w_flame_pickup(int new)
|
|||
void
|
||||
w_flame_draw(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
Weapons_SetModel("models/v_egon.mdl");
|
||||
Weapons_ViewAnimation(FLAME_DRAW);
|
||||
pl.w_idle_next = 1.0f;
|
||||
w_egon_draw();
|
||||
}
|
||||
|
||||
void
|
||||
w_flame_holster(void)
|
||||
{
|
||||
Weapons_ViewAnimation(FLAME_HOLSTER);
|
||||
w_egon_holster();
|
||||
}
|
||||
|
||||
|
||||
#ifdef SSQC
|
||||
void
|
||||
Flame_Touch(void) {
|
||||
|
||||
Flame_Touch(void)
|
||||
{
|
||||
if (other.takedamage != DAMAGE_YES) {
|
||||
remove(self);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* 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);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void w_flame_primary(void)
|
||||
void
|
||||
w_flame_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
|
@ -129,15 +131,15 @@ void w_flame_primary(void)
|
|||
#endif
|
||||
|
||||
#ifdef CSQC
|
||||
if (Weapons_GetAnimation() == FLAME_IDLE1)
|
||||
Weapons_ViewAnimation(FLAME_ALTFIREON);
|
||||
else if (Weapons_GetAnimation() == FLAME_ALTFIREON)
|
||||
Weapons_ViewAnimation(FLAME_ALTFIRECYCLE);
|
||||
|
||||
if (Weapons_GetAnimation() == EGON_IDLE1)
|
||||
Weapons_ViewAnimation(EGON_ALTFIREON);
|
||||
else if (Weapons_GetAnimation() == EGON_ALTFIREON)
|
||||
Weapons_ViewAnimation(EGON_ALTFIRECYCLE);
|
||||
|
||||
pl.a_ammo2--;
|
||||
#else
|
||||
|
||||
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/flmfire2.wav", 1, ATTN_NORM);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_flame.fire");
|
||||
Weapons_MakeVectors();
|
||||
entity flame = spawn();
|
||||
setmodel(flame, "sprites/fthrow.spr");
|
||||
|
@ -160,32 +162,24 @@ void w_flame_primary(void)
|
|||
pl.w_attack_next = 0.2f;
|
||||
pl.w_idle_next = 2.5f;
|
||||
}
|
||||
|
||||
void
|
||||
w_flame_secondary(void)
|
||||
{
|
||||
|
||||
w_egon_secondary();
|
||||
}
|
||||
|
||||
void
|
||||
w_flame_reload(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
w_flame_release(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
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
|
||||
w_egon_release();
|
||||
}
|
||||
|
||||
void
|
||||
w_flame_crosshair(void)
|
||||
{
|
||||
|
@ -202,15 +196,14 @@ w_flame_crosshair(void)
|
|||
float
|
||||
w_flame_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMEGON : ANIM_AIMEGON;
|
||||
return w_egon_aimanim();
|
||||
}
|
||||
|
||||
void
|
||||
w_flame_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
|
||||
if (selected) {
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
|
@ -238,16 +231,16 @@ if (selected) {
|
|||
|
||||
weapon_t w_flame =
|
||||
{
|
||||
.id = ITEM_FLAME,
|
||||
.id = ITEM_EGON,
|
||||
.slot = 3,
|
||||
.slot_pos = 2,
|
||||
.ki_spr = "sprites/640hud1.spr_0.tga",
|
||||
.ki_size = [32,16],
|
||||
.ki_xy = [0,192],
|
||||
.draw = w_flame_draw,
|
||||
.holster = __NULL__,
|
||||
.holster = w_egon_holster,
|
||||
.primary = w_flame_primary,
|
||||
.secondary = __NULL__,
|
||||
.secondary = w_flame_secondary,
|
||||
.reload = __NULL__,
|
||||
.release = w_flame_release,
|
||||
.crosshair = w_flame_crosshair,
|
||||
|
@ -260,11 +253,3 @@ weapon_t w_flame =
|
|||
.aimanim = w_flame_aimanim,
|
||||
.hudpic = w_flame_hudpic
|
||||
};
|
||||
|
||||
|
||||
#ifdef SSQC
|
||||
void
|
||||
weapon_egon(void) {
|
||||
Weapons_InitItem(WEAPON_FLAME);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -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
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net>
|
||||
* 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
|
||||
|
@ -28,6 +28,9 @@ enum
|
|||
void
|
||||
w_medkit_precache(void)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_medkit.heal");
|
||||
#endif
|
||||
precache_model("models/v_tfc_medkit.mdl");
|
||||
precache_model("models/w_tfc_medkit.mdl");
|
||||
precache_model("models/p_tfc_medkit.mdl");
|
||||
|
@ -46,6 +49,7 @@ w_medkit_wmodel(void)
|
|||
{
|
||||
return "models/w_tfc_medkit.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_medkit_pmodel(void)
|
||||
{
|
||||
|
@ -55,7 +59,7 @@ w_medkit_pmodel(void)
|
|||
string
|
||||
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
|
||||
|
@ -105,15 +109,15 @@ w_medkit_primary(void)
|
|||
}
|
||||
|
||||
/* 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--;
|
||||
|
||||
|
||||
if (self.flags & FL_CROUCHING)
|
||||
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
|
||||
else
|
||||
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
|
||||
|
||||
if (pl.health >= 100) {
|
||||
|
@ -136,13 +140,13 @@ w_medkit_release(void)
|
|||
return;
|
||||
}
|
||||
|
||||
r = floor(random(0,2));
|
||||
int r = (float)input_sequence % 2;
|
||||
switch (r) {
|
||||
case 1:
|
||||
case 0:
|
||||
Weapons_ViewAnimation(MEDKIT_IDLE1);
|
||||
pl.w_idle_next = 1.16f;
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
Weapons_ViewAnimation(MEDKIT_IDLE2);
|
||||
pl.w_idle_next = 2.36f;
|
||||
break;
|
||||
|
@ -152,7 +156,7 @@ w_medkit_release(void)
|
|||
float
|
||||
w_medkit_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSQUEAK : ANIM_AIMSQUEAK;
|
||||
return w_snark_aimanim();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -160,7 +164,6 @@ w_medkit_crosshair(void)
|
|||
{
|
||||
#ifdef CSQC
|
||||
vector aicon_pos;
|
||||
|
||||
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
|
||||
HUD_DrawAmmo2();
|
||||
|
@ -210,7 +213,7 @@ w_medkit_hudpic(int selected, vector pos, float a)
|
|||
|
||||
weapon_t w_medkit =
|
||||
{
|
||||
.id = ITEM_MEDKIT2,
|
||||
.id = ITEM_MEDKIT2,
|
||||
.slot = 4,
|
||||
.slot_pos = 4,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
|
@ -235,7 +238,8 @@ weapon_t w_medkit =
|
|||
|
||||
#ifdef SSQC
|
||||
void
|
||||
weapon_th_medkit(void) {
|
||||
weapon_th_medkit(void)
|
||||
{
|
||||
Weapons_InitItem(WEAPON_MEDKIT);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -16,26 +17,25 @@
|
|||
|
||||
enum
|
||||
{
|
||||
SHOVEL_IDLE,
|
||||
SHOVEL_DRAW,
|
||||
SHOVEL_HOLSTER,
|
||||
SHOVEL_ATTACK1HIT,
|
||||
SHOVEL_ATTACK1MISS,
|
||||
SHOVEL_ATTACK2MISS,
|
||||
SHOVEL_ATTACK2HIT,
|
||||
SHOVEL_ATTACK3MISS,
|
||||
SHOVEL_ATTACK3HIT
|
||||
CBAR_IDLE,
|
||||
CBAR_DRAW,
|
||||
CBAR_HOLSTER,
|
||||
CBAR_ATTACK1HIT,
|
||||
CBAR_ATTACK1MISS,
|
||||
CBAR_ATTACK2MISS,
|
||||
CBAR_ATTACK2HIT,
|
||||
CBAR_ATTACK3MISS,
|
||||
CBAR_ATTACK3HIT
|
||||
};
|
||||
|
||||
void
|
||||
w_shovel_precache(void)
|
||||
{
|
||||
precache_sound("weapons/cbar_miss1.wav");
|
||||
precache_sound("weapons/cbar_hit1.wav");
|
||||
precache_sound("weapons/cbar_hit2.wav");
|
||||
precache_sound("weapons/cbar_hitbod1.wav");
|
||||
precache_sound("weapons/cbar_hitbod2.wav");
|
||||
precache_sound("weapons/cbar_hitbod3.wav");
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_crowbar.hit");
|
||||
Sound_Precache("weapon_crowbar.miss");
|
||||
Sound_Precache("weapon_crowbar.hitbody");
|
||||
#endif
|
||||
precache_model("models/v_shovel.mdl");
|
||||
precache_model("models/w_shovel.mdl");
|
||||
precache_model("models/p_shovel.mdl");
|
||||
|
@ -44,9 +44,7 @@ w_shovel_precache(void)
|
|||
void
|
||||
w_shovel_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, -1, -1, -1);
|
||||
#endif
|
||||
w_crowbar_updateammo(pl);
|
||||
}
|
||||
|
||||
string
|
||||
|
@ -63,124 +61,38 @@ w_shovel_pmodel(void)
|
|||
string
|
||||
w_shovel_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Crowbar.";
|
||||
return "%s was buried by %s's Shovel.";
|
||||
}
|
||||
|
||||
void
|
||||
w_shovel_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_shovel.mdl");
|
||||
Weapons_ViewAnimation(SHOVEL_DRAW);
|
||||
Weapons_ViewAnimation(CBAR_DRAW);
|
||||
}
|
||||
|
||||
void
|
||||
w_shovel_holster(void)
|
||||
{
|
||||
Weapons_ViewAnimation(SHOVEL_HOLSTER);
|
||||
w_crowbar_holster();
|
||||
}
|
||||
|
||||
void
|
||||
w_shovel_primary(void)
|
||||
{
|
||||
int anim = 0;
|
||||
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
|
||||
w_crowbar_primary();
|
||||
}
|
||||
|
||||
void
|
||||
w_shovel_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_idle_next) {
|
||||
return;
|
||||
}
|
||||
|
||||
Weapons_ViewAnimation(SHOVEL_IDLE);
|
||||
pl.w_idle_next = 15.0f;
|
||||
w_crowbar_release();
|
||||
}
|
||||
|
||||
float
|
||||
w_shovel_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
return w_crowbar_aimanim();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
264
src/shared/hunger/w_silencer.c
Normal file
264
src/shared/hunger/w_silencer.c
Normal 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
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net>
|
||||
* 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
|
||||
|
@ -28,12 +28,13 @@ enum
|
|||
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/w_isotopebox.mdl");
|
||||
precache_model("models/p_sniper.mdl");
|
||||
|
||||
precache_sound("weapons/sniper.wav");
|
||||
precache_sound("weapons/reload3.wav");
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -78,7 +79,7 @@ w_sniper_pmodel(void)
|
|||
string
|
||||
w_sniper_deathmsg(void)
|
||||
{
|
||||
return "";
|
||||
return "%s was taken out by %s's Sniper.";
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -160,7 +161,7 @@ w_sniper_primary(void)
|
|||
pl.sniper_mag--;
|
||||
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
|
||||
|
||||
|
||||
|
@ -217,7 +218,7 @@ w_sniper_reload(void)
|
|||
if (pl.ammo_sniper <= 0) {
|
||||
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);
|
||||
#endif
|
||||
|
||||
|
@ -286,7 +287,7 @@ w_sniper_crosshair(void)
|
|||
float
|
||||
w_sniper_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMPYTHON : ANIM_AIMPYTHON;
|
||||
return w_crossbow_aimanim();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net>
|
||||
* 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
|
||||
|
@ -26,11 +26,12 @@ enum
|
|||
void
|
||||
w_sniper2_precache(void)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_sniper.fire");
|
||||
#endif
|
||||
precache_model("models/v_hkg36.mdl");
|
||||
precache_model("models/w_hkg36.mdl");
|
||||
precache_model("models/p_hkg36.mdl");
|
||||
|
||||
precache_sound("weapons/sniper.wav");
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -75,7 +76,7 @@ w_sniper2_pmodel(void)
|
|||
string
|
||||
w_sniper2_deathmsg(void)
|
||||
{
|
||||
return "";
|
||||
return "%s was taken out by %s's Sniper.";
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -146,7 +147,7 @@ w_sniper2_primary(void)
|
|||
pl.sniper_mag--;
|
||||
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
|
||||
|
||||
|
||||
|
@ -163,20 +164,7 @@ w_sniper2_primary(void)
|
|||
void
|
||||
w_sniper2_secondary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
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;
|
||||
w_sniper_secondary();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -213,98 +201,25 @@ void
|
|||
w_sniper2_crosshair(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
player pl = (player)self;
|
||||
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
|
||||
);
|
||||
w_sniper_crosshair();
|
||||
#endif
|
||||
}
|
||||
|
||||
float
|
||||
w_sniper2_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMPYTHON : ANIM_AIMPYTHON;
|
||||
return w_crossbow_aimanim();
|
||||
}
|
||||
|
||||
void
|
||||
w_sniper2_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
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
|
||||
w_sniper_hudpic(selected, pos, a);
|
||||
}
|
||||
|
||||
weapon_t w_sniper2 =
|
||||
{
|
||||
.id = ITEM_SNIPER2,
|
||||
.id = ITEM_SNIPER2,
|
||||
.slot = 2,
|
||||
.slot_pos = 4,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
||||
* Copyright (c) 2019 Gethyn ThomasQuail <xylemon@posteo.net>
|
||||
* 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
|
||||
|
@ -17,23 +17,22 @@
|
|||
|
||||
enum
|
||||
{
|
||||
SPAN_IDLE,
|
||||
SPAN_ATTACK1,
|
||||
SPAN_ATTACK2,
|
||||
SPAN_UNUSED,
|
||||
SPAN_DRAW,
|
||||
SPAN_HOLSTER
|
||||
CBAR_IDLE,
|
||||
CBAR_ATTACK1,
|
||||
CBAR_ATTACK2,
|
||||
CBAR_UNUSED,
|
||||
CBAR_DRAW,
|
||||
CBAR_HOLSTER
|
||||
};
|
||||
|
||||
void
|
||||
w_spanner_precache(void)
|
||||
{
|
||||
precache_sound("weapons/cbar_miss1.wav");
|
||||
precache_sound("weapons/cbar_hit1.wav");
|
||||
precache_sound("weapons/cbar_hit2.wav");
|
||||
precache_sound("weapons/cbar_hitbod1.wav");
|
||||
precache_sound("weapons/cbar_hitbod2.wav");
|
||||
precache_sound("weapons/cbar_hitbod3.wav");
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_crowbar.hit");
|
||||
Sound_Precache("weapon_crowbar.miss");
|
||||
Sound_Precache("weapon_crowbar.hitbody");
|
||||
#endif
|
||||
precache_model("models/v_tfc_spanner.mdl");
|
||||
precache_model("models/backpack.mdl");
|
||||
precache_model("models/p_spanner.mdl");
|
||||
|
@ -42,9 +41,7 @@ w_spanner_precache(void)
|
|||
void
|
||||
w_spanner_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, -1, -1, -1);
|
||||
#endif
|
||||
w_crowbar_updateammo(pl);
|
||||
}
|
||||
|
||||
string
|
||||
|
@ -61,20 +58,20 @@ w_spanner_pmodel(void)
|
|||
string
|
||||
w_spanner_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Crowbar.";
|
||||
return "%s was retooled by %'s Wrench.";
|
||||
}
|
||||
|
||||
void
|
||||
w_spanner_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_spanner.mdl");
|
||||
Weapons_ViewAnimation(SPAN_DRAW);
|
||||
Weapons_ViewAnimation(CBAR_DRAW);
|
||||
}
|
||||
|
||||
void
|
||||
w_spanner_holster(void)
|
||||
{
|
||||
Weapons_ViewAnimation(SPAN_HOLSTER);
|
||||
w_crowbar_holster();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -100,12 +97,11 @@ w_spanner_primary(void)
|
|||
pl.w_idle_next = 2.5f;
|
||||
|
||||
#ifdef CSQC
|
||||
|
||||
if (random() < 0.5) {
|
||||
Weapons_ViewAnimation(SPAN_ATTACK1);
|
||||
} else {
|
||||
Weapons_ViewAnimation(SPAN_ATTACK2);
|
||||
}
|
||||
Weapons_ViewAnimation(CBAR_ATTACK1);
|
||||
} else {
|
||||
Weapons_ViewAnimation(CBAR_ATTACK2);
|
||||
}
|
||||
#else
|
||||
if (pl.flags & FL_CROUCHING) {
|
||||
Animation_PlayerTopTemp(ANIM_SHOOTCROWBAR, 0.5f);
|
||||
|
@ -113,7 +109,7 @@ w_spanner_primary(void)
|
|||
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) {
|
||||
return;
|
||||
|
@ -127,31 +123,15 @@ w_spanner_primary(void)
|
|||
}
|
||||
|
||||
if (trace_ent.takedamage) {
|
||||
int r;
|
||||
Damage_Apply(trace_ent, self, 10, WEAPON_SPANNER, DMG_BLUNT );
|
||||
Damage_Apply(trace_ent, pl, Skill_GetValue("plr_crowbar"), WEAPON_CROWBAR, 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;
|
||||
}
|
||||
Sound_Play(self, CHAN_WEAPON, "weapon_crowbar.hitbody");
|
||||
} 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);
|
||||
}
|
||||
Sound_Play(self, CHAN_WEAPON, "weapon_crowbar.hit");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -159,20 +139,13 @@ w_spanner_primary(void)
|
|||
void
|
||||
w_spanner_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_idle_next) {
|
||||
return;
|
||||
}
|
||||
|
||||
Weapons_ViewAnimation(SPAN_IDLE);
|
||||
pl.w_idle_next = 15.0f;
|
||||
w_crowbar_release();
|
||||
}
|
||||
|
||||
float
|
||||
w_spanner_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
return w_crowbar_aimanim();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -32,10 +33,12 @@ enum
|
|||
void
|
||||
w_taurus_precache(void)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_taurus.fire");
|
||||
#endif
|
||||
precache_model("models/v_taurus.mdl");
|
||||
precache_model("models/w_taurus.mdl");
|
||||
precache_model("models/p_taurus.mdl");
|
||||
precache_sound("weapons/tau_fire.wav");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -61,7 +64,7 @@ w_taurus_pmodel(void)
|
|||
string
|
||||
w_taurus_deathmsg(void)
|
||||
{
|
||||
return "";
|
||||
return "%s is seeing blue from %s's Taurus.";
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -134,7 +137,7 @@ w_taurus_primary(void)
|
|||
#else
|
||||
pl.taurus_mag--;
|
||||
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)
|
||||
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
|
||||
|
@ -219,74 +222,19 @@ w_taurus_release(void)
|
|||
float
|
||||
w_taurus_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND;
|
||||
return w_glock_aimanim();
|
||||
}
|
||||
|
||||
void
|
||||
w_taurus_hud(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
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
|
||||
w_glock_hud();
|
||||
}
|
||||
|
||||
void
|
||||
w_taurus_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
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
|
||||
w_glock_hudpic(selected, pos, a);
|
||||
}
|
||||
|
||||
weapon_t w_taurus =
|
||||
|
|
|
@ -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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -26,61 +26,50 @@ enum
|
|||
HANDGRENADE_DRAW
|
||||
};
|
||||
|
||||
/* It's just the grenade with a different model, they could
|
||||
* have just renamed the model itself... why.
|
||||
*/
|
||||
|
||||
void w_handgrenade_precache(void)
|
||||
void w_tnt_precache(void)
|
||||
{
|
||||
precache_sound("weapons/g_bounce1.wav");
|
||||
precache_sound("weapons/g_bounce2.wav");
|
||||
precache_sound("weapons/g_bounce3.wav");
|
||||
precache_sound("weapons/g_bounce4.wav");
|
||||
precache_sound("weapons/g_bounce5.wav");
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_handgrenade.bounce");
|
||||
#endif
|
||||
|
||||
precache_model("models/v_tnt.mdl");
|
||||
precache_model("models/w_tnt.mdl");
|
||||
precache_model("models/p_tnt.mdl");
|
||||
}
|
||||
void w_handgrenade_updateammo(player pl)
|
||||
|
||||
void w_tnt_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, -1, pl.ammo_handgrenade, -1);
|
||||
#endif
|
||||
w_handgrenade_updateammo(pl);
|
||||
}
|
||||
string w_handgrenade_wmodel(void)
|
||||
|
||||
string w_tnt_wmodel(void)
|
||||
{
|
||||
return "models/w_tnt.mdl";
|
||||
}
|
||||
string w_handgrenade_pmodel(void)
|
||||
|
||||
string w_tnt_pmodel(void)
|
||||
{
|
||||
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
|
||||
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;
|
||||
return w_handgrenade_pickup(new);
|
||||
}
|
||||
|
||||
#ifdef SSQC
|
||||
void w_handgrenade_throw(void)
|
||||
void w_tnt_throw(void)
|
||||
{
|
||||
static void WeaponFrag_Throw_Explode( void )
|
||||
{
|
||||
float dmg = Skill_GetValue("plr_hand_grenade");
|
||||
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);
|
||||
remove(self);
|
||||
}
|
||||
|
@ -89,10 +78,9 @@ void w_handgrenade_throw(void)
|
|||
{
|
||||
if (other.takedamage == DAMAGE_YES) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -129,7 +117,7 @@ void w_handgrenade_throw(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
void w_handgrenade_draw(void)
|
||||
void w_tnt_draw(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
Weapons_SetModel("models/v_tnt.mdl");
|
||||
|
@ -137,43 +125,16 @@ void w_handgrenade_draw(void)
|
|||
#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;
|
||||
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;
|
||||
w_handgrenade_primary();
|
||||
}
|
||||
|
||||
void w_handgrenade_hud(void)
|
||||
void w_tnt_hud(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
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;
|
||||
|
||||
|
@ -197,7 +158,7 @@ void w_handgrenade_release(void)
|
|||
Weapons_ViewAnimation(HANDGRENADE_THROW1);
|
||||
#else
|
||||
pl.ammo_handgrenade--;
|
||||
w_handgrenade_throw();
|
||||
w_tnt_throw();
|
||||
#endif
|
||||
pl.a_ammo3 = 2;
|
||||
pl.w_attack_next = 1.0f;
|
||||
|
@ -213,54 +174,51 @@ void w_handgrenade_release(void)
|
|||
pl.w_attack_next = 0.5f;
|
||||
pl.w_idle_next = 0.5f;
|
||||
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
|
||||
w_handgrenade_aimanim(void)
|
||||
w_tnt_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
return w_handgrenade_aimanim();
|
||||
}
|
||||
|
||||
void
|
||||
w_handgrenade_hudpic(int s, vector pos, float a)
|
||||
w_tnt_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
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
|
||||
w_handgrenade_hudpic(selected, pos, a);
|
||||
}
|
||||
|
||||
weapon_t w_handgrenade =
|
||||
weapon_t w_tnt =
|
||||
{
|
||||
ITEM_HANDGRENADE,
|
||||
4,
|
||||
0,
|
||||
"sprites/640hud1.spr_0.tga",
|
||||
[32,16],
|
||||
[192,160],
|
||||
w_handgrenade_draw,
|
||||
w_handgrenade_holster,
|
||||
w_handgrenade_primary,
|
||||
w_handgrenade_release,
|
||||
w_handgrenade_release,
|
||||
w_handgrenade_release,
|
||||
w_handgrenade_hud,
|
||||
w_handgrenade_precache,
|
||||
w_handgrenade_pickup,
|
||||
w_handgrenade_updateammo,
|
||||
w_handgrenade_wmodel,
|
||||
w_handgrenade_pmodel,
|
||||
w_handgrenade_deathmsg,
|
||||
w_handgrenade_aimanim,
|
||||
w_handgrenade_hudpic
|
||||
.id = ITEM_HANDGRENADE,
|
||||
.slot = 4,
|
||||
.slot_pos = 0,
|
||||
.ki_spr = "sprites/640hud1.spr_0.tga",
|
||||
.ki_size = [32,16],
|
||||
.ki_xy = [192,160],
|
||||
.draw = w_tnt_draw,
|
||||
.holster = w_tnt_holster,
|
||||
.primary = w_tnt_primary,
|
||||
.secondary = w_tnt_release,
|
||||
.reload = w_tnt_release,
|
||||
.release = w_tnt_release,
|
||||
.crosshair = w_tnt_hud,
|
||||
.precache = w_tnt_precache,
|
||||
.pickup = w_tnt_pickup,
|
||||
.updateammo = w_tnt_updateammo,
|
||||
.wmodel = w_tnt_wmodel,
|
||||
.pmodel = w_tnt_pmodel,
|
||||
.deathmsg = w_tnt_deathmsg,
|
||||
.aimanim = w_tnt_aimanim,
|
||||
.hudpic = w_tnt_hudpic
|
||||
};
|
||||
|
||||
#ifdef SSQC
|
||||
void weapon_handgrenade(void) {
|
||||
Weapons_InitItem(WEAPON_HANDGRENADE);
|
||||
}
|
||||
#endif
|
|
@ -20,7 +20,7 @@ weapon_t g_weapons[] = {
|
|||
w_crowbar,
|
||||
w_shovel,
|
||||
w_spanner,
|
||||
w_glock,
|
||||
w_silencer,
|
||||
w_python,
|
||||
w_ap9,
|
||||
w_taurus,
|
||||
|
@ -33,7 +33,7 @@ weapon_t g_weapons[] = {
|
|||
w_gauss,
|
||||
w_flame,
|
||||
w_chaingun,
|
||||
w_handgrenade,
|
||||
w_tnt,
|
||||
w_satchel,
|
||||
w_tripmine,
|
||||
w_snark,
|
||||
|
|
|
@ -32,7 +32,7 @@ enum
|
|||
WEAPON_SNIPER2,
|
||||
WEAPON_RPG,
|
||||
WEAPON_GAUSS,
|
||||
WEAPON_FLAME,
|
||||
WEAPON_EGON,
|
||||
WEAPON_CHAINGUN,
|
||||
WEAPON_HANDGRENADE,
|
||||
WEAPON_SATCHEL,
|
||||
|
@ -57,4 +57,4 @@ enum
|
|||
#define MAX_A_TRIPMINE 10
|
||||
#define MAX_A_SNARK 10
|
||||
#define MAX_A_HORNET 8
|
||||
#define MAX_A_MEDKIT 12
|
||||
#define MAX_A_MEDKIT 12
|
||||
|
|
|
@ -75,7 +75,6 @@ float Math_CRandom( void ) {
|
|||
}
|
||||
|
||||
#if defined(SSQC) || defined(CSQC)
|
||||
//.vector basevelocity;
|
||||
int QPhysics_IsStuck( entity eTarget, vector vOffset, vector vecMins, vector vecMaxs )
|
||||
{
|
||||
if ( eTarget.solid != SOLID_SLIDEBOX ) {
|
||||
|
@ -92,7 +91,6 @@ void QPhysics_Run ( entity eTarget )
|
|||
self = eTarget;
|
||||
|
||||
float flFallVel = ( self.flags & FL_ONGROUND ) ? 0 : -self.velocity[2];
|
||||
|
||||
#ifdef CSTRIKE
|
||||
self.maxspeed = Game_GetMaxSpeed( self );
|
||||
#endif
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
|
||||
#define PHY_JUMP_CHAINWINDOW 0.5
|
||||
#define PHY_JUMP_CHAIN 100
|
||||
#define PHY_JUMP_CHAINDECAY 50
|
||||
#define PHY_JUMP_CHAIN 100
|
||||
#define PHY_JUMP_CHAINDECAY 50
|
||||
|
||||
/* FIXME: jumptime should use the time global, as time intervals are not
|
||||
* predictable - decrement it based upon input_timelength */
|
||||
|
@ -102,12 +102,12 @@ PMove_Categorize(void)
|
|||
self.view_ofs = VEC_PLAYER_VIEWPOS;
|
||||
}
|
||||
|
||||
tracebox(self.origin, self.mins, self.maxs, self.origin - [0,0,0.25],
|
||||
FALSE, self);
|
||||
tracebox(self.origin, self.mins, self.maxs, self.origin - [0,0,0.25], FALSE, self);
|
||||
|
||||
if (!trace_startsolid) {
|
||||
if ((trace_fraction < 1) && (trace_plane_normal[2] > 0.7)) {
|
||||
self.flags |= FL_ONGROUND;
|
||||
self.flags &= ~FL_WATERJUMP;
|
||||
self.groundentity = trace_ent;
|
||||
|
||||
if (self.groundentity) {
|
||||
|
@ -118,8 +118,8 @@ PMove_Categorize(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (self.basevelocity[2] > 0)
|
||||
self.flags &= ~FL_ONGROUND;
|
||||
/*if (self.basevelocity[2] > 0)
|
||||
self.flags &= ~FL_ONGROUND;*/
|
||||
|
||||
/* ladder content testing */
|
||||
int oldhitcontents = self.hitcontentsmaski;
|
||||
|
@ -258,7 +258,7 @@ PMove_CheckWaterJump(void)
|
|||
traceline(vStart, vEnd, TRUE, self);
|
||||
|
||||
if (trace_fraction == 1) {
|
||||
//self.flags = self.flags | FL_WATERJUMP;
|
||||
self.flags |= FL_WATERJUMP;
|
||||
self.velocity[2] = 350;
|
||||
self.flags &= ~FL_JUMPRELEASED;
|
||||
return;
|
||||
|
@ -390,7 +390,6 @@ void
|
|||
PMove_AccelFriction(float move_time, float premove, vector wish_dir, float wish_speed)
|
||||
{
|
||||
float flFriction;
|
||||
vector vecWishVel;
|
||||
vector vecTemp;
|
||||
|
||||
// friction
|
||||
|
@ -459,10 +458,16 @@ PMove_AccelJump(float move_time, float premove)
|
|||
float flJumptimeDelta;
|
||||
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;
|
||||
}
|
||||
|
||||
if (self.flags & FL_WATERJUMP)
|
||||
return;
|
||||
if (!(self.flags & FL_ONGROUND))
|
||||
return;
|
||||
if (!(self.flags & FL_JUMPRELEASED))
|
||||
return;
|
||||
|
||||
|
@ -480,6 +485,7 @@ PMove_AccelJump(float move_time, float premove)
|
|||
self.velocity[2] = 50;
|
||||
}
|
||||
} else {
|
||||
/* Half-Life: Longjump module */
|
||||
#ifdef VALVE
|
||||
if (self.flags & FL_CROUCHING && Items_CheckItem(self, 0x00008000)) {
|
||||
self.velocity = v_forward * 512;
|
||||
|
@ -507,23 +513,22 @@ PMove_Acceleration(float move_time, float premove)
|
|||
vector vecWishVel;
|
||||
vector wish_dir;
|
||||
float wish_speed;
|
||||
float flFriction;
|
||||
|
||||
self.jumptime -= move_time;
|
||||
self.teleport_time -= move_time;
|
||||
|
||||
makevectors(input_angles);
|
||||
|
||||
/* figure out where we are in the world */
|
||||
PMove_Categorize();
|
||||
|
||||
/* everything but MOVETYPE_NOCLIP has acceleration */
|
||||
if (self.movetype != MOVETYPE_NOCLIP) {
|
||||
if (self.movetype == MOVETYPE_TOSS) {
|
||||
PMove_AccelToss(move_time, premove);
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.movetype == MOVETYPE_WALK) {
|
||||
} else if (self.movetype == MOVETYPE_WALK) {
|
||||
PMove_AccelMove(move_time, premove);
|
||||
|
||||
}
|
||||
|
||||
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];
|
||||
} else {
|
||||
} else */ {
|
||||
/* on the ground, only yaw matters in terms of direction */
|
||||
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];
|
||||
}
|
||||
|
@ -559,11 +565,6 @@ PMove_Acceleration(float move_time, float premove)
|
|||
} else {
|
||||
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) {
|
||||
PMove_AccelLadder(move_time, premove, wish_dir, wish_speed);
|
||||
} else if (self.flags & FL_ONGROUND) {
|
||||
|
@ -574,6 +575,7 @@ PMove_Acceleration(float move_time, float premove)
|
|||
}
|
||||
}
|
||||
|
||||
/* touch other solid entities */
|
||||
void
|
||||
PMove_DoTouch(entity tother)
|
||||
{
|
||||
|
@ -634,14 +636,14 @@ PMove_Move(void)
|
|||
return;
|
||||
}
|
||||
|
||||
/* hacky attempt at base-velocity, this needs to be cleared/wiped at the end */
|
||||
if (!(self.flags & FL_ONGROUND)) {
|
||||
self.basevelocity[2] = 0;
|
||||
}
|
||||
self.velocity += self.basevelocity;
|
||||
|
||||
/* 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--) {
|
||||
dest = self.origin + (self.velocity * move_time);
|
||||
|
||||
|
@ -730,8 +732,10 @@ PMove_Move(void)
|
|||
}
|
||||
}*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -741,22 +745,29 @@ PMove_Run(void)
|
|||
{
|
||||
float punch;
|
||||
player pl = (player)self;
|
||||
#ifdef VALVE
|
||||
|
||||
/* maxspeed changes when crouching, TODO: make this game-specific */
|
||||
self.maxspeed = (self.flags & FL_CROUCHING) ? 135 : 270;
|
||||
|
||||
/* when pressing the 'use' button, we also walk slower for precision */
|
||||
if (input_buttons & INPUT_BUTTON5) {
|
||||
input_movevalues *= 0.25;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* establish which water elements we're dealing in */
|
||||
PMove_WaterMove();
|
||||
|
||||
/* we might need to apply extra-velocity to get out of water-volumes */
|
||||
if (self.waterlevel >= 2) {
|
||||
PMove_CheckWaterJump();
|
||||
}
|
||||
|
||||
/* move camera up (noclip, fly) when holding jump */
|
||||
if (input_buttons & INPUT_BUTTON2) {
|
||||
input_movevalues[2] = 240;
|
||||
}
|
||||
}
|
||||
|
||||
/* move camera down (noclip, fly) when holding crouching */
|
||||
if (input_buttons & INPUT_BUTTON8) {
|
||||
input_movevalues[2] = -240;
|
||||
}
|
||||
|
@ -769,8 +780,7 @@ PMove_Run(void)
|
|||
|
||||
/* call accelerate before and after the actual move,
|
||||
* 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_Move();
|
||||
PMove_Acceleration(input_timelength / 2, FALSE);
|
||||
|
@ -783,18 +793,18 @@ PMove_Run(void)
|
|||
self.basevelocity = [0,0,0];
|
||||
self.groundentity = __NULL__;
|
||||
|
||||
touchtriggers();
|
||||
|
||||
#ifdef VALVE
|
||||
/* timers, these are predicted and shared across client and server */
|
||||
pl.w_attack_next = max(0, pl.w_attack_next - input_timelength);
|
||||
pl.w_idle_next = max(0, pl.w_idle_next - input_timelength);
|
||||
#endif
|
||||
pl.weapontime += input_timelength;
|
||||
|
||||
punch = max(0, 1.0f - (input_timelength * 4));
|
||||
pl.punchangle[0] *= punch;
|
||||
pl.punchangle[1] *= punch;
|
||||
pl.punchangle[2] *= punch;
|
||||
|
||||
/* weapon/item logic of what the player controls */
|
||||
Game_Input();
|
||||
|
||||
/* activate any SOLID_TRIGGER entities */
|
||||
touchtriggers();
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#define ITEM_SHOTGUN 0x00000008i
|
||||
#define ITEM_CMLWBR 0x00000010i
|
||||
#define ITEM_XS 0x00000020i
|
||||
#define ITEM_PIPEBOMB 0x00000040i
|
||||
#define ITEM_SATCHEL 0x00000040i
|
||||
#define ITEM_UNUSED8 0x00000080i
|
||||
|
||||
#define ITEM_UNUSED9 0x00000100i
|
||||
|
|
114
src/shared/poke646/player.cpp
Normal file
114
src/shared/poke646/player.cpp
Normal 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
|
||||
};
|
||||
|
|
@ -14,6 +14,15 @@
|
|||
* 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
|
||||
{
|
||||
BNAIL_IDLE1,
|
||||
|
@ -34,10 +43,10 @@ enum
|
|||
void
|
||||
w_bradnailer_precache(void)
|
||||
{
|
||||
precache_sound("weapons/brad_hit1.wav");
|
||||
precache_sound("weapons/brad_hit2.wav");
|
||||
precache_sound("weapons/bradnailer.wav");
|
||||
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_bradnailer.fire");
|
||||
Sound_Precache("weapon_bradnailer.hitbody");
|
||||
#endif
|
||||
|
||||
precache_model("models/nail.mdl");
|
||||
precache_model("models/v_bradnailer.mdl");
|
||||
|
@ -48,7 +57,7 @@ void
|
|||
w_bradnailer_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
Weapons_UpdateAmmo(pl, pl.bradnailer_mag, pl.ammo_nail, -1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*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
|
||||
{
|
||||
PIPEB_IDLE,
|
||||
PIPEB_FIDGET,
|
||||
PIPEB_DRAW,
|
||||
PIPEB_THROW
|
||||
SATCHEL_IDLE,
|
||||
SATCHEL_FIDGET,
|
||||
SATCHEL_DRAW,
|
||||
SATCHEL_THROW
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
WATCH_IDLE,
|
||||
WATCH_FIDGET,
|
||||
WATCH_DRAW,
|
||||
WATCH_USE,
|
||||
WATCH_HOLSTER
|
||||
RADIO_IDLE,
|
||||
RADIO_FIDGET,
|
||||
RADIO_DRAW,
|
||||
RADIO_USE,
|
||||
RADIO_HOLSTER
|
||||
};
|
||||
|
||||
void w_pipebomb_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, pl.satchel_chg, pl.ammo_satchel, __NULL__);
|
||||
#endif
|
||||
w_satchel_updateammo(pl);
|
||||
}
|
||||
string w_pipebomb_wmodel(void)
|
||||
{
|
||||
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)
|
||||
{
|
||||
precache_sound("weapons/pb_bounce1.wav");
|
||||
precache_sound("weapons/pb_bounce2.wav"); precache_sound("weapons/pb_bounce3.wav");
|
||||
|
||||
#ifdef SSQC
|
||||
Sound_Precache("weapon_satchel.bounce");
|
||||
#endif
|
||||
precache_model("models/w_pipebomb.mdl");
|
||||
precache_model("models/v_pipebomb.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)
|
||||
{
|
||||
#ifdef SSQC
|
||||
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;
|
||||
return w_satchel_pickup(new);
|
||||
}
|
||||
|
||||
void w_pipebomb_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_pipebomb.mdl");
|
||||
Weapons_ViewAnimation(PIPEB_DRAW);
|
||||
Weapons_ViewAnimation(SATCHEL_DRAW);
|
||||
#ifdef SSQC
|
||||
player pl = (player)self;
|
||||
Weapons_UpdateAmmo(pl, pl.satchel_chg, pl.ammo_satchel, __NULL__);
|
||||
|
@ -83,6 +91,11 @@ void w_pipebomb_holster(void)
|
|||
#ifdef SSQC
|
||||
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;
|
||||
satch = spawn();
|
||||
satch.owner = master;
|
||||
|
@ -94,7 +107,8 @@ void s_pipebomb_drop(entity master, vector src, vector vel)
|
|||
satch.friction = 0.8f;
|
||||
satch.velocity = vel;
|
||||
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]);
|
||||
setorigin(satch, src);
|
||||
}
|
||||
|
@ -102,8 +116,9 @@ void s_pipebomb_detonate(entity master)
|
|||
{
|
||||
for (entity b = world; (b = find(b, ::classname, "satchel"));) {
|
||||
if (b.owner == master) {
|
||||
float dmg = Skill_GetValue("plr_satchel");
|
||||
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);
|
||||
remove(b);
|
||||
}
|
||||
|
@ -131,9 +146,9 @@ void w_pipebomb_primary(void)
|
|||
#endif
|
||||
|
||||
if (pl.a_ammo1 <= 0) {
|
||||
Weapons_ViewAnimation(WATCH_DRAW);
|
||||
Weapons_ViewAnimation(RADIO_DRAW);
|
||||
} else {
|
||||
Weapons_ViewAnimation(WATCH_USE);
|
||||
Weapons_ViewAnimation(RADIO_USE);
|
||||
}
|
||||
|
||||
#ifdef SSQC
|
||||
|
@ -150,7 +165,7 @@ void w_pipebomb_primary(void)
|
|||
pl.satchel_chg = 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__);
|
||||
|
@ -196,54 +211,34 @@ void w_pipebomb_secondary(void)
|
|||
setmodel(pSeat->eViewModel, "models/v_pipebomb_watch.mdl");
|
||||
#endif
|
||||
|
||||
Weapons_ViewAnimation(WATCH_DRAW);
|
||||
Weapons_ViewAnimation(RADIO_DRAW);
|
||||
|
||||
pl.w_attack_next = 1.0f;
|
||||
pl.w_idle_next = 2.5f;
|
||||
}
|
||||
void
|
||||
w_pipebomb_reload(void)
|
||||
void w_pipebomb_reload(void)
|
||||
{
|
||||
|
||||
}
|
||||
void
|
||||
w_pipebomb_release(void)
|
||||
void w_pipebomb_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
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;
|
||||
w_satchel_release();
|
||||
}
|
||||
|
||||
float
|
||||
w_pipebomb_aimanim(void)
|
||||
float w_pipebomb_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSQUEAK : ANIM_AIMSQUEAK;
|
||||
return w_satchel_aimanim();
|
||||
}
|
||||
|
||||
void
|
||||
w_pipebomb_hud(void)
|
||||
void w_pipebomb_hud(void)
|
||||
{
|
||||
w_satchel_holster();
|
||||
}
|
||||
|
||||
void w_pipebomb_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
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", [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) {
|
||||
if (selected) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
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 =
|
||||
{
|
||||
.id = ITEM_PIPEBOMB,
|
||||
.id = ITEM_SATCHEL,
|
||||
.slot = 4,
|
||||
.slot_pos = 0,
|
||||
.slot_pos = 1,
|
||||
.ki_spr = __NULL__,
|
||||
.ki_size = __NULL__,
|
||||
.ki_xy = __NULL__,
|
||||
|
@ -265,20 +260,19 @@ weapon_t w_pipebomb =
|
|||
.secondary = w_pipebomb_secondary,
|
||||
.reload = __NULL__,
|
||||
.release = w_pipebomb_release,
|
||||
.crosshair = __NULL__,
|
||||
.crosshair = w_pipebomb_hud,
|
||||
.precache = w_pipebomb_precache,
|
||||
.pickup = __NULL__,
|
||||
.pickup = w_pipebomb_pickup,
|
||||
.updateammo = w_pipebomb_updateammo,
|
||||
.wmodel = w_pipebomb_wmodel,
|
||||
.pmodel = __NULL__,
|
||||
.deathmsg = __NULL__,
|
||||
.aimanim = __NULL__,
|
||||
.aimanim = w_pipebomb_aimanim,
|
||||
.hudpic = w_pipebomb_hudpic
|
||||
};
|
||||
|
||||
#ifdef SSQC
|
||||
void weapon_pipebomb(void) {
|
||||
Weapons_InitItem(WEAPON_PIPEBOMB);
|
||||
Weapons_InitItem(WEAPON_SATCHEL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -247,7 +247,7 @@ weapon_t w_shotgun =
|
|||
{
|
||||
.id = ITEM_SHOTGUN,
|
||||
.slot = 2,
|
||||
.slot_pos = 0,
|
||||
.slot_pos = 1,
|
||||
.ki_spr = __NULL__,
|
||||
.ki_size = __NULL__,
|
||||
.ki_xy = __NULL__,
|
||||
|
|
|
@ -24,5 +24,11 @@ enum
|
|||
WEAPON_SHOTGUN,
|
||||
WEAPON_CMLWBR,
|
||||
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
|
||||
|
|
|
@ -42,15 +42,18 @@ enum
|
|||
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/v_crossbow.mdl");
|
||||
precache_model("models/w_crossbow.mdl");
|
||||
precache_model("models/p_crossbow.mdl");
|
||||
precache_sound("weapons/xbow_reload1.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
|
||||
|
@ -134,18 +137,14 @@ void Crossbolt_Touch(void) {
|
|||
/* walls, etc. */
|
||||
if (other.takedamage != DAMAGE_YES) {
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
/* anything else that can take damage */
|
||||
Damage_Apply(other, self.owner, Skill_GetValue("plr_xbow_bolt_monster"), WEAPON_CROSSBOW, DMG_BLUNT);
|
||||
if (random() < 0.5) {
|
||||
sound(self, 1, "weapons/xbow_hitbod1.wav", 1.0f, ATTN_NORM);
|
||||
} else {
|
||||
sound(self, 1, "weapons/xbow_hitbod2.wav", 1.0f, ATTN_NORM);
|
||||
}
|
||||
Sound_Play(self, 1, "weapon_crossbow.hitbody");
|
||||
|
||||
if (other.iBleeds == FALSE) {
|
||||
Effect_CreateSpark(self.origin, trace_plane_normal);
|
||||
|
@ -206,10 +205,10 @@ w_crossbow_primary(void)
|
|||
pl.crossbow_mag--;
|
||||
|
||||
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);
|
||||
#endif
|
||||
|
||||
|
|
48
valve/data.pk3dir/particles/fx.cfg
Normal file
48
valve/data.pk3dir/particles/fx.cfg
Normal 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
|
||||
}
|
9
valve/data.pk3dir/sound/items_valve.sndshd
Normal file
9
valve/data.pk3dir/sound/items_valve.sndshd
Normal file
|
@ -0,0 +1,9 @@
|
|||
ammo.pickup
|
||||
{
|
||||
sample items/9mmclip1.wav
|
||||
}
|
||||
|
||||
ammo.respawn
|
||||
{
|
||||
sample items/suitchargeok1.wav
|
||||
}
|
|
@ -9,6 +9,27 @@ weapon_357.reload
|
|||
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
|
||||
{
|
||||
sample weapons/cbar_hit1.wav
|
||||
|
|
BIN
valve/data.pk3dir/textures/fx/flare1.tga
Normal file
BIN
valve/data.pk3dir/textures/fx/flare1.tga
Normal file
Binary file not shown.
BIN
valve/data.pk3dir/textures/fx/flare2.tga
Normal file
BIN
valve/data.pk3dir/textures/fx/flare2.tga
Normal file
Binary file not shown.
BIN
valve/data.pk3dir/textures/fx/flare3.tga
Normal file
BIN
valve/data.pk3dir/textures/fx/flare3.tga
Normal file
Binary file not shown.
BIN
valve/data.pk3dir/textures/fx/flare4.tga
Normal file
BIN
valve/data.pk3dir/textures/fx/flare4.tga
Normal file
Binary file not shown.
Loading…
Reference in a new issue