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