author | koda |
Sun, 16 May 2010 19:24:38 +0000 | |
changeset 3465 | b290993c0810 |
parent 3346 | 967fd96f7373 |
child 4162 | 923db448ad16 |
permissions | -rw-r--r-- |
3263 | 1 |
-- Hedgewars - Knockball for 2+ Players |
2 |
||
3 |
local caption = { |
|
4 |
["en"] = "Hedgewars-Knockball", |
|
5 |
["de"] = "Hedgewars-Knockball", |
|
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-Knockball", |
3264 | 7 |
["pl"] = "Hedgewars-Knockball", |
3266 | 8 |
["pt_PT"] = "Hedgewars-Knockball", |
3465 | 9 |
["sk"] = "Hedgewars-Knockball", |
10 |
["sv"] = "Hedgewars-Knockball" |
|
3263 | 11 |
} |
12 |
||
13 |
local subcaption = { |
|
14 |
["en"] = "Not So Friendly Match", |
|
15 |
["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
|
16 |
["es"] = "Partido no-tan-amistoso", |
3264 | 17 |
["pl"] = "Mecz Nie-Taki-Towarzyski", |
3266 | 18 |
["pt_PT"] = "Partida não muito amigável", |
3465 | 19 |
["sk"] = "Nie tak celkom priateľký zápas", |
20 |
["sv"] = "En inte så vänlig match" |
|
3263 | 21 |
} |
22 |
||
23 |
local goal = { |
|
24 |
["en"] = "Bat balls at your enemies and|push them into the sea!", |
|
25 |
["de"] = "Schlage Bälle auf deine Widersacher|und lass sie ins Meer fallen!", |
|
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
|
26 |
["es"] = "¡Batea pelotas hacia tus enemigos|y hazlos caer al agua!", |
3264 | 27 |
["pl"] = "Uderzaj piłkami w swoich przeciwników|i strącaj ich do wody!", |
3266 | 28 |
["pt_PT"] = "Bate bolas contra os teus|enimigos e empurra-os ao mar!", |
3465 | 29 |
["sk"] = "Loptami triafajte vašich nepriateľov|a zhoďte ich tak do mora!", |
30 |
["sv"] = "Slå bollar mot dina fiender|och slå ner dem i havet" |
|
3263 | 31 |
} |
32 |
||
33 |
local scored = { |
|
34 |
["en"] = "%s is out and Team %d|scored a point!| |Score:", |
|
35 |
["de"] = "%s ist draußen und Team %d|erhält einen Punkt!| |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
|
36 |
["es"] = "¡%s cayó y Equipo %d|anotó un tanto!| |Puntuación:", |
3264 | 37 |
["pl"] = "%s utonął i drużyna %d|zdobyła punkt!| |Punktacja:", |
3266 | 38 |
["pt_PT"] = "%s está fora e a equipa %d|soma um ponto!| |Pontuação:", |
3465 | 39 |
["sk"] = "%s je mimo hru a tím %d|získal bod!| |Skóre:", |
40 |
["sv"] = "%s är ute och lag %d|fick ett poäng!| |Poängställning:" |
|
3263 | 41 |
} |
42 |
||
43 |
local failed = { |
|
44 |
["en"] = "%s is out and Team %d|scored a penalty!| |Score:", |
|
45 |
["de"] = "%s ist draußen und Team %d|erhält eine Strafe!| |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
|
46 |
["es"] = "¡%s cayó y Equipo %d|anotó una falta!| |Puntuación:", |
3264 | 47 |
["pl"] = "%s utonął i drużyna %d|dostała punkt karny!| |Punktacja:", |
3266 | 48 |
["pt_PT"] = "%s está fora e a equipa %d|perde um ponto!| |Pontuação:", |
49 |
["sk"] = "%s je mimo hru a tím %d|dostal trestný bod!| |Skóre:", |
|
3465 | 50 |
["sv"] = "%s är ute och lag %d|fick ett straff!| |Poängställning:" |
3263 | 51 |
} |
52 |
||
53 |
local function loc(text) |
|
54 |
if text == nil then return "**missing**" |
|
55 |
elseif text[L] == nil then return text["en"] |
|
56 |
else return text[L] |
|
57 |
end |
|
58 |
end |
|
59 |
||
60 |
--------------------------------------------------------------- |
|
61 |
||
62 |
local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0} |
|
63 |
||
64 |
local ball = nil |
|
65 |
||
66 |
local started = false |
|
67 |
||
68 |
function onGameInit() |
|
69 |
GameFlags = gfSolidLand + gfInvulnerable + gfDivideTeams |
|
70 |
TurnTime = 20000 |
|
71 |
CaseFreq = 0 |
|
72 |
LandAdds = 0 |
|
73 |
Explosives = 0 |
|
74 |
Delay = 500 |
|
75 |
SuddenDeathTurns = 99999 -- "disable" sudden death |
|
76 |
end |
|
77 |
||
78 |
function onGameStart() |
|
79 |
ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0) |
|
80 |
started = true |
|
81 |
end |
|
82 |
||
83 |
function onGameTick() |
|
84 |
if ball ~= nil and GetFollowGear() ~= nil then FollowGear(ball) end |
|
85 |
end |
|
86 |
||
87 |
function onAmmoStoreInit() |
|
3346 | 88 |
SetAmmo(amBaseballBat, 9, 0, 0, 0) |
89 |
SetAmmo(amSkip, 9, 0, 0, 0) |
|
3263 | 90 |
end |
91 |
||
92 |
function onGearAdd(gear) |
|
93 |
if GetGearType(gear) == gtShover then |
|
94 |
ball = AddGear(GetX(gear), GetY(gear), gtBall, 0, 0, 0, 0) |
|
95 |
if ball ~= nil then |
|
96 |
CopyPV2(gear, ball) |
|
97 |
SetState(ball, 0x200) -- temporary - might change! |
|
98 |
SetTag(ball, 8) -- baseball skin |
|
99 |
FollowGear(ball) |
|
100 |
end |
|
101 |
end |
|
102 |
end |
|
103 |
||
104 |
function onGearDelete(gear) |
|
105 |
if not started then |
|
106 |
return |
|
107 |
end |
|
108 |
if gear == ball then |
|
109 |
ball = nil |
|
110 |
elseif (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then |
|
111 |
local clan = GetHogClan(CurrentHedgehog) |
|
112 |
local s |
|
113 |
if clan ~= nil then |
|
114 |
if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then |
|
115 |
score[clan] = score[clan] + 1 |
|
116 |
s = string.format(loc(scored), GetHogName(gear), clan + 1) |
|
117 |
else |
|
118 |
score[clan] = score[clan] - 1 |
|
119 |
s = string.format(loc(failed), GetHogName(gear), clan + 1) |
|
120 |
end |
|
121 |
s = s .. " " .. score[0] |
|
122 |
for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end |
|
123 |
ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0) |
|
124 |
end |
|
125 |
end |
|
126 |
end |