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