Xonotic
sv_invincibleproj.qc
Go to the documentation of this file.
1 #include "sv_invincibleproj.qh"
2 
5 
6 MUTATOR_HOOKFUNCTION(invincibleprojectiles, EditProjectile)
7 {
8  entity proj = M_ARGV(1, entity);
9 
10  if(GetResource(proj, RES_HEALTH))
11  {
12  // disable health which in effect disables damage calculations
14  }
15 }
16 
17 MUTATOR_HOOKFUNCTION(invincibleprojectiles, BuildMutatorsString)
18 {
19  M_ARGV(0, string) = strcat(M_ARGV(0, string), ":InvincibleProjectiles");
20 }
21 
22 MUTATOR_HOOKFUNCTION(invincibleprojectiles, BuildMutatorsPrettyString)
23 {
24  M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Invincible Projectiles");
25 }
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
Definition: cl_resources.qc:15
entity() spawn
REGISTER_MUTATOR(invincibleprojectiles, expr_evaluate(autocvar_g_invincible_projectiles))
RES_HEALTH
Definition: ent_cs.qc:126
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"))
MUTATOR_HOOKFUNCTION(invincibleprojectiles, EditProjectile)
string autocvar_g_invincible_projectiles
#define M_ARGV(x, type)
Definition: events.qh:17
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
Definition: cl_resources.qc:10
ERASEABLE bool expr_evaluate(string s)
Evaluate an expression of the form: [+ | -]? [var[op]val | [op]var | val | var] ...
Definition: cvar.qh:48