share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua
changeset 12467 de69155f976b
parent 12088 1da37e2ba6fd
child 12468 d652c6f5d5f1
equal deleted inserted replaced
12466:72c17eabc497 12467:de69155f976b
    92 end
    92 end
    93 
    93 
    94 function onNewTurn()
    94 function onNewTurn()
    95 	if startChallenge and currentPosition < 5 then
    95 	if startChallenge and currentPosition < 5 then
    96 		if CurrentHedgehog ~= hero.gear then
    96 		if CurrentHedgehog ~= hero.gear then
    97 			TurnTimeLeft = 0
    97 			EndTurn(true)
    98 		else
    98 		else
    99 			if GetAmmoCount(hero.gear, amRope) == 0  then
    99 			if GetAmmoCount(hero.gear, amRope) == 0  then
   100 				lose()
   100 				lose()
   101 			end
   101 			end
   102 			SetWeapon(amRope)
   102 			SetWeapon(amRope)
   217 			if record ~= nil then
   217 			if record ~= nil then
   218 				SendStat(siCustomAchievement, loc("This is a new personal best time, congratulations!"))
   218 				SendStat(siCustomAchievement, loc("This is a new personal best time, congratulations!"))
   219 			end
   219 			end
   220 		end
   220 		end
   221 
   221 
   222 		TurnTimeLeft = 0
   222 		EndTurn(true)
   223 	elseif currentPosition < 4 then
   223 	elseif currentPosition < 4 then
   224 		if not startChallenge then
   224 		if not startChallenge then
   225 			startChallenge = true
   225 			startChallenge = true
   226 		end
   226 		end
   227 		AddAmmo(hero.gear, amRope, 1)
   227 		AddAmmo(hero.gear, amRope, 1)
   234 			previousTimeLeft = TurnTimeLeft
   234 			previousTimeLeft = TurnTimeLeft
   235 		end
   235 		end
   236 		currentPosition = currentPosition + 1
   236 		currentPosition = currentPosition + 1
   237 		AddVisualGear(GetX(runner.gear), GetY(runner.gear), vgtExplosion, 0, false) 
   237 		AddVisualGear(GetX(runner.gear), GetY(runner.gear), vgtExplosion, 0, false) 
   238 		SetGearPosition(runner.gear, runner.places[currentPosition].x, runner.places[currentPosition].y)
   238 		SetGearPosition(runner.gear, runner.places[currentPosition].x, runner.places[currentPosition].y)
   239 		TurnTimeLeft = 0
   239 		EndTurn(true)
   240 	end
   240 	end
   241 end
   241 end
   242 
   242 
   243 function lose()
   243 function lose()
   244 	SendStat(siGameResult, loc("Too slow! Try again ..."))
   244 	SendStat(siGameResult, loc("Too slow! Try again ..."))