share/hedgewars/Data/Maps/Basketball/map.lua
author sheepluva
Tue, 06 Apr 2010 09:58:43 +0000
changeset 3309 a68632232d1a
parent 3266 aef4b9316060
child 3346 967fd96f7373
permissions -rw-r--r--
* add fixed grave Simple.png, by "anon__" * ran 'find . | grep -i '\.png$' | xargs -d "\n" optipng -o7 -np -nc -nb -fix' on trunk, only took 2h 45m 8-)
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",
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
     9
	["sk"] = "Hedgewars-Basketbal"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    10
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    11
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    12
local subcaption = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    13
	["en"] = "Not So Friendly Match",
3050
smxx
parents: 3004
diff changeset
    14
	["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
    15
	["es"] = "Partido no-tan-amistoso",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    16
	["pl"] = "Mecz Nie-Taki-Towarzyski",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    17
	["pt_PT"] = "Partida não muito amigável",
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    18
	["sk"] = "Nie tak celkom priateľský zápas"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    19
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    20
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    21
local goal = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    22
	["en"] = "Bat your opponents through the|baskets and out of the map!",
3050
smxx
parents: 3004
diff changeset
    23
	["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
    24
	["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
    25
	["pl"] = "Uderzaj swoich przekiwników|wyrzucając przez kosz, poza mapę!",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    26
	["pt_PT"] = "Bate os teus adversarios|fora do mapa acertando com eles no cesto!",
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    27
	["sk"] = "Odpálkujte vašich súperov do koša|a von z mapy!"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    28
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    29
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    30
local scored = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    31
	["en"] = " scored a point!",
3050
smxx
parents: 3004
diff changeset
    32
	["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
    33
	["es"] = " anotó un tanto!",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    34
	["pl"] = " zdobyła punkt!",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    35
	["pt_PT"] = " marca um cesto!",
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    36
	["sk"] = " skóruje!"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    37
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    38
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    39
local failed = {
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    40
	["en"] = " scored a penalty!",
3050
smxx
parents: 3004
diff changeset
    41
	["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
    42
	["es"] = " anotó una falta!",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    43
	["pl"] = " zdobyła punkt karny!",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    44
	["pt_PT"] = " perde um ponto!",
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    45
	["sk"] = " dostáva trestný bod!"
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    46
	}
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    47
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    48
	local sscore = {
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    49
	["en"] = "Score",
3050
smxx
parents: 3004
diff changeset
    50
	["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
    51
	["es"] = "Puntuación",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    52
	["pl"] = "Punktacja",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    53
	["pt_PT"] = "Pontuação",
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    54
	["sk"] = "Skóre"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    55
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    56
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    57
local team = {
3050
smxx
parents: 3004
diff changeset
    58
	["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
    59
	["es"] = "Equipo",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    60
	["pl"] = "Drużyna",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    61
	["pt_PT"] = "Equipa",
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    62
	["sk"] = "Tím"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    63
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    64
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    65
local drowning = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    66
	["en"] = "is out and",
3050
smxx
parents: 3004
diff changeset
    67
	["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
    68
	["es"] = "cayó y",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3257
diff changeset
    69
	["pl"] = "jest wyautowany i",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    70
	["pt_PT"] = "está fora e",
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    71
	["sk"] = "je mimo hru a"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    72
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    73
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    74
local function loc(text)
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    75
	if text == nil then return "**missing**"
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    76
	elseif text[L] == nil then return text["en"]
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    77
	else return text[L]
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    78
	end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    79
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    80
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    81
---------------------------------------------------------------
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    82
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    83
local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    84
3240
smxx
parents: 3235
diff changeset
    85
local started = false
smxx
parents: 3235
diff changeset
    86
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    87
function onGameInit()
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    88
	GameFlags = gfSolidLand + gfBorder + gfInvulnerable + gfLowGravity
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    89
	TurnTime = 20000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    90
	CaseFreq = 0
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    91
	LandAdds = 0
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    92
	Explosives = 0
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    93
	Delay = 500
3197
smxx
parents: 3050
diff changeset
    94
	SuddenDeathTurns = 99999 -- "disable" sudden death
3000
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 onGameStart()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    98
	ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0);
3240
smxx
parents: 3235
diff changeset
    99
	started = true
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 onGameTick()
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 onAmmoStoreInit()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   106
	SetAmmo(amBaseballBat, 9, 0, 0)
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   107
	SetAmmo(amSkip, 9, 0, 0)
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 onGearAdd(gear)
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 onGearDelete(gear)
3240
smxx
parents: 3235
diff changeset
   114
	if not started then
smxx
parents: 3235
diff changeset
   115
		return
3257
smxx
parents: 3240
diff changeset
   116
	end
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   117
	if (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   118
		local clan = GetHogClan(CurrentHedgehog)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   119
		local s = GetHogName(gear) .. " " .. loc(drowning) .. "|" .. loc(team) .. " " .. (clan + 1) .. " "
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   120
		if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   121
			score[clan] = score[clan] + 1
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   122
			s = s .. loc(scored)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   123
		else
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   124
			score[clan] = score[clan] - 1
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   125
			s = s .. loc(failed)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   126
		end
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   127
		s = s .. "| |" .. loc(sscore) .. ": " .. score[0]
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   128
		for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   129
		ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0)
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   130
	end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   131
end