Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_random_gravity.qc File Reference
Include dependency graph for sv_random_gravity.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 MUTATOR_HOOKFUNCTION (random_gravity, BuildMutatorsPrettyString)
 MUTATOR_HOOKFUNCTION (random_gravity, BuildMutatorsString)
 MUTATOR_HOOKFUNCTION (random_gravity, SV_StartFrame)

Variables

float autocvar_g_random_gravity_delay
float autocvar_g_random_gravity_max
float autocvar_g_random_gravity_min
float autocvar_g_random_gravity_negative
float autocvar_g_random_gravity_negative_chance
float autocvar_g_random_gravity_positive

Function Documentation

◆ MUTATOR_HOOKFUNCTION() [1/3]

MUTATOR_HOOKFUNCTION ( random_gravity ,
BuildMutatorsPrettyString  )

Definition at line 47 of file sv_random_gravity.qc.

48{
49 M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Random gravity");
50}
#define M_ARGV(x, type)
Definition events.qh:17
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

References M_ARGV, and strcat().

◆ MUTATOR_HOOKFUNCTION() [2/3]

MUTATOR_HOOKFUNCTION ( random_gravity ,
BuildMutatorsString  )

Definition at line 42 of file sv_random_gravity.qc.

43{
44 M_ARGV(0, string) = strcat(M_ARGV(0, string), ":RandomGravity");
45}

References M_ARGV, and strcat().

◆ MUTATOR_HOOKFUNCTION() [3/3]

MUTATOR_HOOKFUNCTION ( random_gravity ,
SV_StartFrame  )

Definition at line 25 of file sv_random_gravity.qc.

26{
27 if(game_stopped || !cvar("g_random_gravity")) return false;
28 if(time < gravity_delay) return false;
29 if(time < game_starttime) return false;
31
34 else
36
37 gravity_delay = time + autocvar_g_random_gravity_delay;
38
39 LOG_TRACE("Gravity is now: ", ftos(autocvar_sv_gravity));
40}
#define autocvar_sv_gravity
Definition stats.qh:421
float game_starttime
Definition stats.qh:82
float game_stopped
Definition stats.qh:81
float time
#define LOG_TRACE(...)
Definition log.qh:76
void cvar_set(string name, string value)
float bound(float min, float value, float max)
float cvar(string name)
float random(void)
string ftos(float f)
#define round_handler_IsActive()
#define round_handler_IsRoundStarted()
float autocvar_g_random_gravity_delay
float autocvar_g_random_gravity_min
float autocvar_g_random_gravity_max
float autocvar_g_random_gravity_negative_chance
float autocvar_g_random_gravity_negative
float autocvar_g_random_gravity_positive

References autocvar_g_random_gravity_delay, autocvar_g_random_gravity_max, autocvar_g_random_gravity_min, autocvar_g_random_gravity_negative, autocvar_g_random_gravity_negative_chance, autocvar_g_random_gravity_positive, autocvar_sv_gravity, bound(), cvar(), cvar_set(), ftos(), game_starttime, game_stopped, LOG_TRACE, random(), round_handler_IsActive, round_handler_IsRoundStarted, and time.

Variable Documentation

◆ autocvar_g_random_gravity_delay

float autocvar_g_random_gravity_delay

Definition at line 13 of file sv_random_gravity.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_random_gravity_max

float autocvar_g_random_gravity_max

Definition at line 10 of file sv_random_gravity.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_random_gravity_min

float autocvar_g_random_gravity_min

Definition at line 9 of file sv_random_gravity.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_random_gravity_negative

float autocvar_g_random_gravity_negative

Definition at line 12 of file sv_random_gravity.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_random_gravity_negative_chance

float autocvar_g_random_gravity_negative_chance

Definition at line 8 of file sv_random_gravity.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_random_gravity_positive

float autocvar_g_random_gravity_positive

Definition at line 11 of file sv_random_gravity.qc.

Referenced by MUTATOR_HOOKFUNCTION().