Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_hook.qc File Reference
#include "sv_hook.qh"
Include dependency graph for sv_hook.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 AUTOCVAR (g_grappling_hook_useammo, bool, false, "use ammunition with the offhand Grappling Hook")
 MUTATOR_HOOKFUNCTION (hook, BuildMutatorsPrettyString)
 MUTATOR_HOOKFUNCTION (hook, BuildMutatorsString)
 MUTATOR_HOOKFUNCTION (hook, FilterItem)
 MUTATOR_HOOKFUNCTION (hook, PlayerSpawn)
 MUTATOR_HOOKFUNCTION (hook, SetStartItems)
 REGISTER_MUTATOR (hook, expr_evaluate(cvar_string("g_grappling_hook")))

Function Documentation

◆ AUTOCVAR()

AUTOCVAR ( g_grappling_hook_useammo ,
bool ,
false ,
"use ammunition with the offhand Grappling Hook"  )

◆ MUTATOR_HOOKFUNCTION() [1/5]

MUTATOR_HOOKFUNCTION ( hook ,
BuildMutatorsPrettyString  )

Definition at line 28 of file sv_hook.qc.

29{
30 M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Hook");
31}
#define M_ARGV(x, type)
Definition events.qh:17
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

References hook, M_ARGV, and strcat().

◆ MUTATOR_HOOKFUNCTION() [2/5]

MUTATOR_HOOKFUNCTION ( hook ,
BuildMutatorsString  )

Definition at line 23 of file sv_hook.qc.

24{
25 M_ARGV(0, string) = strcat(M_ARGV(0, string), ":grappling_hook");
26}

References hook, M_ARGV, and strcat().

◆ MUTATOR_HOOKFUNCTION() [3/5]

MUTATOR_HOOKFUNCTION ( hook ,
FilterItem  )

Definition at line 50 of file sv_hook.qc.

51{
52 entity item = M_ARGV(0, entity);
53
54 return item.weapon == WEP_HOOK.m_id;
55}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback

References entity(), hook, and M_ARGV.

◆ MUTATOR_HOOKFUNCTION() [4/5]

MUTATOR_HOOKFUNCTION ( hook ,
PlayerSpawn  )

Definition at line 43 of file sv_hook.qc.

44{
45 entity player = M_ARGV(0, entity);
46
47 player.offhand = OFFHAND_HOOK;
48}
OffhandHook OFFHAND_HOOK
Definition hook.qh:80

References entity(), hook, M_ARGV, and OFFHAND_HOOK.

◆ MUTATOR_HOOKFUNCTION() [5/5]

MUTATOR_HOOKFUNCTION ( hook ,
SetStartItems  )

Definition at line 33 of file sv_hook.qc.

34{
35 if(autocvar_g_grappling_hook_useammo)
36 {
37 start_items |= ITEM_FuelRegen.m_itemid;
38 start_ammo_fuel = max(start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
39 warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
40 }
41}
float cvar(string name)
float max(float f,...)
float start_ammo_fuel
Definition world.qh:88
int start_items
Definition world.qh:83
float warmup_start_ammo_fuel
Definition world.qh:106

References cvar(), hook, max(), start_ammo_fuel, start_items, and warmup_start_ammo_fuel.

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( hook ,
expr_evaluate(cvar_string("g_grappling_hook"))  )

Definition at line 8 of file sv_hook.qc.

8 {
10 g_grappling_hook = true;
11 if(!autocvar_g_grappling_hook_useammo)
12 WEP_HOOK.ammo_factor = 0;
13 }
15 g_grappling_hook = false;
16 if(!autocvar_g_grappling_hook_useammo)
17 WEP_HOOK.ammo_factor = 1; // we don't need to change it
18 }
19
20 return false;
21}
#define MUTATOR_ONADD
Definition base.qh:309
#define MUTATOR_ONROLLBACK_OR_REMOVE
Definition base.qh:311
float g_grappling_hook
Definition world.qh:113

References g_grappling_hook, hook, MUTATOR_ONADD, and MUTATOR_ONROLLBACK_OR_REMOVE.