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