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

Go to the source code of this file.

Functions

 MUTATOR_HOOKFUNCTION (rm, Damage_Calculate)
 
 MUTATOR_HOOKFUNCTION (rm, PlayerDies)
 
 REGISTER_MUTATOR (rm, autocvar_g_instagib)
 

Function Documentation

◆ MUTATOR_HOOKFUNCTION() [1/2]

MUTATOR_HOOKFUNCTION ( rm  ,
Damage_Calculate   
)

Definition at line 8 of file sv_rocketminsta.qc.

References autocvar_g_rm, autocvar_g_rm_laser, DEATH_ISWEAPON, entity(), M_ARGV, round_handler_IsActive, and round_handler_IsRoundStarted.

9 {
10  // we do it this way, so rm can be toggled during the match
11  if(!autocvar_g_rm) { return; }
12 
13  entity frag_attacker = M_ARGV(1, entity);
14  entity frag_target = M_ARGV(2, entity);
15  float frag_deathtype = M_ARGV(3, float);
16  float frag_damage = M_ARGV(4, float);
17 
18  if(DEATH_ISWEAPON(frag_deathtype, WEP_DEVASTATOR))
19  if(frag_attacker == frag_target || frag_target.classname == "nade")
20  frag_damage = 0;
21 
23  if(DEATH_ISWEAPON(frag_deathtype, WEP_ELECTRO))
24  if(frag_attacker == frag_target || (round_handler_IsActive() && !round_handler_IsRoundStarted()))
25  frag_damage = 0;
26 
27  M_ARGV(4, float) = frag_damage;
28 }
#define round_handler_IsActive()
entity() spawn
#define round_handler_IsRoundStarted()
float autocvar_g_rm
Definition: sv_instagib.qh:8
#define M_ARGV(x, type)
Definition: events.qh:17
#define DEATH_ISWEAPON(t, w)
Definition: all.qh:42
float autocvar_g_rm_laser
Definition: sv_instagib.qh:13
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [2/2]

MUTATOR_HOOKFUNCTION ( rm  ,
PlayerDies   
)

Definition at line 30 of file sv_rocketminsta.qc.

References autocvar_g_rm, DEATH_ISWEAPON, and M_ARGV.

31 {
32  // we do it this way, so rm can be toggled during the match
33  if(!autocvar_g_rm) { return; }
34 
35  float frag_deathtype = M_ARGV(3, float);
36 
37  if(DEATH_ISWEAPON(frag_deathtype, WEP_DEVASTATOR) || DEATH_ISWEAPON(frag_deathtype, WEP_ELECTRO))
38  M_ARGV(4, float) = 1000; // always gib if it was a vaporizer death
39 }
float autocvar_g_rm
Definition: sv_instagib.qh:8
#define M_ARGV(x, type)
Definition: events.qh:17
#define DEATH_ISWEAPON(t, w)
Definition: all.qh:42

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( rm  ,
autocvar_g_instagib   
)