Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_midair.qc
Go to the documentation of this file.
1#include "sv_midair.qh"
2
7
9
11
12MUTATOR_HOOKFUNCTION(midair, Damage_Calculate)
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}
27
28MUTATOR_HOOKFUNCTION(midair, PlayerPowerups)
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}
39
40MUTATOR_HOOKFUNCTION(midair, PlayerSpawn)
41{
42 entity player = M_ARGV(0, entity);
43
44 if(IS_BOT_CLIENT(player))
45 player.bot_moveskill = 0; // disable bunnyhopping
46}
47
48MUTATOR_HOOKFUNCTION(midair, BuildMutatorsString)
49{
50 M_ARGV(0, string) = strcat(M_ARGV(0, string), ":midair");
51}
52
53MUTATOR_HOOKFUNCTION(midair, BuildMutatorsPrettyString)
54{
55 M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Midair");
56}
#define REGISTER_MUTATOR(...)
Definition base.qh:295
#define MUTATOR_HOOKFUNCTION(...)
Definition base.qh:335
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define M_ARGV(x, type)
Definition events.qh:17
#define IS_PLAYER(s)
Definition player.qh:243
float game_starttime
Definition stats.qh:82
const float EF_ADDITIVE
const float EF_FULLBRIGHT
float time
ERASEABLE bool expr_evaluate(string s)
Evaluate an expression of the form: [+ | -]?
Definition cvar.qh:48
float max(float f,...)
#define IS_ONGROUND(s)
Definition movetypes.qh:16
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
vector
Definition self.qh:92
entity frag_target
Definition sv_ctf.qc:2321
float midair_shieldtime
Definition sv_midair.qc:10
float autocvar_g_midair_damageforcescale
Definition sv_midair.qc:6
float autocvar_g_midair_shieldtime
Definition sv_midair.qc:4
string autocvar_g_midair
Definition sv_midair.qc:3
float autocvar_g_midair_damagemultiplier
Definition sv_midair.qc:5
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
Definition utils.qh:15