share/hedgewars/Data/Scripts/SpeedShoppa.lua
changeset 14578 50f511588635
parent 14480 208359558642
child 14760 75bd27700837
equal deleted inserted replaced
14577:221380cdee7e 14578:50f511588635
   161 				SetEffect(playerHog, heInvulnerable, 1)
   161 				SetEffect(playerHog, heInvulnerable, 1)
   162 				SetState(playerHog, bor(GetState(playerHog), gstWinner))
   162 				SetState(playerHog, bor(GetState(playerHog), gstWinner))
   163 				SetState(playerHog, band(GetState(playerHog), bnot(gstHHDriven)))
   163 				SetState(playerHog, band(GetState(playerHog), bnot(gstHHDriven)))
   164 				AddCaption(loc("Challenge completed!"))
   164 				AddCaption(loc("Challenge completed!"))
   165 				SendStat(siGameResult, loc("Challenge completed!"))
   165 				SendStat(siGameResult, loc("Challenge completed!"))
   166 				SendStat(siPointType, loc("milliseconds"))
   166 				SendStat(siPointType, "!TIME")
   167 				local time = startTime - endTime
   167 				local time = startTime - endTime
   168 				SendStat(siPlayerKills, tostring(time), GetHogTeamName(playerHog))
   168 				SendStat(siPlayerKills, tostring(time), GetHogTeamName(playerHog))
   169 				SendStat(siCustomAchievement, string.format(loc("You have finished the challenge in %.3f s."), (time/1000)))
   169 				SendStat(siCustomAchievement, string.format(loc("You have finished the challenge in %.3f s."), (time/1000)))
   170 				SetTurnTimeLeft(0)
   170 				SetTurnTimeLeft(0)
   171 				updateChallengeRecord("TimeRecord", time)
   171 				updateChallengeRecord("TimeRecord", time)
   172 			else
   172 			else
   173 				SendStat(siGameResult, loc("Challenge failed!"))
   173 				SendStat(siGameResult, loc("Challenge failed!"))
   174 				SendStat(siPointType, loc("crate(s)"))
   174 				SendStat(siPointType, "!CRATES")
   175 				SendStat(siPlayerKills, tostring(cratesCollected), GetHogTeamName(playerHog))
   175 				SendStat(siPlayerKills, tostring(cratesCollected), GetHogTeamName(playerHog))
   176 				SendStat(siCustomAchievement, string.format(loc("You have collected %d out of %d crate(s)."), cratesCollected, #crates))
   176 				SendStat(siCustomAchievement, string.format(loc("You have collected %d out of %d crate(s)."), cratesCollected, #crates))
   177 			end
   177 			end
   178 			gameEnded = true
   178 			gameEnded = true
   179 			EndGame()
   179 			EndGame()