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
|
3000
|
68 |
end
|
|
69 |
|
|
70 |
function onGameStart()
|
|
71 |
ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0);
|
|
72 |
end
|
|
73 |
|
|
74 |
function onGameTick()
|
|
75 |
end
|
|
76 |
|
|
77 |
function onAmmoStoreInit()
|
|
78 |
SetAmmo(amBaseballBat, 9, 0, 0)
|
3003
|
79 |
SetAmmo(amSkip, 9, 0, 0)
|
3000
|
80 |
end
|
|
81 |
|
|
82 |
function onGearAdd(gear)
|
|
83 |
end
|
|
84 |
|
|
85 |
function onGearDelete(gear)
|
3003
|
86 |
if (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then
|
|
87 |
local clan = GetHogClan(CurrentHedgehog)
|
|
88 |
local s = GetHogName(gear) .. " " .. loc(drowning) .. "|" .. loc(team) .. " " .. (clan + 1) .. " "
|
|
89 |
if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then
|
|
90 |
score[clan] = score[clan] + 1
|
|
91 |
s = s .. loc(scored)
|
|
92 |
else
|
|
93 |
score[clan] = score[clan] - 1
|
|
94 |
s = s .. loc(failed)
|
|
95 |
end
|
|
96 |
s = s .. "| |" .. loc(sscore) .. ": " .. score[0]
|
3000
|
97 |
for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
|
3003
|
98 |
ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0)
|
3000
|
99 |
end
|
|
100 |
end
|