Xonotic
sv_midair.qc File Reference
#include "sv_midair.qh"
+ Include dependency graph for sv_midair.qc:

Go to the source code of this file.

Functions

 MUTATOR_HOOKFUNCTION (midair, Damage_Calculate)
 
 MUTATOR_HOOKFUNCTION (midair, PlayerPowerups)
 
 MUTATOR_HOOKFUNCTION (midair, PlayerSpawn)
 
 MUTATOR_HOOKFUNCTION (midair, BuildMutatorsString)
 
 MUTATOR_HOOKFUNCTION (midair, BuildMutatorsPrettyString)
 
 REGISTER_MUTATOR (midair, expr_evaluate(autocvar_g_midair))
 

Variables

string autocvar_g_midair
 
float autocvar_g_midair_shieldtime
 
float midair_shieldtime
 

Function Documentation

◆ MUTATOR_HOOKFUNCTION() [1/5]

MUTATOR_HOOKFUNCTION ( midair  ,
Damage_Calculate   
)

Definition at line 10 of file sv_midair.qc.

References entity(), IS_PLAYER, M_ARGV, and time.

11 {
12  entity frag_attacker = M_ARGV(1, entity);
13  entity frag_target = M_ARGV(2, entity);
14 
15  if(IS_PLAYER(frag_attacker))
16  if(IS_PLAYER(frag_target))
17  if(time < frag_target.midair_shieldtime)
18  M_ARGV(4, float) = 0;
19 }
entity() spawn
#define M_ARGV(x, type)
Definition: events.qh:17
float time
Definition: csprogsdefs.qc:16
#define IS_PLAYER(v)
Definition: utils.qh:9
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [2/5]

MUTATOR_HOOKFUNCTION ( midair  ,
PlayerPowerups   
)

Definition at line 21 of file sv_midair.qc.

References autocvar_g_midair_shieldtime, EF_ADDITIVE, EF_FULLBRIGHT, entity(), IS_ONGROUND, M_ARGV, max(), and time.

22 {
23  entity player = M_ARGV(0, entity);
24 
25  if(time >= game_starttime)
26  if(IS_ONGROUND(player))
27  {
28  player.effects |= (EF_ADDITIVE | EF_FULLBRIGHT);
29  player.midair_shieldtime = max(player.midair_shieldtime, time + autocvar_g_midair_shieldtime);
30  }
31 }
float autocvar_g_midair_shieldtime
Definition: sv_midair.qc:4
entity() spawn
#define IS_ONGROUND(s)
Definition: movetypes.qh:16
const float EF_ADDITIVE
Definition: csprogsdefs.qc:300
const float EF_FULLBRIGHT
Definition: csprogsdefs.qc:303
#define M_ARGV(x, type)
Definition: events.qh:17
float time
Definition: csprogsdefs.qc:16
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [3/5]

MUTATOR_HOOKFUNCTION ( midair  ,
PlayerSpawn   
)

Definition at line 33 of file sv_midair.qc.

References entity(), IS_BOT_CLIENT, and M_ARGV.

34 {
35  entity player = M_ARGV(0, entity);
36 
37  if(IS_BOT_CLIENT(player))
38  player.bot_moveskill = 0; // disable bunnyhopping
39 }
entity() spawn
#define M_ARGV(x, type)
Definition: events.qh:17
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
Definition: utils.qh:15
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [4/5]

MUTATOR_HOOKFUNCTION ( midair  ,
BuildMutatorsString   
)

Definition at line 41 of file sv_midair.qc.

References M_ARGV, and strcat().

42 {
43  M_ARGV(0, string) = strcat(M_ARGV(0, string), ":midair");
44 }
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() [5/5]

MUTATOR_HOOKFUNCTION ( midair  ,
BuildMutatorsPrettyString   
)

Definition at line 46 of file sv_midair.qc.

References M_ARGV, and strcat().

47 {
48  M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Midair");
49 }
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:

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( midair  ,
expr_evaluate(autocvar_g_midair  
)

Variable Documentation

◆ autocvar_g_midair

string autocvar_g_midair

Definition at line 3 of file sv_midair.qc.

◆ autocvar_g_midair_shieldtime

float autocvar_g_midair_shieldtime

Definition at line 4 of file sv_midair.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ midair_shieldtime

float midair_shieldtime

Definition at line 8 of file sv_midair.qc.