]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/mutator_melee_only.qc
Merge branch 'master' into divVerent/4team_ctf
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_melee_only.qc
1 MUTATOR_HOOKFUNCTION(melee_SetStartItems)
2 {
3         start_ammo_shells = 0;
4         warmup_start_ammo_shells = 0;
5
6         start_weapons = WEPSET_SHOTGUN;
7         warmup_start_weapons = WEPSET_SHOTGUN;
8
9         return FALSE;
10 }
11
12 MUTATOR_HOOKFUNCTION(melee_FilterItem)
13 {
14         switch (self.items)
15         {
16                 case IT_5HP:
17                 case IT_ARMOR_SHARD:
18                         return FALSE;
19         }
20
21         return TRUE;
22 }
23
24 MUTATOR_HOOKFUNCTION(melee_BuildMutatorsString)
25 {
26         ret_string = strcat(ret_string, ":MeleeOnly");
27         return FALSE;
28 }
29
30 MUTATOR_HOOKFUNCTION(melee_BuildMutatorsPrettyString)
31 {
32         ret_string = strcat(ret_string, ", Melee Only Arena");
33         return FALSE;
34 }
35
36 MUTATOR_DEFINITION(mutator_melee_only)
37 {
38         MUTATOR_HOOK(SetStartItems, melee_SetStartItems, CBC_ORDER_ANY);
39         MUTATOR_HOOK(FilterItem, melee_FilterItem, CBC_ORDER_ANY);
40         MUTATOR_HOOK(BuildMutatorsString, melee_BuildMutatorsString, CBC_ORDER_ANY);
41         MUTATOR_HOOK(BuildMutatorsPrettyString, melee_BuildMutatorsPrettyString, CBC_ORDER_ANY);
42
43         return FALSE;
44 }