share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
changeset 12338 6bdabf67a012
parent 12292 faf1b93422ba
child 12393 0eb1457f7b94
equal deleted inserted replaced
12337:657a8d63c99d 12338:6bdabf67a012
   458                                         string.format(loc("Rounds complete: %d/%d"), roundNumber, roundLimit) .. "|" .. " " .. "|" ..
   458                                         string.format(loc("Rounds complete: %d/%d"), roundNumber, roundLimit) .. "|" .. " " .. "|" ..
   459                                         loc("Best team times: ") .. "|" .. totalComment, 0, 4000)
   459                                         loc("Best team times: ") .. "|" .. totalComment, 0, 4000)
   460 
   460 
   461         -- end game if its at round limit
   461         -- end game if its at round limit
   462         if roundNumber >= roundLimit then
   462         if roundNumber >= roundLimit then
   463                 gameOver = true
       
   464                 TurnTimeLeft = 10000000
       
   465 
       
   466                 -- Sort the scores for the ranking list
   463                 -- Sort the scores for the ranking list
   467                 local unfinishedArray = {}
   464                 local unfinishedArray = {}
   468                 local sortedTeams = {}
   465                 local sortedTeams = {}
   469                 local k = 1
   466                 local k = 1
   470                 for i = 0, TeamsCount-1 do
   467                 for i = 0, TeamsCount-1 do
   496                         SendStat(siGameResult, loc("Round draw"))
   493                         SendStat(siGameResult, loc("Round draw"))
   497                         SendStat(siCustomAchievement, loc("Nobody managed to finish the race. What a shame!"))
   494                         SendStat(siCustomAchievement, loc("Nobody managed to finish the race. What a shame!"))
   498                         SendStat(siCustomAchievement, loc("Maybe you should try an easier TechRacer map."))
   495                         SendStat(siCustomAchievement, loc("Maybe you should try an easier TechRacer map."))
   499                 end
   496                 end
   500 
   497 
   501                 -- Game over
   498 		-- Kill all the losers
   502                 EndGame()
   499 		for i = 0, (numhhs-1) do
       
   500 			if GetHogClan(hhs[i]) ~= bestClan then
       
   501 				SetEffect(hhs[i], heResurrectable, 0)
       
   502 				SetHealth(hhs[i],0)
       
   503 			end
       
   504 		end
       
   505 
       
   506 		gameOver = true
       
   507 		EndTurn(true)
   503         end
   508         end
   504 
   509 
   505 end
   510 end
   506 
   511 
   507 function CheckForNewRound()
   512 function CheckForNewRound()
   954 	end
   959 	end
   955 
   960 
   956 end
   961 end
   957 
   962 
   958 function onGameStart()
   963 function onGameStart()
       
   964 	SendGameResultOff()
       
   965 	SendRankingStatsOff()
       
   966 	SendAchievementsStatsOff()
   959 	SendHealthStatsOff()
   967 	SendHealthStatsOff()
   960 
   968 
   961 		trackTeams()
   969 		trackTeams()
   962 
   970 
   963 		roundN = 0
   971 		roundN = 0