Allow playing Racer without invulnerability
authorS-D-
Fri, 30 Aug 2019 14:15:34 +0300
changeset 15390 c35c5a9b878c
parent 15389 1c6d5656157c
child 15391 2805681aca54
Allow playing Racer without invulnerability
QTfrontend/model/gameSchemeModel.cpp
share/hedgewars/Data/Scripts/Multiplayer/Racer.cfg
share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
--- a/QTfrontend/model/gameSchemeModel.cpp	Thu Aug 29 21:25:23 2019 +0300
+++ b/QTfrontend/model/gameSchemeModel.cpp	Fri Aug 30 14:15:34 2019 +0300
@@ -92,6 +92,7 @@
                          << "The Specialists"
                          << "Space Invasion"
                          << "HedgeEditor"
+                         << "Racer"
                          ;
 
     numberOfDefaultSchemes = predefSchemesNames.size();
@@ -818,6 +819,53 @@
             << QVariant()              // scriptparam    43
             ;
 
+    QList<QVariant> racer;
+    racer
+            << predefSchemesNames[15]   // name           0
+            << QVariant(false)         // switchhog      1
+            << QVariant(false)         // team divide    2
+            << QVariant(true)          // solid land     3
+            << QVariant(true)          // border         4
+            << QVariant(false)         // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(true)          // 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(true)          // shared ammo    15
+            << QVariant(true)          // disable girders 16
+            << QVariant(true)          // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(true)          // 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(30)            // turn time      27
+            << QVariant(100)           // init health    28
+            << QVariant(50)            // sudden death   29
+            << QVariant(1)             // case prob      30
+            << QVariant(0)             // mines time     31
+            << QVariant(0)             // mines number   32
+            << QVariant(0)             // mine dud pct   33
+            << QVariant(0)             // 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
+            ;
 
 
     schemes.append(defaultScheme);
@@ -835,6 +883,7 @@
     schemes.append(specialists);
     schemes.append(spaceinvasion);
     schemes.append(hedgeeditor);
+    schemes.append(racer);
 
     if (!QDir(cfgdir->absolutePath() + "/Schemes").exists()) {
         QDir().mkdir(cfgdir->absolutePath() + "/Schemes");
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.cfg	Thu Aug 29 21:25:23 2019 +0300
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.cfg	Fri Aug 30 14:15:34 2019 +0300
@@ -1,2 +1,2 @@
+Racer
 Shoppa
-Shoppa
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Thu Aug 29 21:25:23 2019 +0300
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Fri Aug 30 14:15:34 2019 +0300
@@ -680,7 +680,7 @@
 ----------------------------------
 
 function onGameInit()
-        EnableGameFlags(gfInfAttack, gfInvulnerable)
+        EnableGameFlags(gfInfAttack)
         CaseFreq = 0
         TurnTime = 90000
         WaterRise = 0
@@ -956,7 +956,10 @@
                                 trackTime = 0
 
                                 SetGearPosition(CurrentHedgehog, wpX[0], wpY[0])
-                                AddGear(GetX(CurrentHedgehog)+boostX, GetY(CurrentHedgehog)+boostY, gtGrenade, 0, 0, 0, 1)
+                                Explode(GetX(CurrentHedgehog)+boostX,
+                                        GetY(CurrentHedgehog)+boostY,
+                                        50,
+                                        EXPLNoDamage + EXPLAutoSound)
                                 FollowGear(CurrentHedgehog)
 
                                 HideMission()