]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/mutator_rocketminsta.qc
Allow turning off damage from lava and slime in instagib, as it used to be
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_rocketminsta.qc
1 REGISTER_MUTATOR(rm, cvar("g_instagib"));
2
3 MUTATOR_HOOKFUNCTION(rm, PlayerDamage_Calculate)
4 {
5         // we do it this way, so rm can be toggled during the match
6         if(!autocvar_g_rm) { return false; }
7
8         if(DEATH_ISWEAPON(frag_deathtype, WEP_DEVASTATOR.m_id))
9         if(frag_attacker == frag_target || frag_target.classname == "nade")
10                 frag_damage = 0;
11
12         if(autocvar_g_rm_laser)
13         if(DEATH_ISWEAPON(frag_deathtype, WEP_ELECTRO.m_id))
14         if(frag_attacker == frag_target || (round_handler_IsActive() && !round_handler_IsRoundStarted()))
15                 frag_damage = 0;
16
17         return false;
18 }
19
20 MUTATOR_HOOKFUNCTION(rm, PlayerDies)
21 {
22         // we do it this way, so rm can be toggled during the match
23         if(!autocvar_g_rm) { return false; }
24
25         if(DEATH_ISWEAPON(frag_deathtype, WEP_DEVASTATOR.m_id) || DEATH_ISWEAPON(frag_deathtype, WEP_ELECTRO.m_id))
26                 frag_damage = 1000; // always gib if it was a vaporizer death
27
28         return false;
29 }
30