Major cleanup and restructuring. This breaks everything. I'm very, very sorry.
|
@ -1,74 +0,0 @@
|
|||
#pragma target fte
|
||||
#pragma progs_dat "../../freecs/csprogs.dat"
|
||||
|
||||
#define CSQC
|
||||
|
||||
#includelist
|
||||
../Builtins.h
|
||||
../Globals.h
|
||||
../Math.h
|
||||
Defs.h
|
||||
|
||||
../Shared/WeaponAK47.c
|
||||
../Shared/WeaponAUG.c
|
||||
../Shared/WeaponAWP.c
|
||||
../Shared/WeaponC4Bomb.c
|
||||
../Shared/WeaponDeagle.c
|
||||
../Shared/WeaponElites.c
|
||||
../Shared/WeaponFiveSeven.c
|
||||
../Shared/WeaponFlashbang.c
|
||||
../Shared/WeaponG3SG1.c
|
||||
../Shared/WeaponGlock18.c
|
||||
../Shared/WeaponHEGrenade.c
|
||||
../Shared/WeaponKnife.c
|
||||
../Shared/WeaponM3.c
|
||||
../Shared/WeaponM4A1.c
|
||||
../Shared/WeaponMac10.c
|
||||
../Shared/WeaponMP5.c
|
||||
../Shared/WeaponP228.c
|
||||
../Shared/WeaponP90.c
|
||||
../Shared/WeaponPara.c
|
||||
../Shared/WeaponScout.c
|
||||
../Shared/WeaponSG550.c
|
||||
../Shared/WeaponSG552.c
|
||||
../Shared/WeaponSmokeGrenade.c
|
||||
../Shared/WeaponTMP.c
|
||||
../Shared/WeaponUMP45.c
|
||||
../Shared/WeaponUSP45.c
|
||||
../Shared/WeaponXM1014.c
|
||||
../Shared/BaseGun.c
|
||||
../Shared/Weapons.c
|
||||
../Shared/Effects.c
|
||||
../Shared/Radio.c
|
||||
../Shared/Equipment.c
|
||||
../Shared/Animations.c
|
||||
|
||||
../Shared/pmove.c
|
||||
|
||||
../gs-entbase/client.src
|
||||
|
||||
../Shared/spraylogo.cpp
|
||||
Overview.c
|
||||
Player.c
|
||||
View.c
|
||||
VGUIObjects.c
|
||||
VGUISpectator.c
|
||||
VGUIScoreboard.c
|
||||
VGUIMOTD.c
|
||||
VGUIBuyMenu.c
|
||||
VGUITeamSelect.c
|
||||
VGUIRadio.c
|
||||
VGUI.c
|
||||
Damage.c
|
||||
Nightvision.c
|
||||
HUDCrosshair.c
|
||||
HUDScope.c
|
||||
HUDWeaponSelect.c
|
||||
HUDOrbituaries.c
|
||||
HUD.c
|
||||
Sound.c
|
||||
Draw.c
|
||||
Entities.c
|
||||
Event.c
|
||||
Init.c
|
||||
#endlist
|
|
@ -1,6 +1,8 @@
|
|||
CC=fteqcc
|
||||
|
||||
qc-progs:
|
||||
$(CC) Client/progs.src
|
||||
$(CC) Server/progs.src
|
||||
$(CC) Menu-FN/progs.src
|
||||
$(CC) menu-fn/progs.src
|
||||
$(CC) client/valve.src
|
||||
$(CC) server/valve.src
|
||||
$(CC) client/cstrike.src
|
||||
$(CC) server/cstrike.src
|
||||
|
|
|
@ -1,334 +0,0 @@
|
|||
/*
|
||||
Copyright 2016-2018 Marco "eukara" Hladik
|
||||
|
||||
MIT LICENSE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
float bot_skill[] = {
|
||||
2.0f,
|
||||
1.75f,
|
||||
1.5f,
|
||||
1.0f,
|
||||
0.5,
|
||||
0.25f,
|
||||
0.0f
|
||||
};
|
||||
|
||||
/*
|
||||
=================
|
||||
Bot_AutoAdd
|
||||
=================
|
||||
*/
|
||||
.float delay;
|
||||
void Bot_AutoAdd( void ) {
|
||||
if ( self.delay == TRUE ) {
|
||||
CBot bot;
|
||||
bot = (CBot)spawnclient();
|
||||
if ( bot ) {
|
||||
bot.CreateRandom();
|
||||
self.health--;
|
||||
if ( self.health ) {
|
||||
self.nextthink = time + 0.25f;
|
||||
} else {
|
||||
remove( self );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Let's kill the bots that were here before, before they have not been initialized.
|
||||
for ( entity eFind = world; ( eFind = find( eFind, classname, "player" ) ); ) {
|
||||
if ( clienttype( eFind ) == CLIENTTYPE_BOT ) {
|
||||
dropclient( eFind );
|
||||
}
|
||||
}
|
||||
|
||||
// Let's add new bots.
|
||||
float bots = autocvar_bot_autoadd;
|
||||
if ( bots >= cvar( "sv_playerslots" ) ) {
|
||||
bots = cvar( "sv_playerslots" ) - 1;
|
||||
}
|
||||
|
||||
if ( !bots ) {
|
||||
remove( self );
|
||||
return;
|
||||
}
|
||||
|
||||
self.delay = TRUE;
|
||||
self.health = bots;
|
||||
self.nextthink = time + 0.25f;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Bot_Init
|
||||
=================
|
||||
*/
|
||||
void Bot_Init( void )
|
||||
{
|
||||
entity eBotAdder = spawn();
|
||||
eBotAdder.think = Bot_AutoAdd;
|
||||
eBotAdder.nextthink = time + 0.25f;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CBot::PickEnemy
|
||||
=================
|
||||
*/
|
||||
void CBot::PickEnemy( void )
|
||||
{
|
||||
if ( huntenemy && huntenemy.health > 0 ){
|
||||
return;
|
||||
}
|
||||
|
||||
huntenemy = world;
|
||||
float bestdist = 99999999;
|
||||
|
||||
for (entity e = world; (e = find(e, ::classname, "player")); ) {
|
||||
if ( e.team == self.team ) {
|
||||
continue;
|
||||
}
|
||||
if ( e.flags & FL_NOTARGET ) {
|
||||
continue; //cheat.
|
||||
}
|
||||
if ( e == this ) {
|
||||
continue; //no self-harm
|
||||
}
|
||||
if ( e.health > 0 ) {
|
||||
float dist = vlen(e.origin - origin);
|
||||
if ( dist < bestdist ) {
|
||||
traceline(origin+view_ofs, e.origin, TRUE, this);
|
||||
if (trace_ent == e || trace_fraction == 1) {
|
||||
bestdist = dist;
|
||||
huntenemy = e;
|
||||
reflextime = time;
|
||||
reflextime += bot_skill[ bound( 0, autocvar_bot_skill, bot_skill.length - 1 ) ];
|
||||
reflextime += ( random() * 0.25f );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void Bot_RouteCB(entity ent, vector dest, int numnodes, nodeslist_t *nodelist)
|
||||
{
|
||||
CBot player = (CBot)ent;
|
||||
player.nodes = numnodes;
|
||||
player.cur_node = numnodes - 1;
|
||||
player.route = nodelist;
|
||||
|
||||
dprint( "Bot: Route calculated.\n" );
|
||||
dprint( sprintf( "Bot: # of nodes: %i\n", numnodes ) );
|
||||
dprint( sprintf( "Bot: # current node: %i\n", player.cur_node ) );
|
||||
dprint( sprintf( "Bot: # endpos: %v\n", dest ) );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CBot::RunAI
|
||||
=================
|
||||
*/
|
||||
void CBot::RunAI( void )
|
||||
{
|
||||
if ( team <= 0 ) {
|
||||
bprint( "Selecting team\n" );
|
||||
CSEv_GamePlayerSpawn_f( floor( random( 1, 8 ) ));
|
||||
|
||||
// If we couldn't spawn, don't even try doing stuff
|
||||
if ( health <= 0 ) {
|
||||
return;
|
||||
} else {
|
||||
if ( route ) {
|
||||
nodes = 0;
|
||||
memfree( route );
|
||||
huntenemy = __NULL__;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( autocvar_bot_ai == FALSE ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( nodes ) {
|
||||
PickEnemy();
|
||||
}
|
||||
|
||||
input_buttons = 0;
|
||||
|
||||
if ( !nodes ) {
|
||||
route_calculate( this, Route_SelectDestination(this), 0, Bot_RouteCB );
|
||||
bprint( "Route: Calculating first bot route\n" );
|
||||
}
|
||||
|
||||
// Route might have been not been processed
|
||||
if ( !nodes ) {
|
||||
bprint( "Route: NO NODES\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
float dist = floor( vlen( route[cur_node].dest - origin ) );
|
||||
|
||||
if ( dist < 64 ) {
|
||||
bprint( "Route: Reached node.\n" );
|
||||
cur_node--;
|
||||
}
|
||||
|
||||
// We haven't gotten anywhere, start
|
||||
if ( dist == lastdist ) {
|
||||
node_giveup += frametime;
|
||||
}
|
||||
|
||||
if ( node_giveup > 2.5f ) {
|
||||
bprint( "Route: Giving up route\n" );
|
||||
cur_node = -1;
|
||||
node_giveup = 0.0f;
|
||||
} else if ( node_giveup > 1.0f ) {
|
||||
makevectors( angles );
|
||||
tracebox( origin + '0 0 18', mins, maxs, origin + '0 0 18' + ( v_forward * 32 ), FALSE, this );
|
||||
if ( trace_fraction < 1.0f && flags & FL_ONGROUND ) {
|
||||
tracebox( origin + '0 0 64', mins, maxs, origin + '0 0 64' + ( v_forward * 32 ), FALSE, this );
|
||||
if ( trace_fraction == 1.0f ) {
|
||||
input_movevalues_z = 200;
|
||||
} else {
|
||||
tracebox(origin-'0 0 18', VEC_CHULL_MIN, VEC_CHULL_MAX, origin-'0 0 18'+(v_forward * 16), FALSE, this);
|
||||
if ( trace_fraction == 1.0f ) {
|
||||
input_movevalues_z = -200;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( distcache < time ) {
|
||||
lastdist = dist;
|
||||
distcache = time + 2.0f;
|
||||
}
|
||||
// We haven't gotten anywhere, end
|
||||
|
||||
if ( cur_node < 0 ) {
|
||||
bprint( "Route: Calculating new bot route\n" );
|
||||
nodes = 0;
|
||||
memfree( route );
|
||||
route_calculate( this, Route_SelectDestination(this), 0, Bot_RouteCB );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( huntenemy != __NULL__ ) {
|
||||
int enemyvisible;
|
||||
traceline( origin + view_ofs, huntenemy.origin, TRUE, this);
|
||||
enemyvisible = ( trace_ent == huntenemy || trace_fraction == 1.0f );
|
||||
|
||||
if ( enemyvisible ) {
|
||||
angles = vectoangles( huntenemy.origin - origin );
|
||||
input_angles = angles;
|
||||
input_movevalues_x = 80;
|
||||
|
||||
if ( !iAttackMode ) {
|
||||
input_buttons |= INPUT_BUTTON0; // Attack
|
||||
}
|
||||
iAttackMode = 1 - iAttackMode;
|
||||
} else {
|
||||
nodes = 0;
|
||||
memfree( route );
|
||||
route_calculate( this, huntenemy.origin, 0, Bot_RouteCB );
|
||||
huntenemy = __NULL__;
|
||||
}
|
||||
} else if ( nodes ) {
|
||||
/*
|
||||
if ( route[cur_node].linkflags & WP_JUMP && pmove_flags & PM_ONGROUND ) {
|
||||
dprint( "Bot: JUMP!\n" );
|
||||
input_movevalues_z = 200;
|
||||
}*/
|
||||
angles = vectoangles( route[cur_node].dest - origin );
|
||||
input_angles = angles;
|
||||
input_movevalues_x = 250;
|
||||
}
|
||||
|
||||
tracebox( origin + '0 0 18', mins, maxs, origin + '0 0 18' + ( v_forward * 32 ), FALSE, this );
|
||||
if ( trace_fraction < 1.0f && flags & FL_ONGROUND ) {
|
||||
tracebox( origin + '0 0 18', mins, maxs, origin + '0 0 18' + ( v_forward * 32 ) + v_right * 16, FALSE, this );
|
||||
if ( trace_fraction == 1.0f ) {
|
||||
input_movevalues_y = 200;
|
||||
} else {
|
||||
tracebox( origin + '0 0 18', mins, maxs, origin + '0 0 18' + ( v_forward * 32 ) + v_right * -16, FALSE, this );
|
||||
if ( trace_fraction == 1.0f ) {
|
||||
input_movevalues_y = -200;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 1
|
||||
vector vNForward;
|
||||
float fLerpy = bound( 0.0f, 1.0f - ( frametime * 16 ), 1.0f );
|
||||
makevectors( input_angles );
|
||||
|
||||
vNForward = v_forward;
|
||||
makevectors( v_angle );
|
||||
vNForward_x = Math_Lerp( vNForward_x, v_forward_x, fLerpy );
|
||||
vNForward_y = Math_Lerp( vNForward_y, v_forward_y, fLerpy );
|
||||
vNForward_z = Math_Lerp( vNForward_z, v_forward_z, fLerpy );
|
||||
input_angles = vectoangles( vNForward );
|
||||
v_angle = input_angles;
|
||||
angles = input_angles;
|
||||
#else
|
||||
v_angle = input_angles;
|
||||
#endif
|
||||
button0 = input_buttons & INPUT_BUTTON0; //attack
|
||||
//.button1 was meant to be +use, but the bit was never assigned and mods used button1 as a free field. there still is no button 1.
|
||||
button2 = input_buttons & INPUT_BUTTON2; //jump
|
||||
button3 = input_buttons & INPUT_BUTTON3; //tertiary
|
||||
button4 = input_buttons & INPUT_BUTTON4; //reload
|
||||
button5 = input_buttons & INPUT_BUTTON5; //secondary
|
||||
button6 = input_buttons & INPUT_BUTTON6; //unused
|
||||
//button7 = input_buttons & INPUT_BUTTON7; //sprint
|
||||
movement = input_movevalues;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CBot::CreateRandom
|
||||
=================
|
||||
*/
|
||||
void CBot::CreateRandom( void ) {
|
||||
Create( iBots );
|
||||
iBots++;
|
||||
if ( iBots >= iBotTotal ) {
|
||||
iBots = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CBot::Create
|
||||
=================
|
||||
*/
|
||||
void CBot::Create( int iBotID )
|
||||
{
|
||||
forceinfokey( self, "name", "Bot" );
|
||||
|
||||
iInGame = TRUE;
|
||||
|
||||
ClientConnect();
|
||||
PutClientInServer();
|
||||
|
||||
customphysics = Empty;
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
Copyright 2016-2018 Marco "eukara" Hladik
|
||||
|
||||
MIT LICENSE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
class CBot {
|
||||
entity huntenemy; //who we're trying to hunt
|
||||
float wiggletime;
|
||||
float wiggleside;
|
||||
int iAttackMode;
|
||||
float flSwitchDelay;
|
||||
float flRouteDelay;
|
||||
string chat_next;
|
||||
float chat_nexttime;
|
||||
float flJumpNext;
|
||||
|
||||
float reflextime;
|
||||
|
||||
int teamrole; //attack, defend, assist
|
||||
int iInGame; // so we can drop them in case they rejoin
|
||||
|
||||
int nodes;
|
||||
int cur_node;
|
||||
nodeslist_t *route;
|
||||
|
||||
// unstuckyness
|
||||
float node_giveup;
|
||||
float lastdist;
|
||||
float distcache;
|
||||
nonvirtual void( void ) RunAI;
|
||||
nonvirtual void( void ) CreateRandom;
|
||||
nonvirtual void( int iBotID ) Create;
|
||||
};
|
||||
|
||||
var int autocvar_bot_ai = TRUE;
|
||||
var float autocvar_bot_autoadd = 0;
|
||||
var int autocvar_bot_skill = 3;
|
||||
|
||||
int iBots, iBotTotal;
|
||||
void Bot_Init( void );
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
/*
|
||||
Copyright 2016-2018 Marco "eukara" Hladik
|
||||
|
||||
MIT LICENSE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
vector Route_SelectDestination( CBot target )
|
||||
{
|
||||
entity dest = world;
|
||||
|
||||
// Need health!
|
||||
/* if ( target.health < 50 ) {
|
||||
entity temp;
|
||||
int bestrange = 999999;
|
||||
int range;
|
||||
for ( temp = world; ( temp = find( temp, classname, "ItemHealth" ) ); ) {
|
||||
range = vlen( temp.origin - target.origin );
|
||||
if ( ( range < bestrange ) && ( temp.solid = SOLID_TRIGGER ) ) {
|
||||
bestrange = range;
|
||||
dest = temp;
|
||||
}
|
||||
}
|
||||
|
||||
if ( dest ) {
|
||||
dprint( "Route: Going for health!" );
|
||||
return dest.origin + '0 0 32';
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the whole flag situation
|
||||
if ( iGame == MODE_CTF ) {
|
||||
if ( target.flags & FL_HASFLAG ) {
|
||||
if ( target.team == world.team1 ) {
|
||||
dest = find( world, classname, "CTFFlag1" );
|
||||
} else {
|
||||
dest = find( world, classname, "CTFFlag2" );
|
||||
}
|
||||
return dest.origin + '0 0 32';
|
||||
} else {
|
||||
if ( target.team == world.team1 ) {
|
||||
dest = find( world, classname, "CTFFlag2" );
|
||||
} else {
|
||||
dest = find( world, classname, "CTFFlag1" );
|
||||
}
|
||||
|
||||
if ( dest.solid == SOLID_TRIGGER ) {
|
||||
return dest.origin + '0 0 32';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if ( target.team == TEAM_T ) {
|
||||
dest = Spawn_FindSpawnPoint( TEAM_CT );
|
||||
} else {
|
||||
dest = Spawn_FindSpawnPoint( TEAM_T );
|
||||
}
|
||||
|
||||
return dest.origin;
|
||||
}
|
|
@ -1,318 +0,0 @@
|
|||
/*
|
||||
Copyright 2016-2018 Marco "eukara" Hladik
|
||||
|
||||
MIT LICENSE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define COST_INFINITE 999999999999
|
||||
|
||||
enumflags {
|
||||
WP_JUMP, //also implies that the bot must first go behind the wp...
|
||||
WP_CLIMB,
|
||||
WP_CROUCH,
|
||||
WP_USE
|
||||
};
|
||||
|
||||
typedef struct waypoint_s {
|
||||
vector org;
|
||||
float flRadius; //used for picking the closest waypoint. aka proximity weight. also relaxes routes inside the area.
|
||||
struct wpneighbour_s
|
||||
{
|
||||
int node;
|
||||
float linkcost;
|
||||
int iFlags;
|
||||
} *neighbour;
|
||||
int iNeighbours;
|
||||
} waypoint_t;
|
||||
|
||||
static waypoint_t *waypoints;
|
||||
static int iWaypoints;
|
||||
static int bWaypointsLoaded;
|
||||
|
||||
static void() Way_WipeWaypoints=
|
||||
{
|
||||
for (int i = 0; i < iWaypoints; i++)
|
||||
memfree(waypoints[i].neighbour);
|
||||
memfree(waypoints);
|
||||
iWaypoints = 0;
|
||||
}
|
||||
|
||||
void Way_DumpWaypoints( string filename )
|
||||
{
|
||||
float file = fopen(filename, FILE_WRITE);
|
||||
if (file < 0)
|
||||
{
|
||||
print("RT_DumpWaypoints: unable to open ", filename, "\n");
|
||||
return;
|
||||
}
|
||||
fputs(file, sprintf("%i\n", iWaypoints));
|
||||
for(int i = 0i; i < iWaypoints; i++)
|
||||
{
|
||||
fputs(file, sprintf("%v %f %i\n", waypoints[i].org, waypoints[i].flRadius, waypoints[i].iNeighbours));
|
||||
for(int j = 0i; j < waypoints[i].iNeighbours; j++)
|
||||
fputs(file, sprintf(" %i %f %#x\n", waypoints[i].neighbour[j].node, waypoints[i].neighbour[j].linkcost, (float)waypoints[i].neighbour[j].iFlags));
|
||||
}
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
void Way_ReadWaypoints( string filename )
|
||||
{
|
||||
float file = fopen(filename, FILE_READ);
|
||||
bWaypointsLoaded = TRUE;
|
||||
if (file < 0)
|
||||
{
|
||||
print("Way_DumpWaypoints: unable to open ", filename, "\n");
|
||||
return;
|
||||
}
|
||||
Way_WipeWaypoints();
|
||||
|
||||
tokenize(fgets(file));
|
||||
iWaypoints = stoi(argv(0));
|
||||
|
||||
waypoints = memalloc(sizeof(*waypoints)*iWaypoints);
|
||||
for(int i = 0i; i < iWaypoints; i++)
|
||||
{
|
||||
tokenize(fgets(file));
|
||||
waypoints[i].org[0] = stof(argv(0));
|
||||
waypoints[i].org[1] = stof(argv(1));
|
||||
waypoints[i].org[2] = stof(argv(2));
|
||||
waypoints[i].flRadius = stof(argv(3));
|
||||
waypoints[i].iNeighbours = stoi(argv(4));
|
||||
waypoints[i].neighbour = memalloc(sizeof(*waypoints[i].neighbour)*waypoints[i].iNeighbours);
|
||||
for(int j = 0i; j < waypoints[i].iNeighbours; j++)
|
||||
{
|
||||
tokenize(fgets(file));
|
||||
waypoints[i].neighbour[j].node = stoi(argv(0));
|
||||
waypoints[i].neighbour[j].linkcost = stof(argv(1));
|
||||
waypoints[i].neighbour[j].iFlags = stoh(argv(2));
|
||||
}
|
||||
}
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
static void* memrealloc( __variant *oldptr, int elementsize, int oldelements, int newelements )
|
||||
{
|
||||
void *n = memalloc(elementsize*newelements);
|
||||
memcpy(n, oldptr, elementsize*min(oldelements,newelements));
|
||||
memfree(oldptr);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
static void Way_LinkWaypoints( waypoint_t *wp, waypoint_t *w2 )
|
||||
{
|
||||
int w2n = w2-waypoints;
|
||||
for (int i = 0i; i < wp->iNeighbours; i++)
|
||||
{
|
||||
if (wp->neighbour[i].node == w2n)
|
||||
return;
|
||||
}
|
||||
|
||||
int idx = wp->iNeighbours++;
|
||||
wp->neighbour = memrealloc(wp->neighbour, sizeof(*wp->neighbour), idx, wp->iNeighbours);
|
||||
local struct wpneighbour_s *n = wp->neighbour+idx;
|
||||
n->node = w2n;
|
||||
n->linkcost = vlen(w2->org - wp->org);
|
||||
n->iFlags = 0;
|
||||
}
|
||||
|
||||
static void Way_AutoLink( waypoint_t *wp )
|
||||
{
|
||||
int wpidx = wp-waypoints;
|
||||
for (int i = 0i; i < iWaypoints; i++)
|
||||
{
|
||||
if (i == wpidx)
|
||||
continue; //don't link to ourself...
|
||||
|
||||
if (vlen(wp->org - waypoints[i].org) > autocvar( nav_linksize, 256, "Cuttoff distance between links" ) )
|
||||
continue; //autolink distance cutoff.
|
||||
|
||||
//not going to use the full player size because that makes steps really messy.
|
||||
//however, we do need a little size, for sanity's sake
|
||||
tracebox(wp->org, '-16 -16 0', '16 16 32', waypoints[i].org, TRUE, world);
|
||||
if (trace_fraction < 1)
|
||||
continue; //light of sight blocked, don't try autolinking.
|
||||
|
||||
Way_LinkWaypoints(wp, &waypoints[i]);
|
||||
Way_LinkWaypoints(&waypoints[i], wp);
|
||||
}
|
||||
}
|
||||
|
||||
void Way_Waypoint_Create( entity pl, float autolink )
|
||||
{
|
||||
vector pos = pl.origin;
|
||||
int idx = iWaypoints++;
|
||||
waypoints = memrealloc( waypoints, sizeof(waypoint_t), idx, iWaypoints );
|
||||
waypoint_t *n = waypoints + idx;
|
||||
n->org = pos;
|
||||
n->neighbour = __NULL__;
|
||||
n->iNeighbours = 0;
|
||||
|
||||
if (autolink)
|
||||
Way_AutoLink(n);
|
||||
}
|
||||
|
||||
void Way_Waypoint_Delete( int idx )
|
||||
{
|
||||
if (idx < 0i || idx >= iWaypoints)
|
||||
{
|
||||
print("RT_DeleteWaypoint: invalid waypoint\n");
|
||||
return;
|
||||
}
|
||||
|
||||
//wipe the waypoint
|
||||
memfree(waypoints[idx].neighbour);
|
||||
memcpy(waypoints+idx, waypoints+idx+1, (iWaypoints-(idx+1))*sizeof(*waypoints));
|
||||
iWaypoints--;
|
||||
|
||||
//clean up any links to it.
|
||||
for (int i = 0; i < iWaypoints; i++)
|
||||
{
|
||||
for (int j = 0; j < waypoints[i].iNeighbours; )
|
||||
{
|
||||
int l = waypoints[i].neighbour[j].node;
|
||||
if (l == idx)
|
||||
{
|
||||
memcpy(waypoints[i].neighbour+j, waypoints[i].neighbour+j+1, (waypoints[i].iNeighbours-(j+1))*sizeof(*waypoints[i].neighbour));
|
||||
waypoints[i].iNeighbours--;
|
||||
continue;
|
||||
}
|
||||
else if (l > idx)
|
||||
waypoints[i].neighbour[j].node = l-1;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Way_Waypoint_SetRadius( int idx, float radius )
|
||||
{
|
||||
if (idx < 0i || idx >= iWaypoints)
|
||||
{
|
||||
print("RT_Waypoint_SetRadius: invalid waypoint\n");
|
||||
return;
|
||||
}
|
||||
waypoints[idx].flRadius = radius;
|
||||
}
|
||||
|
||||
void Way_Waypoint_MakeJump(int idx)
|
||||
{
|
||||
if (idx < 0i || idx >= iWaypoints)
|
||||
{
|
||||
print("RT_Waypoint_SetRadius: invalid waypoint\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for(int j = 0i; j < waypoints[idx].iNeighbours; j++) {
|
||||
int target = waypoints[idx].neighbour[j].node;
|
||||
|
||||
for(int b = 0i; b < waypoints[target].iNeighbours; b++) {
|
||||
if ( waypoints[target].neighbour[b].node == idx ) {
|
||||
waypoints[target].neighbour[b].iFlags = WP_JUMP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-1 for no nodes anywhere...
|
||||
int Way_FindClosestWaypoint( vector org )
|
||||
{
|
||||
int r = -1i;
|
||||
float bestdist = COST_INFINITE;
|
||||
for (int i = 0i; i < iWaypoints; i++)
|
||||
{
|
||||
float dist = vlen(waypoints[i].org - org) - waypoints[i].flRadius;
|
||||
if (dist < bestdist)
|
||||
{
|
||||
if (dist < 0)
|
||||
{ //within the waypoint's radius
|
||||
bestdist = dist;
|
||||
r = i;
|
||||
}
|
||||
else
|
||||
{ //outside the waypoint, make sure its valid.
|
||||
traceline(org, waypoints[i].org, TRUE, world);
|
||||
if (trace_fraction == 1)
|
||||
{ //FIXME: sort them frst, to avoid traces?
|
||||
bestdist = dist;
|
||||
r = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
//Lame visualisation stuff - this is only visible on listen servers.
|
||||
void SV_AddDebugPolygons( void ) {
|
||||
if ( !autocvar( way_display, 0, "Display current waypoints" ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !iWaypoints ) {
|
||||
return;
|
||||
}
|
||||
|
||||
int nearest = Way_FindClosestWaypoint(self.origin);
|
||||
makevectors(self.v_angle);
|
||||
R_BeginPolygon( "waypoint", 0, 0 );
|
||||
|
||||
for ( int i = 0i; i < iWaypoints; i++ ) {
|
||||
waypoint_t *w = waypoints+i;
|
||||
vector org = w->org;
|
||||
vector rgb = '1 1 1';
|
||||
if (nearest == i)
|
||||
rgb = '0 1 0';
|
||||
R_PolygonVertex(org + v_right*16 - v_up*16, '1 1', rgb, 1);
|
||||
R_PolygonVertex(org - v_right*16 - v_up*16, '0 1', rgb, 1);
|
||||
R_PolygonVertex(org - v_right*16 + v_up*16, '0 0', rgb, 1);
|
||||
R_PolygonVertex(org + v_right*16 + v_up*16, '1 0', rgb, 1);
|
||||
R_EndPolygon();
|
||||
}
|
||||
|
||||
R_BeginPolygon("", 0, 0);
|
||||
for ( int i = 0i; i < iWaypoints; i++ ) {
|
||||
waypoint_t *w = waypoints+i;
|
||||
vector org = w->org;
|
||||
|
||||
for (float j = 0; j < 2*M_PI; j += 2*M_PI/4)
|
||||
R_PolygonVertex(org + [sin(j), cos(j)]*w->flRadius, '1 1', '0 0.25 0', 1);
|
||||
R_EndPolygon();
|
||||
}
|
||||
|
||||
R_BeginPolygon("", 1, 0);
|
||||
for ( int i = 0i; i < iWaypoints; i++ ) {
|
||||
waypoint_t *w = waypoints+i;
|
||||
vector org = w->org;
|
||||
vector rgb = '1 1 1';
|
||||
for ( int j = 0i; j < w->iNeighbours; j++ ) {
|
||||
int k = w->neighbour[j].node;
|
||||
if ( k < 0i || k >= iWaypoints ) {
|
||||
break;
|
||||
}
|
||||
waypoint_t *w2 = &waypoints[k];
|
||||
R_PolygonVertex(org, '0 1', '1 0 1', 1);
|
||||
R_PolygonVertex(w2->org, '1 1', '0 1 0', 1);
|
||||
R_EndPolygon();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
CC=fteqcc
|
||||
|
||||
all:
|
||||
$(CC)
|
|
@ -1,81 +0,0 @@
|
|||
#pragma target fte
|
||||
#pragma progs_dat "../../freecs/progs.dat"
|
||||
|
||||
#includelist
|
||||
../Builtins.h
|
||||
../Globals.h
|
||||
../Math.h
|
||||
Defs.h
|
||||
DefsFields.h
|
||||
|
||||
../gs-entbase/server.src
|
||||
|
||||
Money.c
|
||||
../Shared/Animations.c
|
||||
../Shared/Radio.c
|
||||
../Shared/WeaponAK47.c
|
||||
../Shared/WeaponAUG.c
|
||||
../Shared/WeaponAWP.c
|
||||
../Shared/WeaponC4Bomb.c
|
||||
../Shared/WeaponDeagle.c
|
||||
../Shared/WeaponElites.c
|
||||
../Shared/WeaponFiveSeven.c
|
||||
../Shared/WeaponFlashbang.c
|
||||
../Shared/WeaponG3SG1.c
|
||||
../Shared/WeaponGlock18.c
|
||||
../Shared/WeaponHEGrenade.c
|
||||
../Shared/WeaponKnife.c
|
||||
../Shared/WeaponM3.c
|
||||
../Shared/WeaponM4A1.c
|
||||
../Shared/WeaponMac10.c
|
||||
../Shared/WeaponMP5.c
|
||||
../Shared/WeaponP228.c
|
||||
../Shared/WeaponP90.c
|
||||
../Shared/WeaponPara.c
|
||||
../Shared/WeaponScout.c
|
||||
../Shared/WeaponSG550.c
|
||||
../Shared/WeaponSG552.c
|
||||
../Shared/WeaponSmokeGrenade.c
|
||||
../Shared/WeaponTMP.c
|
||||
../Shared/WeaponUMP45.c
|
||||
../Shared/WeaponUSP45.c
|
||||
../Shared/WeaponXM1014.c
|
||||
../Shared/BaseGun.c
|
||||
../Shared/BaseMelee.c
|
||||
../Shared/Weapons.c
|
||||
../Shared/Effects.c
|
||||
../Shared/Equipment.c
|
||||
../Shared/spraylogo.cpp
|
||||
../Shared/pmove.c
|
||||
|
||||
armoury_entity.cpp
|
||||
hostage_entity.cpp
|
||||
func_hostage_rescue.cpp
|
||||
info_hostage_rescue.cpp
|
||||
func_vip_safetyzone.cpp
|
||||
info_map_parameters.cpp
|
||||
|
||||
Vox.c
|
||||
Ammo.c
|
||||
Damage.c
|
||||
TraceAttack.c
|
||||
Rules.c
|
||||
Timer.c
|
||||
|
||||
func_bomb_target.cpp
|
||||
func_buyzone.cpp
|
||||
func_escapezone.cpp
|
||||
|
||||
Bot/Bot.h
|
||||
Bot/Way.c
|
||||
|
||||
Main.c
|
||||
Player.c
|
||||
Spawn.c
|
||||
Footsteps.c
|
||||
Input.c
|
||||
Client.c
|
||||
|
||||
Bot/Route.c
|
||||
Bot/Bot.c
|
||||
#endlist
|
|
@ -1,47 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html><head>
|
||||
|
||||
|
||||
<link rel="SHORTCUT ICON" href="site.ico">
|
||||
|
||||
|
||||
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>FreeCS - About FreeCS</title>
|
||||
|
||||
|
||||
|
||||
|
||||
<meta content="eukara" name="author"></head>
|
||||
<body style="color: white; background-color: transparent; background-image: url(back.gif);" alink="#99ffff" link="#ccccff" vlink="#ccccff">
|
||||
<table style="text-align: left; height: 149px; width: 636px; font-family: Times New Roman,Times,serif; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top; text-align: center; height: 74px; width: 128px;"><img style="width: 128px; height: 128px;" alt="" src="logo_m.png"><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 74px; width: 398px;"><img src="header.png" alt="" style="width: 450px; height: 128px;"><br>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; height: 220px; width: 128px;">
|
||||
<hr style="width: 100%; height: 2px;"><a href="index.html"><span style="font-weight: bold;"></span></a><a href="index.html">Main Page</a><br><a href="about.html">About FreeCS</a><br><a href="team.html">The Team</a><br><a href="faq.html">The FAQ</a><br><a href="screens.html">Screenshots</a><br><a href="dloads.html">Downloads</a><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 220px; width: 398px;">
|
||||
|
||||
<hr style="width: 100%; height: 2px;"><span style="font-weight: bold; text-decoration: underline;">About FreeCS</span><br><p>The goal of this project is to provide a documented, open-source version of Counter-Strike 1.5. </p><p>Counter-Strike, being one of the most popular multiplayer games to exist, surprisingly hasn't had
|
||||
a free-software implementation done until now.</p>
|
||||
<p>Five cool random things you can do with this:</p>
|
||||
<ol><li>Play/Host CS on virtually every platform.</li><li>Customize the game to whatever extent you like.</li><li>Create entirely new weapons!</li><li>Create completely new and refreshing gamemodes!</li><li>Have a guarantee to be able to play it 20 years into the future!</li></ol>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div style="text-align: center; font-family: Times New Roman,Times,serif;">
|
||||
<small><span style="font-style: italic;">1995 - 2017 - by Marco 'eukara' Hladik</span></small>
|
||||
</div>
|
||||
|
||||
</body></html>
|
Before Width: | Height: | Size: 62 B |
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html><head>
|
||||
|
||||
|
||||
<link rel="SHORTCUT ICON" href="site.ico">
|
||||
|
||||
|
||||
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>FreeCS - Downloads</title>
|
||||
|
||||
|
||||
|
||||
|
||||
<meta content="eukara" name="author"></head>
|
||||
<body style="color: white; background-color: transparent; background-image: url(back.gif);" alink="#99ffff" link="#ccccff" vlink="#ccccff">
|
||||
<table style="text-align: left; height: 149px; width: 636px; font-family: Times New Roman,Times,serif; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top; text-align: center; height: 74px; width: 128px;"><img style="width: 128px; height: 128px;" alt="" src="logo_m.png"><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 74px; width: 398px;"><img src="header.png" alt="" style="width: 450px; height: 128px;"><br>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; height: 220px; width: 128px;">
|
||||
<hr style="width: 100%; height: 2px;"><a href="index.html"><span style="font-weight: bold;"></span></a><a href="index.html">Main Page</a><br><a href="about.html">About FreeCS</a><br><a href="team.html">The Team</a><br><a href="faq.html">The FAQ</a><br><a href="screens.html">Screenshots</a><br><a href="dloads.html">Downloads</a><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 220px; width: 398px;">
|
||||
|
||||
<hr style="width: 100%; height: 2px;"><span style="font-weight: bold; text-decoration: underline;">Downloads</span><br><br>Windows 32-bit: Coming soon, check repo!<br>Windows 64-bit: Coming soon, check repo!<br>Linux 32-bit: Coming soon, check repo!<br>Linux 64-bit: Coming soon, check repo!<br><br>Due to inconsistent packaging methods across all Linux distributions, I will only provide a tarball for the binaries. Sorry.<br><br>Check out the source-repo here:<br><a href="https://github.com/eukara/FreeCS">https://github.com/eukara/FreeCS</a><br><br>This is where you can find FTE QuakeWorlds source-repo:<br><a href="https://sourceforge.net/p/fteqw/">https://sourceforge.net/p/fteqw/</a><br><br>Currently hosted at GitHub. Will move it over to icculus hopefully<br>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div style="text-align: center; font-family: Times New Roman,Times,serif;">
|
||||
<small><span style="font-style: italic;">1995 - 2017 - by Marco 'eukara' Hladik</span></small>
|
||||
</div>
|
||||
|
||||
</body></html>
|
|
@ -1,68 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html><head>
|
||||
|
||||
|
||||
<link rel="SHORTCUT ICON" href="site.ico">
|
||||
|
||||
|
||||
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>FreeCS - The FAQ</title>
|
||||
|
||||
|
||||
|
||||
|
||||
<meta content="eukara" name="author"></head>
|
||||
<body style="color: white; background-color: transparent; background-image: url(back.gif);" alink="#99ffff" link="#ccccff" vlink="#ccccff">
|
||||
<table style="text-align: left; height: 149px; width: 636px; font-family: Times New Roman,Times,serif; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top; text-align: center; height: 74px; width: 128px;"><img style="width: 128px; height: 128px;" alt="" src="logo_m.png"><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 74px; width: 398px;"><img src="header.png" alt="" style="width: 450px; height: 128px;"><br>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; height: 220px; width: 128px;">
|
||||
<hr style="width: 100%; height: 2px;"><a href="index.html"><span style="font-weight: bold;"></span></a><a href="index.html">Main Page</a><br><a href="about.html">About FreeCS</a><br><a href="team.html">The Team</a><br><a href="faq.html">The FAQ</a><br><a href="screens.html">Screenshots</a><br><a href="dloads.html">Downloads</a><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 220px; width: 398px;">
|
||||
|
||||
<hr style="width: 100%; height: 2px;"><span style="font-weight: bold; text-decoration: underline;">The Frequently Asked Questions</span><br><br>Please refer to this FAQ before sending any mails or C&D letters to my door.<br><br>Q: Is this the full version of Counter-Strike?<br>A:
|
||||
These are only binaries for a rewritten, specific version of
|
||||
Counter-Strike, the mod. It has nothing to do with the CS games of the
|
||||
past 15 years.<br><br>Q: Why emulate Counter-Strike 1.5?<br>A:
|
||||
It was the last release handled by the original CS team. It's the
|
||||
version me and my friends preferred playing (we did not care about the
|
||||
new weapons and that shield they added...) and it's free for Half-Life
|
||||
owners.<br><br>Q: Should I have to own Half-Life to play this?<br>A:
|
||||
In short: Yes. It will run without. Hell, it can even "run" without the CS content.
|
||||
But you certainly will have difficulties connecting to FreeCS servers.<br><br>Q: Why do I have to download CS 1.5 manually?<br>A: Legal reasons, cannot re-distribute them without potentially causing some trouble.<br><br>Q: Why is this not using the Half-Life engine?<br>A:
|
||||
Many reasons. The SDK for that engine does not encourage free and
|
||||
open-source software. Open-sourcing a Half-Life mod is actually
|
||||
against the EULA of that SDK. Making it a QuakeWorld mod means I own
|
||||
all the rights to it, too. Secondly, CS 1.5 does not run on Steam
|
||||
Half-Life. Even if it did, it would only run on Windows.<br><br>Q: What does FreeCS mean?<br>A: Primarily
|
||||
it stands for Free Counter-Strike, as in Free-Software... it can also
|
||||
mean "free" as in free beer because you don't have to pay anything to
|
||||
download FreeCS itself. Some people have also speculated that it's a
|
||||
political message... gotta love synonyms!<br><br>Q: Can I connect to Counter-Strike 1.5 servers with this?<br>A: No.<br><br>Q: Can I connect to (anything other than FreeCS) with this?<br>A: No.<br><br>Q: Hey, can I take redistribute this on the PlayStore and make money off of this?<br>A:
|
||||
You'd be a scumbag if you did. If you want to contribute towards a proper Android version, please do.<br><br>Q: What motivated you to do all this?<br>A:
|
||||
Good
|
||||
memories, love, passion for Counter-Strike. Also as a middle finger to
|
||||
anyone who told me to "do it better" when criticising a new CS game.
|
||||
Besides, x86 will go away eventually. Making CS run on an engine that
|
||||
has already been ported to multiple platforms ensures that we won't
|
||||
have to emulate WON Half-Life to play anymore!<br><br>Q: How can I contact you for further questions?<br>A: E-Mail! Please send it to: marco at icculus dot org<br>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div style="text-align: center; font-family: Times New Roman,Times,serif;">
|
||||
<small><span style="font-style: italic;">1995 - 2017 - by Marco 'eukara' Hladik</span></small>
|
||||
</div>
|
||||
|
||||
</body></html>
|
Before Width: | Height: | Size: 27 KiB |
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html><head>
|
||||
|
||||
|
||||
<link rel="SHORTCUT ICON" href="site.ico">
|
||||
|
||||
|
||||
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>FreeCS - Home</title>
|
||||
|
||||
|
||||
|
||||
|
||||
<meta content="eukara" name="author"></head>
|
||||
<body style="color: white; background-color: transparent; background-image: url(back.gif);" alink="#99ffff" link="#ccccff" vlink="#ccccff">
|
||||
<table style="text-align: left; height: 149px; width: 636px; font-family: Times New Roman,Times,serif; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top; text-align: center; height: 74px; width: 128px;"><img style="width: 128px; height: 128px;" alt="" src="logo_m.png"><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 74px; width: 398px;"><img src="header.png" alt="" style="width: 450px; height: 128px;"><br>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; height: 220px; width: 128px;">
|
||||
<hr style="width: 100%; height: 2px;"><a href="index.html"><span style="font-weight: bold;"></span></a><a href="index.html">Main Page</a><br><a href="about.html">About FreeCS</a><br><a href="team.html">The Team</a><br><a href="faq.html">The FAQ</a><br><a href="screens.html">Screenshots</a><br><a href="dloads.html">Downloads</a><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 220px; width: 398px;">
|
||||
|
||||
<hr style="width: 100%; height: 2px;"><span style="font-weight: bold; text-decoration: underline;">Main Page</span><br><br>Hello! Welcome to the official site for FreeCS. <br>Check out those links on the left side. They're for navigation.<br>Gotta love the Web!(TM)<br>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div style="text-align: center; font-family: Times New Roman,Times,serif;">
|
||||
<small><span style="font-style: italic;">1995 - 2017 - by Marco 'eukara' Hladik</span></small>
|
||||
</div>
|
||||
|
||||
</body></html>
|
Before Width: | Height: | Size: 18 KiB |
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html><head>
|
||||
|
||||
|
||||
<link rel="SHORTCUT ICON" href="site.ico">
|
||||
|
||||
|
||||
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>FreeCS - Screenshots</title>
|
||||
|
||||
|
||||
|
||||
|
||||
<meta content="eukara" name="author"></head>
|
||||
<body style="color: white; background-color: transparent; background-image: url(back.gif);" alink="#99ffff" link="#ccccff" vlink="#ccccff">
|
||||
<table style="text-align: left; height: 149px; width: 636px; font-family: Times New Roman,Times,serif; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top; text-align: center; height: 74px; width: 128px;"><img style="width: 128px; height: 128px;" alt="" src="logo_m.png"><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 74px; width: 398px;"><img src="header.png" alt="" style="width: 450px; height: 128px;"><br>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; height: 220px; width: 128px;">
|
||||
<hr style="width: 100%; height: 2px;"><a href="index.html"><span style="font-weight: bold;"></span></a><a href="index.html">Main Page</a><br><a href="about.html">About FreeCS</a><br><a href="team.html">The Team</a><br><a href="faq.html">The FAQ</a><br><a href="screens.html">Screenshots</a><br><a href="dloads.html">Downloads</a><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 220px; width: 398px;">
|
||||
|
||||
<hr style="width: 100%; height: 2px;"><span style="font-weight: bold;"></span><a href="screens/screen1.png"><img style="border: 2px solid ; width: 128px; height: 96px;" alt="Screenshot 1" title="Class Selection" src="screens/screen1_thumb.jpg"></a> <a href="screens/screen2.png"><img style="border: 2px solid ; width: 128px; height: 96px;" alt="Screenshot 2" title="cs_assault CT Spawn" src="screens/screen2_thumb.jpg"></a> <a href="screens/screen3.png"><img style="border: 2px solid ; width: 128px; height: 96px;" alt="Screenshot 3" title="Scoreboard Display" src="screens/screen3_thumb.jpg"></a><br><a href="screens/screen4.png"><img style="border: 2px solid ; width: 128px; height: 96px;" alt="Screenshot 4" title="Correct Lighting" src="screens/screen4_thumb.jpg"></a> <a href="screens/portable.jpg"><img style="border: 2px solid ; width: 128px; height: 72px;" alt="Screenshot 5" title="Running on an Android tablet, natively" src="screens/portable_thmb.jpg"></a><br>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div style="text-align: center; font-family: Times New Roman,Times,serif;">
|
||||
<small><span style="font-style: italic;">1995 - 2017 - by Marco 'eukara' Hladik</span></small>
|
||||
</div>
|
||||
|
||||
</body></html>
|
Before Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 360 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 621 KiB |
Before Width: | Height: | Size: 6 KiB |
Before Width: | Height: | Size: 569 KiB |
Before Width: | Height: | Size: 7 KiB |
Before Width: | Height: | Size: 239 KiB |
Before Width: | Height: | Size: 2.9 KiB |
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html><head>
|
||||
|
||||
|
||||
<link rel="SHORTCUT ICON" href="site.ico">
|
||||
|
||||
|
||||
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>FreeCS - The Team</title>
|
||||
|
||||
|
||||
|
||||
|
||||
<meta content="eukara" name="author"></head>
|
||||
<body style="color: white; background-color: transparent; background-image: url(back.gif);" alink="#99ffff" link="#ccccff" vlink="#ccccff">
|
||||
<table style="text-align: left; height: 149px; width: 636px; font-family: Times New Roman,Times,serif; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top; text-align: center; height: 74px; width: 128px;"><img style="width: 128px; height: 128px;" alt="" src="logo_m.png"><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 74px; width: 398px;"><img src="header.png" alt="" style="width: 450px; height: 128px;"><br>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; height: 220px; width: 128px;">
|
||||
<hr style="width: 100%; height: 2px;"><a href="index.html"><span style="font-weight: bold;"></span></a><a href="index.html">Main Page</a><br><a href="about.html">About FreeCS</a><br><a href="team.html">The Team</a><br><a href="faq.html">The FAQ</a><br><a href="screens.html">Screenshots</a><br><a href="dloads.html">Downloads</a><br>
|
||||
</td>
|
||||
<td style="vertical-align: top; height: 220px; width: 398px;">
|
||||
|
||||
<hr style="width: 100%; height: 2px;"><span style="font-weight: bold; text-decoration: underline;">The Team</span><br><br>Project Founder: Marco 'eukara' Hladik<br>Programming: See Project Founder<br>Website: See Programming<br>Hosting: Ryan C. Gordon aka icculus!<br><br>By the way, if you have experience making websites... shoot me a mail. <br>As you can probably tell: I don't!<br>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div style="text-align: center; font-family: Times New Roman,Times,serif;">
|
||||
<small><span style="font-style: italic;">1995 - 2017 - by Marco 'eukara' Hladik</span></small>
|
||||
</div>
|
||||
|
||||
</body></html>
|
79
Source/client/cstrike.src
Executable file
|
@ -0,0 +1,79 @@
|
|||
#pragma target fte
|
||||
#pragma progs_dat "../../cstrike/csprogs.dat"
|
||||
|
||||
#define CSQC
|
||||
#define CSTRIKE
|
||||
|
||||
#includelist
|
||||
../builtins.h
|
||||
../defs.h
|
||||
../shared/cstrike/defs.h
|
||||
../math.h
|
||||
../materials.h
|
||||
../events.h
|
||||
../entities.h
|
||||
cstrike/defs.h
|
||||
|
||||
../shared/cstrike/weaponak47.c
|
||||
../shared/cstrike/weaponaug.c
|
||||
../shared/cstrike/weaponawp.c
|
||||
../shared/cstrike/weaponc4bomb.c
|
||||
../shared/cstrike/weapondeagle.c
|
||||
../shared/cstrike/weaponelites.c
|
||||
../shared/cstrike/weaponfiveseven.c
|
||||
../shared/cstrike/weaponflashbang.c
|
||||
../shared/cstrike/weapong3sg1.c
|
||||
../shared/cstrike/weaponglock18.c
|
||||
../shared/cstrike/weaponhegrenade.c
|
||||
../shared/cstrike/weaponknife.c
|
||||
../shared/cstrike/weaponm3.c
|
||||
../shared/cstrike/weaponm4a1.c
|
||||
../shared/cstrike/weaponmac10.c
|
||||
../shared/cstrike/weaponmp5.c
|
||||
../shared/cstrike/weaponp228.c
|
||||
../shared/cstrike/weaponp90.c
|
||||
../shared/cstrike/weaponpara.c
|
||||
../shared/cstrike/weaponscout.c
|
||||
../shared/cstrike/weaponsg550.c
|
||||
../shared/cstrike/weaponsg552.c
|
||||
../shared/cstrike/weaponsmokegrenade.c
|
||||
../shared/cstrike/weapontmp.c
|
||||
../shared/cstrike/weaponump45.c
|
||||
../shared/cstrike/weaponusp45.c
|
||||
../shared/cstrike/weaponxm1014.c
|
||||
../shared/cstrike/basegun.c
|
||||
../shared/cstrike/weapons.c
|
||||
../shared/cstrike/radio.c
|
||||
../shared/cstrike/equipment.c
|
||||
../shared/cstrike/animations.c
|
||||
../shared/effects.c
|
||||
|
||||
../shared/pmove.c
|
||||
../gs-entbase/client.src
|
||||
../shared/spraylogo.cpp
|
||||
|
||||
cstrike/overview.c
|
||||
cstrike/player.c
|
||||
cstrike/view.c
|
||||
cstrike/vguiobjects.c
|
||||
cstrike/vguispectator.c
|
||||
cstrike/vguiscoreboard.c
|
||||
cstrike/vguimotd.c
|
||||
cstrike/vguibuymenu.c
|
||||
cstrike/vguiteamselect.c
|
||||
cstrike/vguiradio.c
|
||||
cstrike/vgui.c
|
||||
cstrike/damage.c
|
||||
cstrike/nightvision.c
|
||||
cstrike/hudcrosshair.c
|
||||
cstrike/hudscope.c
|
||||
cstrike/hudweaponselect.c
|
||||
cstrike/hudorbituaries.c
|
||||
cstrike/hud.c
|
||||
cstrike/sound.c
|
||||
cstrike/draw.c
|
||||
cstrike/entities.c
|
||||
cstrike/event.c
|
||||
cstrike/init.c
|
||||
entry.c
|
||||
#endlist
|
|
@ -170,130 +170,13 @@ CSQC_UpdateView
|
|||
Entry point for drawing on the client
|
||||
=================
|
||||
*/
|
||||
void CSQC_UpdateView(float fWinWidth, float fWinHeight, float fGameFocus) {
|
||||
float needcursor;
|
||||
int s;
|
||||
void Cstrike_PreDraw(void)
|
||||
{
|
||||
|
||||
if (fWinWidth == 0 || fWinHeight == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
vVideoResolution_x = fWinWidth;
|
||||
vVideoResolution_y = fWinHeight;
|
||||
|
||||
clearscene();
|
||||
setproperty(VF_DRAWENGINESBAR, 0);
|
||||
setproperty(VF_DRAWCROSSHAIR, 0);
|
||||
|
||||
//just in case...
|
||||
if (numclientseats > seats.length) {
|
||||
numclientseats = seats.length;
|
||||
}
|
||||
|
||||
for (s = seats.length; s-- > numclientseats;) {
|
||||
pSeat = &seats[s];
|
||||
pSeat->fVGUI_Display = VGUI_MOTD;
|
||||
pSeat->ePlayer = world;
|
||||
}
|
||||
|
||||
for (s = numclientseats; s-- > 0;) {
|
||||
pSeat = &seats[s];
|
||||
|
||||
CSQC_CalcViewport(s, fWinWidth, fWinHeight);
|
||||
setproperty(VF_ACTIVESEAT, (float)s);
|
||||
|
||||
pSeat->ePlayer = self = findfloat(world, entnum, player_localentnum);
|
||||
if (self) {
|
||||
Player_PreUpdate();
|
||||
}
|
||||
|
||||
pSeat->vPlayerOrigin = self.origin;
|
||||
pSeat->vPlayerVelocity = self.velocity;
|
||||
pSeat->fPlayerFlags = self.flags;
|
||||
|
||||
// Render 3D Game Loop
|
||||
Nightvision_PreDraw();
|
||||
|
||||
// Don't hide the player entity
|
||||
if (autocvar_cl_thirdperson == TRUE && getstatf(STAT_HEALTH)) {
|
||||
setproperty(VF_VIEWENTITY, (float)0);
|
||||
} else {
|
||||
setproperty(VF_VIEWENTITY, (float)player_localentnum);
|
||||
}
|
||||
|
||||
setproperty(VF_AFOV, cvar("fov") * (getstatf(STAT_VIEWZOOM)));
|
||||
setsensitivityscaler((getstatf(STAT_VIEWZOOM)));
|
||||
|
||||
View_Stairsmooth();
|
||||
|
||||
// When Cameratime is active, draw on the forced coords instead
|
||||
if (pSeat->fCameraTime > time) {
|
||||
setproperty(VF_ORIGIN, pSeat->vCameraPos);
|
||||
setproperty(VF_CL_VIEWANGLES, pSeat->vCameraAngle);
|
||||
} else {
|
||||
if (getstatf(STAT_HEALTH)) {
|
||||
if (autocvar_cl_thirdperson == TRUE ) {
|
||||
makevectors(view_angles);
|
||||
vector vStart = [pSeat->vPlayerOrigin[0], pSeat->vPlayerOrigin[1], pSeat->vPlayerOrigin[2] + 16] + (v_right * 4);
|
||||
vector vEnd = vStart + (v_forward * -48) + '0 0 16' + (v_right * 4);
|
||||
traceline(vStart, vEnd, FALSE, self);
|
||||
setproperty(VF_ORIGIN, trace_endpos + (v_forward * 5));
|
||||
} else {
|
||||
setproperty(VF_ORIGIN, pSeat->vPlayerOrigin + self.view_ofs);
|
||||
}
|
||||
} else {
|
||||
setproperty(VF_ORIGIN, pSeat->vPlayerOrigin);
|
||||
}
|
||||
View_DrawViewModel();
|
||||
}
|
||||
|
||||
addentities(MASK_ENGINE);
|
||||
setproperty(VF_MIN, vVideoMins);
|
||||
setproperty(VF_SIZE, vVideoResolution);
|
||||
setproperty(VF_ANGLES, view_angles + pSeat->vPunchAngle);
|
||||
setproperty(VF_DRAWWORLD, 1);
|
||||
renderscene();
|
||||
|
||||
View_DropPunchAngle();
|
||||
Fade_Update((int)vVideoMins[0],(int)vVideoMins[1], (int)fWinWidth, (int)fWinHeight);
|
||||
Nightvision_PostDraw((int)vVideoMins[0],(int)vVideoMins[1], (int)fWinWidth, (int)fWinHeight);
|
||||
View_PostDraw();
|
||||
|
||||
if(fGameFocus == TRUE) {
|
||||
GameText_Draw();
|
||||
|
||||
// The spectator sees things... differently
|
||||
if (getplayerkeyvalue(player_localnum, "*spec") != "0") {
|
||||
VGUI_DrawSpectatorHUD();
|
||||
} else {
|
||||
HUD_Draw();
|
||||
}
|
||||
|
||||
HUD_DrawOrbituaries();
|
||||
HUD_DrawVoice();
|
||||
CSQC_DrawChat();
|
||||
|
||||
// Don't even try to draw centerprints and VGUI menus when scores are shown
|
||||
if (pSeat->iShowScores == TRUE || getstatf(STAT_GAMESTATE) == GAME_OVER) {
|
||||
VGUI_Scores_Show();
|
||||
} else {
|
||||
CSQC_DrawCenterprint();
|
||||
needcursor |= CSQC_VGUI_Draw();
|
||||
}
|
||||
}
|
||||
|
||||
if (self) {
|
||||
Player_ResetPrediction();
|
||||
}
|
||||
}
|
||||
|
||||
pSeat = (void*)0x70000000i;
|
||||
|
||||
if (needcursor) {
|
||||
setcursormode(TRUE, "gfx/cursor", '0 0 0', 1.0f);
|
||||
} else {
|
||||
setcursormode(FALSE, "gfx/cursor", '0 0 0', 1.0f);
|
||||
}
|
||||
|
||||
Sound_ProcessWordQue();
|
||||
Nightvision_PreDraw();
|
||||
}
|
||||
|
||||
void Cstrike_PostDraw(int x, int y, int w, int h)
|
||||
{
|
||||
Nightvision_PostDraw(x, y, w, h);
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
****/
|
||||
|
||||
#include "VGUI.h"
|
||||
#include "vgui.h"
|
||||
|
||||
// Menus with their window titles and draw functions
|
||||
vguiwindow_t vguiMenus[11] = {
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
****/
|
||||
|
||||
#include "VGUI.h"
|
||||
#include "vgui.h"
|
||||
|
||||
vguiweaponobject_t vguiWeaponTable[CS_WEAPON_COUNT] = {
|
||||
{ _("WEAPON_NONE"), "" },
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
****/
|
||||
|
||||
#include "VGUI.h"
|
||||
#include "vgui.h"
|
||||
|
||||
/*
|
||||
====================
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
****/
|
||||
|
||||
#include "VGUI.h"
|
||||
#include "vgui.h"
|
||||
|
||||
/*
|
||||
====================
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
****/
|
||||
|
||||
#include "VGUI.h"
|
||||
#include "vgui.h"
|
||||
|
||||
// Radio Commands
|
||||
#define VGUIRADIO_COMMANDS 6
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
****/
|
||||
|
||||
#include "VGUI.h"
|
||||
#include "vgui.h"
|
||||
|
||||
string sScoreTeams[4] = {
|
||||
_("SCORE_TITLE_SPECTATOR"),
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
****/
|
||||
|
||||
#include "VGUI.h"
|
||||
#include "vgui.h"
|
||||
|
||||
/*
|
||||
====================
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
****/
|
||||
|
||||
#include "VGUI.h"
|
||||
#include "vgui.h"
|
||||
|
||||
string sClassInfo[64] = {
|
||||
_("VGUI_T1_TITLE"), "gfx/vgui/640_terror",
|
140
Source/client/entry.c
Normal file
|
@ -0,0 +1,140 @@
|
|||
/***
|
||||
*
|
||||
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
|
||||
*
|
||||
* See the file LICENSE attached with the sources for usage details.
|
||||
*
|
||||
****/
|
||||
|
||||
void CSQC_UpdateView(float w, float h, float focus)
|
||||
{
|
||||
float needcursor;
|
||||
int s;
|
||||
|
||||
if (w == 0 || h == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
vVideoResolution_x = w;
|
||||
vVideoResolution_y = h;
|
||||
|
||||
clearscene();
|
||||
setproperty(VF_DRAWENGINESBAR, 0);
|
||||
setproperty(VF_DRAWCROSSHAIR, 0);
|
||||
|
||||
//just in case...
|
||||
if (numclientseats > seats.length) {
|
||||
numclientseats = seats.length;
|
||||
}
|
||||
|
||||
for (s = seats.length; s-- > numclientseats;) {
|
||||
pSeat = &seats[s];
|
||||
pSeat->fVGUI_Display = VGUI_MOTD;
|
||||
pSeat->ePlayer = world;
|
||||
}
|
||||
|
||||
for (s = numclientseats; s-- > 0;) {
|
||||
pSeat = &seats[s];
|
||||
|
||||
CSQC_CalcViewport(s, w, h);
|
||||
setproperty(VF_ACTIVESEAT, (float)s);
|
||||
|
||||
pSeat->ePlayer = self = findfloat(world, entnum, player_localentnum);
|
||||
if (self) {
|
||||
Player_PreUpdate();
|
||||
}
|
||||
|
||||
pSeat->vPlayerOrigin = self.origin;
|
||||
pSeat->vPlayerVelocity = self.velocity;
|
||||
pSeat->fPlayerFlags = self.flags;
|
||||
|
||||
// Render 3D Game Loop
|
||||
#ifdef CSTRIKE
|
||||
Cstrike_PreDraw();
|
||||
#endif
|
||||
|
||||
// Don't hide the player entity
|
||||
if (autocvar_cl_thirdperson == TRUE && getstatf(STAT_HEALTH)) {
|
||||
setproperty(VF_VIEWENTITY, (float)0);
|
||||
} else {
|
||||
setproperty(VF_VIEWENTITY, (float)player_localentnum);
|
||||
}
|
||||
|
||||
setproperty(VF_AFOV, cvar("fov") * (getstatf(STAT_VIEWZOOM)));
|
||||
setsensitivityscaler((getstatf(STAT_VIEWZOOM)));
|
||||
|
||||
View_Stairsmooth();
|
||||
|
||||
// When Cameratime is active, draw on the forced coords instead
|
||||
if (pSeat->fCameraTime > time) {
|
||||
setproperty(VF_ORIGIN, pSeat->vCameraPos);
|
||||
setproperty(VF_CL_VIEWANGLES, pSeat->vCameraAngle);
|
||||
} else {
|
||||
if (getstatf(STAT_HEALTH)) {
|
||||
if (autocvar_cl_thirdperson == TRUE ) {
|
||||
makevectors(view_angles);
|
||||
vector vStart = [pSeat->vPlayerOrigin[0], pSeat->vPlayerOrigin[1], pSeat->vPlayerOrigin[2] + 16] + (v_right * 4);
|
||||
vector vEnd = vStart + (v_forward * -48) + '0 0 16' + (v_right * 4);
|
||||
traceline(vStart, vEnd, FALSE, self);
|
||||
setproperty(VF_ORIGIN, trace_endpos + (v_forward * 5));
|
||||
} else {
|
||||
setproperty(VF_ORIGIN, pSeat->vPlayerOrigin + self.view_ofs);
|
||||
}
|
||||
} else {
|
||||
setproperty(VF_ORIGIN, pSeat->vPlayerOrigin);
|
||||
}
|
||||
View_DrawViewModel();
|
||||
}
|
||||
|
||||
addentities(MASK_ENGINE);
|
||||
setproperty(VF_MIN, vVideoMins);
|
||||
setproperty(VF_SIZE, vVideoResolution);
|
||||
setproperty(VF_ANGLES, view_angles + pSeat->vPunchAngle);
|
||||
setproperty(VF_DRAWWORLD, 1);
|
||||
renderscene();
|
||||
|
||||
View_DropPunchAngle();
|
||||
Fade_Update((int)vVideoMins[0],(int)vVideoMins[1], (int)w, (int)h);
|
||||
#ifdef CSTRIKE
|
||||
Cstrike_PostDraw((int)vVideoMins[0],(int)vVideoMins[1], (int)w, (int)h);
|
||||
#endif
|
||||
View_PostDraw();
|
||||
|
||||
if(focus == TRUE) {
|
||||
GameText_Draw();
|
||||
|
||||
// The spectator sees things... differently
|
||||
if (getplayerkeyvalue(player_localnum, "*spec") != "0") {
|
||||
VGUI_DrawSpectatorHUD();
|
||||
} else {
|
||||
HUD_Draw();
|
||||
}
|
||||
|
||||
HUD_DrawOrbituaries();
|
||||
HUD_DrawVoice();
|
||||
CSQC_DrawChat();
|
||||
|
||||
// Don't even try to draw centerprints and VGUI menus when scores are shown
|
||||
if (pSeat->iShowScores == TRUE || getstatf(STAT_GAMESTATE) == GAME_OVER) {
|
||||
VGUI_Scores_Show();
|
||||
} else {
|
||||
CSQC_DrawCenterprint();
|
||||
needcursor |= CSQC_VGUI_Draw();
|
||||
}
|
||||
}
|
||||
|
||||
if (self) {
|
||||
Player_ResetPrediction();
|
||||
}
|
||||
}
|
||||
|
||||
pSeat = (void*)0x70000000i;
|
||||
|
||||
if (needcursor) {
|
||||
setcursormode(TRUE, "gfx/cursor", '0 0 0', 1.0f);
|
||||
} else {
|
||||
setcursormode(FALSE, "gfx/cursor", '0 0 0', 1.0f);
|
||||
}
|
||||
|
||||
Sound_ProcessWordQue();
|
||||
}
|
79
Source/client/valve.src
Executable file
|
@ -0,0 +1,79 @@
|
|||
#pragma target fte
|
||||
#pragma progs_dat "../../valve/csprogs.dat"
|
||||
|
||||
#define CSQC
|
||||
#define CSTRIKE
|
||||
|
||||
#includelist
|
||||
../builtins.h
|
||||
../defs.h
|
||||
../shared/cstrike/defs.h
|
||||
../math.h
|
||||
../materials.h
|
||||
../events.h
|
||||
../entities.h
|
||||
cstrike/defs.h
|
||||
|
||||
../shared/cstrike/weaponak47.c
|
||||
../shared/cstrike/weaponaug.c
|
||||
../shared/cstrike/weaponawp.c
|
||||
../shared/cstrike/weaponc4bomb.c
|
||||
../shared/cstrike/weapondeagle.c
|
||||
../shared/cstrike/weaponelites.c
|
||||
../shared/cstrike/weaponfiveseven.c
|
||||
../shared/cstrike/weaponflashbang.c
|
||||
../shared/cstrike/weapong3sg1.c
|
||||
../shared/cstrike/weaponglock18.c
|
||||
../shared/cstrike/weaponhegrenade.c
|
||||
../shared/cstrike/weaponknife.c
|
||||
../shared/cstrike/weaponm3.c
|
||||
../shared/cstrike/weaponm4a1.c
|
||||
../shared/cstrike/weaponmac10.c
|
||||
../shared/cstrike/weaponmp5.c
|
||||
../shared/cstrike/weaponp228.c
|
||||
../shared/cstrike/weaponp90.c
|
||||
../shared/cstrike/weaponpara.c
|
||||
../shared/cstrike/weaponscout.c
|
||||
../shared/cstrike/weaponsg550.c
|
||||
../shared/cstrike/weaponsg552.c
|
||||
../shared/cstrike/weaponsmokegrenade.c
|
||||
../shared/cstrike/weapontmp.c
|
||||
../shared/cstrike/weaponump45.c
|
||||
../shared/cstrike/weaponusp45.c
|
||||
../shared/cstrike/weaponxm1014.c
|
||||
../shared/cstrike/basegun.c
|
||||
../shared/cstrike/weapons.c
|
||||
../shared/cstrike/radio.c
|
||||
../shared/cstrike/equipment.c
|
||||
../shared/cstrike/animations.c
|
||||
../shared/effects.c
|
||||
|
||||
../shared/pmove.c
|
||||
../gs-entbase/client.src
|
||||
../shared/spraylogo.cpp
|
||||
|
||||
cstrike/overview.c
|
||||
cstrike/player.c
|
||||
cstrike/view.c
|
||||
cstrike/vguiobjects.c
|
||||
cstrike/vguispectator.c
|
||||
cstrike/vguiscoreboard.c
|
||||
cstrike/vguimotd.c
|
||||
cstrike/vguibuymenu.c
|
||||
cstrike/vguiteamselect.c
|
||||
cstrike/vguiradio.c
|
||||
cstrike/vgui.c
|
||||
cstrike/damage.c
|
||||
cstrike/nightvision.c
|
||||
cstrike/hudcrosshair.c
|
||||
cstrike/hudscope.c
|
||||
cstrike/hudweaponselect.c
|
||||
cstrike/hudorbituaries.c
|
||||
cstrike/hud.c
|
||||
cstrike/sound.c
|
||||
cstrike/draw.c
|
||||
cstrike/entities.c
|
||||
cstrike/event.c
|
||||
cstrike/init.c
|
||||
entry.c
|
||||
#endlist
|
4
Source/client/valve/hud.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
void HUD_Draw(void)
|
||||
{
|
||||
|
||||
}
|
0
Source/client/valve/view.c
Normal file
27
Source/defs.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
|
||||
const vector VEC_HULL_MIN = '-16 -16 -36';
|
||||
const vector VEC_HULL_MAX = '16 16 36';
|
||||
|
||||
const vector VEC_CHULL_MIN = '-16 -16 -18';
|
||||
const vector VEC_CHULL_MAX = '16 16 18';
|
||||
|
||||
const vector VEC_PLAYER_VIEWPOS = '0 0 20';
|
||||
const vector VEC_PLAYER_CVIEWPOS = '0 0 12';
|
||||
|
||||
// Actually used by input_button etc.
|
||||
#define INPUT_BUTTON0 1
|
||||
#define INPUT_BUTTON2 2
|
||||
#define INPUT_BUTTON3 4
|
||||
#define INPUT_BUTTON4 8
|
||||
#define INPUT_BUTTON5 16
|
||||
#define INPUT_BUTTON6 32
|
||||
#define INPUT_BUTTON7 64
|
||||
#define INPUT_BUTTON8 128
|
||||
|
||||
#define FL_USERELEASED (1<<13)
|
||||
#define FL_CROUCHING (1<<19)
|
||||
#define FL_SEMI_TOGGLED (1<<15)
|
||||
#define FL_FROZEN (1<<17)
|
||||
#define FL_REMOVEME (1<<18)
|
||||
|
||||
#define clamp(d,min,max) bound(min,d,max)
|
8
Source/entities.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
enum {
|
||||
ENT_PLAYER = 1,
|
||||
ENT_AMBIENTSOUND,
|
||||
ENT_SPRITE,
|
||||
ENT_SPRAY,
|
||||
ENT_DECAL
|
||||
};
|
28
Source/events.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
|
||||
// Network Events
|
||||
enum {
|
||||
EV_WEAPON_DRAW,
|
||||
EV_WEAPON_PRIMARYATTACK,
|
||||
EV_WEAPON_SECONDARYATTACK,
|
||||
EV_WEAPON_RELOAD,
|
||||
EV_IMPACT,
|
||||
EV_EXPLOSION,
|
||||
EV_SPARK,
|
||||
EV_SHAKE,
|
||||
EV_FADE,
|
||||
EV_TEXT,
|
||||
EV_MESSAGE,
|
||||
EV_SPRITE,
|
||||
EV_MODELGIB,
|
||||
EV_CAMERATRIGGER,
|
||||
EV_ORBITUARY,
|
||||
EV_CHAT,
|
||||
EV_CHAT_TEAM,
|
||||
EV_CHAT_VOX,
|
||||
#ifdef CSTRIKE
|
||||
EV_RADIOMSG,
|
||||
EV_RADIOMSG2,
|
||||
EV_SMOKE,
|
||||
EV_FLASH,
|
||||
#endif
|
||||
};
|
25
Source/materials.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Submodel materials
|
||||
enum {
|
||||
MATERIAL_GLASS = 0,
|
||||
MATERIAL_WOOD,
|
||||
MATERIAL_METAL,
|
||||
MATERIAL_FLESH,
|
||||
MATERIAL_CINDER,
|
||||
MATERIAL_TILE,
|
||||
MATERIAL_COMPUTER,
|
||||
MATERIAL_GLASS_UNBREAKABLE,
|
||||
MATERIAL_ROCK,
|
||||
MATERIAL_NONE
|
||||
};
|
||||
|
||||
// Impact types
|
||||
enum {
|
||||
IMPACT_MELEE = 0,
|
||||
IMPACT_EXPLOSION,
|
||||
IMPACT_DEFAULT,
|
||||
IMPACT_GLASS,
|
||||
IMPACT_WOOD,
|
||||
IMPACT_METAL,
|
||||
IMPACT_FLESH,
|
||||
IMPACT_ROCK,
|
||||
};
|
|
@ -75,8 +75,10 @@ void QPhysics_Run ( entity eTarget )
|
|||
|
||||
float flFallVel = ( self.flags & FL_ONGROUND ) ? 0 : -self.velocity_z;
|
||||
|
||||
#ifdef CSTRIKE
|
||||
self.maxspeed = Game_GetMaxSpeed( self );
|
||||
//runstandardplayerphysics(self);
|
||||
#endif
|
||||
|
||||
PMove_Run();
|
||||
#ifdef SSQC
|
||||
if ( ( self.flags & FL_ONGROUND ) && self.movetype == MOVETYPE_WALK && ( flFallVel > 580 )) {
|
|
@ -12,6 +12,7 @@ void m_init(void)
|
|||
{
|
||||
vector g_btnsize;
|
||||
|
||||
registercommand("menu_customgame");
|
||||
font_console = loadfont( "font", "", "12", -1 );
|
||||
font_label = loadfont( "label", "gfx/shell/mssansserif.ttf", "10 12 14", -1 );
|
||||
font_arial = loadfont( "label", "gfx/shell/arial.ttf", "14 11", -1 );
|
||||
|
@ -24,9 +25,10 @@ void m_init(void)
|
|||
localcmd("con_textsize -12\n");
|
||||
localcmd("scr_conalpha 1\n");
|
||||
localcmd("cl_idlefps 0\n");
|
||||
|
||||
/* Hack! */
|
||||
localcmd("gl_font 0\n");
|
||||
registercommand("menu_customgame");
|
||||
|
||||
localcmd("gl_font CONCHARS?fmt=h\n");
|
||||
|
||||
shaderforname("logo_avi", "{\n{\nvideomap av:media/logo.avi\n}\n}");
|
||||
|
||||
|
@ -37,10 +39,11 @@ void m_init(void)
|
|||
g_btnsize = drawgetimagesize(g_bmp[BTNS_MAIN]);
|
||||
g_btnofs = 26 / g_btnsize[1];
|
||||
|
||||
Strings_Init();
|
||||
Colors_Init();
|
||||
games_init();
|
||||
main_init();
|
||||
|
||||
Colors_Init();
|
||||
Strings_Init();
|
||||
g_initialized = TRUE;
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
#pragma target fte
|
||||
#pragma progs_dat "../../fn/menu.dat"
|
||||
#pragma progs_dat "../../valve/menu.dat"
|
||||
|
||||
#define MENU
|
||||
|
||||
#includelist
|
||||
../Builtins.h
|
||||
../Math.h
|
||||
../builtins.h
|
||||
../math.h
|
||||
defs.h
|
||||
bitmaps.h
|
||||
strings.h
|