share/hedgewars/Data/Scripts/SimpleMission.lua
changeset 14231 74bf2d906097
parent 13643 690cc84e9fd6
child 14464 ead8928a59f8
equal deleted inserted replaced
14230:8edbdd3a1fe7 14231:74bf2d906097
   340 			local g2 = (not goal.xMax) or gX <= goal.xMax
   340 			local g2 = (not goal.xMax) or gX <= goal.xMax
   341 			local g3 = (not goal.yMin) or gY >= goal.yMin
   341 			local g3 = (not goal.yMin) or gY >= goal.yMin
   342 			local g4 = (not goal.yMax) or gY <= goal.yMax
   342 			local g4 = (not goal.yMax) or gY <= goal.yMax
   343 			return g1 and g2 and g3 and g4
   343 			return g1 and g2 and g3 and g4
   344 		elseif goal.type == "distGearPos" or goal.type == "distGearGear" then
   344 		elseif goal.type == "distGearPos" or goal.type == "distGearGear" then
   345 			local gX, tY, tX, tY
   345 			local gX, gY, tX, tY
   346 			if goal.type == "distGearPos" then
   346 			if goal.type == "distGearPos" then
   347 				if getGearValue(_G.sm.goalGears[goal.id], "sm_destroyed") then
   347 				if getGearValue(_G.sm.goalGears[goal.id], "sm_destroyed") then
   348 					-- Fail if gear was destroyed
   348 					-- Fail if gear was destroyed
   349 					return "fail", criticalGearFailText(goal.id)
   349 					return "fail", criticalGearFailText(goal.id)
   350 				end
   350 				end
   561 			EndGame()
   561 			EndGame()
   562 		end
   562 		end
   563 	end
   563 	end
   564 
   564 
   565 	_G.onSuddenDeath = function()
   565 	_G.onSuddenDeath = function()
   566 		sm.isInSuddenDeath = true
   566 		_G.sm.isInSuddenDeath = true
   567 	end
   567 	end
   568 
   568 
   569 	_G.onGearWaterSkip = function(gear)
   569 	_G.onGearWaterSkip = function(gear)
   570 		increaseGearValue(gear, "sm_waterSkips")
   570 		increaseGearValue(gear, "sm_waterSkips")
   571 	end
   571 	end