Xonotic
sv_melee_only.qc File Reference
+ Include dependency graph for sv_melee_only.qc:

Go to the source code of this file.

Functions

 MUTATOR_HOOKFUNCTION (melee_only, SetStartItems, CBC_ORDER_LAST)
 
 MUTATOR_HOOKFUNCTION (melee_only, SetWeaponArena)
 
 MUTATOR_HOOKFUNCTION (melee_only, ForbidRandomStartWeapons)
 
 MUTATOR_HOOKFUNCTION (melee_only, ForbidThrowCurrentWeapon)
 
 MUTATOR_HOOKFUNCTION (melee_only, FilterItemDefinition)
 
 MUTATOR_HOOKFUNCTION (melee_only, BuildMutatorsString)
 
 MUTATOR_HOOKFUNCTION (melee_only, BuildMutatorsPrettyString)
 
 REGISTER_MUTATOR (melee_only, expr_evaluate(autocvar_g_melee_only) &&!MUTATOR_IS_ENABLED(mutator_instagib) &&!MUTATOR_IS_ENABLED(ok) &&!MapInfo_LoadedGametype.m_weaponarena)
 

Variables

string autocvar_g_melee_only
 

Function Documentation

◆ MUTATOR_HOOKFUNCTION() [1/7]

MUTATOR_HOOKFUNCTION ( melee_only  ,
SetStartItems  ,
CBC_ORDER_LAST   
)

Definition at line 8 of file sv_melee_only.qc.

References start_ammo_shells, start_weapons, warmup_start_ammo_shells, warmup_start_weapons, and WEPSET.

9 {
12 }
#define WEPSET(id)
Definition: all.qh:37
float warmup_start_ammo_shells
Definition: world.qh:104
WepSet warmup_start_weapons
Definition: world.qh:100
WepSet start_weapons
Definition: world.qh:81
float start_ammo_shells
Definition: world.qh:85

◆ MUTATOR_HOOKFUNCTION() [2/7]

MUTATOR_HOOKFUNCTION ( melee_only  ,
SetWeaponArena   
)

Definition at line 14 of file sv_melee_only.qc.

References M_ARGV.

15 {
16  // turn weapon arena off
17  M_ARGV(0, string) = "off";
18 }
#define M_ARGV(x, type)
Definition: events.qh:17

◆ MUTATOR_HOOKFUNCTION() [3/7]

MUTATOR_HOOKFUNCTION ( melee_only  ,
ForbidRandomStartWeapons   
)

Definition at line 20 of file sv_melee_only.qc.

21 {
22  return true;
23 }

◆ MUTATOR_HOOKFUNCTION() [4/7]

MUTATOR_HOOKFUNCTION ( melee_only  ,
ForbidThrowCurrentWeapon   
)

Definition at line 25 of file sv_melee_only.qc.

26 {
27  return true;
28 }

◆ MUTATOR_HOOKFUNCTION() [5/7]

MUTATOR_HOOKFUNCTION ( melee_only  ,
FilterItemDefinition   
)

Definition at line 30 of file sv_melee_only.qc.

References entity(), and M_ARGV.

31 {
32  entity definition = M_ARGV(0, entity);
33 
34  switch (definition)
35  {
36  case ITEM_HealthSmall:
37  case ITEM_ArmorSmall:
38  return false;
39  }
40 
41  return true;
42 }
entity() spawn
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [6/7]

MUTATOR_HOOKFUNCTION ( melee_only  ,
BuildMutatorsString   
)

Definition at line 44 of file sv_melee_only.qc.

References M_ARGV, and strcat().

45 {
46  M_ARGV(0, string) = strcat(M_ARGV(0, string), ":MeleeOnly");
47 }
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [7/7]

MUTATOR_HOOKFUNCTION ( melee_only  ,
BuildMutatorsPrettyString   
)

Definition at line 49 of file sv_melee_only.qc.

References M_ARGV, and strcat().

50 {
51  M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Melee Only Arena");
52 }
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( melee_only  ,
expr_evaluate(autocvar_g_melee_only) &&!MUTATOR_IS_ENABLED(mutator_instagib) &&!MUTATOR_IS_ENABLED(ok) &&!MapInfo_LoadedGametype.  m_weaponarena 
)

Variable Documentation

◆ autocvar_g_melee_only

string autocvar_g_melee_only

Definition at line 5 of file sv_melee_only.qc.