author | koda |
Sun, 03 Nov 2013 22:53:16 +0100 | |
changeset 9673 | 5be4de0eb4b0 |
parent 9093 | 4114ce5d885d |
child 10631 | 3d164350cc48 |
permissions | -rw-r--r-- |
4506
37744d5c877e
Finnished up the lua translations by adding training maps, campaign is ignored for now
Henek
parents:
4502
diff
changeset
|
1 |
-- Hedgewars - Basketball for 2+ Players |
3000 | 2 |
|
9093 | 3 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
3000 | 4 |
|
5 |
local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0} |
|
6 |
||
3240 | 7 |
local started = false |
8 |
||
3000 | 9 |
function onGameInit() |
3003 | 10 |
GameFlags = gfSolidLand + gfBorder + gfInvulnerable + gfLowGravity |
3000 | 11 |
TurnTime = 20000 |
12 |
CaseFreq = 0 |
|
4162 | 13 |
MinesNum = 0 |
3000 | 14 |
Explosives = 0 |
3003 | 15 |
Delay = 500 |
3197 | 16 |
SuddenDeathTurns = 99999 -- "disable" sudden death |
3000 | 17 |
end |
18 |
||
19 |
function onGameStart() |
|
4502
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
20 |
ShowMission(loc("Hedgewars-Basketball"), loc("Not So Friendly Match"), loc("Bat your opponents through the|baskets and out of the map!"), -amBaseballBat, 0) |
3240 | 21 |
started = true |
3000 | 22 |
end |
23 |
||
24 |
function onGameTick() |
|
25 |
end |
|
26 |
||
27 |
function onAmmoStoreInit() |
|
3346 | 28 |
SetAmmo(amBaseballBat, 9, 0, 0, 0) |
29 |
SetAmmo(amSkip, 9, 0, 0, 0) |
|
3000 | 30 |
end |
31 |
||
32 |
function onGearAdd(gear) |
|
33 |
end |
|
34 |
||
35 |
function onGearDelete(gear) |
|
3240 | 36 |
if not started then |
37 |
return |
|
3257 | 38 |
end |
3003 | 39 |
if (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then |
40 |
local clan = GetHogClan(CurrentHedgehog) |
|
4502
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
41 |
local s |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
42 |
if clan ~= nil then |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
43 |
if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
44 |
score[clan] = score[clan] + 1 |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
45 |
s = string.format(loc("%s is out and Team %d|scored a point!| |Score:"), GetHogName(gear), clan + 1) |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
46 |
else |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
47 |
score[clan] = score[clan] - 1 |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
48 |
s = string.format(loc("%s is out and Team %d|scored a penalty!| |Score:"), GetHogName(gear), clan + 1) |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
49 |
end |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
50 |
s = s .. " " .. score[0] |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
51 |
for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end |
759c1a3bb156
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.
Henek
parents:
4493
diff
changeset
|
52 |
ShowMission(loc("Hedgewars-Basketball"), loc("Not So Friendly Match"), s, -amBaseballBat, 0) |
3003 | 53 |
end |
3000 | 54 |
end |
55 |
end |