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