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