share/hedgewars/Data/Maps/Basketball/map.lua
author nemo
Fri, 02 Apr 2010 18:36:14 +0000
changeset 3264 3cf9d915cdb9
parent 3257 fff80d469185
child 3266 aef4b9316060
permissions -rw-r--r--
inu adds portugese translation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3004
e9b3613cc3fb Engine:
smxx
parents: 3003
diff changeset
     1
-- Hedgewars - Basketball for 2+ Players
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
     2
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
     3
local caption = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
     4
	["en"] = "Hedgewars-Basketball",
3050
smxx
parents: 3004
diff changeset
     5
	["de"] = "Hedgewars-Basketball",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
     6
	["es"] = "Hedgewars-Baloncesto",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
     7
	["pl"] = "Hedgewars-Koszykówka",
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
     8
	["pt_PT"] = "Hedgewars-Basketball"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
     9
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    10
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    11
local subcaption = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    12
	["en"] = "Not So Friendly Match",
3050
smxx
parents: 3004
diff changeset
    13
	["de"] = "Kein-so-Freundschaftsspiel",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
    14
	["es"] = "Partido no-tan-amistoso",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    15
	["pl"] = "Mecz Nie-Taki-Towarzyski",
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    16
	["pt_PT"] = "Partida não muito amigável"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    17
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    18
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    19
local goal = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    20
	["en"] = "Bat your opponents through the|baskets and out of the map!",
3050
smxx
parents: 3004
diff changeset
    21
	["de"] = "Schlage deine Widersacher durch|die Körbe und aus der Karte hinaus!",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
    22
	["es"] = "¡Batea a tus oponentes fuera del mapa a través de la canasta!",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    23
	["pl"] = "Uderzaj swoich przekiwników|wyrzucając przez kosz, poza mapę!",
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    24
	["pt_PT"] = "Bate os teus adversarios|fora do mapa acertando com eles no cesto!"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    25
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    26
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    27
local scored = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    28
	["en"] = " scored a point!",
3050
smxx
parents: 3004
diff changeset
    29
	["de"] = " erhält einen Punkt!",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
    30
	["es"] = " anotó un tanto!",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    31
	["pl"] = " zdobyła punkt!",
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    32
	["pt_PT"] = " marca um cesto!"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    33
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    34
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    35
local failed = {
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    36
	["en"] = " scored a penalty!",
3050
smxx
parents: 3004
diff changeset
    37
	["de"] = " erhält eine Strafe!",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
    38
	["es"] = " anotó una falta!",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    39
	["pl"] = " zdobyła punkt karny!",
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    40
	["pt_PT"] = " perde um ponto!"
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    41
	}
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    42
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    43
	local sscore = {
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    44
	["en"] = "Score",
3050
smxx
parents: 3004
diff changeset
    45
	["de"] = "Punktestand",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
    46
	["es"] = "Puntuación",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    47
	["pl"] = "Punktacja",
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    48
	["pt_PT"] = "Pontuação"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    49
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    50
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    51
local team = {
3050
smxx
parents: 3004
diff changeset
    52
	["en"] = "Team",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
    53
	["es"] = "Equipo",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    54
	["pl"] = "Drużyna",
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    55
	["pt_PT"] = "Equipa"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    56
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    57
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    58
local drowning = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    59
	["en"] = "is out and",
3050
smxx
parents: 3004
diff changeset
    60
	["de"] = "ist draußen und",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
    61
	["es"] = "cayó y",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    62
	["pl"] = "jest wyautowany i",
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    63
	["pt_PT"] = "está fora e"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    64
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    65
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    66
local function loc(text)
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    67
	if text == nil then return "**missing**"
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    68
	elseif text[L] == nil then return text["en"]
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    69
	else return text[L]
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    70
	end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    71
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    72
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    73
---------------------------------------------------------------
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    74
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    75
local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    76
3240
smxx
parents: 3235
diff changeset
    77
local started = false
smxx
parents: 3235
diff changeset
    78
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    79
function onGameInit()
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    80
	GameFlags = gfSolidLand + gfBorder + gfInvulnerable + gfLowGravity
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    81
	TurnTime = 20000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    82
	CaseFreq = 0
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    83
	LandAdds = 0
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    84
	Explosives = 0
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    85
	Delay = 500
3197
smxx
parents: 3050
diff changeset
    86
	SuddenDeathTurns = 99999 -- "disable" sudden death
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    87
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    88
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    89
function onGameStart()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    90
	ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0);
3240
smxx
parents: 3235
diff changeset
    91
	started = true
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    92
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    93
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    94
function onGameTick()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    95
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    96
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    97
function onAmmoStoreInit()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    98
	SetAmmo(amBaseballBat, 9, 0, 0)
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    99
	SetAmmo(amSkip, 9, 0, 0)
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   100
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   101
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   102
function onGearAdd(gear)
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   103
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   104
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   105
function onGearDelete(gear)
3240
smxx
parents: 3235
diff changeset
   106
	if not started then
smxx
parents: 3235
diff changeset
   107
		return
3257
smxx
parents: 3240
diff changeset
   108
	end
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   109
	if (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   110
		local clan = GetHogClan(CurrentHedgehog)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   111
		local s = GetHogName(gear) .. " " .. loc(drowning) .. "|" .. loc(team) .. " " .. (clan + 1) .. " "
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   112
		if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   113
			score[clan] = score[clan] + 1
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   114
			s = s .. loc(scored)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   115
		else
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   116
			score[clan] = score[clan] - 1
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   117
			s = s .. loc(failed)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   118
		end
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   119
		s = s .. "| |" .. loc(sscore) .. ": " .. score[0]
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   120
		for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   121
		ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0)
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   122
	end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   123
end