]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mutators/mutator/hook/hook.qc
Include new models by morphed (shotgun model has midair shell)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / hook / hook.qc
1 #ifdef IMPLEMENTATION
2 AUTOCVAR(g_grappling_hook, bool, false, _("let players spawn with the grappling hook which allows them to pull themselves up"));
3 #ifdef SVQC
4 REGISTER_MUTATOR(hook, autocvar_g_grappling_hook) {
5     MUTATOR_ONADD {
6         g_grappling_hook = true;
7         WEP_HOOK.ammo_factor = 0;
8     }
9     MUTATOR_ONROLLBACK_OR_REMOVE {
10         g_grappling_hook = false;
11         WEP_HOOK.ammo_factor = 1;
12     }
13
14     return false;
15 }
16
17 MUTATOR_HOOKFUNCTION(hook, BuildMutatorsString)
18 {
19     M_ARGV(0, string) = strcat(M_ARGV(0, string), ":grappling_hook");
20 }
21
22 MUTATOR_HOOKFUNCTION(hook, BuildMutatorsPrettyString)
23 {
24     M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Hook");
25 }
26
27 MUTATOR_HOOKFUNCTION(hook, BuildGameplayTipsString)
28 {
29     M_ARGV(0, string) = strcat(M_ARGV(0, string), "\n\n^3grappling hook^8 is enabled, press 'e' to use it\n");
30 }
31
32 MUTATOR_HOOKFUNCTION(hook, PlayerSpawn)
33 {
34     entity player = M_ARGV(0, entity);
35
36     player.offhand = OFFHAND_HOOK;
37 }
38
39 MUTATOR_HOOKFUNCTION(hook, FilterItem)
40 {
41     entity item = M_ARGV(0, entity);
42
43     return item.weapon == WEP_HOOK.m_id;
44 }
45
46 #endif
47 #endif