Mutant: Faster excess hog removal
authorWuzzy <Wuzzy2@mail.ru>
Thu, 08 Mar 2018 11:58:27 +0100
changeset 13113 f3f8d017f994
parent 13112 7b3bc9a4dfb9
child 13114 59ebdb80d693
Mutant: Faster excess hog removal
share/hedgewars/Data/Locale/de.lua
share/hedgewars/Data/Locale/stub.lua
share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua
--- a/share/hedgewars/Data/Locale/de.lua	Thu Mar 08 03:00:51 2018 +0100
+++ b/share/hedgewars/Data/Locale/de.lua	Thu Mar 08 11:58:27 2018 +0100
@@ -1555,7 +1555,7 @@
 ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."]="Ein Stamm war friedlich und verbrachte die Zeit mit der Jagd, Übungen und den kleinen Freuden des Lebens.",
 ["Oneye"] = "Einauge", -- portal
 ["Only Hog Solo can be trusted with the crate."] = "Nur Igel Einsam kann man die Kiste anvertrauen.", -- A_Space_Adventure:fruit02
-["Only one hog per team allowed! Excess hogs will be removed"] = "Nur ein Igel pro Team erlaubt! Überschüssige Igel werden entfernt", -- Mutant
+["Only one hog per team allowed! Excess hogs will be removed."] = "Nur ein Igel pro Team erlaubt! Überschüssige Igel werden entfernt.", -- Mutant
 ["Only the best pilots can master the following stunts."] = "Nur die besten Piloten können die folgenden Stunts meistern.", -- Basic_Training_-_Flying_Saucer
 ["On the Desert Planet, Hog Solo found some time to play with his RC plane"] = "Auf dem Wüstenplaneten hat Igel Einsam etwas Zeit gefunden, um mit seinem Funkflugzeug zu spielen.", -- A_Space_Adventure:desert03
 ["On the Ice Planet, where ice rules ..."]="Auf dem Eisplaneten, wo das Eis herrscht …", -- A_Space_Adventure:ice01
--- a/share/hedgewars/Data/Locale/stub.lua	Thu Mar 08 03:00:51 2018 +0100
+++ b/share/hedgewars/Data/Locale/stub.lua	Thu Mar 08 11:58:27 2018 +0100
@@ -1455,7 +1455,7 @@
 --      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Oneye"] = "", -- portal
 --      ["Only Hog Solo can be trusted with the crate."] = "", -- A_Space_Adventure:fruit02
---      ["Only one hog per team allowed! Excess hogs will be removed"] = "", -- Mutant
+--      ["Only one hog per team allowed! Excess hogs will be removed."] = "", -- Mutant
 --      ["Only the best pilots can master the following stunts."] = "", -- Basic_Training_-_Flying_Saucer
 --      ["On the Ice Planet, where ice rules ..."] = "", -- A_Space_Adventure:ice01
 --      ["On the other side of the moon ..."] = "", -- A_Space_Adventure:moon02
--- a/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Thu Mar 08 03:00:51 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Thu Mar 08 11:58:27 2018 +0100
@@ -144,11 +144,12 @@
 
 function limitHogs(gear)
     cnthhs = cnthhs + 1
-        if cnthhs > 1 then
-            hogLimitHit = true
-            SetEffect(gear, heResurrectable, false)
-            SetGearPosition(gear, -100,LAND_HEIGHT)
-        end
+    if cnthhs > 1 then
+        hogLimitHit = true
+        SetEffect(gear, heResurrectable, 0)
+        setGearValue(gear, "excess", true)
+        DeleteGear(gear)
+    end
 end
 
 function onGameStart()
@@ -165,7 +166,7 @@
         runOnHogsInTeam(limitHogs, teams[i])
     end
     if hogLimitHit then
-        AddCaption(loc("Only one hog per team allowed! Excess hogs will be removed"), 0xFFFFFFFF, capgrpGameState)
+        WriteLnToChat(loc("Only one hog per team allowed! Excess hogs will be removed."))
     end
     showStartingInfo()
 end
@@ -363,7 +364,7 @@
 
 function armageddon(gear)
     SetState(gear, gstLoser)
-    SetEffect(gear, heResurrectable, false)
+    SetEffect(gear, heResurrectable, 0)
     SetHealth(gear, 0)
 end
 
@@ -759,7 +760,9 @@
             teams[TeamsCount - 1] = nil
             TeamsCount = TeamsCount - 1
         end
-        AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
+        if getGearValue(gear, "excess") ~= true then
+            AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
+        end
         trackDeletion(gear)
     elseif GetGearType(gear) == gtCase then
         -- Check if a crate has been collected