ASA, moon01: Don't save checkpoint if player was first detected, and then grabbed the weapons
authorWuzzy <almikes@aol.com>
Sat, 30 Sep 2017 17:23:47 +0200
changeset 12622 bcd679240cd2
parent 12621 88b9f41a5789
child 12623 2d68c113fc8d
ASA, moon01: Don't save checkpoint if player was first detected, and then grabbed the weapons
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua	Sat Sep 30 17:04:41 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua	Sat Sep 30 17:23:47 2017 +0200
@@ -339,16 +339,24 @@
 -------------- ACTIONS ------------------
 
 function weaponsPlatform(gear)
-	saveCheckpoint("2")
-	SaveCampaignVar("HeroHealth",GetHealth(hero.gear))
-	EndTurn(true)
-	weaponsAcquired = true
-	SetWind(60)
-	GameFlags = bor(GameFlags,gfDisableWind)
-	AddAmmo(hero.gear, amRope, 0)
-	if GetX(hero.gear) < 1900 then
-		AddAnim(dialog02)
+	if not battleZoneReached then
+		-- Player entered weapons platform before entering battle zone.
+		-- Checkpoint and dialog!
+		saveCheckpoint("2")
+		SaveCampaignVar("HeroHealth",GetHealth(hero.gear))
+		EndTurn(true)
+		weaponsAcquired = true
+		SetWind(60)
+		GameFlags = bor(GameFlags,gfDisableWind)
+		AddAmmo(hero.gear, amRope, 0)
+		if GetX(hero.gear) < 1900 then
+			AddAnim(dialog02)
+		end
 	end
+	-- The player may screw up by going into the battle zone too early (dialog03).
+	-- In that case, the player is punished for this stupid move (no checkpoint),
+	-- but it is still theoretically possible to win by going for the weapons
+	-- very fast.
 end
 
 function heroDeath(gear)