scihunt: Added support for parsing SH_Data files, gave it its own game
This commit is contained in:
parent
9fa8ab4079
commit
1a3bf2d6ad
10 changed files with 172 additions and 5 deletions
|
@ -4,5 +4,6 @@ qc-progs:
|
|||
$(CC) menu-fn/progs.src
|
||||
$(CC) client/valve.src
|
||||
$(CC) server/valve.src
|
||||
$(CC) server/scihunt.src
|
||||
$(CC) client/cstrike.src
|
||||
$(CC) server/cstrike.src
|
||||
|
|
|
@ -35,9 +35,9 @@ const vector VEC_PLAYER_CVIEWPOS = [0,0,12];
|
|||
#define INPUT_BUTTON8 0x00000080
|
||||
|
||||
#define FL_USERELEASED (1<<13)
|
||||
#define FL_CROUCHING (1<<19)
|
||||
#define FL_CROUCHING (1<<19)
|
||||
#define FL_SEMI_TOGGLED (1<<15)
|
||||
#define FL_FROZEN (1<<17)
|
||||
#define FL_REMOVEME (1<<18)
|
||||
#define FL_FROZEN (1<<17)
|
||||
#define FL_REMOVEME (1<<18)
|
||||
|
||||
#define clamp(d,min,max) bound(min,d,max)
|
||||
|
|
67
Source/server/scihunt.src
Executable file
67
Source/server/scihunt.src
Executable file
|
@ -0,0 +1,67 @@
|
|||
#pragma target fte
|
||||
#pragma progs_dat "../../scihunt/progs.dat"
|
||||
|
||||
#define QWSSQC
|
||||
#define VALVE
|
||||
|
||||
#includelist
|
||||
../builtins.h
|
||||
../defs.h
|
||||
valve/defs.h
|
||||
../math.h
|
||||
../materials.h
|
||||
../events.h
|
||||
../entities.h
|
||||
defs.h
|
||||
|
||||
../gs-entbase/server.src
|
||||
valve/monster_rat.cpp
|
||||
scihunt/monster_scientist.cpp
|
||||
|
||||
../shared/decals.c
|
||||
../shared/effects.c
|
||||
../shared/spraylogo.cpp
|
||||
|
||||
../shared/valve/player.cpp
|
||||
valve/player.c
|
||||
../shared/pmove.c
|
||||
valve/spectator.c
|
||||
../shared/valve/items.h
|
||||
../shared/valve/crosshair.h
|
||||
../shared/valve/weapons.h
|
||||
../shared/valve/w_crowbar.c
|
||||
../shared/valve/w_glock.c
|
||||
../shared/valve/w_python.c
|
||||
../shared/valve/w_mp5.c
|
||||
../shared/valve/w_crossbow.c
|
||||
../shared/valve/w_shotgun.c
|
||||
../shared/valve/w_rpg.c
|
||||
../shared/valve/w_gauss.c
|
||||
../shared/valve/w_egon.c
|
||||
../shared/valve/w_hornetgun.c
|
||||
../shared/valve/w_handgrenade.c
|
||||
../shared/valve/w_tripmine.c
|
||||
../shared/valve/w_satchel.c
|
||||
../shared/valve/w_snark.c
|
||||
valve/items.cpp
|
||||
../shared/valve/weapons.c
|
||||
|
||||
scihunt/shdata_parse.c
|
||||
spawn.c
|
||||
|
||||
valve/client.c
|
||||
client.c
|
||||
|
||||
scihunt/server.c
|
||||
server.c
|
||||
|
||||
valve/damage.c
|
||||
traceattack.c
|
||||
vox.c
|
||||
|
||||
valve/input.c
|
||||
|
||||
valve/spawn.c
|
||||
footsteps.c
|
||||
entry.c
|
||||
#endlist
|
24
Source/server/scihunt/server.c
Normal file
24
Source/server/scihunt/server.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
/***
|
||||
*
|
||||
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
|
||||
*
|
||||
* See the file LICENSE attached with the sources for usage details.
|
||||
*
|
||||
****/
|
||||
|
||||
void Game_StartFrame(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
float Game_ConsoleCmd(string cmd)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void Game_Worldspawn(void)
|
||||
{
|
||||
precache_model("models/player.mdl");
|
||||
Weapons_Init();
|
||||
SHData_Parse(mapname);
|
||||
}
|
76
Source/server/scihunt/shdata_parse.c
Normal file
76
Source/server/scihunt/shdata_parse.c
Normal file
|
@ -0,0 +1,76 @@
|
|||
/***
|
||||
*
|
||||
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
|
||||
*
|
||||
* See the file LICENSE attached with the sources for usage details.
|
||||
*
|
||||
****/
|
||||
|
||||
void SHData_New(void)
|
||||
{
|
||||
entity new = spawn();
|
||||
new.origin[0] = stof(argv(1));
|
||||
new.origin[1] = stof(argv(2));
|
||||
new.origin[2] = stof(argv(3));
|
||||
setorigin(new, new.origin);
|
||||
|
||||
entity oldself = self;
|
||||
self = new;
|
||||
|
||||
if (argv(0) == "monster_scientist") {
|
||||
spawnfunc_monster_scientist();
|
||||
} else if (argv(0) == "info_player_team1") {
|
||||
self.classname = "info_player_deathmatch";
|
||||
} else if (argv(0) == "info_player_team2") {
|
||||
self.classname = "info_player_deathmatch";
|
||||
}
|
||||
self = oldself;
|
||||
}
|
||||
|
||||
void SHData_NewAngles(void)
|
||||
{
|
||||
entity new = spawn();
|
||||
new.origin[0] = stof(argv(1));
|
||||
new.origin[1] = stof(argv(2));
|
||||
new.origin[2] = stof(argv(3));
|
||||
new.angles[0] = stof(argv(4));
|
||||
new.angles[1] = stof(argv(5));
|
||||
new.angles[2] = stof(argv(6));
|
||||
setorigin(new, new.origin);
|
||||
|
||||
entity oldself = self;
|
||||
self = new;
|
||||
|
||||
if (argv(0) == "monster_scientist") {
|
||||
spawnfunc_monster_scientist();
|
||||
} else if (argv(0) == "info_player_team1") {
|
||||
self.classname = "info_player_deathmatch";
|
||||
} else if (argv(0) == "info_player_team2") {
|
||||
self.classname = "info_player_deathmatch";
|
||||
}
|
||||
self = oldself;
|
||||
}
|
||||
|
||||
void SHData_Parse(string map)
|
||||
{
|
||||
int c;
|
||||
string temp;
|
||||
filestream shdfile = fopen(sprintf("SH_Data/%s.shd", map), FILE_READ);
|
||||
|
||||
if (shdfile < 0) {
|
||||
dprint(sprintf("^1WARNING^7: Could not load SH_Data/%s.shd\n", map));
|
||||
return;
|
||||
}
|
||||
|
||||
if (shdfile >= 0) {
|
||||
while ((temp = fgets(shdfile))) {
|
||||
c = tokenize(temp);
|
||||
|
||||
if (c == 4) {
|
||||
SHData_New();
|
||||
} else if (c == 7) {
|
||||
SHData_NewAngles();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,6 @@ defs.h
|
|||
|
||||
../gs-entbase/server.src
|
||||
valve/monster_rat.cpp
|
||||
valve/monster_scientist.cpp
|
||||
|
||||
../shared/decals.c
|
||||
../shared/effects.c
|
||||
|
|
|
@ -67,7 +67,7 @@ void Damage_Apply(entity eTarget, entity eAttacker, float fDamage, vector vHitPo
|
|||
|
||||
if ((eTarget.flags & FL_CLIENT) && (eAttacker.flags & FL_CLIENT)) {
|
||||
eAttacker.frags++;
|
||||
Damage_CastOrbituary(eAttacker, eTarget, eAttacker.weapon);
|
||||
//Damage_CastOrbituary(eAttacker, eTarget, eAttacker.weapon);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
BIN
scihunt/progs.dat
Normal file
BIN
scihunt/progs.dat
Normal file
Binary file not shown.
BIN
valve/progs.dat
BIN
valve/progs.dat
Binary file not shown.
Loading…
Reference in a new issue