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

Go to the source code of this file.

Functions

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

Variables

string autocvar_g_midair
float autocvar_g_midair_damageforcescale
float autocvar_g_midair_damagemultiplier
float autocvar_g_midair_shieldtime
float midair_shieldtime

Function Documentation

◆ MUTATOR_HOOKFUNCTION() [1/5]

MUTATOR_HOOKFUNCTION ( midair ,
BuildMutatorsPrettyString  )

Definition at line 53 of file sv_midair.qc.

54{
55 M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Midair");
56}
#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/5]

MUTATOR_HOOKFUNCTION ( midair ,
BuildMutatorsString  )

Definition at line 48 of file sv_midair.qc.

49{
50 M_ARGV(0, string) = strcat(M_ARGV(0, string), ":midair");
51}

References M_ARGV, and strcat().

◆ MUTATOR_HOOKFUNCTION() [3/5]

MUTATOR_HOOKFUNCTION ( midair ,
Damage_Calculate  )

Definition at line 12 of file sv_midair.qc.

13{
14 entity frag_attacker = M_ARGV(1, entity);
16
17 if(IS_PLAYER(frag_attacker) && IS_PLAYER(frag_target))
18 {
19 if(time < frag_target.midair_shieldtime)
20 M_ARGV(4, float) = 0;
21 else
25 }
26}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define IS_PLAYER(s)
Definition player.qh:243
float time
vector
Definition self.qh:92
entity frag_target
Definition sv_ctf.qc:2321
float autocvar_g_midair_damageforcescale
Definition sv_midair.qc:6
float autocvar_g_midair_damagemultiplier
Definition sv_midair.qc:5

References autocvar_g_midair_damageforcescale, autocvar_g_midair_damagemultiplier, entity(), frag_target, IS_PLAYER, M_ARGV, time, and vector.

◆ MUTATOR_HOOKFUNCTION() [4/5]

MUTATOR_HOOKFUNCTION ( midair ,
PlayerPowerups  )

Definition at line 28 of file sv_midair.qc.

29{
30 entity player = M_ARGV(0, entity);
31
32 if(time >= game_starttime)
33 if(IS_ONGROUND(player))
34 {
35 player.effects |= (EF_ADDITIVE | EF_FULLBRIGHT);
36 player.midair_shieldtime = max(player.midair_shieldtime, time + autocvar_g_midair_shieldtime);
37 }
38}
float game_starttime
Definition stats.qh:82
const float EF_ADDITIVE
const float EF_FULLBRIGHT
float max(float f,...)
#define IS_ONGROUND(s)
Definition movetypes.qh:16
float autocvar_g_midair_shieldtime
Definition sv_midair.qc:4

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

◆ MUTATOR_HOOKFUNCTION() [5/5]

MUTATOR_HOOKFUNCTION ( midair ,
PlayerSpawn  )

Definition at line 40 of file sv_midair.qc.

41{
42 entity player = M_ARGV(0, entity);
43
44 if(IS_BOT_CLIENT(player))
45 player.bot_moveskill = 0; // disable bunnyhopping
46}
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
Definition utils.qh:15

References entity(), IS_BOT_CLIENT, and M_ARGV.

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( midair ,
expr_evaluate(autocvar_g_midair)  )

References autocvar_g_midair.

Variable Documentation

◆ autocvar_g_midair

string autocvar_g_midair

Definition at line 3 of file sv_midair.qc.

Referenced by REGISTER_MUTATOR().

◆ autocvar_g_midair_damageforcescale

float autocvar_g_midair_damageforcescale

Definition at line 6 of file sv_midair.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_midair_damagemultiplier

float autocvar_g_midair_damagemultiplier

Definition at line 5 of file sv_midair.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ 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 10 of file sv_midair.qc.