nuclide/Source/server/scihunt/input.c
Marco Hladik 7c15bed7bb Flashlight: Add the HUD indicator in the 'valve' base
Rewolf: Preparing initial work
Effects: Added Gib-Human effect
CBaseEntity: Make sure things that are hidden can't be damaged by default. E.g. func_breakables that are hidden
func_door_rotating: Minor tweak saving us a few bytes
item_food/sodacan: Make bounding box bigger, fix classname check to apply to "player", not "Player" (TW leftover)
Damage_Radius: Fix how damage radius checks for brush based entities.

Scientist Hunt specific stuff:
- impulse 103 test cvar added to destroy everything around the map
- scientists can be gibbed
- scientists scream when falling
- new cvar sh_scialert that spawn scientists alerted
- new cvar sh_scispeed that is mirrored from the original mod
- new cvar sh_scimax that will limit the amount of scientists spawned by the shdata system
- new cvar sh_sciyaw that will randomize the spawn yaw angle when there's no other specified
2019-03-09 15:50:11 +01:00

62 lines
1.2 KiB
C

/***
*
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
*
* See the file LICENSE attached with the sources for usage details.
*
****/
/*
=================
Input_Handle
Handles impulse and whatnot
=================
*/
void Game_Input(void)
{
if (self.button0) {
Weapons_Primary();
} else if (self.button4) {
Weapons_Reload();
} else if (self.button3) {
Weapons_Secondary();
} else {
Weapons_Release();
}
if (self.button5) {
Player_UseDown();
} else {
Player_UseUp();
}
if (self.impulse == 100) {
Flashlight_Toggle();
}
if (cvar("sv_cheats") == 1) {
player pl = (player)self;
if (self.impulse == 102) {
// Respawn all the entities
for (entity a = world; (a = findfloat(a, gflags, GF_CANRESPAWN));) {
CBaseEntity caw = (CBaseEntity)a;
caw.Respawn();
}
bprint(PRINT_HIGH, "Respawning all map entities...\n");
}
if (self.impulse == 103) {
// Respawn all the entities
for (entity a = world; (a = find(a, classname, "func_breakable"));) {
func_breakable caw = (func_breakable)a;
caw.vDeath(world, 0, 0);
}
bprint(PRINT_HIGH, "BREAK EVERYTHING!\n");
}
}
self.impulse = 0;
}