Add Mutant game scheme, and adapt Mutant for the newly unlocked settings
authorWuzzy <Wuzzy2@mail.ru>
Wed, 21 Nov 2018 22:19:58 +0100
changeset 14274 47af42f7ca8b
parent 14273 23eacb6f1c20
child 14275 efa901b04bad
Add Mutant game scheme, and adapt Mutant for the newly unlocked settings
ChangeLog.txt
QTfrontend/model/gameSchemeModel.cpp
share/hedgewars/Data/Scripts/Multiplayer/Mutant.cfg
share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua
--- a/ChangeLog.txt	Wed Nov 21 23:55:32 2018 +0300
+++ b/ChangeLog.txt	Wed Nov 21 22:19:58 2018 +0100
@@ -108,6 +108,9 @@
 Random Weapon:
  * Fix breakage when enabling per-hog ammo
 
+Mutant:
+ + Unlock game scheme
+
 Continental supplies:
  + Continents are now selected before the game starts
  + Continents give hog different start health
--- a/QTfrontend/model/gameSchemeModel.cpp	Wed Nov 21 23:55:32 2018 +0300
+++ b/QTfrontend/model/gameSchemeModel.cpp	Wed Nov 21 22:19:58 2018 +0100
@@ -87,6 +87,7 @@
                          << "Timeless"
                          << "Thinking with Portals"
                          << "King Mode"
+                         << "Mutant"
                          << "Construction Mode"
                          << "Space Invasion"
                          << "HedgeEditor"
@@ -573,9 +574,57 @@
             << QVariant()              // scriptparam    43
             ;
 
+    QList<QVariant> mutant;
+    mutant
+            << predefSchemesNames[10]  // name           0
+            << QVariant(false)         // switchhog      1
+            << QVariant(false)         // team divide    2
+            << QVariant(false)         // solid land     3
+            << QVariant(false)         // border         4
+            << QVariant(false)         // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(false)         // invulnerable   7
+            << QVariant(false)         // reset health   8
+            << QVariant(false)         // vampiric       9
+            << QVariant(false)         // karma          10
+            << QVariant(false)         // artillery      11
+            << QVariant(true)          // random order   12
+            << QVariant(false)         // king           13
+            << QVariant(false)         // place hog      14
+            << QVariant(false)         // shared ammo    15
+            << QVariant(false)         // disable girders 16
+            << QVariant(false)         // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(false)         // inf. attack    19
+            << QVariant(true)          // reset weps     20
+            << QVariant(false)         // per hog ammo   21
+            << QVariant(false)         // no wind        22
+            << QVariant(false)         // more wind      23
+            << QVariant(false)         // tag team       24
+            << QVariant(false)         // bottom border  25
+            << QVariant(100)           // damage modfier 26
+            << QVariant(20)            // turn time      27
+            << QVariant(100)           // init health    28
+            << QVariant(15)            // sudden death   29
+            << QVariant(2)             // case prob      30
+            << QVariant(1)             // mines time     31
+            << QVariant(4)             // mines number   32
+            << QVariant(0)             // mine dud pct   33
+            << QVariant(2)             // explosives     34
+            << QVariant(0)             // air mines      35
+            << QVariant(0)             // health case pct 36
+            << QVariant(25)            // health case amt 37
+            << QVariant(0)             // water rise amt 38
+            << QVariant(0)             // health dec amt 39
+            << QVariant(100)           // rope modfier   40
+            << QVariant(100)           // get away time  41
+            << QVariant(0)             // world edge     42
+            << QVariant()              // scriptparam    43
+            ;
+
     QList<QVariant> construction;
     construction
-            << predefSchemesNames[10]  // name           0
+            << predefSchemesNames[11]  // name           0
             << QVariant(false)         // switchhog      1
             << QVariant(false)         // team divide    2
             << QVariant(false)         // solid land     3
@@ -624,7 +673,7 @@
 
     QList<QVariant> spaceinvasion;
     spaceinvasion
-            << predefSchemesNames[11]  // name           0
+            << predefSchemesNames[12]  // name           0
             << QVariant(false)         // switchhog      1
             << QVariant(false)         // team divide    2
             << QVariant(false)         // solid land     3
@@ -673,7 +722,7 @@
 
     QList<QVariant> hedgeeditor;
     hedgeeditor
-            << predefSchemesNames[12]  // name           0
+            << predefSchemesNames[13]  // name           0
             << QVariant(false)         // switchhog      1
             << QVariant(false)         // team divide    2
             << QVariant(false)         // solid land     3
@@ -731,6 +780,7 @@
     schemes.append(timeless);
     schemes.append(thinkingportals);
     schemes.append(kingmode);
+    schemes.append(mutant);
     schemes.append(construction);
     schemes.append(spaceinvasion);
     schemes.append(hedgeeditor);
--- a/share/hedgewars/Data/Scripts/Multiplayer/Mutant.cfg	Wed Nov 21 23:55:32 2018 +0300
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Mutant.cfg	Wed Nov 21 22:19:58 2018 +0100
@@ -1,2 +1,2 @@
-*
+Mutant
 locked
--- a/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Wed Nov 21 23:55:32 2018 +0300
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Wed Nov 21 22:19:58 2018 +0100
@@ -12,7 +12,8 @@
 
 
 ----  Recommended settings:
-----    * one hedgehog per team
+----    * one hedgehog per team (forced by game)
+----    * one team per clan
 ----    * 'Small' one-island map
 
 --]]
@@ -23,13 +24,7 @@
 
 --[[
     MUTANT SCRIPT
-
-    To Do:  -Clean-up this fucking piece of code
-            -Debug
-            -Find a girlfriend
-            -Fix Sheepluva's hat  +[p]
-            -Cookies
------------------------]]
+]]
 
 local hhs = {}
 local crates = {}
@@ -104,8 +99,14 @@
 
 function rules()
 
+    local mineStr
+    if MinesTime < 0 then
+        mineStr = loc("Mines time: 0s-5s")
+    else
+        mineStr = string.format(loc("Mines explode after %d s."), div(MinesTime, 1000))
+    end
     local ruleSet = loc("Hedgehogs will be revived after their death.") .. "|" ..
-    string.format(loc("Mines explode after %d s."), div(MinesTime, 1000)) .. "|" ..
+    mineStr .. "|" ..
     loc("The first hedgehog to kill someone becomes the Mutant.") .. "|" ..
     loc("The Mutant has super weapons and a lot of health.") .. "|" ..
     loc("The Mutant loses health quickly, but gains health by killing.") .. "|" ..
@@ -132,14 +133,13 @@
 end
 
 function onGameInit()
-    TurnTime = 20000
+    -- Sudden Death would be weird
     WaterRise = 0
     HealthDecrease = 0
-    EnableGameFlags(gfResetWeps, gfPerHogAmmo)
-    HealthCaseProb=0
-    HealthCaseAmount=0
-    MinesTime=1000
-    CaseFreq = 2
+    -- Weapons must be reset for the Mutant mechanic to work
+    EnableGameFlags(gfResetWeps)
+    -- King Mode messes with game too much
+    DisableGameFlags(gfKing)
 end
 
 
@@ -237,7 +237,7 @@
     trackTeams()
     killsCounter = 0
 
-    if mutant == nil then
+    if mutant == nil and TotalRounds >= 0 then
         AddCaption( loc("First killer will mutate"), capcolDefault, capgrpGameState )
     end