share/hedgewars/Data/Maps/TrophyRace/map.lua
author henek
Sun, 31 Oct 2010 21:02:59 -0400
changeset 4072 6bc2b8982c7b
parent 4071 20df9c487482
child 4074 b73fd6ca06dd
permissions -rw-r--r--
moar swedish
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4071
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
     1
-- Hedgewars - Roperace for 2+ Players
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
     2
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
     3
local caption = {
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
     4
	["en"] = "ShoppaKing Map Three: TrophyRace",
4072
6bc2b8982c7b moar swedish
henek
parents: 4071
diff changeset
     5
	["sv"] = "ShoppaKing bana tre: TrophyRace",
4071
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
     6
	}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
     7
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
     8
local subcaption = {
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
     9
	["en"] = "Made by Wolfmarc and Dragonfly",
4072
6bc2b8982c7b moar swedish
henek
parents: 4071
diff changeset
    10
	["sv"] = "Skapad av Wolfmarc och Dragonfly",
4071
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    11
	}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    12
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    13
local goal = {
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    14
	["en"] = "Use your rope to get from start to finish as fast as you can!",
4072
6bc2b8982c7b moar swedish
henek
parents: 4071
diff changeset
    15
	["sv"] = "Använd ditt rep för att ta dig från start till mål så fort du kan!",
4071
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    16
	}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    17
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    18
local done = {
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    19
	["en"] = "You've reached the goal!| |Time: ",
4072
6bc2b8982c7b moar swedish
henek
parents: 4071
diff changeset
    20
	["sv"] = "Du är i mål!| |Tid: ",
4071
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    21
	}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    22
local eliminated = {
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    23
	["en"] = "Eliminating worst hedgehog this round...| |%s is OUT!",
4072
6bc2b8982c7b moar swedish
henek
parents: 4071
diff changeset
    24
	["sv"] = "Eliminerar sämsta igelkotten den här omgången...| |%s är UTE!",
4071
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    25
	}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    26
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    27
local newbesttime = {
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    28
	["en"] = "NEW fastest lap: ",
4072
6bc2b8982c7b moar swedish
henek
parents: 4071
diff changeset
    29
	["sv"] = "NY snabbaste tid: ",
4071
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    30
	}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    31
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    32
local oldbesttime = {
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    33
	["en"] = "Fastest lap: ",
4072
6bc2b8982c7b moar swedish
henek
parents: 4071
diff changeset
    34
	["sv"] = "Snabbaste tid: ",
4071
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    35
	}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    36
local bestclantimes = {
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    37
	["en"] = "Best laps per team: ",
4072
6bc2b8982c7b moar swedish
henek
parents: 4071
diff changeset
    38
	["sv"] = "Bästa tider per lag: ",
4071
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    39
	}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    40
local clantime = {
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    41
	["en"] = "Team %d: ",
4072
6bc2b8982c7b moar swedish
henek
parents: 4071
diff changeset
    42
	["sv"] = "Lag %d: ",
4071
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    43
	}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    44
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    45
	local function loc(text)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    46
	if text == nil then return "**missing**"
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    47
	elseif text[L] == nil then return text["en"]
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    48
	else return text[L]
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    49
	end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    50
end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    51
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    52
---------------------------------------------------------------
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    53
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    54
-- store number of hedgehogs
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    55
local numhhs = 0
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    56
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    57
-- store hedgehog gears
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    58
local hhs = {}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    59
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    60
-- store best time per team
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    61
local clantimes = {}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    62
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    63
-- store best times
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    64
local times = {}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    65
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    66
-- in milisseconds
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    67
local maxtime = 99000
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    68
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    69
-- define start area (left, top, width, height)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    70
local start_area = {1606, 498, 356, 80}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    71
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    72
-- define goal area (left, top, width, height)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    73
local goal_area = {2030, 300, 56, 280}
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    74
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    75
-- last active hog
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    76
local lasthog = nil
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    77
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    78
-- active hog reached the goal?
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    79
local reached = false
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    80
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    81
-- hog with best time
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    82
local besthog = nil
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    83
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    84
-- hog with worst time (per round)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    85
local worsthog = nil
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    86
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    87
-- best time
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    88
local besttime = maxtime + 1
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    89
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    90
-- worst time (per round)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    91
local worsttime = 0
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    92
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    93
function onGameInit()
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    94
	GameFlags = gfSolidLand + gfInvulnerable
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    95
	TurnTime = maxtime
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    96
	CaseFreq = 0
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    97
	LandAdds = 0
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    98
	Explosives = 0
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
    99
	Delay = 500
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   100
	SuddenDeathTurns = 99999 -- "disable" sudden death
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   101
	Theme = 'Olympics'
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   102
end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   103
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   104
function onGameStart()
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   105
	ShowMission(loc(caption), loc(subcaption), loc(goal), -amRope, 0)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   106
	started = true
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   107
	p=1820
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   108
	for i = 0, numhhs - 1 do
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   109
	p = p + 50	
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   110
	SetGearPosition(hhs[i], p, 0)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   111
	end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   112
	
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   113
	for i=0, ClansCount-1 do
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   114
		clantimes[i] = 0
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   115
	end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   116
end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   117
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   118
function onAmmoStoreInit()
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   119
	SetAmmo(amRope, 9, 2, 0)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   120
end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   121
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   122
function onGameTick()
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   123
	if TurnTimeLeft == 1 and CurrentHedgehog ~= nil then
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   124
		SetHealth(CurrentHedgehog, 0)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   125
		x, y = GetGearPosition(CurrentHedgehog)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   126
		AddGear(x, y, gtAmmo_Grenade, 0, 0, 0, 0)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   127
		worsttime = 99999
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   128
		worsthog = nil
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   129
	elseif TurnTimeLeft == maxtime - 1 and CurrentHedgehog ~= nil then
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   130
		if lasthog ~= nil then 
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   131
		SetGearPosition(lasthog, p , 0)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   132
		end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   133
		reached = false
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   134
		SetGearPosition(CurrentHedgehog, start_area[1] + start_area[3] / 2, start_area[2] + start_area[4] / 2)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   135
	elseif CurrentHedgehog ~= nil then
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   136
		x, y = GetGearPosition(CurrentHedgehog)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   137
		if not reached and x > goal_area[1] and x < goal_area[1] + goal_area[3] and y > goal_area[2] and y < goal_area[2] + goal_area[4] then -- hog is within goal rectangle
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   138
			reached = true
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   139
			local ttime = maxtime - TurnTimeLeft
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   140
			--give it a sound;)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   141
			if ttime < besttime then
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   142
				PlaySound (sndHomerun)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   143
			else
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   144
				PlaySound (sndHellish)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   145
			end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   146
			for i = 0, numhhs - 1 do
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   147
				if hhs[i] == CurrentHedgehog then
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   148
					times[numhhs] = ttime
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   149
				end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   150
			end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   151
				
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   152
			local hscore = "| |"
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   153
			local clan = GetHogClan(CurrentHedgehog)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   154
			if ttime < clantimes[clan] or clantimes[clan] == 0 then
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   155
				clantimes[clan] = ttime
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   156
			end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   157
			
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   158
			if ttime < besttime then
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   159
				besttime = ttime
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   160
				besthog = CurrentHedgehog
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   161
				hscore = hscore .. loc(newbesttime)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   162
			else
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   163
				hscore = hscore .. loc(oldbesttime)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   164
			end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   165
			if ttime > worsttime then
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   166
				worsttime = ttime
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   167
				worsthog = CurrentHedgehog
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   168
			end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   169
			hscore = hscore .. GetHogName(besthog) .. " - " .. (besttime / 1000) .. " s | |" .. loc(bestclantimes)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   170
			
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   171
			if clan == ClansCount -1 then
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   172
				-- Time for elimination - worst hog is out and the worst hog vars are reset.
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   173
				SetHealth(worsthog, 0)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   174
				--Place a grenade to make inactive slowest hog active
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   175
				x, y = GetGearPosition(worsthog)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   176
				AddGear(x, y, gtAmmo_Grenade, 0, 0, 0, 0)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   177
				worsttime = 0
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   178
				worsthog = nil
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   179
				end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   180
			
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   181
			for i=0, ClansCount -1 do
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   182
				local tt = "" .. (clantimes[i] / 1000) .. " s"
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   183
				if clantimes[i] == 0 then
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   184
					tt = "--"
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   185
				end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   186
				hscore = hscore .. "|" .. string.format(loc(clantime), i+1) .. tt
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   187
			end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   188
			
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   189
			ShowMission(loc(caption), loc(subcaption), loc(done) .. (ttime / 1000) .. " s" .. hscore, 0, 0)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   190
			TurnTimeLeft = 0
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   191
		end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   192
	end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   193
end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   194
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   195
function onGearAdd(gear)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   196
	if GetGearType(gear) == gtHedgehog then
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   197
		hhs[numhhs] = gear
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   198
		times[numhhs] = 0
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   199
		numhhs = numhhs + 1
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   200
	elseif GetGearType(gear) == gtRope then -- rope is shot
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   201
		
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   202
	end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   203
end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   204
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   205
function onGearDelete(gear)
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   206
	if GetGearType(gear) == gtRope then -- rope deletion - hog didn't manage to rerope
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   207
		--TurnTimeLeft = 0 -- end turn or not? hm...
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   208
		lasthog = CurrentHedgehog
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   209
		
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   210
	end
20df9c487482 fix encoding and stupid file host behaviour
nemo
parents: 4057
diff changeset
   211
end