share/hedgewars/Data/Maps/Basketball/map.lua
author koda
Sun, 16 May 2010 19:24:38 +0000
changeset 3465 b290993c0810
parent 3346 967fd96f7373
child 4162 923db448ad16
permissions -rw-r--r--
unbreak stuff Henek updates swedish locale
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",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
     8
	["pt_PT"] = "Hedgewars-Basketball",
3465
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
     9
	["sk"] = "Hedgewars-Basketbal",
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    10
	["sv"] = "Hedgewars-Basket"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    11
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    12
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    13
local subcaption = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    14
	["en"] = "Not So Friendly Match",
3050
smxx
parents: 3004
diff changeset
    15
	["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
    16
	["es"] = "Partido no-tan-amistoso",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    17
	["pl"] = "Mecz Nie-Taki-Towarzyski",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    18
	["pt_PT"] = "Partida não muito amigável",
3465
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    19
	["sk"] = "Nie tak celkom priateľský zápas",
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    20
	["sv"] = "En inte så vänlig match"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    21
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    22
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    23
local goal = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    24
	["en"] = "Bat your opponents through the|baskets and out of the map!",
3050
smxx
parents: 3004
diff changeset
    25
	["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
    26
	["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
    27
	["pl"] = "Uderzaj swoich przekiwników|wyrzucając przez kosz, poza mapę!",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    28
	["pt_PT"] = "Bate os teus adversarios|fora do mapa acertando com eles no cesto!",
3465
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    29
	["sk"] = "Odpálkujte vašich súperov do koša|a von z mapy!",
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    30
	["sv"] = "Slå ner dina motståndare i|korgarna och ut ur kartan!"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    31
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    32
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    33
local scored = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    34
	["en"] = " scored a point!",
3050
smxx
parents: 3004
diff changeset
    35
	["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
    36
	["es"] = " anotó un tanto!",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    37
	["pl"] = " zdobyła punkt!",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    38
	["pt_PT"] = " marca um cesto!",
3465
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    39
	["sk"] = " skóruje!",
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    40
	["sv"] = " fick ett poäng"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    41
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    42
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    43
local failed = {
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    44
	["en"] = " scored a penalty!",
3050
smxx
parents: 3004
diff changeset
    45
	["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
    46
	["es"] = " anotó una falta!",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    47
	["pl"] = " zdobyła punkt karny!",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    48
	["pt_PT"] = " perde um ponto!",
3465
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    49
	["sk"] = " dostáva trestný bod!",
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    50
	["sv"] = " fick ett straff"
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    51
	}
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    52
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    53
	local sscore = {
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    54
	["en"] = "Score",
3050
smxx
parents: 3004
diff changeset
    55
	["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
    56
	["es"] = "Puntuación",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    57
	["pl"] = "Punktacja",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    58
	["pt_PT"] = "Pontuação",
3465
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    59
	["sk"] = "Skóre",
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    60
	["sv"] = "Poängställning"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    61
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    62
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    63
local team = {
3050
smxx
parents: 3004
diff changeset
    64
	["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
    65
	["es"] = "Equipo",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    66
	["pl"] = "Drużyna",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    67
	["pt_PT"] = "Equipa",
3465
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    68
	["sk"] = "Tím",
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    69
	["sv"] = "Lag"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    70
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    71
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    72
local drowning = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    73
	["en"] = "is out and",
3050
smxx
parents: 3004
diff changeset
    74
	["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
    75
	["es"] = "cayó y",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    76
	["pl"] = "jest wyautowany i",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    77
	["pt_PT"] = "está fora e",
3465
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    78
	["sk"] = "je mimo hru a",
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    79
	["sv"] = "är ute och"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    80
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    81
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    82
local function loc(text)
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    83
	if text == nil then return "**missing**"
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    84
	elseif text[L] == nil then return text["en"]
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    85
	else return text[L]
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    86
	end
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
---------------------------------------------------------------
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    90
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    91
local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    92
3240
smxx
parents: 3235
diff changeset
    93
local started = false
smxx
parents: 3235
diff changeset
    94
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    95
function onGameInit()
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    96
	GameFlags = gfSolidLand + gfBorder + gfInvulnerable + gfLowGravity
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    97
	TurnTime = 20000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    98
	CaseFreq = 0
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    99
	LandAdds = 0
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   100
	Explosives = 0
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   101
	Delay = 500
3197
smxx
parents: 3050
diff changeset
   102
	SuddenDeathTurns = 99999 -- "disable" sudden death
3000
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 onGameStart()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   106
	ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0);
3240
smxx
parents: 3235
diff changeset
   107
	started = true
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   108
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   109
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   110
function onGameTick()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   111
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   112
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   113
function onAmmoStoreInit()
3346
967fd96f7373 Engine/Frontend:
smxx
parents: 3266
diff changeset
   114
	SetAmmo(amBaseballBat, 9, 0, 0, 0)
967fd96f7373 Engine/Frontend:
smxx
parents: 3266
diff changeset
   115
	SetAmmo(amSkip, 9, 0, 0, 0)
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   116
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   117
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   118
function onGearAdd(gear)
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   119
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   120
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   121
function onGearDelete(gear)
3240
smxx
parents: 3235
diff changeset
   122
	if not started then
smxx
parents: 3235
diff changeset
   123
		return
3257
smxx
parents: 3240
diff changeset
   124
	end
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   125
	if (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   126
		local clan = GetHogClan(CurrentHedgehog)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   127
		local s = GetHogName(gear) .. " " .. loc(drowning) .. "|" .. loc(team) .. " " .. (clan + 1) .. " "
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   128
		if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   129
			score[clan] = score[clan] + 1
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   130
			s = s .. loc(scored)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   131
		else
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   132
			score[clan] = score[clan] - 1
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   133
			s = s .. loc(failed)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   134
		end
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   135
		s = s .. "| |" .. loc(sscore) .. ": " .. score[0]
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   136
		for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   137
		ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0)
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   138
	end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   139
end