]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/mutator_rocketminsta.qc
Merge branch 'master' into TimePath/deathtypes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_rocketminsta.qc
1 #include "../../common/deathtypes/all.qh"
2 #include "../round_handler.qh"
3
4 REGISTER_MUTATOR(rm, cvar("g_instagib"));
5
6 MUTATOR_HOOKFUNCTION(rm, PlayerDamage_Calculate)
7 {
8         // we do it this way, so rm can be toggled during the match
9         if(!autocvar_g_rm) { return false; }
10
11         if(DEATH_ISWEAPON(frag_deathtype, WEP_DEVASTATOR))
12         if(frag_attacker == frag_target || frag_target.classname == "nade")
13                 frag_damage = 0;
14
15         if(autocvar_g_rm_laser)
16         if(DEATH_ISWEAPON(frag_deathtype, WEP_ELECTRO))
17         if(frag_attacker == frag_target || (round_handler_IsActive() && !round_handler_IsRoundStarted()))
18                 frag_damage = 0;
19
20         return false;
21 }
22
23 MUTATOR_HOOKFUNCTION(rm, PlayerDies)
24 {
25         // we do it this way, so rm can be toggled during the match
26         if(!autocvar_g_rm) { return false; }
27
28         if(DEATH_ISWEAPON(frag_deathtype, WEP_DEVASTATOR) || DEATH_ISWEAPON(frag_deathtype, WEP_ELECTRO))
29                 frag_damage = 1000; // always gib if it was a vaporizer death
30
31         return false;
32 }
33