share/hedgewars/Data/Maps/Basketball/map.lua
author smxx
Thu, 01 Apr 2010 16:46:44 +0000
changeset 3240 e3b52d10b4c2
parent 3235 c7ceda2f5d4a
child 3257 fff80d469185
permissions -rw-r--r--
Maps: * Basketball/Knockball: Avoid trying to count score or show mission goals before round start (would crash engine)
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",
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
     7
	["pl"] = "Hedgewars-Koszykówka"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
     8
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
     9
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    10
local subcaption = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    11
	["en"] = "Not So Friendly Match",
3050
smxx
parents: 3004
diff changeset
    12
	["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
    13
	["es"] = "Partido no-tan-amistoso",
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
	["pl"] = "Mecz Nie-Taki-Towarzyski"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    15
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    16
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    17
local goal = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    18
	["en"] = "Bat your opponents through the|baskets and out of the map!",
3050
smxx
parents: 3004
diff changeset
    19
	["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
    20
	["es"] = "¡Batea a tus oponentes fuera del mapa a través de la canasta!",
3235
c7ceda2f5d4a Trainings:
smxx
parents: 3223
diff changeset
    21
	["pl"] = "Uderzaj swoich przekiwników|wyrzucając przez kosz, poza mapę!"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    22
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    23
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    24
local scored = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    25
	["en"] = " scored a point!",
3050
smxx
parents: 3004
diff changeset
    26
	["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
    27
	["es"] = " anotó un tanto!",
3235
c7ceda2f5d4a Trainings:
smxx
parents: 3223
diff changeset
    28
	["pl"] = " zdobyła punkt!"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    29
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    30
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    31
local failed = {
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    32
	["en"] = " scored a penalty!",
3050
smxx
parents: 3004
diff changeset
    33
	["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
    34
	["es"] = " anotó una falta!",
3235
c7ceda2f5d4a Trainings:
smxx
parents: 3223
diff changeset
    35
	["pl"] = " zdobyła punkt karny!"
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    36
	}
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    37
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    38
	local sscore = {
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    39
	["en"] = "Score",
3050
smxx
parents: 3004
diff changeset
    40
	["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
    41
	["es"] = "Puntuación",
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
	["pl"] = "Punktacja"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    43
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    44
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    45
local team = {
3050
smxx
parents: 3004
diff changeset
    46
	["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
    47
	["es"] = "Equipo",
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
    48
	["pl"] = "Drużyna"
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 drowning = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    52
	["en"] = "is out and",
3050
smxx
parents: 3004
diff changeset
    53
	["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
    54
	["es"] = "cayó y",
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
    55
	["en"] = "jest wyautowany i",
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 function loc(text)
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    59
	if text == nil then return "**missing**"
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    60
	elseif text[L] == nil then return text["en"]
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    61
	else return text[L]
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    62
	end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    63
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    64
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    65
---------------------------------------------------------------
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    66
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    67
local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    68
3240
smxx
parents: 3235
diff changeset
    69
local started = false
smxx
parents: 3235
diff changeset
    70
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    71
function onGameInit()
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    72
	GameFlags = gfSolidLand + gfBorder + gfInvulnerable + gfLowGravity
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    73
	TurnTime = 20000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    74
	CaseFreq = 0
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    75
	LandAdds = 0
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    76
	Explosives = 0
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    77
	Delay = 500
3197
smxx
parents: 3050
diff changeset
    78
	SuddenDeathTurns = 99999 -- "disable" sudden death
3000
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
function onGameStart()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    82
	ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0);
3240
smxx
parents: 3235
diff changeset
    83
	started = true
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    84
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    85
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    86
function onGameTick()
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 onAmmoStoreInit()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    90
	SetAmmo(amBaseballBat, 9, 0, 0)
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    91
	SetAmmo(amSkip, 9, 0, 0)
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 onGearAdd(gear)
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 onGearDelete(gear)
3240
smxx
parents: 3235
diff changeset
    98
	if not started then
smxx
parents: 3235
diff changeset
    99
		return
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   100
	if (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   101
		local clan = GetHogClan(CurrentHedgehog)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   102
		local s = GetHogName(gear) .. " " .. loc(drowning) .. "|" .. loc(team) .. " " .. (clan + 1) .. " "
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   103
		if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   104
			score[clan] = score[clan] + 1
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   105
			s = s .. loc(scored)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   106
		else
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   107
			score[clan] = score[clan] - 1
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   108
			s = s .. loc(failed)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   109
		end
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   110
		s = s .. "| |" .. loc(sscore) .. ": " .. score[0]
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   111
		for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
   112
		ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0)
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   113
	end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   114
end