Team Fortress: Initial commit. Rough framework for the weapons, build
scripts, etc.
This commit is contained in:
parent
1ebd5f6ced
commit
94b0b5acc5
56 changed files with 4043 additions and 182 deletions
|
@ -14,3 +14,6 @@ qc-progs:
|
|||
mkdir -p ../rewolf/data.pk3dir
|
||||
$(CC) client/rewolf/progs.src
|
||||
$(CC) server/rewolf/progs.src
|
||||
mkdir -p ../tfc/data.pk3dir
|
||||
$(CC) client/tfc/progs.src
|
||||
$(CC) server/tfc/progs.src
|
||||
|
|
|
@ -41,6 +41,7 @@ decore.cpp
|
|||
../npc.c
|
||||
|
||||
../../shared/valve/items.h
|
||||
../../shared/valve/weapon_common.h
|
||||
../../shared/valve/weapons.h
|
||||
../../shared/valve/w_crossbow.c
|
||||
../../shared/valve/w_crowbar.c
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
init.c
|
||||
|
||||
../../shared/scihunt/items.h
|
||||
../../shared/valve/weapon_common.h
|
||||
../../shared/scihunt/weapons.h
|
||||
../../shared/valve/w_crossbow.c
|
||||
../../shared/valve/w_crowbar.c
|
||||
|
|
26
src/client/tfc/entities.c
Normal file
26
src/client/tfc/entities.c
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* 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
|
||||
Game_Entity_Update(float id, float new)
|
||||
{
|
||||
switch (id) {
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
59
src/client/tfc/init.c
Normal file
59
src/client/tfc/init.c
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
float(entity foo, float chanid) getchannellevel = #0;
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
Client_Init
|
||||
|
||||
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
||||
=================
|
||||
*/
|
||||
void Client_Init(float apilevel, string enginename, float engineversion)
|
||||
{
|
||||
precache_model("sprites/640hud1.spr");
|
||||
precache_model("sprites/640hud2.spr");
|
||||
precache_model("sprites/640hud3.spr");
|
||||
precache_model("sprites/640hud4.spr");
|
||||
precache_model("sprites/640hud5.spr");
|
||||
precache_model("sprites/640hud6.spr");
|
||||
|
||||
precache_model("sprites/tfc_dmsg.spr");
|
||||
precache_model("sprites/tfchud01.spr");
|
||||
precache_model("sprites/tfchud02.spr");
|
||||
precache_model("sprites/tfchud03.spr");
|
||||
precache_model("sprites/tfchud04.spr");
|
||||
precache_model("sprites/tfchud05.spr");
|
||||
precache_model("sprites/tfchud06.spr");
|
||||
precache_model("sprites/tfchud07.spr");
|
||||
|
||||
precache_model("sprites/chainsaw.spr");
|
||||
precache_model("sprites/hammer.spr");
|
||||
precache_model("sprites/w_cannon.spr");
|
||||
|
||||
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
||||
}
|
||||
|
||||
void Client_InitDone(void)
|
||||
{
|
||||
}
|
||||
|
||||
void Game_RendererRestarted(string rstr)
|
||||
{
|
||||
|
||||
}
|
86
src/client/tfc/progs.src
Executable file
86
src/client/tfc/progs.src
Executable file
|
@ -0,0 +1,86 @@
|
|||
#pragma target fte
|
||||
#pragma progs_dat "../../../tfc/data.pk3dir/csprogs.dat"
|
||||
|
||||
#define CSQC
|
||||
#define VALVE
|
||||
|
||||
#includelist
|
||||
../../shared/fteextensions.qc
|
||||
../../shared/defs.h
|
||||
../../shared/math.h
|
||||
../../shared/materials.h
|
||||
../../shared/events.h
|
||||
../../shared/entities.h
|
||||
../valve/defs.h
|
||||
../valve/particles.h
|
||||
../defs.h
|
||||
|
||||
../../vgui/include.src
|
||||
|
||||
../util.c
|
||||
init.c
|
||||
|
||||
../../gs-entbase/client.src
|
||||
|
||||
../sound.c
|
||||
../text.c
|
||||
../voice.c
|
||||
|
||||
../../shared/valve/animations.h
|
||||
../../shared/valve/animations.c
|
||||
../../shared/valve/player.cpp
|
||||
../player.c
|
||||
../../shared/pmove.c
|
||||
../predict.c
|
||||
../../shared/decals.c
|
||||
../../shared/effects.c
|
||||
../../shared/spraylogo.cpp
|
||||
../npc.c
|
||||
|
||||
../../shared/tfc/items.h
|
||||
../../shared/valve/weapon_common.h
|
||||
../../shared/tfc/weapons.h
|
||||
../../shared/tfc/w_asscan.c
|
||||
../../shared/tfc/w_autorifle.c
|
||||
../../shared/tfc/w_crowbar.c
|
||||
../../shared/tfc/w_dbs.c
|
||||
../../shared/tfc/w_flamer.c
|
||||
../../shared/tfc/w_glauncher.c
|
||||
../../shared/tfc/w_grapple.c
|
||||
../../shared/tfc/w_incendiary.c
|
||||
../../shared/tfc/w_knife.c
|
||||
../../shared/tfc/w_medkit.c
|
||||
../../shared/tfc/w_nailgun.c
|
||||
../../shared/tfc/w_pipebomb.c
|
||||
../../shared/tfc/w_railgun.c
|
||||
../../shared/tfc/w_rpg.c
|
||||
../../shared/tfc/w_sbs.c
|
||||
../../shared/tfc/w_sniper.c
|
||||
../../shared/tfc/w_supernail.c
|
||||
../../shared/tfc/w_tranquil.c
|
||||
../../shared/tfc/w_umbrella.c
|
||||
../../shared/tfc/w_wrench.c
|
||||
../../shared/tfc/weapons.c
|
||||
../../shared/valve/weapon_common.c
|
||||
|
||||
../valve/player.c
|
||||
entities.c
|
||||
../entities.c
|
||||
|
||||
../valve/cmds.c
|
||||
../valve/game_event.c
|
||||
../events.c
|
||||
../valve/view.c
|
||||
../view.c
|
||||
../damage.c
|
||||
../obituary.c
|
||||
../chat.c
|
||||
../vgui.cpp
|
||||
|
||||
../valve/hud.c
|
||||
../valve/hud_weaponselect.c
|
||||
../valve/scoreboard.c
|
||||
|
||||
../valve/input.c
|
||||
../entry.c
|
||||
#endlist
|
|
@ -50,6 +50,12 @@ Player_ReadEntity(float new)
|
|||
|
||||
fl = readfloat();
|
||||
|
||||
/* HACK: we need to make this more reliable */
|
||||
if (fl == UPDATE_ALL) {
|
||||
/* we respawned */
|
||||
pl.gravity = __NULL__;
|
||||
}
|
||||
|
||||
if (fl & PLAYER_MODELINDEX)
|
||||
pl.modelindex = readshort();
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ init.c
|
|||
../npc.c
|
||||
|
||||
../../shared/valve/items.h
|
||||
../../shared/valve/weapon_common.h
|
||||
../../shared/valve/weapons.h
|
||||
../../shared/valve/w_crossbow.c
|
||||
../../shared/valve/w_crowbar.c
|
||||
|
|
|
@ -33,7 +33,7 @@ void Voice_DrawHUD(void) {
|
|||
drawfill([pos[0] + 143, pos[1]], [1, 24], UI_MAINCOLOR, 1.0f);
|
||||
|
||||
drawfont = FONT_CON;
|
||||
drawstring([pos[0] + 28, pos[1] + 8], getplayerkeyvalue(i, "name"), [12,12], UI_MAINCOLOR, 1.0f, DRAWFLAG_NORMAL);
|
||||
drawstring([pos[0] + 28, pos[1] + 8], getplayerkeyvalue(i, "name"), [12,12], [1,1,1], 1.0f, DRAWFLAG_NORMAL);
|
||||
|
||||
drawpic(pos + [2,0], "gfx/vgui/icntlk_sv.tga", [24,24], UI_MAINCOLOR, 1, DRAWFLAG_NORMAL);
|
||||
pos[1] -= 32;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* TODO: Move these into the player info struct! */
|
||||
float g_flFadeDuration;
|
||||
float g_flFadeHold;
|
||||
float g_flFadeMaxAlpha;
|
||||
|
@ -38,9 +39,19 @@ enumflags
|
|||
EVF_ONLYUSER
|
||||
};
|
||||
|
||||
const string mat_fade_modulate =
|
||||
"{\n" \
|
||||
"{\n" \
|
||||
"map $whiteimage\n" \
|
||||
"rgbGen vertex\n" \
|
||||
"blendFunc GL_DST_COLOR GL_ONE_MINUS_SRC_ALPHA\n" \
|
||||
"alphaGen vertex\n" \
|
||||
"}\n" \
|
||||
"}\n";
|
||||
|
||||
void Fade_Init(void)
|
||||
{
|
||||
shaderforname("fade_modulate","{\n{\nmap $whiteimage\nrgbGen vertex\nblendFunc GL_DST_COLOR GL_ONE_MINUS_SRC_ALPHA\nalphaGen vertex\n}\n}\n");
|
||||
shaderforname("fade_modulate", mat_fade_modulate);
|
||||
}
|
||||
|
||||
void Fade_Update (int x, int y, int w, int h)
|
||||
|
@ -50,13 +61,13 @@ void Fade_Update (int x, int y, int w, int h)
|
|||
}
|
||||
if (g_flFadeStyle & EVF_FADEDROM) {
|
||||
if (g_flFadeTime > g_flFadeHold) {
|
||||
g_flFadeAlpha -= (frametime * (1.0f / g_flFadeDuration)) * g_flFadeMaxAlpha;
|
||||
g_flFadeAlpha -= (clframetime * (1.0f / g_flFadeDuration)) * g_flFadeMaxAlpha;
|
||||
}
|
||||
} else {
|
||||
if (g_flFadeTime < g_flFadeDuration) {
|
||||
g_flFadeAlpha += (frametime * (1.0f / g_flFadeDuration)) * g_flFadeMaxAlpha;
|
||||
g_flFadeAlpha += (clframetime * (1.0f / g_flFadeDuration)) * g_flFadeMaxAlpha;
|
||||
} else {
|
||||
g_flFadeAlpha -= (frametime * (1.0f / g_flFadeHold)) * g_flFadeMaxAlpha;
|
||||
g_flFadeAlpha -= (clframetime * (1.0f / g_flFadeHold)) * g_flFadeMaxAlpha;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,7 +88,7 @@ void Fade_Update (int x, int y, int w, int h)
|
|||
drawfill([x, y], [w, h], g_vecFadeColor, g_flFadeAlpha, 0);
|
||||
}
|
||||
|
||||
g_flFadeTime += frametime;
|
||||
g_flFadeTime += clframetime;
|
||||
}
|
||||
|
||||
void Fade_Parse (void)
|
||||
|
|
|
@ -23,10 +23,6 @@ All it does right now is spawn snarks, regardless of what monster you want to
|
|||
spawn.
|
||||
*/
|
||||
|
||||
#ifdef VALVE
|
||||
void() w_snark_deploy;
|
||||
#endif
|
||||
|
||||
class monstermaker : CBaseTrigger
|
||||
{
|
||||
void() monstermaker;
|
||||
|
@ -35,9 +31,7 @@ class monstermaker : CBaseTrigger
|
|||
|
||||
void monstermaker :: Trigger ( void )
|
||||
{
|
||||
#ifdef VALVE
|
||||
w_snark_deploy();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void monstermaker :: monstermaker ( void )
|
||||
|
|
|
@ -22,17 +22,6 @@
|
|||
STUB!
|
||||
*/
|
||||
|
||||
class path_track:CBaseTrigger
|
||||
class path_track:path_corner
|
||||
{
|
||||
float m_flSpeed;
|
||||
float m_flWait;
|
||||
|
||||
void() path_track;
|
||||
};
|
||||
|
||||
void path_track::path_track(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
m_flSpeed = 100;
|
||||
m_flWait = 1.0f;
|
||||
}
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
/*
|
||||
Copyright 2019 <marco@icculus.org>
|
||||
Permission to use, copy, modify, and/or 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 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.
|
||||
*/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
var int autocvar_chatplug_suppresschat = 0;
|
||||
|
||||
|
@ -70,6 +71,14 @@ init(float prevprogs)
|
|||
int i = 0;
|
||||
int c = 0;
|
||||
filestream chatfile;
|
||||
searchhandle list;
|
||||
|
||||
list = search_begin("plugins/chatsounds/*.txt", TRUE, TRUE);
|
||||
for (int i = 0; i < search_getsize(list); i++) {
|
||||
print(sprintf("Found %s\n", search_getfilename(list, i)));
|
||||
}
|
||||
search_end(list);
|
||||
|
||||
chatfile = fopen("chatsounds.txt", FILE_READ);
|
||||
|
||||
if (chatfile < 0) {
|
||||
|
|
|
@ -36,6 +36,7 @@ monster_human_unarmed.cpp
|
|||
../../shared/pmove.c
|
||||
../valve/spectator.c
|
||||
../../shared/valve/items.h
|
||||
../../shared/valve/weapon_common.h
|
||||
../../shared/valve/weapons.h
|
||||
../../shared/valve/w_crossbow.c
|
||||
../../shared/valve/w_crowbar.c
|
||||
|
|
|
@ -189,6 +189,7 @@ void Game_PutClientInServer(void)
|
|||
setsize(pl, VEC_HULL_MIN, VEC_HULL_MAX);
|
||||
pl.view_ofs = VEC_PLAYER_VIEWPOS;
|
||||
pl.velocity = [0,0,0];
|
||||
pl.gravity = __NULL__;
|
||||
pl.frame = 1;
|
||||
pl.SendEntity = Player_SendEntity;
|
||||
pl.SendFlags = UPDATE_ALL;
|
||||
|
|
|
@ -32,6 +32,7 @@ monster_scientist.cpp
|
|||
../../shared/pmove.c
|
||||
../valve/spectator.c
|
||||
../../shared/scihunt/items.h
|
||||
../../shared/valve/weapon_common.h
|
||||
../../shared/scihunt/weapons.h
|
||||
../../shared/valve/w_crossbow.c
|
||||
../../shared/valve/w_crowbar.c
|
||||
|
|
319
src/server/tfc/client.c
Normal file
319
src/server/tfc/client.c
Normal file
|
@ -0,0 +1,319 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
var int autocvar_sv_networkeverything = FALSE;
|
||||
|
||||
void
|
||||
Game_ClientConnect(void)
|
||||
{
|
||||
entity a;
|
||||
bprint(PRINT_HIGH, sprintf("%s connected\n", self.netname));
|
||||
|
||||
int playercount = 0;
|
||||
for (a = world; (a = find(a, classname, "player"));) {
|
||||
playercount++;
|
||||
}
|
||||
|
||||
/* we're the first. respawn all entities? */
|
||||
if (playercount == 0) {
|
||||
for (a = world; (a = findfloat(a, gflags, GF_CANRESPAWN));) {
|
||||
CBaseEntity caw = (CBaseEntity)a;
|
||||
caw.Respawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Game_ClientDisconnect(void)
|
||||
{
|
||||
bprint(PRINT_HIGH, sprintf("%s disconnected\n", self.netname));
|
||||
|
||||
/* Make this unusable */
|
||||
self.solid = SOLID_NOT;
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
self.modelindex = 0;
|
||||
self.health = 0;
|
||||
self.takedamage = 0;
|
||||
self.SendFlags = PLAYER_MODELINDEX;
|
||||
}
|
||||
|
||||
void
|
||||
Game_ClientKill(void)
|
||||
{
|
||||
Damage_Apply(self, self, self.health, self.origin, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
Game_PlayerPreThink(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
Game_PlayerPostThink(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
Animation_PlayerUpdate();
|
||||
|
||||
pl.SendFlags |= PLAYER_KEEPALIVE;
|
||||
|
||||
if (pl.old_modelindex != pl.modelindex) {
|
||||
pl.SendFlags |= PLAYER_MODELINDEX;
|
||||
}
|
||||
if (pl.old_origin[0] != pl.origin[0]) {
|
||||
pl.SendFlags |= PLAYER_ORIGIN;
|
||||
}
|
||||
if (pl.old_origin[1] != pl.origin[1]) {
|
||||
pl.SendFlags |= PLAYER_ORIGIN;
|
||||
}
|
||||
if (pl.old_origin[2] != pl.origin[2]) {
|
||||
pl.SendFlags |= PLAYER_ORIGIN_Z;
|
||||
}
|
||||
if (pl.old_angles[0] != pl.angles[0]) {
|
||||
pl.SendFlags |= PLAYER_ANGLES_X;
|
||||
}
|
||||
if (pl.old_angles[1] != pl.angles[1]) {
|
||||
pl.SendFlags |= PLAYER_ANGLES_Y;
|
||||
}
|
||||
if (pl.old_angles[2] != pl.angles[2]) {
|
||||
pl.SendFlags |= PLAYER_ANGLES_Z;
|
||||
}
|
||||
if (pl.old_velocity[0] != pl.velocity[0]) {
|
||||
pl.SendFlags |= PLAYER_VELOCITY;
|
||||
}
|
||||
if (pl.old_velocity[1] != pl.velocity[1]) {
|
||||
pl.SendFlags |= PLAYER_VELOCITY;
|
||||
}
|
||||
if (pl.old_velocity[2] != pl.velocity[2]) {
|
||||
pl.SendFlags |= PLAYER_VELOCITY_Z;
|
||||
}
|
||||
if (pl.old_flags != pl.flags) {
|
||||
pl.SendFlags |= PLAYER_FLAGS;
|
||||
}
|
||||
if (pl.old_activeweapon != pl.activeweapon) {
|
||||
pl.SendFlags |= PLAYER_WEAPON;
|
||||
}
|
||||
if (pl.old_items != pl.g_items) {
|
||||
pl.SendFlags |= PLAYER_ITEMS;
|
||||
}
|
||||
if (pl.old_health != pl.health) {
|
||||
pl.SendFlags |= PLAYER_HEALTH;
|
||||
}
|
||||
if (pl.old_armor != pl.armor) {
|
||||
pl.SendFlags |= PLAYER_ARMOR;
|
||||
}
|
||||
if (pl.old_movetype != pl.movetype) {
|
||||
pl.SendFlags |= PLAYER_MOVETYPE;
|
||||
}
|
||||
if (pl.old_viewofs != pl.view_ofs[2]) {
|
||||
pl.SendFlags |= PLAYER_VIEWOFS;
|
||||
}
|
||||
if (pl.old_baseframe != pl.baseframe) {
|
||||
pl.SendFlags |= PLAYER_BASEFRAME;
|
||||
}
|
||||
if (pl.old_frame != pl.frame) {
|
||||
pl.SendFlags |= PLAYER_FRAME;
|
||||
}
|
||||
if (pl.old_a_ammo1 != pl.a_ammo1) {
|
||||
pl.SendFlags |= PLAYER_AMMO1;
|
||||
}
|
||||
if (pl.old_a_ammo2 != pl.a_ammo2) {
|
||||
pl.SendFlags |= PLAYER_AMMO2;
|
||||
}
|
||||
if (pl.old_a_ammo3 != pl.a_ammo3) {
|
||||
pl.SendFlags |= PLAYER_AMMO3;
|
||||
}
|
||||
|
||||
pl.old_modelindex = pl.modelindex;
|
||||
pl.old_origin = pl.origin;
|
||||
pl.old_angles = pl.angles;
|
||||
pl.old_velocity = pl.velocity;
|
||||
pl.old_flags = pl.flags;
|
||||
pl.old_activeweapon = pl.activeweapon;
|
||||
pl.old_items = pl.g_items;
|
||||
pl.old_health = pl.health;
|
||||
pl.old_armor = pl.armor;
|
||||
pl.old_movetype = pl.movetype;
|
||||
pl.old_viewofs = pl.view_ofs[2];
|
||||
pl.old_baseframe = pl.baseframe;
|
||||
pl.old_frame = pl.frame;
|
||||
pl.old_a_ammo1 = pl.a_ammo1;
|
||||
pl.old_a_ammo2 = pl.a_ammo2;
|
||||
pl.old_a_ammo3 = pl.a_ammo3;
|
||||
}
|
||||
void
|
||||
Game_RunClientCommand(void)
|
||||
{
|
||||
Footsteps_Update();
|
||||
QPhysics_Run(self);
|
||||
}
|
||||
|
||||
void
|
||||
Game_DecodeChangeParms(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
g_landmarkpos[0] = parm1;
|
||||
g_landmarkpos[1] = parm2;
|
||||
g_landmarkpos[2] = parm3;
|
||||
pl.angles[0] = parm4;
|
||||
pl.angles[1] = parm5;
|
||||
pl.angles[2] = parm6;
|
||||
pl.velocity[0] = parm7;
|
||||
pl.velocity[1] = parm8;
|
||||
pl.velocity[2] = parm9;
|
||||
pl.g_items = parm10;
|
||||
pl.activeweapon = parm11;
|
||||
}
|
||||
|
||||
void
|
||||
Game_SetChangeParms(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
parm1 = g_landmarkpos[0];
|
||||
parm2 = g_landmarkpos[1];
|
||||
parm3 = g_landmarkpos[2];
|
||||
parm4 = pl.angles[0];
|
||||
parm5 = pl.angles[1];
|
||||
parm6 = pl.angles[2];
|
||||
parm7 = pl.velocity[0];
|
||||
parm8 = pl.velocity[1];
|
||||
parm9 = pl.velocity[2];
|
||||
parm10 = pl.g_items;
|
||||
parm11 = pl.activeweapon;
|
||||
}
|
||||
|
||||
void
|
||||
Game_PutClientInServer(void)
|
||||
{
|
||||
if (self.classname != "player") {
|
||||
spawnfunc_player();
|
||||
}
|
||||
player pl = (player)self;
|
||||
|
||||
entity spot;
|
||||
pl.classname = "player";
|
||||
pl.health = self.max_health = 100;
|
||||
|
||||
pl.takedamage = DAMAGE_YES;
|
||||
pl.solid = SOLID_SLIDEBOX;
|
||||
pl.movetype = MOVETYPE_WALK;
|
||||
pl.flags = FL_CLIENT;
|
||||
pl.viewzoom = 1.0;
|
||||
pl.model = "models/player.mdl";
|
||||
|
||||
string mymodel = infokey(pl, "model");
|
||||
|
||||
if (mymodel) {
|
||||
mymodel = sprintf("models/player/%s/%s.mdl", mymodel, mymodel);
|
||||
if (whichpack(mymodel)) {
|
||||
pl.model = mymodel;
|
||||
}
|
||||
}
|
||||
setmodel(pl, pl.model);
|
||||
|
||||
setsize(pl, VEC_HULL_MIN, VEC_HULL_MAX);
|
||||
pl.view_ofs = VEC_PLAYER_VIEWPOS;
|
||||
pl.velocity = [0,0,0];
|
||||
pl.gravity = __NULL__;
|
||||
pl.frame = 1;
|
||||
pl.SendEntity = Player_SendEntity;
|
||||
pl.SendFlags = UPDATE_ALL;
|
||||
|
||||
pl.customphysics = Empty;
|
||||
pl.vPain = Player_Pain;
|
||||
pl.vDeath = Player_Death;
|
||||
pl.iBleeds = TRUE;
|
||||
forceinfokey(pl, "*spec", "0");
|
||||
forceinfokey(self, "*deaths", ftos(self.deaths));
|
||||
|
||||
if (cvar("sv_playerslots") == 1) {
|
||||
Game_DecodeChangeParms();
|
||||
|
||||
if (startspot != "") {
|
||||
setorigin(pl, Landmark_GetSpot());
|
||||
} else {
|
||||
spot = find(world, classname, "info_player_start");
|
||||
setorigin(pl, spot.origin);
|
||||
pl.angles = spot.angles;
|
||||
pl.fixangle = TRUE;
|
||||
}
|
||||
} else {
|
||||
spot = Spawn_SelectRandom("info_player_deathmatch");
|
||||
setorigin(pl, spot.origin);
|
||||
pl.angles = spot.angles;
|
||||
pl.fixangle = TRUE;
|
||||
|
||||
pl.ammo_9mm = 68;
|
||||
Weapons_AddItem(pl, WEAPON_CROWBAR);
|
||||
pl.g_items |= ITEM_SUIT;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SV_SendChat(entity sender, string msg, entity eEnt, float fType)
|
||||
{
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, fType == 0 ? EV_CHAT:EV_CHAT_TEAM);
|
||||
WriteByte(MSG_MULTICAST, num_for_edict(sender) - 1);
|
||||
WriteByte(MSG_MULTICAST, sender.team);
|
||||
WriteString(MSG_MULTICAST, msg);
|
||||
if (eEnt) {
|
||||
msg_entity = eEnt;
|
||||
multicast([0,0,0], MULTICAST_ONE);
|
||||
} else {
|
||||
multicast([0,0,0], MULTICAST_ALL);
|
||||
}
|
||||
|
||||
localcmd(sprintf("echo [SERVER] %s: %s\n", sender.netname, msg));
|
||||
}
|
||||
|
||||
void
|
||||
Game_ParseClientCommand(string cmd)
|
||||
{
|
||||
tokenize(cmd);
|
||||
|
||||
if (argv(1) == "timeleft") {
|
||||
string msg;
|
||||
string timestring;
|
||||
float timeleft;
|
||||
timeleft = cvar("mp_timelimit") - (time / 60);
|
||||
timestring = Vox_TimeToString(timeleft);
|
||||
msg = sprintf("we have %s minutes remaining", timestring);
|
||||
Vox_Singlecast(self, msg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (argv(0) == "say") {
|
||||
SV_SendChat(self, argv(1), world, 0);
|
||||
return;
|
||||
} else if (argv(0) == "say_team") {
|
||||
entity a;
|
||||
for (a = world; (a = find(a, classname, "player"));) {
|
||||
if (a.team == self.team) {
|
||||
SV_SendChat(self, argv(1), a, 1);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
clientcommand(self, cmd);
|
||||
}
|
||||
|
||||
void
|
||||
Game_SetNewParms(void)
|
||||
{
|
||||
|
||||
}
|
83
src/server/tfc/input.c
Normal file
83
src/server/tfc/input.c
Normal file
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
=================
|
||||
Input_Handle
|
||||
|
||||
Handles impulse and whatnot
|
||||
=================
|
||||
*/
|
||||
void Game_Input(void)
|
||||
{
|
||||
if (input_buttons & INPUT_BUTTON0) {
|
||||
Weapons_Primary();
|
||||
} else if (input_buttons & INPUT_BUTTON4) {
|
||||
Weapons_Reload();
|
||||
} else if (input_buttons & INPUT_BUTTON3) {
|
||||
Weapons_Secondary();
|
||||
} else {
|
||||
Weapons_Release();
|
||||
}
|
||||
|
||||
if (input_buttons & INPUT_BUTTON5) {
|
||||
Player_UseDown();
|
||||
} else {
|
||||
Player_UseUp();
|
||||
}
|
||||
|
||||
if (self.impulse == 100) {
|
||||
Flashlight_Toggle();
|
||||
}
|
||||
|
||||
if (cvar("sv_cheats") == 1) {
|
||||
player pl = (player)self;
|
||||
if (self.impulse == 101) {
|
||||
pl.health = 100;
|
||||
pl.armor = 100;
|
||||
Weapons_AddItem(pl, WEAPON_CROWBAR);
|
||||
Weapons_AddItem(pl, WEAPON_MEDKIT);
|
||||
Weapons_AddItem(pl, WEAPON_KNIFE);
|
||||
Weapons_AddItem(pl, WEAPON_WRENCH);
|
||||
Weapons_AddItem(pl, WEAPON_UMBRELLA);
|
||||
Weapons_AddItem(pl, WEAPON_SBS);
|
||||
Weapons_AddItem(pl, WEAPON_SNIPER);
|
||||
Weapons_AddItem(pl, WEAPON_TRANQUIL);
|
||||
Weapons_AddItem(pl, WEAPON_RAILGUN);
|
||||
Weapons_AddItem(pl, WEAPON_AUTORIFLE);
|
||||
Weapons_AddItem(pl, WEAPON_DBS);
|
||||
Weapons_AddItem(pl, WEAPON_NAILGUN);
|
||||
Weapons_AddItem(pl, WEAPON_GLAUNCHER);
|
||||
Weapons_AddItem(pl, WEAPON_SUPERNAIL);
|
||||
Weapons_AddItem(pl, WEAPON_FLAMER);
|
||||
Weapons_AddItem(pl, WEAPON_RPG);
|
||||
Weapons_AddItem(pl, WEAPON_PIPEBOMB);
|
||||
Weapons_AddItem(pl, WEAPON_ASSCAN);
|
||||
Weapons_AddItem(pl, WEAPON_INCENDIARY);
|
||||
}
|
||||
|
||||
if (self.impulse == 102) {
|
||||
// Respawn all the entities
|
||||
for (entity a = world; (a = findfloat(a, gflags, GF_CANRESPAWN));) {
|
||||
CBaseEntity caw = (CBaseEntity)a;
|
||||
caw.Respawn();
|
||||
}
|
||||
bprint(PRINT_HIGH, "Respawning all map entities...\n");
|
||||
}
|
||||
}
|
||||
|
||||
self.impulse = 0;
|
||||
}
|
69
src/server/tfc/progs.src
Executable file
69
src/server/tfc/progs.src
Executable file
|
@ -0,0 +1,69 @@
|
|||
#pragma target fte
|
||||
#pragma progs_dat "../../../tfc/data.pk3dir/progs.dat"
|
||||
|
||||
#define QWSSQC
|
||||
#define VALVE
|
||||
|
||||
#includelist
|
||||
../../shared/fteextensions.qc
|
||||
../../shared/defs.h
|
||||
../valve/defs.h
|
||||
../../shared/math.h
|
||||
../../shared/materials.h
|
||||
../../shared/events.h
|
||||
../../shared/entities.h
|
||||
../../shared/valve/animations.h
|
||||
../defs.h
|
||||
../plugins.c
|
||||
../../gs-entbase/server.src
|
||||
../../shared/decals.c
|
||||
../../shared/effects.c
|
||||
../../shared/spraylogo.cpp
|
||||
../../shared/valve/player.cpp
|
||||
../valve/player.c
|
||||
../../shared/pmove.c
|
||||
../valve/spectator.c
|
||||
|
||||
../../shared/tfc/items.h
|
||||
../../shared/valve/weapon_common.h
|
||||
../../shared/tfc/weapons.h
|
||||
../../shared/tfc/w_asscan.c
|
||||
../../shared/tfc/w_autorifle.c
|
||||
../../shared/tfc/w_crowbar.c
|
||||
../../shared/tfc/w_dbs.c
|
||||
../../shared/tfc/w_flamer.c
|
||||
../../shared/tfc/w_glauncher.c
|
||||
../../shared/tfc/w_grapple.c
|
||||
../../shared/tfc/w_incendiary.c
|
||||
../../shared/tfc/w_knife.c
|
||||
../../shared/tfc/w_medkit.c
|
||||
../../shared/tfc/w_nailgun.c
|
||||
../../shared/tfc/w_pipebomb.c
|
||||
../../shared/tfc/w_railgun.c
|
||||
../../shared/tfc/w_rpg.c
|
||||
../../shared/tfc/w_sbs.c
|
||||
../../shared/tfc/w_sniper.c
|
||||
../../shared/tfc/w_supernail.c
|
||||
../../shared/tfc/w_tranquil.c
|
||||
../../shared/tfc/w_umbrella.c
|
||||
../../shared/tfc/w_wrench.c
|
||||
../valve/items.cpp
|
||||
../valve/item_weaponbox.cpp
|
||||
../../shared/tfc/weapons.c
|
||||
../../shared/valve/weapon_common.c
|
||||
|
||||
../spawn.c
|
||||
../vox.c
|
||||
../../shared/valve/animations.c
|
||||
client.c
|
||||
../client.c
|
||||
../valve/server.c
|
||||
../server.c
|
||||
../valve/damage.c
|
||||
../traceattack.c
|
||||
../footsteps.c
|
||||
../flashlight.c
|
||||
input.c
|
||||
../valve/spawn.c
|
||||
../entry.c
|
||||
#endlist
|
1
src/server/valve/cheats.c
Normal file
1
src/server/valve/cheats.c
Normal file
|
@ -0,0 +1 @@
|
|||
|
|
@ -227,6 +227,7 @@ Game_PutClientInServer(void)
|
|||
setsize(pl, VEC_HULL_MIN, VEC_HULL_MAX);
|
||||
pl.view_ofs = VEC_PLAYER_VIEWPOS;
|
||||
pl.velocity = [0,0,0];
|
||||
pl.gravity = __NULL__;
|
||||
pl.frame = 1;
|
||||
pl.SendEntity = Player_SendEntity;
|
||||
pl.SendFlags = UPDATE_ALL;
|
||||
|
|
|
@ -63,7 +63,7 @@ void Game_Input(void)
|
|||
Weapons_AddItem(pl, WEAPON_TRIPMINE);
|
||||
Weapons_AddItem(pl, WEAPON_SNARK);
|
||||
}
|
||||
|
||||
|
||||
if (self.impulse == 102) {
|
||||
// Respawn all the entities
|
||||
for (entity a = world; (a = findfloat(a, gflags, GF_CANRESPAWN));) {
|
||||
|
|
|
@ -31,6 +31,7 @@ player.c
|
|||
../../shared/pmove.c
|
||||
spectator.c
|
||||
../../shared/valve/items.h
|
||||
../../shared/valve/weapon_common.h
|
||||
../../shared/valve/weapons.h
|
||||
../../shared/valve/w_crossbow.c
|
||||
../../shared/valve/w_crowbar.c
|
||||
|
|
|
@ -199,6 +199,30 @@ void Decal_MakeShader(decal target)
|
|||
string shader_buff;
|
||||
target.m_strShader = sprintf("decal_%s", target.m_strTexture);
|
||||
|
||||
if (target.style & DFLAG_INVERT) {
|
||||
int i;
|
||||
int *buff;
|
||||
vector res;
|
||||
int w, h;
|
||||
|
||||
res = drawgetimagesize(target.m_strTexture);
|
||||
w = (int)res[0];
|
||||
h = (int)res[1];
|
||||
buff = r_readimage(target.m_strTexture, w, h);
|
||||
|
||||
/* we can only upload this under a new name */
|
||||
target.m_strTexture = sprintf("%s_inv", target.m_strTexture);
|
||||
|
||||
if (buff != __NULL__) {
|
||||
for (i = 0; i < ( w * h ); i++) {
|
||||
//buff[i] = ~buff[i];
|
||||
}
|
||||
|
||||
r_uploadimage(target.m_strTexture, w, h, (void*)buff);
|
||||
memfree(buff);
|
||||
}
|
||||
}
|
||||
|
||||
if (target.style & DFLAG_ADDITIVE) {
|
||||
shader_buff = sprintf(g_decal_shader_add, target.m_strTexture);
|
||||
} else {
|
||||
|
|
|
@ -23,7 +23,8 @@ typedef struct
|
|||
|
||||
enumflags
|
||||
{
|
||||
DFLAG_ADDITIVE
|
||||
DFLAG_ADDITIVE,
|
||||
DFLAG_INVERT
|
||||
};
|
||||
|
||||
#define COLOR_REDBLOOD [114,25,7]
|
||||
|
@ -31,27 +32,27 @@ enumflags
|
|||
|
||||
decal_t g_decalwad[] =
|
||||
{
|
||||
{ "{bigblood1", COLOR_REDBLOOD, 0 },
|
||||
{ "{bigblood2", COLOR_REDBLOOD, 0 },
|
||||
{ "{bigblood1", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{bigblood2", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{bproof1", [255,255,255], DFLAG_ADDITIVE },
|
||||
{ "{break1", [255,255,255], DFLAG_ADDITIVE },
|
||||
{ "{break2", [255,255,255], DFLAG_ADDITIVE },
|
||||
{ "{break3", [255,255,255], DFLAG_ADDITIVE },
|
||||
{ "{blood1", COLOR_REDBLOOD, 0 },
|
||||
{ "{blood2", COLOR_REDBLOOD, 0 },
|
||||
{ "{blood3", COLOR_REDBLOOD, 0 },
|
||||
{ "{blood4", COLOR_REDBLOOD, 0 },
|
||||
{ "{blood5", COLOR_REDBLOOD, 0 },
|
||||
{ "{blood6", COLOR_REDBLOOD, 0 },
|
||||
{ "{blood7", COLOR_REDBLOOD, 0 },
|
||||
{ "{blood8", COLOR_REDBLOOD, 0 },
|
||||
{ "{bloodhand1", COLOR_REDBLOOD, 0 },
|
||||
{ "{bloodhand2", COLOR_REDBLOOD, 0 },
|
||||
{ "{bloodhand3", COLOR_REDBLOOD, 0 },
|
||||
{ "{bloodhand4", COLOR_REDBLOOD, 0 },
|
||||
{ "{bloodhand5", COLOR_REDBLOOD, 0 },
|
||||
{ "{bloodhand6", COLOR_REDBLOOD, 0 },
|
||||
{ "{hand1", COLOR_REDBLOOD, 0 },
|
||||
{ "{blood1", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{blood2", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{blood3", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{blood4", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{blood5", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{blood6", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{blood7", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{blood8", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{bloodhand1", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{bloodhand2", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{bloodhand3", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{bloodhand4", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{bloodhand5", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{bloodhand6", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{hand1", COLOR_REDBLOOD, DFLAG_INVERT },
|
||||
{ "{shot1", [255,255,255], 0 },
|
||||
{ "{shot2", [255,255,255], 0 },
|
||||
{ "{shot3", [255,255,255], 0 },
|
||||
|
@ -66,12 +67,12 @@ decal_t g_decalwad[] =
|
|||
{ "{scorch1", [255,255,255], 0 },
|
||||
{ "{scorch2", [255,255,255], 0 },
|
||||
{ "{scorch3", [255,255,255], 0 },
|
||||
{ "{yblood1", COLOR_YELLOWBLOOD, 0 },
|
||||
{ "{yblood2", COLOR_YELLOWBLOOD, 0 },
|
||||
{ "{yblood3", COLOR_YELLOWBLOOD, 0 },
|
||||
{ "{yblood4", COLOR_YELLOWBLOOD, 0 },
|
||||
{ "{yblood5", COLOR_YELLOWBLOOD, 0 },
|
||||
{ "{yblood6", COLOR_YELLOWBLOOD, 0 },
|
||||
{ "{yblood7", COLOR_YELLOWBLOOD, 0 },
|
||||
{ "{yblood8", COLOR_YELLOWBLOOD, 0 }
|
||||
{ "{yblood1", COLOR_YELLOWBLOOD, DFLAG_INVERT },
|
||||
{ "{yblood2", COLOR_YELLOWBLOOD, DFLAG_INVERT },
|
||||
{ "{yblood3", COLOR_YELLOWBLOOD, DFLAG_INVERT },
|
||||
{ "{yblood4", COLOR_YELLOWBLOOD, DFLAG_INVERT },
|
||||
{ "{yblood5", COLOR_YELLOWBLOOD, DFLAG_INVERT },
|
||||
{ "{yblood6", COLOR_YELLOWBLOOD, DFLAG_INVERT },
|
||||
{ "{yblood7", COLOR_YELLOWBLOOD, DFLAG_INVERT },
|
||||
{ "{yblood8", COLOR_YELLOWBLOOD, DFLAG_INVERT }
|
||||
};
|
||||
|
|
|
@ -24,7 +24,8 @@ string g_hgibs[] = {
|
|||
"models/gib_b_gib.mdl"
|
||||
};
|
||||
|
||||
void Effects_Init(void)
|
||||
void
|
||||
Effects_Init(void)
|
||||
{
|
||||
precache_model("sprites/fexplo.spr");
|
||||
precache_model("sprites/bloodspray.spr");
|
||||
|
@ -79,12 +80,13 @@ void Effects_Init(void)
|
|||
precache_sound("weapons/ric_conc-2.wav");
|
||||
precache_sound("weapons/knife_hitwall1.wav");
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void Effect_GibHuman(vector pos) {
|
||||
void
|
||||
Effect_GibHuman(vector pos)
|
||||
{
|
||||
#ifdef SSQC
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EV_GIBHUMAN);
|
||||
|
@ -118,7 +120,9 @@ void Effect_GibHuman(vector pos) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void Effect_CreateExplosion(vector vPos) {
|
||||
void
|
||||
Effect_CreateExplosion(vector vPos)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Decals_PlaceScorch(vPos);
|
||||
vPos[2] += 48;
|
||||
|
|
|
@ -14,35 +14,7 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int id; /* bitflag id */
|
||||
int slot;
|
||||
int slot_pos;
|
||||
|
||||
string ki_spr;
|
||||
vector ki_size;
|
||||
vector ki_xy;
|
||||
|
||||
void() draw;
|
||||
void() holster;
|
||||
void() primary;
|
||||
void() secondary;
|
||||
void() reload;
|
||||
void() release;
|
||||
void() crosshair;
|
||||
|
||||
void() precache;
|
||||
void() pickup;
|
||||
void(player) updateammo;
|
||||
string() wmodel;
|
||||
string() pmodel;
|
||||
string() deathmsg;
|
||||
float() aimanim;
|
||||
void(int, vector) hudpic;
|
||||
} weapon_t;
|
||||
|
||||
/* Weapon Indices for the weapon table */
|
||||
/* weapon Indices for the weapon table */
|
||||
enum
|
||||
{
|
||||
WEAPON_NONE,
|
||||
|
@ -65,7 +37,7 @@ enum
|
|||
WEAPON_SNARK
|
||||
};
|
||||
|
||||
/* What the weapons do support and stuff */
|
||||
/* what the weapons do support and stuff */
|
||||
enum
|
||||
{
|
||||
AMMO_9MM,
|
||||
|
@ -81,27 +53,3 @@ enum
|
|||
AMMO_SNARK,
|
||||
AMMO_HORNET
|
||||
};
|
||||
|
||||
void Weapons_DrawCrosshair(void);
|
||||
void Decals_PlaceSmall(vector pos);
|
||||
void Decals_PlaceBig(vector pos);
|
||||
void Weapons_MakeVectors(void);
|
||||
void Weapons_ViewAnimation(int i);
|
||||
vector Weapons_GetCameraPos(void);
|
||||
void Weapons_ViewPunchAngle(vector add);
|
||||
void Weapons_PlaySound(entity t, float ch, string s, float vol, float at);
|
||||
int Weapons_IsPresent(player pl, int w);
|
||||
void Weapons_SetModel(string);
|
||||
#ifdef SSQC
|
||||
void Weapons_RefreshAmmo(player);
|
||||
void Weapons_InitItem(int w);
|
||||
void Weapons_AddItem(player pl, int w);
|
||||
void Weapons_RemoveItem(player pl, int w);
|
||||
string Weapons_GetWorldmodel(int id);
|
||||
void Weapons_UpdateAmmo(player pl, int a1, int a2, int a3);
|
||||
void Weapons_ReloadWeapon(player pl, .int mag, .int ammo, int max);
|
||||
#else
|
||||
string Weapons_GetPlayermodel(int id);
|
||||
int Weapons_GetAnimation(void);
|
||||
void Weapons_HUDPic(int w, int s, vector pos);
|
||||
#endif
|
||||
|
|
|
@ -101,7 +101,7 @@ const string g_spray_mat = \
|
|||
"polygonOffset\n" \
|
||||
"{\n" \
|
||||
"map $rt:%s\n" \
|
||||
"blendfunc gl_one gl_one_minus_src_alpha\n" \
|
||||
"blendfunc blend\n" \
|
||||
"rgbGen vertex\n" \
|
||||
"}\n" \
|
||||
"}";
|
||||
|
|
50
src/shared/tfc/items.h
Normal file
50
src/shared/tfc/items.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define ITEM_CROWBAR 0x00000001
|
||||
#define ITEM_MEDKIT 0x00000002
|
||||
#define ITEM_KNIFE 0x00000004
|
||||
#define ITEM_WRENCH 0x00000008
|
||||
#define ITEM_UMBRELLA 0x00000010
|
||||
#define ITEM_SBS 0x00000020
|
||||
#define ITEM_SNIPER 0x00000040
|
||||
#define ITEM_TRANQUIL 0x00000080
|
||||
#define ITEM_RAILGUN 0x00000100
|
||||
#define ITEM_AUTORIFLE 0x00000200
|
||||
#define ITEM_DBS 0x00000400
|
||||
#define ITEM_NAILGUN 0x00000800
|
||||
#define ITEM_GLAUNCHER 0x00001000
|
||||
#define ITEM_SUPERNAIL 0x00002000
|
||||
#define ITEM_FLAMER 0x00004000
|
||||
#define ITEM_RPG 0x00008000
|
||||
#define ITEM_PIPEBOMB 0x00010000
|
||||
#define ITEM_ASSCAN 0x00020000
|
||||
|
||||
#define ITEM_INCENDIARY 0x00040000
|
||||
|
||||
#define ITEM_GRAPPLE 0x00080000
|
||||
#define ITEM_SUIT 0x00100000
|
||||
#define ITEM_UNUSED22 0x00200000
|
||||
#define ITEM_UNUSED23 0x00400000
|
||||
#define ITEM_UNUSED24 0x00800000
|
||||
#define ITEM_UNUSED25 0x01000000
|
||||
#define ITEM_UNUSED26 0x02000000
|
||||
#define ITEM_UNUSED27 0x04000000
|
||||
#define ITEM_UNUSED28 0x08000000
|
||||
#define ITEM_UNUSED29 0x10000000
|
||||
#define ITEM_UNUSED30 0x20000000
|
||||
#define ITEM_UNUSED31 0x40000000
|
||||
#define ITEM_UNUSED32 0x80000000
|
116
src/shared/tfc/w_asscan.c
Normal file
116
src/shared/tfc/w_asscan.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_asscan_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfac.mdl");
|
||||
precache_model("models/w_asscan.mdl");
|
||||
precache_model("models/p_asscan.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_asscan_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_asscan_wmodel(void)
|
||||
{
|
||||
return "models/w_asscan.mdl";
|
||||
}
|
||||
string
|
||||
w_asscan_pmodel(void)
|
||||
{
|
||||
return "models/p_asscan.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_asscan_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_asscan_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfac.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_asscan_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_asscan_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud04.spr_0.tga",
|
||||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud03.spr_0.tga",
|
||||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_asscan =
|
||||
{
|
||||
.id = ITEM_ASSCAN,
|
||||
.slot = 4,
|
||||
.slot_pos = 2,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [0,16],
|
||||
.draw = w_asscan_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_asscan_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_asscan_updateammo,
|
||||
.wmodel = w_asscan_wmodel,
|
||||
.pmodel = w_asscan_pmodel,
|
||||
.deathmsg = w_asscan_deathmsg,
|
||||
.aimanim = w_asscan_aimanim,
|
||||
.hudpic = w_asscan_hudpic
|
||||
};
|
116
src/shared/tfc/w_autorifle.c
Normal file
116
src/shared/tfc/w_autorifle.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_autorifle_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_sniper.mdl");
|
||||
precache_model("models/w_autorifle.mdl");
|
||||
precache_model("models/p_autorifle.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_autorifle_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_autorifle_wmodel(void)
|
||||
{
|
||||
return "models/w_autorifle.mdl";
|
||||
}
|
||||
string
|
||||
w_autorifle_pmodel(void)
|
||||
{
|
||||
return "models/p_autorifle.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_autorifle_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_autorifle_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_sniper.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_autorifle_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_autorifle_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud02.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud01.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_autorifle =
|
||||
{
|
||||
.id = ITEM_AUTORIFLE,
|
||||
.slot = 2,
|
||||
.slot_pos = 0,
|
||||
.ki_spr = "sprites/640hud1.spr_0.tga",
|
||||
.ki_size = [60,16],
|
||||
.ki_xy = [0,80],
|
||||
.draw = w_autorifle_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_autorifle_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_autorifle_updateammo,
|
||||
.wmodel = w_autorifle_wmodel,
|
||||
.pmodel = w_autorifle_pmodel,
|
||||
.deathmsg = w_autorifle_deathmsg,
|
||||
.aimanim = w_autorifle_aimanim,
|
||||
.hudpic = w_autorifle_hudpic
|
||||
};
|
234
src/shared/tfc/w_crowbar.c
Normal file
234
src/shared/tfc/w_crowbar.c
Normal file
|
@ -0,0 +1,234 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
CBAR_IDLE,
|
||||
CBAR_DRAW,
|
||||
CBAR_HOLSTER,
|
||||
CBAR_ATTACK1HIT,
|
||||
CBAR_ATTACK1MISS,
|
||||
CBAR_ATTACK2MISS,
|
||||
CBAR_ATTACK2HIT,
|
||||
CBAR_ATTACK3MISS,
|
||||
CBAR_ATTACK3HIT
|
||||
};
|
||||
|
||||
void
|
||||
w_crowbar_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");
|
||||
precache_model("models/v_tfc_crowbar.mdl");
|
||||
precache_model("models/w_crowbar.mdl");
|
||||
precache_model("models/p_crowbar.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_crowbar_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_crowbar_wmodel(void)
|
||||
{
|
||||
return "models/w_crowbar.mdl";
|
||||
}
|
||||
string
|
||||
w_crowbar_pmodel(void)
|
||||
{
|
||||
return "models/p_crowbar.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_crowbar_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Crowbar.";
|
||||
}
|
||||
|
||||
void
|
||||
w_crowbar_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_crowbar.mdl");
|
||||
Weapons_ViewAnimation(CBAR_DRAW);
|
||||
}
|
||||
|
||||
void
|
||||
w_crowbar_holster(void)
|
||||
{
|
||||
Weapons_ViewAnimation(CBAR_HOLSTER);
|
||||
}
|
||||
|
||||
void
|
||||
w_crowbar_primary(void)
|
||||
{
|
||||
int anim = 0;
|
||||
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);
|
||||
|
||||
int r = (float)input_sequence % 3;
|
||||
switch (r) {
|
||||
case 0:
|
||||
anim = trace_fraction >= 1 ? CBAR_ATTACK1MISS:CBAR_ATTACK1HIT;
|
||||
break;
|
||||
case 1:
|
||||
anim = trace_fraction >= 1 ? CBAR_ATTACK2MISS:CBAR_ATTACK2HIT;
|
||||
break;
|
||||
default:
|
||||
anim = trace_fraction >= 1 ? CBAR_ATTACK3MISS:CBAR_ATTACK3HIT;
|
||||
}
|
||||
Weapons_ViewAnimation(anim);
|
||||
|
||||
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 SSQC
|
||||
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, [0,0,0]);
|
||||
} else {
|
||||
Effect_Impact(IMPACT_MELEE, trace_endpos, trace_plane_normal);
|
||||
}
|
||||
|
||||
if (trace_ent.takedamage) {
|
||||
Damage_Apply(trace_ent, self, 10, trace_endpos, FALSE );
|
||||
|
||||
if (!trace_ent.iBleeds) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (random() < 0.33) {
|
||||
sound(pl, 8, "weapons/cbar_hitbod1.wav", 1, ATTN_NORM);
|
||||
} else if (random() < 0.66) {
|
||||
sound(pl, 8, "weapons/cbar_hitbod2.wav", 1, ATTN_NORM);
|
||||
} else {
|
||||
sound(pl, 8, "weapons/cbar_hitbod3.wav", 1, ATTN_NORM);
|
||||
}
|
||||
} else {
|
||||
if (random() < 0.5) {
|
||||
sound(pl, 8, "weapons/cbar_hit1.wav", 1, ATTN_NORM);
|
||||
} else {
|
||||
sound(pl, 8, "weapons/cbar_hit2.wav", 1, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
w_crowbar_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_idle_next) {
|
||||
return;
|
||||
}
|
||||
|
||||
Weapons_ViewAnimation(CBAR_IDLE);
|
||||
pl.w_idle_next = 15.0f;
|
||||
}
|
||||
|
||||
float
|
||||
w_crowbar_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_crowbar_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/640hud4.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/640hud1.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_crowbar =
|
||||
{
|
||||
.id = ITEM_CROWBAR,
|
||||
.slot = 0,
|
||||
.slot_pos = 0,
|
||||
.ki_spr = "sprites/640hud1.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [192,0],
|
||||
.draw = w_crowbar_draw,
|
||||
.holster = w_crowbar_holster,
|
||||
.primary = w_crowbar_primary,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = w_crowbar_release,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_crowbar_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_crowbar_updateammo,
|
||||
.wmodel = w_crowbar_wmodel,
|
||||
.pmodel = w_crowbar_pmodel,
|
||||
.deathmsg = w_crowbar_deathmsg,
|
||||
.aimanim = w_crowbar_aimanim,
|
||||
.hudpic = w_crowbar_hudpic
|
||||
};
|
274
src/shared/tfc/w_dbs.c
Normal file
274
src/shared/tfc/w_dbs.c
Normal file
|
@ -0,0 +1,274 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
DBS_IDLE1,
|
||||
DBS_FIRE1,
|
||||
DBS_FIRE2,
|
||||
DBS_ADDSHELL,
|
||||
DBS_PUMP,
|
||||
DBS_START_RELOAD,
|
||||
DBS_DRAW,
|
||||
DBS_HOLSTER,
|
||||
DBS_IDLE2,
|
||||
DBS_IDLE3
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
DBS_IDLE,
|
||||
DBS_RELOAD_START,
|
||||
DBS_RELOAD,
|
||||
DBS_RELOAD_END
|
||||
};
|
||||
|
||||
void
|
||||
w_dbs_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_shotgun.mdl");
|
||||
precache_model("models/w_shot2.mdl");
|
||||
precache_model("models/p_shot2.mdl");
|
||||
precache_sound("weapons/sbarrel1.wav");
|
||||
precache_sound("weapons/dbarrel1.wav");
|
||||
precache_sound("weapons/reload3.wav");
|
||||
precache_sound("weapons/scock1.wav");
|
||||
}
|
||||
|
||||
void
|
||||
w_dbs_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_shells, __NULL__);
|
||||
#endif
|
||||
}
|
||||
string w_dbs_wmodel(void)
|
||||
{
|
||||
return "models/w_shot2.mdl";
|
||||
}
|
||||
string w_dbs_pmodel(void)
|
||||
{
|
||||
return "models/p_shot2.mdl";
|
||||
}
|
||||
string w_dbs_deathmsg(void)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
void
|
||||
w_dbs_pickup(void)
|
||||
{
|
||||
#ifdef SSQC
|
||||
player pl = (player)self;
|
||||
pl.shotgun_mag = bound(0, pl.shotgun_mag + 8, 8);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
w_dbs_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_shotgun.mdl");
|
||||
Weapons_ViewAnimation(DBS_DRAW);
|
||||
#ifdef SSQC
|
||||
player pl = (player)self;
|
||||
Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_shells, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
w_dbs_holster(void)
|
||||
{
|
||||
Weapons_ViewAnimation(DBS_HOLSTER);
|
||||
}
|
||||
|
||||
void
|
||||
w_dbs_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pl.a_ammo3 > DBS_IDLE) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Ammo check */
|
||||
#ifdef SSQC
|
||||
if (pl.shotgun_mag <= 0) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (pl.a_ammo1 <= 0) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SSQC
|
||||
TraceAttack_FireBullets(4, pl.origin + pl.view_ofs, 14, [0.17365,0.04362]);
|
||||
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/sbarrel1.wav", 1, ATTN_NORM);
|
||||
pl.shotgun_mag--;
|
||||
Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_shells, __NULL__);
|
||||
#else
|
||||
View_SetMuzzleflash(MUZZLE_WEIRD);
|
||||
Weapons_ViewPunchAngle([-5,0,0]);
|
||||
pl.a_ammo1--;
|
||||
#endif
|
||||
Weapons_ViewAnimation(DBS_FIRE1);
|
||||
|
||||
pl.w_attack_next = 0.75;
|
||||
pl.w_idle_next = 2.5f;
|
||||
}
|
||||
|
||||
void
|
||||
w_dbs_reload(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
#ifdef CSQC
|
||||
if (pl.a_ammo1 >= 8) {
|
||||
return;
|
||||
}
|
||||
if (pl.a_ammo2 <= 0) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (pl.shotgun_mag >= 8) {
|
||||
return;
|
||||
}
|
||||
if (pl.ammo_shells <= 0) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pl.a_ammo3 > DBS_IDLE) {
|
||||
return;
|
||||
}
|
||||
pl.a_ammo3 = DBS_RELOAD_START;
|
||||
pl.w_idle_next = 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
w_dbs_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pl.a_ammo3 == DBS_IDLE) {
|
||||
int r = floor(random(0,3));
|
||||
switch (r) {
|
||||
case 0:
|
||||
Weapons_ViewAnimation(DBS_IDLE1);
|
||||
break;
|
||||
case 1:
|
||||
Weapons_ViewAnimation(DBS_IDLE2);
|
||||
break;
|
||||
case 2:
|
||||
Weapons_ViewAnimation(DBS_IDLE3);
|
||||
break;
|
||||
}
|
||||
pl.w_idle_next = 15.0f;
|
||||
} else if (pl.a_ammo3 == DBS_RELOAD_START) {
|
||||
Weapons_ViewAnimation(DBS_START_RELOAD);
|
||||
pl.a_ammo3 = DBS_RELOAD;
|
||||
pl.w_idle_next = 0.65f;
|
||||
} else if (pl.a_ammo3 == DBS_RELOAD) {
|
||||
Weapons_ViewAnimation(DBS_ADDSHELL);
|
||||
#ifdef CSQC
|
||||
pl.a_ammo1++;
|
||||
pl.a_ammo2--;
|
||||
|
||||
if (pl.a_ammo2 <= 0 || pl.a_ammo1 >= 8) {
|
||||
pl.a_ammo3 = DBS_RELOAD_END;
|
||||
}
|
||||
#else
|
||||
pl.shotgun_mag++;
|
||||
pl.ammo_shells--;
|
||||
Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_shells, pl.a_ammo3);
|
||||
sound(pl, CHAN_WEAPON, "weapons/reload3.wav", 1.0, ATTN_NORM);
|
||||
if (pl.ammo_shells <= 0 || pl.shotgun_mag >= 8) {
|
||||
pl.a_ammo3 = DBS_RELOAD_END;
|
||||
}
|
||||
#endif
|
||||
pl.w_idle_next = 0.5f;
|
||||
} else if (pl.a_ammo3 == DBS_RELOAD_END) {
|
||||
Weapons_ViewAnimation(DBS_PUMP);
|
||||
#ifdef SSQC
|
||||
sound(pl, CHAN_WEAPON, "weapons/scock1.wav", 1.0, ATTN_NORM);
|
||||
#endif
|
||||
pl.a_ammo3 = DBS_IDLE;
|
||||
pl.w_idle_next = 10.0f;
|
||||
pl.w_attack_next = 0.5f;
|
||||
}
|
||||
}
|
||||
void
|
||||
w_dbs_crosshair(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
static vector cross_pos;
|
||||
cross_pos = (video_res / 2) + [-12,-12];
|
||||
drawsubpic(cross_pos, [24,24], "sprites/crosshairs.spr_0.tga", [48/128,24/128], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL);
|
||||
HUD_DrawAmmo1();
|
||||
HUD_DrawAmmo2();
|
||||
vector aicon_pos = video_mins + [video_res[0] - 48, video_res[1] - 42];
|
||||
drawsubpic(aicon_pos, [24,24], "sprites/640hud7.spr_0.tga", [72/256,72/128], [24/256, 24/128], g_hud_color, pSeat->ammo2_alpha, DRAWFLAG_ADDITIVE);
|
||||
#endif
|
||||
}
|
||||
|
||||
float
|
||||
w_dbs_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN;
|
||||
}
|
||||
|
||||
void
|
||||
w_dbs_hudpic(int s, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud4.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud1.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_dbs =
|
||||
{
|
||||
ITEM_DBS,
|
||||
2,
|
||||
1,
|
||||
"sprites/640hud1.spr_0.tga",
|
||||
[48,16],
|
||||
[192,64],
|
||||
w_dbs_draw,
|
||||
w_dbs_holster,
|
||||
w_dbs_primary,
|
||||
w_dbs_release,
|
||||
w_dbs_reload,
|
||||
w_dbs_release,
|
||||
w_dbs_crosshair,
|
||||
w_dbs_precache,
|
||||
w_dbs_pickup,
|
||||
w_dbs_updateammo,
|
||||
w_dbs_wmodel,
|
||||
w_dbs_pmodel,
|
||||
w_dbs_deathmsg,
|
||||
w_dbs_aimanim,
|
||||
w_dbs_hudpic
|
||||
};
|
116
src/shared/tfc/w_flamer.c
Normal file
116
src/shared/tfc/w_flamer.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_flamer_precache(void)
|
||||
{
|
||||
precache_model("models/v_flame.mdl");
|
||||
precache_model("models/w_flamer.mdl");
|
||||
precache_model("models/p_flamer.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_flamer_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_flamer_wmodel(void)
|
||||
{
|
||||
return "models/w_flamer.mdl";
|
||||
}
|
||||
string
|
||||
w_flamer_pmodel(void)
|
||||
{
|
||||
return "models/p_flamer.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_flamer_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_flamer_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_flame.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_flamer_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_flamer_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud07.spr_0.tga",
|
||||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud07.spr_0.tga",
|
||||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_flamer =
|
||||
{
|
||||
.id = ITEM_FLAMER,
|
||||
.slot = 3,
|
||||
.slot_pos = 3,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
.ki_size = [64,16],
|
||||
.ki_xy = [112,24],
|
||||
.draw = w_flamer_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_flamer_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_flamer_updateammo,
|
||||
.wmodel = w_flamer_wmodel,
|
||||
.pmodel = w_flamer_pmodel,
|
||||
.deathmsg = w_flamer_deathmsg,
|
||||
.aimanim = w_flamer_aimanim,
|
||||
.hudpic = w_flamer_hudpic
|
||||
};
|
116
src/shared/tfc/w_glauncher.c
Normal file
116
src/shared/tfc/w_glauncher.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_glauncher_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfgl.mdl");
|
||||
precache_model("models/w_glauncher.mdl");
|
||||
precache_model("models/p_glauncher.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_glauncher_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_glauncher_wmodel(void)
|
||||
{
|
||||
return "models/w_glauncher.mdl";
|
||||
}
|
||||
string
|
||||
w_glauncher_pmodel(void)
|
||||
{
|
||||
return "models/p_glauncher.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_glauncher_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_glauncher_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfgl.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_glauncher_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_glauncher_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud02.spr_0.tga",
|
||||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud01.spr_0.tga",
|
||||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_glauncher =
|
||||
{
|
||||
.id = ITEM_GLAUNCHER,
|
||||
.slot = 3,
|
||||
.slot_pos = 1,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [0,128],
|
||||
.draw = w_glauncher_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_glauncher_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_glauncher_updateammo,
|
||||
.wmodel = w_glauncher_wmodel,
|
||||
.pmodel = w_glauncher_pmodel,
|
||||
.deathmsg = w_glauncher_deathmsg,
|
||||
.aimanim = w_glauncher_aimanim,
|
||||
.hudpic = w_glauncher_hudpic
|
||||
};
|
116
src/shared/tfc/w_grapple.c
Normal file
116
src/shared/tfc/w_grapple.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_grapple_precache(void)
|
||||
{
|
||||
precache_model("models/v_grapple.mdl");
|
||||
precache_model("models/w_grapple.mdl");
|
||||
precache_model("models/p_grapple.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_grapple_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_grapple_wmodel(void)
|
||||
{
|
||||
return "models/w_grapple.mdl";
|
||||
}
|
||||
string
|
||||
w_grapple_pmodel(void)
|
||||
{
|
||||
return "models/p_grapple.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_grapple_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_grapple_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_grapple.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_grapple_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_grapple_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/640hud4.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/640hud1.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_grapple =
|
||||
{
|
||||
.id = ITEM_GRAPPLE,
|
||||
.slot = 5,
|
||||
.slot_pos = 0,
|
||||
.ki_spr = "sprites/640hud1.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [192,0],
|
||||
.draw = w_grapple_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_grapple_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_grapple_updateammo,
|
||||
.wmodel = w_grapple_wmodel,
|
||||
.pmodel = w_grapple_pmodel,
|
||||
.deathmsg = w_grapple_deathmsg,
|
||||
.aimanim = w_grapple_aimanim,
|
||||
.hudpic = w_grapple_hudpic
|
||||
};
|
116
src/shared/tfc/w_incendiary.c
Normal file
116
src/shared/tfc/w_incendiary.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_incendiary_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_rpg.mdl");
|
||||
precache_model("models/w_incendiary.mdl");
|
||||
precache_model("models/p_incendiary.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_incendiary_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_incendiary_wmodel(void)
|
||||
{
|
||||
return "models/w_incendiary.mdl";
|
||||
}
|
||||
string
|
||||
w_incendiary_pmodel(void)
|
||||
{
|
||||
return "models/p_incendiary.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_incendiary_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_incendiary_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_rpg.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_incendiary_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_incendiary_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud05.spr_0.tga",
|
||||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud06.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_incendiary =
|
||||
{
|
||||
.id = ITEM_INCENDIARY,
|
||||
.slot = 4,
|
||||
.slot_pos = 3,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [0,160],
|
||||
.draw = w_incendiary_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_incendiary_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_incendiary_updateammo,
|
||||
.wmodel = w_incendiary_wmodel,
|
||||
.pmodel = w_incendiary_pmodel,
|
||||
.deathmsg = w_incendiary_deathmsg,
|
||||
.aimanim = w_incendiary_aimanim,
|
||||
.hudpic = w_incendiary_hudpic
|
||||
};
|
116
src/shared/tfc/w_knife.c
Normal file
116
src/shared/tfc/w_knife.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_knife_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_knife.mdl");
|
||||
precache_model("models/w_knife.mdl");
|
||||
precache_model("models/p_knife.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_knife_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_knife_wmodel(void)
|
||||
{
|
||||
return "models/w_knife.mdl";
|
||||
}
|
||||
string
|
||||
w_knife_pmodel(void)
|
||||
{
|
||||
return "models/p_knife.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_knife_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_knife_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_knife.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_knife_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_knife_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud04.spr_0.tga",
|
||||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud03.spr_0.tga",
|
||||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_knife =
|
||||
{
|
||||
.id = ITEM_KNIFE,
|
||||
.slot = 0,
|
||||
.slot_pos = 2,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [0,32],
|
||||
.draw = w_knife_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_knife_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_knife_updateammo,
|
||||
.wmodel = w_knife_wmodel,
|
||||
.pmodel = w_knife_pmodel,
|
||||
.deathmsg = w_knife_deathmsg,
|
||||
.aimanim = w_knife_aimanim,
|
||||
.hudpic = w_knife_hudpic
|
||||
};
|
116
src/shared/tfc/w_medkit.c
Normal file
116
src/shared/tfc/w_medkit.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_medkit_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_medkit.mdl");
|
||||
precache_model("models/w_medkit.mdl");
|
||||
precache_model("models/p_medkit.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_medkit_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_medkit_wmodel(void)
|
||||
{
|
||||
return "models/w_medkit.mdl";
|
||||
}
|
||||
string
|
||||
w_medkit_pmodel(void)
|
||||
{
|
||||
return "models/p_medkit.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_medkit_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_medkit_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_medkit.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_medkit_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_medkit_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud05.spr_0.tga",
|
||||
[0,180/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud06.spr_0.tga",
|
||||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_medkit =
|
||||
{
|
||||
.id = ITEM_MEDKIT,
|
||||
.slot = 0,
|
||||
.slot_pos = 1,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [0,192],
|
||||
.draw = w_medkit_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_medkit_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_medkit_updateammo,
|
||||
.wmodel = w_medkit_wmodel,
|
||||
.pmodel = w_medkit_pmodel,
|
||||
.deathmsg = w_medkit_deathmsg,
|
||||
.aimanim = w_medkit_aimanim,
|
||||
.hudpic = w_medkit_hudpic
|
||||
};
|
116
src/shared/tfc/w_nailgun.c
Normal file
116
src/shared/tfc/w_nailgun.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_nailgun_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_nailgun.mdl");
|
||||
precache_model("models/w_nailgun.mdl");
|
||||
precache_model("models/p_nailgun.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_nailgun_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_nailgun_wmodel(void)
|
||||
{
|
||||
return "models/w_nailgun.mdl";
|
||||
}
|
||||
string
|
||||
w_nailgun_pmodel(void)
|
||||
{
|
||||
return "models/p_nailgun.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_nailgun_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_nailgun_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_nailgun.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_nailgun_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_nailgun_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud07.spr_0.tga",
|
||||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud07.spr_0.tga",
|
||||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_nailgun =
|
||||
{
|
||||
.id = ITEM_NAILGUN,
|
||||
.slot = 3,
|
||||
.slot_pos = 0,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [112,43],
|
||||
.draw = w_nailgun_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_nailgun_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_nailgun_updateammo,
|
||||
.wmodel = w_nailgun_wmodel,
|
||||
.pmodel = w_nailgun_pmodel,
|
||||
.deathmsg = w_nailgun_deathmsg,
|
||||
.aimanim = w_nailgun_aimanim,
|
||||
.hudpic = w_nailgun_hudpic
|
||||
};
|
117
src/shared/tfc/w_pipebomb.c
Normal file
117
src/shared/tfc/w_pipebomb.c
Normal file
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_pipebomb_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfgl.mdl");
|
||||
precache_model("models/w_pipebomb.mdl");
|
||||
precache_model("models/p_pipebomb.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_pipebomb_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
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 was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_pipebomb_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfgl.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_pipebomb_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_pipebomb_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud02.spr_0.tga",
|
||||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud01.spr_0.tga",
|
||||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_pipebomb =
|
||||
{
|
||||
.id = ITEM_PIPEBOMB,
|
||||
.slot = 4,
|
||||
.slot_pos = 1,
|
||||
.ki_spr = "sprites/640hud1.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [0,112],
|
||||
.draw = w_pipebomb_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_pipebomb_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_pipebomb_updateammo,
|
||||
.wmodel = w_pipebomb_wmodel,
|
||||
.pmodel = w_pipebomb_pmodel,
|
||||
.deathmsg = w_pipebomb_deathmsg,
|
||||
.aimanim = w_pipebomb_aimanim,
|
||||
.hudpic = w_pipebomb_hudpic
|
||||
};
|
116
src/shared/tfc/w_railgun.c
Normal file
116
src/shared/tfc/w_railgun.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_railgun_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_railgun.mdl");
|
||||
precache_model("models/w_railgun.mdl");
|
||||
precache_model("models/p_railgun.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_railgun_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_railgun_wmodel(void)
|
||||
{
|
||||
return "models/w_railgun.mdl";
|
||||
}
|
||||
string
|
||||
w_railgun_pmodel(void)
|
||||
{
|
||||
return "models/p_railgun.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_railgun_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_railgun_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_railgun.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_railgun_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_railgun_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud07.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud07.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_railgun =
|
||||
{
|
||||
.id = ITEM_RAILGUN,
|
||||
.slot = 1,
|
||||
.slot_pos = 3,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [113,4],
|
||||
.draw = w_railgun_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_railgun_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_railgun_updateammo,
|
||||
.wmodel = w_railgun_wmodel,
|
||||
.pmodel = w_railgun_pmodel,
|
||||
.deathmsg = w_railgun_deathmsg,
|
||||
.aimanim = w_railgun_aimanim,
|
||||
.hudpic = w_railgun_hudpic
|
||||
};
|
98
src/shared/tfc/w_rpg.c
Normal file
98
src/shared/tfc/w_rpg.c
Normal file
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_rpg_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_rpg.mdl");
|
||||
precache_model("models/w_rpg.mdl");
|
||||
precache_model("models/p_rpg.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_rpg_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_rpg_wmodel(void)
|
||||
{
|
||||
return "models/w_rpg.mdl";
|
||||
}
|
||||
string
|
||||
w_rpg_pmodel(void)
|
||||
{
|
||||
return "models/p_rpg.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_rpg_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_rpg_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_rpg.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_rpg_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_rpg_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud5.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud2.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_rpg =
|
||||
{
|
||||
.id = ITEM_RPG,
|
||||
.slot = 4,
|
||||
.slot_pos = 0,
|
||||
.ki_spr = "sprites/640hud1.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [192,96],
|
||||
.draw = w_rpg_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_rpg_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_rpg_updateammo,
|
||||
.wmodel = w_rpg_wmodel,
|
||||
.pmodel = w_rpg_pmodel,
|
||||
.deathmsg = w_rpg_deathmsg,
|
||||
.aimanim = w_rpg_aimanim,
|
||||
.hudpic = w_rpg_hudpic
|
||||
};
|
273
src/shared/tfc/w_sbs.c
Normal file
273
src/shared/tfc/w_sbs.c
Normal file
|
@ -0,0 +1,273 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
SBS_IDLE1,
|
||||
SBS_FIRE1,
|
||||
SBS_FIRE2,
|
||||
SBS_ADDSHELL,
|
||||
SBS_PUMP,
|
||||
SBS_START_RELOAD,
|
||||
SBS_DRAW,
|
||||
SBS_HOLSTER,
|
||||
SBS_IDLE2,
|
||||
SBS_IDLE3
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SBS_IDLE,
|
||||
SBS_RELOAD_START,
|
||||
SBS_RELOAD,
|
||||
SBS_RELOAD_END
|
||||
};
|
||||
|
||||
void
|
||||
w_sbs_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_12gauge.mdl");
|
||||
precache_model("models/p_shotgun.mdl");
|
||||
precache_sound("weapons/sbarrel1.wav");
|
||||
precache_sound("weapons/dbarrel1.wav");
|
||||
precache_sound("weapons/reload3.wav");
|
||||
precache_sound("weapons/scock1.wav");
|
||||
}
|
||||
|
||||
void
|
||||
w_sbs_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_shells, __NULL__);
|
||||
#endif
|
||||
}
|
||||
string w_sbs_wmodel(void)
|
||||
{
|
||||
return "models/ball.mdl";
|
||||
}
|
||||
string w_sbs_pmodel(void)
|
||||
{
|
||||
return "models/p_shotgun.mdl";
|
||||
}
|
||||
string w_sbs_deathmsg(void)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
void
|
||||
w_sbs_pickup(void)
|
||||
{
|
||||
#ifdef SSQC
|
||||
player pl = (player)self;
|
||||
pl.shotgun_mag = bound(0, pl.shotgun_mag + 8, 8);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
w_sbs_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_12gauge.mdl");
|
||||
Weapons_ViewAnimation(SBS_DRAW);
|
||||
#ifdef SSQC
|
||||
player pl = (player)self;
|
||||
Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_shells, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
w_sbs_holster(void)
|
||||
{
|
||||
Weapons_ViewAnimation(SBS_HOLSTER);
|
||||
}
|
||||
|
||||
void
|
||||
w_sbs_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pl.a_ammo3 > SBS_IDLE) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Ammo check */
|
||||
#ifdef SSQC
|
||||
if (pl.shotgun_mag <= 0) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (pl.a_ammo1 <= 0) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SSQC
|
||||
TraceAttack_FireBullets(4, pl.origin + pl.view_ofs, 6, [0.17365,0.04362]);
|
||||
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/sbarrel1.wav", 1, ATTN_NORM);
|
||||
pl.shotgun_mag--;
|
||||
Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_shells, __NULL__);
|
||||
#else
|
||||
View_SetMuzzleflash(MUZZLE_WEIRD);
|
||||
Weapons_ViewPunchAngle([-5,0,0]);
|
||||
pl.a_ammo1--;
|
||||
#endif
|
||||
Weapons_ViewAnimation(SBS_FIRE1);
|
||||
|
||||
pl.w_attack_next = 0.75;
|
||||
pl.w_idle_next = 2.5f;
|
||||
}
|
||||
|
||||
void
|
||||
w_sbs_reload(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
#ifdef CSQC
|
||||
if (pl.a_ammo1 >= 8) {
|
||||
return;
|
||||
}
|
||||
if (pl.a_ammo2 <= 0) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (pl.shotgun_mag >= 8) {
|
||||
return;
|
||||
}
|
||||
if (pl.ammo_shells <= 0) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pl.a_ammo3 > SBS_IDLE) {
|
||||
return;
|
||||
}
|
||||
pl.a_ammo3 = SBS_RELOAD_START;
|
||||
pl.w_idle_next = 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
w_sbs_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pl.a_ammo3 == SBS_IDLE) {
|
||||
int r = floor(random(0,3));
|
||||
switch (r) {
|
||||
case 0:
|
||||
Weapons_ViewAnimation(SBS_IDLE1);
|
||||
break;
|
||||
case 1:
|
||||
Weapons_ViewAnimation(SBS_IDLE2);
|
||||
break;
|
||||
case 2:
|
||||
Weapons_ViewAnimation(SBS_IDLE3);
|
||||
break;
|
||||
}
|
||||
pl.w_idle_next = 15.0f;
|
||||
} else if (pl.a_ammo3 == SBS_RELOAD_START) {
|
||||
Weapons_ViewAnimation(SBS_START_RELOAD);
|
||||
pl.a_ammo3 = SBS_RELOAD;
|
||||
pl.w_idle_next = 0.65f;
|
||||
} else if (pl.a_ammo3 == SBS_RELOAD) {
|
||||
Weapons_ViewAnimation(SBS_ADDSHELL);
|
||||
#ifdef CSQC
|
||||
pl.a_ammo1++;
|
||||
pl.a_ammo2--;
|
||||
|
||||
if (pl.a_ammo2 <= 0 || pl.a_ammo1 >= 8) {
|
||||
pl.a_ammo3 = SBS_RELOAD_END;
|
||||
}
|
||||
#else
|
||||
pl.shotgun_mag++;
|
||||
pl.ammo_shells--;
|
||||
Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_shells, pl.a_ammo3);
|
||||
sound(pl, CHAN_WEAPON, "weapons/reload3.wav", 1.0, ATTN_NORM);
|
||||
if (pl.ammo_shells <= 0 || pl.shotgun_mag >= 8) {
|
||||
pl.a_ammo3 = SBS_RELOAD_END;
|
||||
}
|
||||
#endif
|
||||
pl.w_idle_next = 0.5f;
|
||||
} else if (pl.a_ammo3 == SBS_RELOAD_END) {
|
||||
Weapons_ViewAnimation(SBS_PUMP);
|
||||
#ifdef SSQC
|
||||
sound(pl, CHAN_WEAPON, "weapons/scock1.wav", 1.0, ATTN_NORM);
|
||||
#endif
|
||||
pl.a_ammo3 = SBS_IDLE;
|
||||
pl.w_idle_next = 10.0f;
|
||||
pl.w_attack_next = 0.5f;
|
||||
}
|
||||
}
|
||||
void
|
||||
w_sbs_crosshair(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
static vector cross_pos;
|
||||
cross_pos = (video_res / 2) + [-12,-12];
|
||||
drawsubpic(cross_pos, [24,24], "sprites/crosshairs.spr_0.tga", [48/128,24/128], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL);
|
||||
HUD_DrawAmmo1();
|
||||
HUD_DrawAmmo2();
|
||||
vector aicon_pos = video_mins + [video_res[0] - 48, video_res[1] - 42];
|
||||
drawsubpic(aicon_pos, [24,24], "sprites/640hud7.spr_0.tga", [72/256,72/128], [24/256, 24/128], g_hud_color, pSeat->ammo2_alpha, DRAWFLAG_ADDITIVE);
|
||||
#endif
|
||||
}
|
||||
|
||||
float
|
||||
w_sbs_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN;
|
||||
}
|
||||
|
||||
void
|
||||
w_sbs_hudpic(int s, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/tfchud02.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/tfchud01.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_sbs =
|
||||
{
|
||||
ITEM_SBS,
|
||||
1,
|
||||
0,
|
||||
"sprites/tfc_dmsg.spr_0.tga",
|
||||
[60,16],
|
||||
[0,144],
|
||||
w_sbs_draw,
|
||||
w_sbs_holster,
|
||||
w_sbs_primary,
|
||||
w_sbs_release,
|
||||
w_sbs_reload,
|
||||
w_sbs_release,
|
||||
w_sbs_crosshair,
|
||||
w_sbs_precache,
|
||||
w_sbs_pickup,
|
||||
w_sbs_updateammo,
|
||||
w_sbs_wmodel,
|
||||
w_sbs_pmodel,
|
||||
w_sbs_deathmsg,
|
||||
w_sbs_aimanim,
|
||||
w_sbs_hudpic
|
||||
};
|
116
src/shared/tfc/w_sniper.c
Normal file
116
src/shared/tfc/w_sniper.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_sniper_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_sniper.mdl");
|
||||
precache_model("models/w_sniper.mdl");
|
||||
precache_model("models/p_sniper.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_sniper_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_sniper_wmodel(void)
|
||||
{
|
||||
return "models/w_sniper.mdl";
|
||||
}
|
||||
string
|
||||
w_sniper_pmodel(void)
|
||||
{
|
||||
return "models/p_sniper.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_sniper_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_sniper_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_sniper.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_sniper_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_sniper_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud02.spr_0.tga",
|
||||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud01.spr_0.tga",
|
||||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_sniper =
|
||||
{
|
||||
.id = ITEM_SNIPER,
|
||||
.slot = 1,
|
||||
.slot_pos = 1,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
.ki_size = [60,16],
|
||||
.ki_xy = [0,96],
|
||||
.draw = w_sniper_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_sniper_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_sniper_updateammo,
|
||||
.wmodel = w_sniper_wmodel,
|
||||
.pmodel = w_sniper_pmodel,
|
||||
.deathmsg = w_sniper_deathmsg,
|
||||
.aimanim = w_sniper_aimanim,
|
||||
.hudpic = w_sniper_hudpic
|
||||
};
|
116
src/shared/tfc/w_supernail.c
Normal file
116
src/shared/tfc/w_supernail.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_supernail_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_supernailgun.mdl");
|
||||
precache_model("models/w_supernail.mdl");
|
||||
precache_model("models/p_supernail.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_supernail_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_supernail_wmodel(void)
|
||||
{
|
||||
return "models/w_supernail.mdl";
|
||||
}
|
||||
string
|
||||
w_supernail_pmodel(void)
|
||||
{
|
||||
return "models/p_supernail.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_supernail_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_supernail_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_supernailgun.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_supernail_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_supernail_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud07.spr_0.tga",
|
||||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud07.spr_0.tga",
|
||||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_supernail =
|
||||
{
|
||||
.id = ITEM_SUPERNAIL,
|
||||
.slot = 3,
|
||||
.slot_pos = 2,
|
||||
.ki_spr = "sprites/640hud1.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [112,64],
|
||||
.draw = w_supernail_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_supernail_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_supernail_updateammo,
|
||||
.wmodel = w_supernail_wmodel,
|
||||
.pmodel = w_supernail_pmodel,
|
||||
.deathmsg = w_supernail_deathmsg,
|
||||
.aimanim = w_supernail_aimanim,
|
||||
.hudpic = w_supernail_hudpic
|
||||
};
|
116
src/shared/tfc/w_tranquil.c
Normal file
116
src/shared/tfc/w_tranquil.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
void
|
||||
w_tranquil_precache(void)
|
||||
{
|
||||
precache_model("models/v_tfc_pistol.mdl");
|
||||
precache_model("models/w_tranquil.mdl");
|
||||
precache_model("models/p_tranquil.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_tranquil_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_tranquil_wmodel(void)
|
||||
{
|
||||
return "models/w_tranquil.mdl";
|
||||
}
|
||||
string
|
||||
w_tranquil_pmodel(void)
|
||||
{
|
||||
return "models/p_tranquil.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_tranquil_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Assault Cannon.";
|
||||
}
|
||||
|
||||
void
|
||||
w_tranquil_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_pistol.mdl");
|
||||
Weapons_ViewAnimation(0);
|
||||
}
|
||||
|
||||
float
|
||||
w_tranquil_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_tranquil_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud05.spr_0.tga",
|
||||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud06.spr_0.tga",
|
||||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_tranquil =
|
||||
{
|
||||
.id = ITEM_TRANQUIL,
|
||||
.slot = 1,
|
||||
.slot_pos = 2,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [0,176],
|
||||
.draw = w_tranquil_draw,
|
||||
.holster = __NULL__,
|
||||
.primary = __NULL__,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = __NULL__,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_tranquil_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_tranquil_updateammo,
|
||||
.wmodel = w_tranquil_wmodel,
|
||||
.pmodel = w_tranquil_pmodel,
|
||||
.deathmsg = w_tranquil_deathmsg,
|
||||
.aimanim = w_tranquil_aimanim,
|
||||
.hudpic = w_tranquil_hudpic
|
||||
};
|
237
src/shared/tfc/w_umbrella.c
Normal file
237
src/shared/tfc/w_umbrella.c
Normal file
|
@ -0,0 +1,237 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* stat wise is this the same as the crowbar, but we might tweak it, so it's a
|
||||
* seperate weapon entry. who knows what modders/servers come up with, too */
|
||||
|
||||
enum
|
||||
{
|
||||
UMBRELLA_IDLE,
|
||||
UMBRELLA_DRAW,
|
||||
UMBRELLA_HOLSTER,
|
||||
UMBRELLA_ATTACK1HIT,
|
||||
UMBRELLA_ATTACK1MISS,
|
||||
UMBRELLA_ATTACK2MISS,
|
||||
UMBRELLA_ATTACK2HIT,
|
||||
UMBRELLA_ATTACK3MISS,
|
||||
UMBRELLA_ATTACK3HIT
|
||||
};
|
||||
|
||||
void
|
||||
w_umbrella_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");
|
||||
precache_model("models/v_umbrella.mdl");
|
||||
precache_model("models/w_umbrella.mdl");
|
||||
precache_model("models/p_umbrella.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_umbrella_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_umbrella_wmodel(void)
|
||||
{
|
||||
return "models/w_umbrella.mdl";
|
||||
}
|
||||
string
|
||||
w_umbrella_pmodel(void)
|
||||
{
|
||||
return "models/p_umbrella.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_umbrella_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Umbrella.";
|
||||
}
|
||||
|
||||
void
|
||||
w_umbrella_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_umbrella.mdl");
|
||||
Weapons_ViewAnimation(UMBRELLA_DRAW);
|
||||
}
|
||||
|
||||
void
|
||||
w_umbrella_holster(void)
|
||||
{
|
||||
Weapons_ViewAnimation(UMBRELLA_HOLSTER);
|
||||
}
|
||||
|
||||
void
|
||||
w_umbrella_primary(void)
|
||||
{
|
||||
int anim = 0;
|
||||
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);
|
||||
|
||||
int r = (float)input_sequence % 3;
|
||||
switch (r) {
|
||||
case 0:
|
||||
anim = trace_fraction >= 1 ? UMBRELLA_ATTACK1MISS:UMBRELLA_ATTACK1HIT;
|
||||
break;
|
||||
case 1:
|
||||
anim = trace_fraction >= 1 ? UMBRELLA_ATTACK2MISS:UMBRELLA_ATTACK2HIT;
|
||||
break;
|
||||
default:
|
||||
anim = trace_fraction >= 1 ? UMBRELLA_ATTACK3MISS:UMBRELLA_ATTACK3HIT;
|
||||
}
|
||||
Weapons_ViewAnimation(anim);
|
||||
|
||||
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 SSQC
|
||||
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, [0,0,0]);
|
||||
} else {
|
||||
Effect_Impact(IMPACT_MELEE, trace_endpos, trace_plane_normal);
|
||||
}
|
||||
|
||||
if (trace_ent.takedamage) {
|
||||
Damage_Apply(trace_ent, self, 10, trace_endpos, FALSE );
|
||||
|
||||
if (!trace_ent.iBleeds) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (random() < 0.33) {
|
||||
sound(pl, 8, "weapons/cbar_hitbod1.wav", 1, ATTN_NORM);
|
||||
} else if (random() < 0.66) {
|
||||
sound(pl, 8, "weapons/cbar_hitbod2.wav", 1, ATTN_NORM);
|
||||
} else {
|
||||
sound(pl, 8, "weapons/cbar_hitbod3.wav", 1, ATTN_NORM);
|
||||
}
|
||||
} else {
|
||||
if (random() < 0.5) {
|
||||
sound(pl, 8, "weapons/cbar_hit1.wav", 1, ATTN_NORM);
|
||||
} else {
|
||||
sound(pl, 8, "weapons/cbar_hit2.wav", 1, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
w_umbrella_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_idle_next) {
|
||||
return;
|
||||
}
|
||||
|
||||
Weapons_ViewAnimation(UMBRELLA_IDLE);
|
||||
pl.w_idle_next = 15.0f;
|
||||
}
|
||||
|
||||
float
|
||||
w_umbrella_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_umbrella_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/640hud4.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/640hud1.spr_0.tga",
|
||||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_umbrella =
|
||||
{
|
||||
.id = ITEM_UMBRELLA,
|
||||
.slot = 0,
|
||||
.slot_pos = 4,
|
||||
.ki_spr = "sprites/640hud1.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [192,0],
|
||||
.draw = w_umbrella_draw,
|
||||
.holster = w_umbrella_holster,
|
||||
.primary = w_umbrella_primary,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = w_umbrella_release,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_umbrella_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_umbrella_updateammo,
|
||||
.wmodel = w_umbrella_wmodel,
|
||||
.pmodel = w_umbrella_pmodel,
|
||||
.deathmsg = w_umbrella_deathmsg,
|
||||
.aimanim = w_umbrella_aimanim,
|
||||
.hudpic = w_umbrella_hudpic
|
||||
};
|
234
src/shared/tfc/w_wrench.c
Normal file
234
src/shared/tfc/w_wrench.c
Normal file
|
@ -0,0 +1,234 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
WRENCH_IDLE,
|
||||
WRENCH_DRAW,
|
||||
WRENCH_HOLSTER,
|
||||
WRENCH_ATTACK1HIT,
|
||||
WRENCH_ATTACK1MISS,
|
||||
WRENCH_ATTACK2MISS,
|
||||
WRENCH_ATTACK2HIT,
|
||||
WRENCH_ATTACK3MISS,
|
||||
WRENCH_ATTACK3HIT
|
||||
};
|
||||
|
||||
void
|
||||
w_wrench_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");
|
||||
precache_model("models/v_tfc_spanner.mdl");
|
||||
precache_model("models/w_wrench.mdl");
|
||||
precache_model("models/p_wrench.mdl");
|
||||
}
|
||||
|
||||
void
|
||||
w_wrench_updateammo(player pl)
|
||||
{
|
||||
#ifdef SSQC
|
||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
w_wrench_wmodel(void)
|
||||
{
|
||||
return "models/w_wrench.mdl";
|
||||
}
|
||||
string
|
||||
w_wrench_pmodel(void)
|
||||
{
|
||||
return "models/p_wrench.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_wrench_deathmsg(void)
|
||||
{
|
||||
return "%s was assaulted by %s's Wrench.";
|
||||
}
|
||||
|
||||
void
|
||||
w_wrench_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_tfc_spanner.mdl");
|
||||
Weapons_ViewAnimation(WRENCH_DRAW);
|
||||
}
|
||||
|
||||
void
|
||||
w_wrench_holster(void)
|
||||
{
|
||||
Weapons_ViewAnimation(WRENCH_HOLSTER);
|
||||
}
|
||||
|
||||
void
|
||||
w_wrench_primary(void)
|
||||
{
|
||||
int anim = 0;
|
||||
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);
|
||||
|
||||
int r = (float)input_sequence % 3;
|
||||
switch (r) {
|
||||
case 0:
|
||||
anim = trace_fraction >= 1 ? WRENCH_ATTACK1MISS:WRENCH_ATTACK1HIT;
|
||||
break;
|
||||
case 1:
|
||||
anim = trace_fraction >= 1 ? WRENCH_ATTACK2MISS:WRENCH_ATTACK2HIT;
|
||||
break;
|
||||
default:
|
||||
anim = trace_fraction >= 1 ? WRENCH_ATTACK3MISS:WRENCH_ATTACK3HIT;
|
||||
}
|
||||
Weapons_ViewAnimation(anim);
|
||||
|
||||
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 SSQC
|
||||
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, [0,0,0]);
|
||||
} else {
|
||||
Effect_Impact(IMPACT_MELEE, trace_endpos, trace_plane_normal);
|
||||
}
|
||||
|
||||
if (trace_ent.takedamage) {
|
||||
Damage_Apply(trace_ent, self, 10, trace_endpos, FALSE );
|
||||
|
||||
if (!trace_ent.iBleeds) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (random() < 0.33) {
|
||||
sound(pl, 8, "weapons/cbar_hitbod1.wav", 1, ATTN_NORM);
|
||||
} else if (random() < 0.66) {
|
||||
sound(pl, 8, "weapons/cbar_hitbod2.wav", 1, ATTN_NORM);
|
||||
} else {
|
||||
sound(pl, 8, "weapons/cbar_hitbod3.wav", 1, ATTN_NORM);
|
||||
}
|
||||
} else {
|
||||
if (random() < 0.5) {
|
||||
sound(pl, 8, "weapons/cbar_hit1.wav", 1, ATTN_NORM);
|
||||
} else {
|
||||
sound(pl, 8, "weapons/cbar_hit2.wav", 1, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
w_wrench_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_idle_next) {
|
||||
return;
|
||||
}
|
||||
|
||||
Weapons_ViewAnimation(WRENCH_IDLE);
|
||||
pl.w_idle_next = 15.0f;
|
||||
}
|
||||
|
||||
float
|
||||
w_wrench_aimanim(void)
|
||||
{
|
||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_wrench_hudpic(int selected, vector pos)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud04.spr_0.tga",
|
||||
[0,180/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
"sprites/tfchud03.spr_0.tga",
|
||||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
weapon_t w_wrench =
|
||||
{
|
||||
.id = ITEM_WRENCH,
|
||||
.slot = 0,
|
||||
.slot_pos = 3,
|
||||
.ki_spr = "sprites/tfc_dmsg.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [0,48],
|
||||
.draw = w_wrench_draw,
|
||||
.holster = w_wrench_holster,
|
||||
.primary = w_wrench_primary,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = w_wrench_release,
|
||||
.crosshair = __NULL__,
|
||||
.precache = w_wrench_precache,
|
||||
.pickup = __NULL__,
|
||||
.updateammo = w_wrench_updateammo,
|
||||
.wmodel = w_wrench_wmodel,
|
||||
.pmodel = w_wrench_pmodel,
|
||||
.deathmsg = w_wrench_deathmsg,
|
||||
.aimanim = w_wrench_aimanim,
|
||||
.hudpic = w_wrench_hudpic
|
||||
};
|
40
src/shared/tfc/weapons.c
Normal file
40
src/shared/tfc/weapons.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
weapon_t w_null = {};
|
||||
weapon_t g_weapons[] = {
|
||||
w_null,
|
||||
w_crowbar,
|
||||
w_medkit,
|
||||
w_knife,
|
||||
w_wrench,
|
||||
w_umbrella,
|
||||
w_sbs,
|
||||
w_sniper,
|
||||
w_tranquil,
|
||||
w_railgun,
|
||||
w_autorifle,
|
||||
w_dbs,
|
||||
w_nailgun,
|
||||
w_glauncher,
|
||||
w_supernail,
|
||||
w_flamer,
|
||||
w_rpg,
|
||||
w_pipebomb,
|
||||
w_asscan,
|
||||
w_incendiary,
|
||||
w_grapple
|
||||
};
|
50
src/shared/tfc/weapons.h
Normal file
50
src/shared/tfc/weapons.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* weapon Indices for the weapon table */
|
||||
enum
|
||||
{
|
||||
WEAPON_NONE,
|
||||
WEAPON_CROWBAR,
|
||||
WEAPON_MEDKIT,
|
||||
WEAPON_KNIFE,
|
||||
WEAPON_WRENCH,
|
||||
WEAPON_UMBRELLA,
|
||||
WEAPON_SBS,
|
||||
WEAPON_SNIPER,
|
||||
WEAPON_TRANQUIL,
|
||||
WEAPON_RAILGUN,
|
||||
WEAPON_AUTORIFLE,
|
||||
WEAPON_DBS,
|
||||
WEAPON_NAILGUN,
|
||||
WEAPON_GLAUNCHER,
|
||||
WEAPON_SUPERNAIL,
|
||||
WEAPON_FLAMER,
|
||||
WEAPON_RPG,
|
||||
WEAPON_PIPEBOMB,
|
||||
WEAPON_ASSCAN,
|
||||
WEAPON_INCENDIARY,
|
||||
WEAPON_GRAPPLE
|
||||
};
|
||||
|
||||
/* What the weapons do support and stuff */
|
||||
enum
|
||||
{
|
||||
AMMO_SHELLS,
|
||||
AMMO_NAILS,
|
||||
AMMO_ROCKETS,
|
||||
AMMO_CELLS
|
||||
};
|
|
@ -67,14 +67,14 @@ w_crowbar_deathmsg(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_CBAR_DRAW(void)
|
||||
w_crowbar_draw(void)
|
||||
{
|
||||
Weapons_SetModel("models/v_crowbar.mdl");
|
||||
Weapons_ViewAnimation(CBAR_DRAW);
|
||||
}
|
||||
|
||||
void
|
||||
w_CBAR_HOLSTER(void)
|
||||
w_crowbar_holster(void)
|
||||
{
|
||||
Weapons_ViewAnimation(CBAR_HOLSTER);
|
||||
}
|
||||
|
@ -216,8 +216,8 @@ weapon_t w_crowbar =
|
|||
.ki_spr = "sprites/640hud1.spr_0.tga",
|
||||
.ki_size = [48,16],
|
||||
.ki_xy = [192,0],
|
||||
.draw = w_CBAR_DRAW,
|
||||
.holster = w_CBAR_HOLSTER,
|
||||
.draw = w_crowbar_draw,
|
||||
.holster = w_crowbar_holster,
|
||||
.primary = w_crowbar_primary,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
|
|
|
@ -163,11 +163,11 @@ void w_python_reload(void)
|
|||
}
|
||||
void w_python_release(void)
|
||||
{
|
||||
|
||||
player pl = (player)self;
|
||||
if (pl.w_idle_next) {
|
||||
return;
|
||||
}
|
||||
|
||||
int r = floor(random(0,3));
|
||||
switch (r) {
|
||||
case 0:
|
||||
|
|
67
src/shared/valve/weapon_common.h
Normal file
67
src/shared/valve/weapon_common.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int id; /* bitflag id */
|
||||
int slot;
|
||||
int slot_pos;
|
||||
string ki_spr;
|
||||
vector ki_size;
|
||||
vector ki_xy;
|
||||
|
||||
void() draw;
|
||||
void() holster;
|
||||
void() primary;
|
||||
void() secondary;
|
||||
void() reload;
|
||||
void() release;
|
||||
void() crosshair;
|
||||
|
||||
void() precache;
|
||||
void() pickup;
|
||||
void(player) updateammo;
|
||||
string() wmodel;
|
||||
string() pmodel;
|
||||
string() deathmsg;
|
||||
float() aimanim;
|
||||
void(int, vector) hudpic;
|
||||
} weapon_t;
|
||||
|
||||
void Weapons_DrawCrosshair(void);
|
||||
void Decals_PlaceSmall(vector);
|
||||
void Decals_PlaceBig(vector);
|
||||
void Weapons_MakeVectors(void);
|
||||
vector Weapons_GetCameraPos(void);
|
||||
void Weapons_ViewAnimation(int);
|
||||
void Weapons_ViewPunchAngle(vector);
|
||||
void Weapons_PlaySound(entity, float, string, float, float);
|
||||
int Weapons_IsPresent(player, int);
|
||||
void Weapons_SetModel(string);
|
||||
#ifdef SSQC
|
||||
void Weapons_RefreshAmmo(player);
|
||||
void Weapons_InitItem(int);
|
||||
float Weapons_GetAim(int);
|
||||
void Weapons_AddItem(player, int);
|
||||
void Weapons_RemoveItem(player, int);
|
||||
string Weapons_GetWorldmodel(int);
|
||||
void Weapons_UpdateAmmo(player, int, int, int);
|
||||
void Weapons_ReloadWeapon(player, .int, .int, int);
|
||||
#else
|
||||
string Weapons_GetPlayermodel(int);
|
||||
int Weapons_GetAnimation(void);
|
||||
void Weapons_HUDPic(int, int, vector);
|
||||
#endif
|
|
@ -14,34 +14,7 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int id; /* bitflag id */
|
||||
int slot;
|
||||
int slot_pos;
|
||||
string ki_spr;
|
||||
vector ki_size;
|
||||
vector ki_xy;
|
||||
|
||||
void() draw;
|
||||
void() holster;
|
||||
void() primary;
|
||||
void() secondary;
|
||||
void() reload;
|
||||
void() release;
|
||||
void() crosshair;
|
||||
|
||||
void() precache;
|
||||
void() pickup;
|
||||
void(player) updateammo;
|
||||
string() wmodel;
|
||||
string() pmodel;
|
||||
string() deathmsg;
|
||||
float() aimanim;
|
||||
void(int, vector) hudpic;
|
||||
} weapon_t;
|
||||
|
||||
/* Weapon Indices for the weapon table */
|
||||
/* weapon Indices for the weapon table */
|
||||
enum
|
||||
{
|
||||
WEAPON_NONE,
|
||||
|
@ -77,28 +50,3 @@ enum
|
|||
AMMO_SNARK,
|
||||
AMMO_HORNET
|
||||
};
|
||||
|
||||
void Weapons_DrawCrosshair(void);
|
||||
void Decals_PlaceSmall(vector);
|
||||
void Decals_PlaceBig(vector);
|
||||
void Weapons_MakeVectors(void);
|
||||
vector Weapons_GetCameraPos(void);
|
||||
void Weapons_ViewAnimation(int);
|
||||
void Weapons_ViewPunchAngle(vector);
|
||||
void Weapons_PlaySound(entity, float, string, float, float);
|
||||
int Weapons_IsPresent(player, int);
|
||||
void Weapons_SetModel(string);
|
||||
#ifdef SSQC
|
||||
void Weapons_RefreshAmmo(player);
|
||||
void Weapons_InitItem(int);
|
||||
float Weapons_GetAim(int);
|
||||
void Weapons_AddItem(player, int);
|
||||
void Weapons_RemoveItem(player, int);
|
||||
string Weapons_GetWorldmodel(int);
|
||||
void Weapons_UpdateAmmo(player, int, int, int);
|
||||
void Weapons_ReloadWeapon(player, .int, .int, int);
|
||||
#else
|
||||
string Weapons_GetPlayermodel(int);
|
||||
int Weapons_GetAnimation(void);
|
||||
void Weapons_HUDPic(int, int, vector);
|
||||
#endif
|
||||
|
|
91
tfc/data.pk3dir/default.cfg
Executable file
91
tfc/data.pk3dir/default.cfg
Executable file
|
@ -0,0 +1,91 @@
|
|||
// Generic Binds
|
||||
bind "ESC" "togglemenu"
|
||||
bind "w" "+forward"
|
||||
bind "s" "+back"
|
||||
bind "a" "+moveleft"
|
||||
bind "d" "+moveright"
|
||||
bind "SPACE" "+jump"
|
||||
bind "CTRL" "+duck"
|
||||
bind "SHIFT" "+speed"
|
||||
bind "0" "slot10"
|
||||
bind "1" "slot1"
|
||||
bind "2" "slot2"
|
||||
bind "3" "slot3"
|
||||
bind "4" "slot4"
|
||||
bind "5" "slot5"
|
||||
bind "6" "slot6"
|
||||
bind "7" "slot7"
|
||||
bind "8" "slot8"
|
||||
bind "9" "slot9"
|
||||
bind "UPARROW" "+forward"
|
||||
bind "DOWNARROW" "+back"
|
||||
bind "LEFTARROW" "+left"
|
||||
bind "RIGHTARROW" "+right"
|
||||
bind "MOUSE1" "+attack"
|
||||
bind "MOUSE2" "+attack2"
|
||||
bind "MWHEELDOWN" "invnext"
|
||||
bind "MWHEELUP" "invprev"
|
||||
bind "r" "+reload"
|
||||
bind "e" "+use"
|
||||
bind "TAB" "+showscores"
|
||||
bind "y" "messagemode"
|
||||
bind "u" "messagemode2"
|
||||
bind "t" "impulse 201"
|
||||
bind "f" "impulse 100"
|
||||
|
||||
// Game Variables
|
||||
seta "hostname" "FreeTF Server"
|
||||
seta "maxplayers" "8"
|
||||
|
||||
// Physics Variables
|
||||
serverinfo "phy_stepheight" "18"
|
||||
serverinfo "phy_airstepheight" "18"
|
||||
serverinfo "phy_friction" "4"
|
||||
serverinfo "phy_edgefriction" "1"
|
||||
serverinfo "phy_stopspeed" "75"
|
||||
serverinfo "phy_gravity" "800"
|
||||
serverinfo "phy_airaccelerate" "10"
|
||||
serverinfo "phy_accelerate" "8"
|
||||
serverinfo "phy_maxspeed" "270"
|
||||
|
||||
// 2D/HUD Variables
|
||||
seta "con_color" "255 150 0"
|
||||
seta "vgui_color" "255 170 0"
|
||||
seta "cross_color" "0 255 0"
|
||||
seta "vid_conautoscale" "1"
|
||||
seta "con_textsize" "12"
|
||||
seta "cl_cursor_scale" "1"
|
||||
seta "vid_conautoscale" "1"
|
||||
seta "scr_conalpha" "1"
|
||||
|
||||
// View Variables
|
||||
seta "cl_bob" "0"
|
||||
seta "maxpitch" "89"
|
||||
seta "minpitch" "-89"
|
||||
seta "r_meshpitch" "1"
|
||||
seta "v_bob" "0.01"
|
||||
seta "v_bobcycle" "0.8"
|
||||
seta "v_bobup" "0.5"
|
||||
seta "v_contentblend" "0"
|
||||
|
||||
// 3D World Variables
|
||||
seta "gl_blacklist_debug_glsl" "0"
|
||||
seta "gl_overbright" "0"
|
||||
seta "r_fb_models" "0"
|
||||
seta "r_fullbrightSkins" "0"
|
||||
seta "r_particledesc" "default"
|
||||
seta "r_polygonoffset_submodel_factor" "0"
|
||||
seta "r_polygonoffset_submodel_offset" "0"
|
||||
seta "r_shadow_realtime_dlight_shadows" "0"
|
||||
seta "r_shadow_realtime_world_shadows" "0"
|
||||
|
||||
// Misc defaults
|
||||
seta "cfg_save_auto" "1"
|
||||
seta "cl_idlefps" "60"
|
||||
seta "cl_maxfps" "250"
|
||||
seta "com_nogamedirnativecode" "0"
|
||||
seta "con_logcenterprint" "0"
|
||||
seta "con_notifylines" "0"
|
||||
seta "lang" "en_us"
|
||||
seta "r_imageexensions" "tga bmp pcx"
|
||||
seta "scr_sshot_type" "tga"
|
Loading…
Reference in a new issue