ACF mission 6: Fix incorrect crate types (weapon vs utility)
authorWuzzy <almikes@aol.com>
Mon, 25 Sep 2017 16:35:07 +0200
changeset 12511 15e9ef8be44f
parent 12510 cc146b018d14
child 12512 b1c2b0a8a43e
ACF mission 6: Fix incorrect crate types (weapon vs utility)
ChangeLog.txt
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua
--- a/ChangeLog.txt	Mon Sep 25 16:07:31 2017 +0200
+++ b/ChangeLog.txt	Mon Sep 25 16:35:07 2017 +0200
@@ -185,10 +185,12 @@
  * Mission 3: Fix broken end sequence after killing cyborg or princess
  * Mission 5: Fix crash when skipping animation while the cyborg talks before the 3rd wave of cannibals starts
  * Mission 6: Block off left cave entrance to stop player to just rope all the way around
- * Mission 6: Remove some misleading mission panel texts
+ * Mission 6: Fix mines not being able to get triggered in first turn
+ * Mission 6: Rewrite misleading mission texts
  * Mission 8: Fix Lua error message at the beginning
  * Mission 10: Fix mission becoming unplayable when all hogs except the traitor died
  * All missions: Add missing texts for translation
+ * All missions: Fix incorrect crate types
  * Fix swapped mission preview images of missions 2 and 3
 
 A Space Adventure:
@@ -201,6 +203,7 @@
  * Fix weird behaviour when walking right before the first animation in most missions
  * Fix a coupe of texts being untranslatable
  * Fix typos
+ * All missions: Fix incorrect crate types
 
 Missions:
  + New scenario: Teamwork 2
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua	Mon Sep 25 16:07:31 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua	Mon Sep 25 16:35:07 2017 +0200
@@ -138,16 +138,16 @@
 cyborgsDir = {"Left", "Left", "Left", "Right"}
 
 cratePos = {
-            {788, 1919, amGirder, 2}, {412, 1615, amGirder, 1},
-            {209, 1474, amSniperRifle, 1}, {1178, 637, amDEagle, 1},
-            {633, 268, amDEagle, 1}, {3016, 1545, amDEagle, 1},
-            {249, 1377, amRope, 3}, {330, 1018, amGirder, 1},
-            {888, 647, amRope, 3}, {2116, 337, amRope, 3},
-            {1779, 948, amRope, 3}, {3090, 1066, amRope, 3},
-            {947, 480, amBazooka, 3}, {1097, 480, amMortar, 3},
-            {1139, 451, amSnowball, 3}, {1207, 468, amShotgun, 3},
-            {1024, 393, amSniperRifle, 2}, {998, 391, amDynamite, 2},
-            {1024, 343, amRope, 2}, {998, 341, amRope, 2}
+            {{788, 1919, amGirder, 2}, true}, {{412, 1615, amGirder, 1}, true},
+            {{209, 1474, amSniperRifle, 1}}, {{1178, 637, amDEagle, 1}},
+            {{633, 268, amDEagle, 1}}, {{3016, 1545, amDEagle, 1}},
+            {{249, 1377, amRope, 3}, true}, {{330, 1018, amGirder, 1}, true},
+            {{888, 647, amRope, 3}, true}, {{2116, 337, amRope, 3}, true},
+            {{1779, 948, amRope, 3}, true}, {{3090, 1066, amRope, 3}, true},
+            {{947, 480, amBazooka, 3}}, {{1097, 480, amMortar, 3}},
+            {{1139, 451, amSnowball, 3}}, {{1207, 468, amShotgun, 3}},
+            {{1024, 393, amSniperRifle, 2}}, {{998, 391, amDynamite, 2}},
+            {{1024, 343, amRope, 2}, true}, {{998, 341, amRope, 2}, true},
            }
 reactions = {loc("Yeah, take that!"), loc("Bullseye"), loc("Die, die, die!")}
 
@@ -308,11 +308,20 @@
   AddFunction({func = HideHedge, args = {cyborg}})
 end
 
+function SpawnCrateByID(id)
+    if cratePos[id][2] == true then
+       crates[id] = SpawnUtilityCrate(unpack(cratePos[id][1]))
+    else
+       crates[id] = SpawnAmmoCrate(unpack(cratePos[id][1]))
+    end
+    return crates[id]
+end
+
 function AfterStartAnim()
   SetGearMessage(native, 0)
   cratesNum = 0
   for i = 1, 6 do
-    crates[i] = SpawnAmmoCrate(unpack(cratePos[i]))
+    SpawnCrateByID(i)
     cratesNum = cratesNum + 1
   end
   FollowGear(native)
@@ -392,7 +401,7 @@
 function PutWeaponCrates()
   for i = 1, 8 do
     cratesNum = cratesNum + 1
-    crates[cratesNum] = SpawnAmmoCrate(unpack(cratePos[cratesNum]))
+    SpawnCrateByID(cratesNum)
   end
   FollowGear(native)
 end
@@ -408,7 +417,7 @@
 function PutCrates(index)
   if index <= 7 then
     cratesNum = cratesNum + 1
-    crates[cratesNum] = SpawnUtilityCrate(unpack(cratePos[cratesNum]))
+    SpawnCrateByID(cratesNum)
     AddNewEvent(CheckGearDead, {crates[cratesNum]}, PutCrates, {index + 1}, 0)
     FollowGear(native)
   else