]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / vampirehook / sv_vampirehook.qc
index ce9e270654cb498281e01db990aa652e0ae8f8c1..0bfc8dfc94c156bae3c71a8ea29e51cb2f6a4089 100644 (file)
@@ -16,23 +16,30 @@ MUTATOR_HOOKFUNCTION(vh, GrappleHookThink)
 
        entity dmgent = ((SAME_TEAM(thehook.owner, thehook.aiment) && autocvar_g_vampirehook_teamheal) ? thehook.owner : thehook.aiment);
 
-       if(IS_PLAYER(thehook.aiment))
-       if(thehook.last_dmg < time)
-       if(!STAT(FROZEN, thehook.aiment))
-       if(time >= game_starttime)
-       if(DIFF_TEAM(thehook.owner, thehook.aiment) || autocvar_g_vampirehook_teamheal)
-       if(thehook.aiment.health > 0)
-       if(autocvar_g_vampirehook_damage)
-       {
-               thehook.last_dmg = time + autocvar_g_vampirehook_damagerate;
-               thehook.owner.damage_dealt += autocvar_g_vampirehook_damage;
-               Damage(dmgent, thehook, thehook.owner, autocvar_g_vampirehook_damage, WEP_HOOK.m_id, thehook.origin, '0 0 0');
-               if(SAME_TEAM(thehook.owner, thehook.aiment))
-                       thehook.aiment.health = min(thehook.aiment.health + autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max);
-               else
-                       thehook.owner.health = min(thehook.owner.health + autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max);
+       if (IS_PLAYER(thehook.aiment)) {
+               if (thehook.last_dmg < time) {
+                       if (!STAT(FROZEN, thehook.aiment)) {
+                               if (time >= game_starttime) {
+                                       if (DIFF_TEAM(thehook.owner, thehook.aiment) || autocvar_g_vampirehook_teamheal) {
+                                               if (thehook.aiment.health > 0) {
+                                                       if (autocvar_g_vampirehook_damage) {
+                                                               thehook.last_dmg = time + autocvar_g_vampirehook_damagerate;
+                                                               thehook.owner.damage_dealt += autocvar_g_vampirehook_damage;
+                                                               Damage(dmgent, thehook, thehook.owner, autocvar_g_vampirehook_damage, WEP_HOOK.m_id, thehook.origin, '0 0 0');
+                                                               if (SAME_TEAM(thehook.owner, thehook.aiment)) {
+                                                                       thehook.aiment.health = min(thehook.aiment.health + autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max);
+                                                               } else {
+                                                                       thehook.owner.health = min(thehook.owner.health + autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max);
+                                                               }
 
-               if(dmgent == thehook.owner)
-                       dmgent.health -= autocvar_g_vampirehook_damage; // FIXME: friendly fire?!
+                                                               if (dmgent == thehook.owner) {
+                                                                       dmgent.health -= autocvar_g_vampirehook_damage; // FIXME: friendly fire?!
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
        }
 }