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