]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mutators/mutator/instagib/sv_instagib.qh
Merge branch 'master' into terencehill/less_entities
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / instagib / sv_instagib.qh
1 #pragma once
2
3 #include "items.qh"
4 #include <common/gamemodes/_mod.qh>
5
6 // TODO: make this its own mutator (somehow)!
7 float autocvar_g_rm;
8 float autocvar_g_rm_damage;
9 float autocvar_g_rm_edgedamage;
10 float autocvar_g_rm_force;
11 float autocvar_g_rm_radius;
12 float autocvar_g_rm_laser;
13 float autocvar_g_rm_laser_count;
14 float autocvar_g_rm_laser_speed;
15 float autocvar_g_rm_laser_spread;
16 float autocvar_g_rm_laser_spread_random;
17 float autocvar_g_rm_laser_lifetime;
18 float autocvar_g_rm_laser_damage;
19 float autocvar_g_rm_laser_refire;
20 float autocvar_g_rm_laser_rapid;
21 float autocvar_g_rm_laser_rapid_refire;
22 float autocvar_g_rm_laser_rapid_delay;
23 float autocvar_g_rm_laser_radius;
24 float autocvar_g_rm_laser_force;
25
26 bool autocvar_g_instagib;
27 float autocvar_g_instagib_invis_alpha;
28 int autocvar_g_instagib_extralives;
29
30 void instagib_invisibility(entity this);
31 void instagib_extralife(entity this);
32 void instagib_speed(entity this);
33 IntrusiveList g_instagib_items;
34
35 REGISTER_MUTATOR(mutator_instagib, autocvar_g_instagib && !MapInfo_LoadedGametype.m_weaponarena)
36 {
37         MUTATOR_ONADD
38         {
39                 g_instagib_items = IL_NEW();
40                 IL_PUSH(g_instagib_items, ITEM_VaporizerCells);
41                 IL_PUSH(g_instagib_items, ITEM_ExtraLife);
42                 IL_PUSH(g_instagib_items, ITEM_Invisibility);
43                 IL_PUSH(g_instagib_items, ITEM_Speed);
44
45                 ITEM_VaporizerCells.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
46                 ITEM_Invisibility.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
47                 ITEM_Speed.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
48         }
49         MUTATOR_ONROLLBACK_OR_REMOVE
50         {
51                 ITEM_VaporizerCells.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
52                 ITEM_Invisibility.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
53                 ITEM_Speed.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
54         }
55 }