]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/mutator_midair.qc
Merge remote-tracking branch 'origin/debugger/superspec_options'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_midair.qc
1 .float midair_shieldtime;
2
3 MUTATOR_HOOKFUNCTION(midair_PlayerDamage)
4 {
5         if(IS_PLAYER(frag_attacker))
6         if(IS_PLAYER(frag_target))
7         if(time < self.midair_shieldtime)
8                 frag_damage = FALSE;
9
10         return FALSE;
11 }
12
13 MUTATOR_HOOKFUNCTION(midair_PlayerPowerups)
14 {
15         if(time >= game_starttime)
16         if(self.flags & FL_ONGROUND)
17         {
18                 self.effects |= (EF_ADDITIVE | EF_FULLBRIGHT);
19                 self.midair_shieldtime = max(self.midair_shieldtime, time + autocvar_g_midair_shieldtime);
20         }
21                 
22         return FALSE;
23 }
24
25 MUTATOR_HOOKFUNCTION(midair_PlayerSpawn)
26 {
27         if(IS_BOT_CLIENT(self))
28                 self.bot_moveskill = 0; // disable bunnyhopping
29
30         return FALSE;
31 }
32
33 MUTATOR_HOOKFUNCTION(midair_BuildMutatorsString)
34 {
35         ret_string = strcat(ret_string, ":midair");
36         return FALSE;
37 }
38
39 MUTATOR_HOOKFUNCTION(midair_BuildMutatorsPrettyString)
40 {
41         ret_string = strcat(ret_string, ", Midair");
42         return FALSE;
43 }
44
45 MUTATOR_DEFINITION(mutator_midair)
46 {
47         MUTATOR_HOOK(PlayerDamage_Calculate, midair_PlayerDamage, CBC_ORDER_ANY);
48         MUTATOR_HOOK(PlayerPowerups, midair_PlayerPowerups, CBC_ORDER_ANY);
49         MUTATOR_HOOK(PlayerSpawn, midair_PlayerSpawn, CBC_ORDER_ANY);
50         MUTATOR_HOOK(BuildMutatorsString, midair_BuildMutatorsString, CBC_ORDER_ANY);
51         MUTATOR_HOOK(BuildMutatorsPrettyString, midair_BuildMutatorsPrettyString, CBC_ORDER_ANY);
52
53         return FALSE;
54 }