Xonotic
sv_random_gravity.qc File Reference
+ Include dependency graph for sv_random_gravity.qc:

Go to the source code of this file.

Functions

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

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  ,
SV_StartFrame   
)

Definition at line 25 of file sv_random_gravity.qc.

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, bound(), cvar(), cvar_set(), ftos(), LOG_TRACE, random(), round_handler_IsActive, round_handler_IsRoundStarted, and time.

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 round_handler_IsActive()
#define round_handler_IsRoundStarted()
float autocvar_g_random_gravity_delay
float autocvar_g_random_gravity_negative_chance
float autocvar_g_random_gravity_max
float autocvar_g_random_gravity_negative
float autocvar_g_random_gravity_positive
float autocvar_g_random_gravity_min
#define LOG_TRACE(...)
Definition: log.qh:81
float time
Definition: csprogsdefs.qc:16
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [2/3]

MUTATOR_HOOKFUNCTION ( random_gravity  ,
BuildMutatorsString   
)

Definition at line 42 of file sv_random_gravity.qc.

References M_ARGV, and strcat().

43 {
44  M_ARGV(0, string) = strcat(M_ARGV(0, string), ":RandomGravity");
45 }
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [3/3]

MUTATOR_HOOKFUNCTION ( random_gravity  ,
BuildMutatorsPrettyString   
)

Definition at line 47 of file sv_random_gravity.qc.

References M_ARGV, and strcat().

48 {
49  M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Random gravity");
50 }
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

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().