This commit is contained in:
Marco Cawthorne 2025-01-31 14:34:49 -08:00
parent 8fe765aa0a
commit f2eb9c02bc
132 changed files with 511 additions and 1095 deletions

BIN
.dir.tiff Normal file

Binary file not shown.

View file

View file

@ -1 +1 @@
TeamContest
TeamEffort

View file

@ -1,4 +1,4 @@
# Team Contest (FreeTFC)
# Team Effort (FreeTFC)
Clean-room reimplementation of Team Fortress Classic in QuakeC.
![Preview 1](img/preview1.jpg)
@ -29,7 +29,7 @@ We've had people ask in the oddest of places for help, please don't do that.
## License
ISC License
Copyright (c) 2016-2021 Marco Hladik <marco@icculus.org>
Copyright (c) 2016-2024 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

View file

@ -1,6 +1,6 @@
entityDef item_suit
{
"spawnclass" "NSItem"
"spawnclass" "ncItem"
"model" "models/w_suit.mdl"
"mins" "-16 -16 0"
"maxs" "16 16 16"

View file

@ -3,9 +3,15 @@ entityDef player
"spawnclass" "TFPlayer"
}
entityDef player_scout
entityDef player_shared
{
"inherit" "player"
"item" "item_suit"
}
entityDef player_scout
{
"inherit" "player_shared"
"model" "models/player/scout/scout.mdl"
"health" "75"
"armor" "25"
@ -23,7 +29,7 @@ entityDef player_scout
entityDef player_sniper
{
"inherit" "player"
"inherit" "player_shared"
"model" "models/player/sniper/sniper.mdl"
"health" "90"
"armor" "0"
@ -41,7 +47,7 @@ entityDef player_sniper
entityDef player_soldier
{
"inherit" "player"
"inherit" "player_shared"
"model" "models/player/soldier/soldier.mdl"
"health" "100"
"armor" "100"
@ -59,7 +65,7 @@ entityDef player_soldier
entityDef player_demo
{
"inherit" "player"
"inherit" "player_shared"
"model" "models/player/demo/demo.mdl"
"health" "90"
"armor" "50"
@ -77,7 +83,7 @@ entityDef player_demo
entityDef player_medic
{
"inherit" "player"
"inherit" "player_shared"
"model" "models/player/medic/medic.mdl"
"health" "90"
"armor" "50"
@ -95,7 +101,7 @@ entityDef player_medic
entityDef player_heavy
{
"inherit" "player"
"inherit" "player_shared"
"model" "models/player/hvyweapon/hvyweapon.mdl"
"health" "100"
"armor" "150"
@ -112,7 +118,7 @@ entityDef player_heavy
entityDef player_pyro
{
"inherit" "player"
"inherit" "player_shared"
"model" "models/player/pyro/pyro.mdl"
"health" "100"
"armor" "50"
@ -131,7 +137,7 @@ entityDef player_pyro
entityDef player_spy
{
"inherit" "player"
"inherit" "player_shared"
"model" "models/player/spy/spy.mdl"
"health" "90"
"armor" "25"
@ -149,7 +155,7 @@ entityDef player_spy
entityDef player_engineer
{
"inherit" "player"
"inherit" "player_shared"
"model" "models/player/engineer/engineer.mdl"
"health" "80"
"armor" "25"
@ -168,7 +174,7 @@ entityDef player_engineer
entityDef player_civilian
{
"inherit" "player"
"inherit" "player_shared"
"model" "models/player/civilian/civilian.mdl"
"health" "50"
"armor" "0"

View file

@ -44,7 +44,7 @@ entityDef fireInfo_tfFlameThrower
entityDef projectile_tfFire
{
"spawnclass" "NSProjectile"
"spawnclass" "ncProjectile"
"model" "sprites/fthrow.spr"
"def_damage" "tfFireDirect"

View file

@ -47,7 +47,7 @@ entityDef fireInfo_tfGrenadeLauncher
entityDef projectile_tfPipebomb
{
"spawnclass" "NSProjectile"
"spawnclass" "ncProjectile"
"model" "models/pipebomb.mdl"
"skin" "1"
"frame" "1"

View file

@ -42,7 +42,7 @@ entityDef tf_weapon_ic
entityDef projectile_tfIncendiaryRocket
{
"spawnclass" "NSProjectile"
"spawnclass" "ncProjectile"
"model" "models/rpgrocket.mdl"
"def_damage" "damage_tfIncendiaryRocketDirect"

View file

@ -33,13 +33,13 @@ entityDef tf_weapon_ng
entityDef debris_tfNail
{
"spawnclass" "NSProjectile"
"spawnclass" "ncProjectile"
"model" "models/nail.mdl"
}
entityDef projectile_tfNail
{
"spawnclass" "NSProjectile"
"spawnclass" "ncProjectile"
"model" "models/nail.mdl"
"velocity" "1000 0 0"
"angular_velocity" "0 0 20"
@ -54,10 +54,11 @@ entityDef projectile_tfNail
"detonate_on_actor" "1"
"projectile_debris" "debris_tfNail"
"model_detonate" "impact_default.main"
"decal_detonate" "ExplosionScorch"
"decal_detonate" "Impact.Shot"
"debris_count" "1"
"debris_stick" "1"
"debris_offset" "-2 0 0"
"offset" "0 3 -6"
}
entityDef fireInfo_tfNailGun

View file

@ -48,7 +48,7 @@ entityDef fireInfo_tfStickyLauncher
entityDef projectile_tfStickybomb
{
"spawnclass" "NSProjectile"
"spawnclass" "ncProjectile"
"model" "models/pipebomb.mdl"
"frame" "1"
"bounce" "1"

View file

@ -39,7 +39,7 @@ entityDef tf_weapon_railgun
entityDef projectile_tfRailShot
{
"spawnclass" "NSProjectile"
"spawnclass" "ncProjectile"
"model" ""
"def_damage" "damage_tfRailDirect"
@ -70,7 +70,7 @@ entityDef projectile_tfRailShot
entityDef projectile_tfRailChargedShot
{
"spawnclass" "NSProjectile"
"spawnclass" "ncProjectile"
"model" ""
"def_damage" "damage_tfRailChargeDirect"

View file

@ -41,7 +41,7 @@ entityDef tf_weapon_rpg
entityDef projectile_tfRocket
{
"spawnclass" "NSProjectile"
"spawnclass" "ncProjectile"
"model" "models/rpgrocket.mdl"
"def_damage" "damage_tfRocketDirect"

View file

@ -33,7 +33,7 @@ entityDef tf_weapon_superng
entityDef projectile_tfSuperNail
{
"spawnclass" "NSProjectile"
"spawnclass" "ncProjectile"
"model" "models/nail.mdl"
"velocity" "1000 0 0"
"angular_velocity" "0 0 20"

View file

@ -49,7 +49,7 @@ entityDef fireInfo_tfTranq
entityDef projectile_tfTranq
{
"spawnclass" "NSProjectile"
"spawnclass" "ncProjectile"
"model" "models/nail.mdl"
"velocity" "1000 0 0"
"angular_velocity" "0 0 20"

2
default_tfc.cfg Normal file
View file

@ -0,0 +1,2 @@
set "hostname" "FreeTFC Server"
set "maxplayers" "8"

BIN
icon.tga Normal file

Binary file not shown.

View file

@ -1,2 +0,0 @@
In order to play this FreeHL addon, please move the folder this file is
in into the same place where 'valve' and 'default.fmf' reside. Thanks!

View file

@ -1,14 +0,0 @@
FTEMANIFEST 1
GAME tfc
NAME "Team Fortress"
BASEGAME platform
BASEGAME valve
BASEGAME tfc
// you don't really want to change these
RTCBROKER master.frag-net.com:27950
PROTOCOLNAME "Nuclide"
MAINCONFIG game.cfg
DOWNLOADSURL "http://www.frag-net.com/dl/packages"
-exec platform_default.cfg

BIN
maps/2fort.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View file

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

BIN
maps/avanti.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View file

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

BIN
maps/badlands.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View file

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

BIN
maps/casbah.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View file

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

BIN
maps/crossover2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View file

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

BIN
maps/cz2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View file

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

BIN
maps/dustbowl.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View file

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 109 KiB

BIN
maps/epicenter.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View file

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

BIN
maps/flagrun.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View file

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

BIN
maps/hunted.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View file

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

BIN
maps/push.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View file

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

BIN
maps/rock2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View file

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

BIN
maps/warpath.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View file

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

BIN
maps/well.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

View file

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

5
quake.rc Normal file
View file

@ -0,0 +1,5 @@
exec default_controls.cfg
exec default_cvar.cfg
exec default_video.cfg
exec default_valve.cfg
exec default_tfc.cfg

View file

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<game
type="hl"
name="Team Fortress Classic"
enginepath_linux="/usr/local/games/halflife/"
enginepath_win32="c:/sierra/half-life/"
engine_win32="hl.exe"
engine_linux="hl_linux"
basegame="tfc"
basegamename="Team Fortress Classic"
unknowngamename="Custom Team Fortress Classic modification"
default_scale="1.0"
no_patch="1"
no_bsp_monitor="1"
show_wads="1"
archivetypes="pak wad"
texturetypes="tga jpg mip hlw"
modeltypes="mdl"
maptypes="mapq1"
shaders="quake3"
entityclass="quake3"
entityclasstype="def xml"
entities="quake3"
brushtypes="quake"
patchtypes="quake3"
/>

View file

@ -1,76 +0,0 @@
<?xml version="1.0"?>
<!--
to avoid naming conflicts, the tools are assumed to be named 'hlcsg', 'hlbsp', 'hlvis' and 'hlrad' in your path
-->
<project version="2.0">
<var name="csg">"hlcsg"</var>
<var name="bsp">"hlbsp"</var>
<var name="vis">"hlvis"</var>
<var name="light">"hlrad"</var>
<var name="qbsp">qbsp -hlbsp -basedir "[EnginePath]" -gamedir "[GameName]" -path "[UserEnginePath]"</var>
<var name="qvis">qvis -basedir "[EnginePath]" -gamedir "[GameName]" -path "[UserEnginePath]"</var>
<var name="qlight">qlight -basedir "[EnginePath]" -gamedir "[GameName]" -path "[UserEnginePath]"</var>
<build name="extra fidelity">
<command>[csg] "[MapFile]"</command>
<command>[bsp] "[MapFile]"</command>
<command>[vis] -full "[MapFile]"</command>
<command>[light] -extra "[MapFile]"</command>
</build>
<build name="standard fidelity">
<command>[csg] "[MapFile]"</command>
<command>[bsp] "[MapFile]"</command>
<command>[vis] "[MapFile]"</command>
<command>[light] "[MapFile]"</command>
</build>
<build name="quick compile">
<command>[csg] "[MapFile]"</command>
<command>[bsp] "[MapFile]"</command>
<command>[vis] -fast "[MapFile]"</command>
<command>[light] -fast "[MapFile]"</command>
</build>
<build name="fast vis only">
<command>[csg] "[MapFile]"</command>
<command>[bsp] "[MapFile]"</command>
<command>[vis] -fast "[MapFile]"</command>
</build>
<build name="no vis, no lighting">
<command>[csg] "[MapFile]"</command>
<command>[bsp] "[MapFile]"</command>
</build>
<build name="only entities">
<command>[csg] -onlyents "[MapFile]"</command>
<command>[bsp]"[MapFile]"</command>
</build>
<!--
in case you want to use free-software tools
-->
<build name="tyrutils extra fidelity">
<command>[qbsp] "[MapFile]"</command>
<command>[qvis] "[MapFile]"</command>
<command>[qlight] -extra "[MapFile]"</command>
</build>
<build name="tyrutils standard fidelity">
<command>[qbsp] "[MapFile]"</command>
<command>[qvis] "[MapFile]"</command>
<command>[qlight] "[MapFile]"</command>
</build>
<build name="tyrutils quick compile">
<command>[qbsp] "[MapFile]"</command>
<command>[qvis] -fast "[MapFile]"</command>
<command>[qlight] -fast "[MapFile]"</command>
</build>
<build name="tyrutils fast vis only">
<command>[qbsp] "[MapFile]"</command>
<command>[qvis] -fast "[MapFile]"</command>
</build>
<build name="tyrutils no vis, no lighting">
<command>[qbsp] "[MapFile]"</command>
</build>
<build name="tyrutils only entities">
<command>[qbsp] -onlyents "[MapFile]"</command>
</build>
</project>

View file

@ -2,4 +2,5 @@ CC=fteqcc
all:
cd client && $(MAKE)
cd rules && $(MAKE)
cd server && $(MAKE)

View file

@ -1,4 +1,4 @@
QCC=fteqcc
all:
$(QCC) progs.src
$(QCC) $(CFLAGS) -I../../../src/platform/ -I../../../valve/src/shared/ progs.src

View file

@ -14,7 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void VGUI_ChooseClass(void);
void VGUI_ChooseClass(int);
bool
ClientGame_ConsoleCommand(void)
@ -31,7 +31,7 @@ ClientGame_ConsoleCommand(void)
break;
case "chooseclass":
case "changeclass":
VGUI_ChooseClass();
VGUI_ChooseClass(userinfo.GetInteger(pSeat->m_ePlayer, "*team"));
break;
case "chooseteam":
case "changeteam":

View file

@ -24,20 +24,6 @@ ClientGame_EventParse(float fHeader)
case EV_OBITUARY:
Obituary_Parse();
break;
case EV_BLOOD:
vector vBloodPos;
vector vBloodColor;
vBloodPos[0] = readcoord();
vBloodPos[1] = readcoord();
vBloodPos[2] = readcoord();
vBloodColor[0] = readbyte() / 255;
vBloodColor[1] = readbyte() / 255;
vBloodColor[2] = readbyte() / 255;
FX_Blood(vBloodPos, vBloodColor);
break;
case EV_CHAT:
float fSender = readbyte();
float fTeam = readbyte();
@ -55,15 +41,6 @@ ClientGame_EventParse(float fHeader)
case EV_VIEWMODEL:
View_PlayAnimation(readbyte());
break;
case EV_WEAPON_PICKUP:
int w = readbyte();
if (autocvar_cl_autoweaponswitch == 1) {
sendevent("PlayerSwitchWeapon", "i", w);
}
HUD_WeaponPickupNotify(w);
break;
default:
return (0);
}

View file

@ -1,5 +1,5 @@
class
TFCHallucination:NSEntity
TFCHallucination:ncEntity
{
};
@ -28,7 +28,8 @@ TFCHallucination_Insert(vector viewPosition, vector viewDirection)
halluPos += v_forward * random(8, 64);
halluPos += v_up * random(-64, 64);
halluPos += v_right * random(-64, 64);
FX_Blood(halluPos, [1,0,0]);
#warning FIX THE BLOOD CALL!
//FX_Blood(halluPos, [1,0,0]);
}
pointsound(viewPosition, "weapons/cbar_hitbod1.wav", 1, ATTN_NORM);
break;
@ -67,7 +68,7 @@ TFCHallucination_Insert(vector viewPosition, vector viewDirection)
break;
case 7: /* nade thrown about */
int nadeSelection = (int)floor(random(0, 8));
NSRenderableEntity eNade = spawn(NSRenderableEntity);
ncRenderableEntity eNade = spawn(ncRenderableEntity);
switch (nadeSelection) {
case 1:
@ -107,7 +108,7 @@ TFCHallucination_Insert(vector viewPosition, vector viewDirection)
break;
case 8: /* nail shot around */
halluPos = viewPosition + (v_forward * -32) + (v_right * random(-64, 64));
NSRenderableEntity eNail = spawn(NSRenderableEntity);
ncRenderableEntity eNail = spawn(ncRenderableEntity);
eNail.SetModel("models/nail.mdl");
eNail.SetOrigin(halluPos);
eNail.SetMovetype(MOVETYPE_NOCLIP);

View file

@ -76,7 +76,7 @@ HUD_AmmoNotify_Insert(int type, int count)
/* called whenever we should check for pickup updates */
void
HUD_AmmoNotify_Check(NSClientPlayer pl)
HUD_AmmoNotify_Check(ncPlayer pl)
{
HUD_AmmoNotify_Insert(0, pl.m_iAmmoTypes[1] - pl.m_iAmmoTypes_net[1]);
HUD_AmmoNotify_Insert(1, pl.m_iAmmoTypes[2] - pl.m_iAmmoTypes_net[2]);

View file

@ -76,7 +76,7 @@ HUD_ItemNotify_Insert(int type, int count)
/* called whenever we should check for pickup updates */
void
HUD_ItemNotify_Check(NSClientPlayer pl)
HUD_ItemNotify_Check(ncPlayer pl)
{
int healthdiff = bound(0, pl.health - pl.health_net, 100);
int armordiff = bound(0, pl.armor - pl.armor_net, 100);

View file

@ -30,10 +30,9 @@ ClientGame_Init(float apilevel, string enginename, float engineversion)
registercommand("-gren1");
registercommand("+gren2");
registercommand("-gren2");
registercommand("chooseclass");
registercommand("changeclass");
registercommand("chooseteam");
registercommand("changeteam");
registercommand("chooseteam");
registercommand("lastinv");
registercommand("invnext");
@ -59,8 +58,6 @@ ClientGame_RendererRestart(string rstr)
Obituary_Precache();
Damage_Precache();
FX_Blood_Init();
/* HUD selection icons */
g_dmsg_spr = spriteframe("sprites/tfc_dmsg.spr", 0, 0.0f);
g_tfchud1_spr = spriteframe("sprites/tfchud01.spr", 0, 0.0f);

View file

@ -1,6 +1,7 @@
#pragma target fte_5768
//#pragma flag enable assumeint
#pragma progs_dat "../../csprogs.dat"
#pragma forcecrc 54730
#define CSQC
#define CLIENT
@ -43,8 +44,8 @@ hud_ammonotify.qc
../../../valve/src/client/scoreboard.qc
../../../src/client/include.src
vgui_chooseteam.qc
vgui_changeclass.qc
../../../valve/src/client/vgui_chooseteam.qc
../../../valve/src/client/vgui_changeclass.qc
../../../src/shared/include.src
#endlist

View file

@ -1,232 +0,0 @@
/*
* Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
static string g_classDescrScout;
static string g_classDescrSniper;
static string g_classDescrSoldier;
static string g_classDescrDemoman;
static string g_classDescrMedic;
static string g_classDescrHWGuy;
static string g_classDescrPyro;
static string g_classDescrSpy;
static string g_classDescrEngineer;
static string g_classDescrRandomPC;
static void
TFCClass_Init(void)
{
g_classDescrScout = textfile_to_string("classes/short_scout.txt");
g_classDescrSniper = textfile_to_string("classes/short_sniper.txt");
g_classDescrSoldier = textfile_to_string("classes/short_soldier.txt");
g_classDescrDemoman = textfile_to_string("classes/short_demoman.txt");
g_classDescrMedic = textfile_to_string("classes/short_medic.txt");
g_classDescrHWGuy = textfile_to_string("classes/short_hwguy.txt");
g_classDescrPyro = textfile_to_string("classes/short_pyro.txt");
g_classDescrSpy = textfile_to_string("classes/short_spy.txt");
g_classDescrEngineer = textfile_to_string("classes/short_engineer.txt");
g_classDescrRandomPC = textfile_to_string("classes/short_randompc.txt");
}
static VGUIWindow winClassSelection;
static VGUIPic imgClassPreview;
static VGUILabel lblClassTitle;
static VGUILabel lblClassDescription;
static VGUILabel lblClassCounter;
class TFClassButton:VGUIButton
{
void TFClassButton(void);
virtual void OnMouseUp(void);
virtual void OnMouseEntered(void);
};
void
TFClassButton::TFClassButton(void)
{
}
void
TFClassButton::OnMouseUp(void)
{
int classSelection = GetTag();
sendevent("ClassJoin", "f", (float)classSelection);
winClassSelection.Hide();
}
void
TFClassButton::OnMouseEntered(void)
{
int classSelection = GetTag();
string teamName = "blue";
switch (getplayerkeyfloat(player_localnum, "*team")) {
case 1:
teamName = "blue";
break;
case 2:
teamName = "red";
break;
case 3:
teamName = "blue"; /* TFC doesn't ship with a real green. */
break;
case 4:
teamName = "red"; /* TFC doesn't ship with a real yellow either. */
break;
}
switch (classSelection) {
case 1:
lblClassTitle.SetTitle(Titles_GetTextBody("Title_scout"));
imgClassPreview.SetImage(strcat("gfx/vgui/640_scout", teamName));
lblClassDescription.SetTitle(g_classDescrScout);
break;
case 2:
lblClassTitle.SetTitle(Titles_GetTextBody("Title_sniper"));
imgClassPreview.SetImage(strcat("gfx/vgui/640_sniper", teamName));
lblClassDescription.SetTitle(g_classDescrSniper);
break;
case 3:
lblClassTitle.SetTitle(Titles_GetTextBody("Title_soldier"));
imgClassPreview.SetImage(strcat("gfx/vgui/640_soldier", teamName));
lblClassDescription.SetTitle(g_classDescrSoldier);
break;
case 4:
lblClassTitle.SetTitle(Titles_GetTextBody("Title_demoman"));
imgClassPreview.SetImage(strcat("gfx/vgui/640_demoman", teamName));
lblClassDescription.SetTitle(g_classDescrDemoman);
break;
case 5:
lblClassTitle.SetTitle(Titles_GetTextBody("Title_medic"));
imgClassPreview.SetImage(strcat("gfx/vgui/640_medic", teamName));
lblClassDescription.SetTitle(g_classDescrMedic);
break;
case 6:
lblClassTitle.SetTitle(Titles_GetTextBody("Title_hwguy"));
imgClassPreview.SetImage(strcat("gfx/vgui/640_hwguy", teamName));
lblClassDescription.SetTitle(g_classDescrHWGuy);
break;
case 7:
lblClassTitle.SetTitle(Titles_GetTextBody("Title_pyro"));
imgClassPreview.SetImage(strcat("gfx/vgui/640_pyro", teamName));
lblClassDescription.SetTitle(g_classDescrPyro);
break;
case 8:
lblClassTitle.SetTitle(Titles_GetTextBody("Title_spy"));
imgClassPreview.SetImage(strcat("gfx/vgui/640_spy", teamName));
lblClassDescription.SetTitle(g_classDescrSpy);
break;
case 9:
lblClassTitle.SetTitle(Titles_GetTextBody("Title_engineer"));
imgClassPreview.SetImage(strcat("gfx/vgui/640_engineer", teamName));
lblClassDescription.SetTitle(g_classDescrEngineer);
break;
case 0:
lblClassTitle.SetTitle(Titles_GetTextBody("RandomPC"));
imgClassPreview.SetImage(strcat("gfx/vgui/640_randompc", teamName));
lblClassDescription.SetTitle(g_classDescrRandomPC);
break;
}
}
string g_classnames [] = {
"Scout",
"Sniper",
"Soldier",
"Demoman",
"Medic",
"HWGuy",
"Pyro",
"Spy",
"Engineer",
"Random"
};
void
VGUI_ChooseClass(void)
{
static int initialized;
static TFClassButton *btns;
static VGUILabel lblSelectClass;
static VGUIFrame frmClassInfo;
if (!initialized) {
vector btnpos = [40,80];
initialized = TRUE;
TFCClass_Init();
winClassSelection = spawn(VGUIWindow);
winClassSelection.SetSize([640, 480]);
winClassSelection.SetStyleMask(VGUIWindowBorderless | VGUIWindowFullscreen);
lblSelectClass = spawn(VGUILabel);
lblSelectClass.SetTitle(Titles_GetTextBody("Title_SelectYourClass"));
lblSelectClass.SetTextSize(19);
lblSelectClass.SetPos([40, 38]);
lblSelectClass.SetSize([400, 24]);
frmClassInfo = spawn(VGUIFrame);
frmClassInfo.SetPos([176, 80]);
frmClassInfo.SetSize([424, 312]);
imgClassPreview = spawn(VGUIPic);
imgClassPreview.SetPos([190, 90]);
lblClassTitle = spawn(VGUILabel);
lblClassTitle.SetPos([338, 90]);
lblClassTitle.SetTextSize(19);
lblClassTitle.SetSize([320, 24]);
lblClassCounter = spawn(VGUILabel);
lblClassCounter.SetPos([338, 90 + 32]);
lblClassCounter.SetSize([320, 18]);
lblClassDescription = spawn(VGUILabel);
lblClassDescription.SetPos([338, 90 + 32 + 32]);
lblClassDescription.SetSize([250, 240]);
g_uiDesktop.Add(winClassSelection);
winClassSelection.Add(lblSelectClass);
winClassSelection.Add(frmClassInfo);
winClassSelection.Add(imgClassPreview);
winClassSelection.Add(lblClassTitle);
winClassSelection.Add(lblClassCounter);
winClassSelection.Add(lblClassDescription);
btns = memalloc(sizeof(TFClassButton) * g_classnames.length);
for (int i = 0; i < g_classnames.length; i++) {
btns[i] = spawn(TFClassButton);
btns[i].SetTitle(Titles_GetTextBody(g_classnames[i]));
btns[i].SetSize([124, 24]);
btns[i].SetPos(btnpos);
if (i == 9) {
btns[i].SetKeyEquivalent("0");
btns[i].SetTag(0);
} else {
btns[i].SetKeyEquivalent(ftos((float)i+1));
btns[i].SetTag(i+1i);
}
winClassSelection.Add(btns[i]);
btnpos[1] += 32;
}
}
winClassSelection.Show();
winClassSelection.SetPos((g_vidsize / 2) - (winClassSelection.GetSize() / 2));
}

View file

@ -1,159 +0,0 @@
/*
* Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
static VGUIWindow winChooseTeam;
class TFTeamButton:VGUIButton
{
void TFTeamButton(void);
virtual void OnMouseUp(void);
};
void
TFTeamButton::TFTeamButton(void)
{
}
void
TFTeamButton::OnMouseUp(void)
{
int tag = GetTag();
localcmd("changeclass\n");
sendevent("TeamJoin", "f", (float)tag);
winChooseTeam.Hide();
}
string
VGUI_ChooseTeam_MapInfo(void)
{
static string mapinfo = __NULL__;
if (mapinfo != __NULL__)
return mapinfo;
filestream fileMap = fopen(strcat("maps/", mapname, ".txt"), FILE_READ);
string temp;
if (fileMap != -1) {
while ((temp = fgets(fileMap))) {
mapinfo = strcat(mapinfo, temp, "\n");
}
} else {
mapinfo = Titles_GetTextBody("Map_Description_not_available");
}
return mapinfo;
}
void
VGUI_ChooseTeam(void)
{
static int initialized;
static VGUIButton btnAutoAssign;
static VGUIButton btnGoSpectator;
static VGUIFrame frmMapInfo;
static VGUILabel lblSelectTeam;
static VGUILabel lblMapName;
static VGUILabel lblMapInfo;
if (!initialized) {
vector btnpos = [40,80];
initialized = TRUE;
winChooseTeam = spawn(VGUIWindow);
winChooseTeam.SetSize('640 480');
winChooseTeam.SetStyleMask(VGUIWindowBorderless | VGUIWindowFullscreen);
lblSelectTeam = spawn(VGUILabel);
lblSelectTeam.SetTitle(Titles_GetTextBody("Title_SelectYourTeam"));
lblSelectTeam.SetTextSize(19);
lblSelectTeam.SetPos([40, 38]);
lblSelectTeam.SetSize('400 24');
frmMapInfo = spawn(VGUIFrame);
frmMapInfo.SetPos('176 80');
frmMapInfo.SetSize('424 312');
lblMapName = spawn(VGUILabel);
lblMapName.SetTitle(mapname);
lblMapName.SetTextSize(19);
lblMapName.SetPos('194 105');
lblMapName.SetSize('250 312');
lblMapInfo = spawn(VGUILabel);
lblMapInfo.SetTitle(VGUI_ChooseTeam_MapInfo());
lblMapInfo.SetPos('194 129');
lblMapInfo.SetSize('375 250');
for (int t = 1; t <= serverkeyfloat("teams"); t++) {
TFTeamButton btnForTeam;
string team_name = serverkey(sprintf("team_%i", t));
btnForTeam = spawn(TFTeamButton);
btnForTeam.SetTitle(strtoupper(team_name));
btnForTeam.SetPos(btnpos);
btnForTeam.SetKeyEquivalent(ftos((float)t));
btnForTeam.SetSize('124 24');
switch (team_name) {
case "Blue":
btnForTeam.SetTag(1);
break;
case "Red":
btnForTeam.SetTag(2);
break;
case "Green":
btnForTeam.SetTag(3);
break;
case "Yellow":
btnForTeam.SetTag(4);
break;
}
winChooseTeam.Add(btnForTeam);
btnpos[1] += 32;
}
btnAutoAssign = spawn(VGUIButton);
btnAutoAssign.SetTitle(Titles_GetTextBody("Team_AutoAssign"));
btnAutoAssign.SetPos(btnpos);
btnAutoAssign.SetSize('124 24');
btnAutoAssign.SetKeyEquivalent("5");
//btnAutoAssign.SetFunc(VGUI_AutoAssign);
btnpos[1] += 32;
btnGoSpectator = spawn(VGUIButton);
btnGoSpectator.SetTitle(Titles_GetTextBody("Menu_Spectate"));
btnGoSpectator.SetPos(btnpos);
btnGoSpectator.SetSize('124 24');
btnGoSpectator.SetKeyEquivalent("6");
//btnGoSpectator.SetFunc(VGUI_GoSpectator);
g_uiDesktop.Add(winChooseTeam);
winChooseTeam.Add(frmMapInfo);
winChooseTeam.Add(lblSelectTeam);
winChooseTeam.Add(lblMapName);
winChooseTeam.Add(lblMapInfo);
winChooseTeam.Add(btnAutoAssign);
winChooseTeam.Add(btnGoSpectator);
}
winChooseTeam.Show();
winChooseTeam.SetPos((g_vidsize / 2) - (winChooseTeam.GetSize() / 2));
}

View file

@ -15,7 +15,7 @@
*/
class
TFCVox:NSTalkMonster
TFCVox:ncTalkMonster
{
void(void) TFCVox;
virtual void(string) SentenceSample;

64
src/files.dat Normal file
View file

@ -0,0 +1,64 @@
63
1 cfg/skill.cfg
1 cfg/skill_manifest.cfg
1 data/avanti.way
1 data/badlands.way
1 data/casbah.way
1 data/crossover2.way
1 data/cz2.way
1 data/dustbowl.way
1 data/epicenter.way
1 data/flagrun.way
1 data/hunted.way
1 data/push.way
1 data/rock2.way
1 data/warpath.way
1 data/well.way
1 decls/def/ammo.def
1 decls/def/armor.def
1 decls/def/items.def
1 decls/def/monsters.def
1 decls/def/player.def
1 decls/def/weapons.def
1 decls/def/weapons/ac.def
1 decls/def/weapons/autorifle.def
1 decls/def/weapons/axe.def
1 decls/def/weapons/flamethrower.def
1 decls/def/weapons/gl.def
1 decls/def/weapons/ic.def
1 decls/def/weapons/knife.def
1 decls/def/weapons/medikit.def
1 decls/def/weapons/ng.def
1 decls/def/weapons/pl.def
1 decls/def/weapons/railgun.def
1 decls/def/weapons/rpg.def
1 decls/def/weapons/shotgun.def
1 decls/def/weapons/sniperrifle.def
1 decls/def/weapons/spanner.def
1 decls/def/weapons/superng.def
1 decls/def/weapons/supershotgun.def
1 decls/def/weapons/tranq.def
1 decls/def/weapons/umbrella.def
1 decls/sound/items_tfc.sndshd
1 decls/sound/player_tfc.sndshd
1 decls/sound/turret_tfc.sndshd
1 decls/sound/weapons_tfc.sndshd
1 default_tfc.cfg
1 maps/2fort.jpg
1 maps/avanti.jpg
1 maps/badlands.jpg
1 maps/casbah.jpg
1 maps/crossover2.jpg
1 maps/cz2.jpg
1 maps/dustbowl.jpg
1 maps/epicenter.jpg
1 maps/flagrun.jpg
1 maps/hunted.jpg
1 maps/push.jpg
1 maps/rock2.jpg
1 maps/warpath.jpg
1 maps/well.jpg
1 particles/weapon_railgun.cfg
1 progs/default.dat
1 quake.rc
1 scripts/constants.txt

View file

@ -1,2 +1,3 @@
#pragma sourcefile client/progs.src
#pragma sourcefile server/progs.src
#pragma sourcefile rules/default.qc

Some files were not shown because too many files have changed in this diff Show more