Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
| mp_timelimit | 0 | - | - | Period between map rotations.<br />`0` means no limit |
| mp_forcerespawn | 0 | 0 | - | Players will automatically respawn when killed.<br/>`0` disabled<br/>`>0.00001` time delay to respawn |
| mp_hostage_hurtable | 1 | 0 | 1 | The hostages can take damage.<br/>`0` disabled<br/>`1` from any team<br/>`2` only from `CT`<br/>`3` only from `T` |
| mp_hostage_fear | 1 | 0 | 1 | The hostages with improved AI (`hostage_ai_enable 1`) get scared of gunfire, explosions and nearby deaths.<br/>`0` disabled (hostages stay calm)<br/>`1` enabled |
| mp_show_radioicon | 1 | 0 | 1 | Show radio icon.<br/>`0` disabled<br/>`1` enabled |
| mp_show_scenarioicon | 0 | 0 | 1 | Show scenario icon in HUD such as count of alive hostages or ticking bomb.<br/>`0` disabled<br/>`1` enabled |
| mp_old_bomb_defused_sound | 1 | 0 | 1 | Play "Bomb has been defused" sound instead of "Counter-Terrorists win" when bomb was defused<br/>`0` disabled<br/>`1` enabled |
Expand Down
8 changes: 8 additions & 0 deletions dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ mp_forcerespawn "0"
// Default value: "1"
mp_hostage_hurtable "1"

// The hostages with improved AI (hostage_ai_enable 1)
// get scared of gunfire, explosions and nearby deaths.
// 0 - disabled (hostages stay calm)
// 1 - enabled (default behaviour)
//
// Default value: "1"
mp_hostage_fear "1"

// Show radio icon.
// 0 - disabled
// 1 - enabled (default behavior)
Expand Down
2 changes: 2 additions & 0 deletions regamedll/dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ cvar_t round_restart_delay = { "mp_round_restart_delay", "5", FCVAR_SERVER, 0.
cvar_t showtriggers = { "showtriggers", "0", 0, 0.0f, nullptr }; // debug cvar shows triggers
// TODO: Maybe it's better to register in the engine?
cvar_t hostagehurtable = { "mp_hostage_hurtable", "1", FCVAR_SERVER, 1.0f, nullptr };
cvar_t hostagefear = { "mp_hostage_fear", "1", FCVAR_SERVER, 1.0f, nullptr };
cvar_t roundover = { "mp_roundover", "0", FCVAR_SERVER, 0.0f, nullptr };
cvar_t forcerespawn = { "mp_forcerespawn", "0", FCVAR_SERVER, 0.0f, nullptr };
cvar_t show_radioicon = { "mp_show_radioicon", "1", 0, 1.0f, nullptr };
Expand Down Expand Up @@ -403,6 +404,7 @@ void EXT_FUNC GameDLLInit()

CVAR_REGISTER(&showtriggers);
CVAR_REGISTER(&hostagehurtable);
CVAR_REGISTER(&hostagefear);
CVAR_REGISTER(&roundover);
CVAR_REGISTER(&forcerespawn);
CVAR_REGISTER(&show_radioicon);
Expand Down
1 change: 1 addition & 0 deletions regamedll/dlls/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ extern cvar_t round_restart_delay;

extern cvar_t showtriggers;
extern cvar_t hostagehurtable;
extern cvar_t hostagefear;
extern cvar_t roundover;
extern cvar_t forcerespawn;
extern cvar_t show_radioicon;
Expand Down
6 changes: 6 additions & 0 deletions regamedll/dlls/hostage/hostage_improv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,12 @@ bool CHostageImprov::IsScared() const

void CHostageImprov::Frighten(ScareType scare)
{
#ifdef REGAMEDLL_ADD
// keep hostages calm, they won't get scared of gunfire, explosions or nearby deaths
if (hostagefear.value <= 0.0f)
return;
#endif

const float ignoreTime = 10.0f;

if (!IsScared())
Expand Down
Loading