share/hedgewars/Data/Maps/Basketball/map.lua
author smxx
Mon, 22 Mar 2010 20:57:49 +0000
changeset 3050 d6937fc885a1
parent 3004 e9b3613cc3fb
child 3197 e1fa864fd6ca
permissions -rw-r--r--
Maps: * Added Palewolf's Spanish translation for Basketball's script * Added Knockball's directory to directories to be installed
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",
smxx
parents: 3004
diff changeset
     6
	["es"] = "Hedgewars-Baloncesto"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
     7
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
     8
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
     9
local subcaption = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    10
	["en"] = "Not So Friendly Match",
3050
smxx
parents: 3004
diff changeset
    11
	["de"] = "Kein-so-Freundschaftsspiel",
smxx
parents: 3004
diff changeset
    12
	["es"] = "Partido no-tan-amistoso"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    13
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    14
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    15
local goal = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    16
	["en"] = "Bat your opponents through the|baskets and out of the map!",
3050
smxx
parents: 3004
diff changeset
    17
	["de"] = "Schlage deine Widersacher durch|die Körbe und aus der Karte hinaus!",
smxx
parents: 3004
diff changeset
    18
	["es"] = "¡Batea a tus oponentes fuera del mapa a través de la canasta!"
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 scored = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    22
	["en"] = " scored a point!",
3050
smxx
parents: 3004
diff changeset
    23
	["de"] = " erhält einen Punkt!",
smxx
parents: 3004
diff changeset
    24
	["es"] = " anotó un tanto!"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    25
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    26
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    27
local failed = {
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    28
	["en"] = " scored a penalty!",
3050
smxx
parents: 3004
diff changeset
    29
	["de"] = " erhält eine Strafe!",
smxx
parents: 3004
diff changeset
    30
	["es"] = " anotó una falta!"
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    31
	}
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    32
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    33
	local sscore = {
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    34
	["en"] = "Score",
3050
smxx
parents: 3004
diff changeset
    35
	["de"] = "Punktestand",
smxx
parents: 3004
diff changeset
    36
	["es"] = "Puntuación"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    37
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    38
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    39
local team = {
3050
smxx
parents: 3004
diff changeset
    40
	["en"] = "Team",
smxx
parents: 3004
diff changeset
    41
	["es"] = "Equipo"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    42
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    43
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    44
local drowning = {
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    45
	["en"] = "is out and",
3050
smxx
parents: 3004
diff changeset
    46
	["de"] = "ist draußen und",
smxx
parents: 3004
diff changeset
    47
	["es"] = "cayó y"
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    48
	}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    49
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    50
local function loc(text)
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    51
	if text == nil then return "**missing**"
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    52
	elseif text[L] == nil then return text["en"]
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    53
	else return text[L]
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    54
	end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    55
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    56
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    57
---------------------------------------------------------------
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    58
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    59
local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0}
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    60
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    61
function onGameInit()
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    62
	GameFlags = gfSolidLand + gfBorder + gfInvulnerable + gfLowGravity
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    63
	TurnTime = 20000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    64
	CaseFreq = 0
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    65
	LandAdds = 0
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    66
	Explosives = 0
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    67
	Delay = 500
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    68
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    69
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    70
function onGameStart()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    71
	ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0);
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    72
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    73
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    74
function onGameTick()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    75
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    76
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    77
function onAmmoStoreInit()
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    78
	SetAmmo(amBaseballBat, 9, 0, 0)
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    79
	SetAmmo(amSkip, 9, 0, 0)
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    80
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    81
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    82
function onGearAdd(gear)
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    83
end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    84
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    85
function onGearDelete(gear)
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    86
	if (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    87
		local clan = GetHogClan(CurrentHedgehog)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    88
		local s = GetHogName(gear) .. " " .. loc(drowning) .. "|" .. loc(team) .. " " .. (clan + 1) .. " "
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    89
		if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    90
			score[clan] = score[clan] + 1
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    91
			s = s .. loc(scored)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    92
		else
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    93
			score[clan] = score[clan] - 1
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    94
			s = s .. loc(failed)
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    95
		end
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    96
		s = s .. "| |" .. loc(sscore) .. ": " .. score[0]
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    97
		for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
3003
0afdba08a858 Engine:
smxx
parents: 3000
diff changeset
    98
		ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0)
3000
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
    99
	end
2b9405b6dc5d General:
smxx
parents: 2999
diff changeset
   100
end