author | Wuzzy <almikes@aol.com> |
Fri, 25 Nov 2016 13:38:24 +0100 | |
changeset 12084 | 8f222872d432 |
parent 12082 | ce3860c82c8b |
child 12086 | ed40d46c9e59 |
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 |
10631
3d164350cc48
make BasketballField available as regular map. maybe should make it destructable when not in mission mode *shrugs*
sheepluva
parents:
9093
diff
changeset
|
16 |
Map = 'BasketballField' |
12084
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12082
diff
changeset
|
17 |
-- Disable Sudden Death |
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12082
diff
changeset
|
18 |
WaterRise = 0 |
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12082
diff
changeset
|
19 |
HealthDecrease = 0 |
3000 | 20 |
end |
21 |
||
22 |
function onGameStart() |
|
12082
ce3860c82c8b
Rewrite 2nd line of mission panel of most missions for consistency
Wuzzy <almikes@aol.com>
parents:
11202
diff
changeset
|
23 |
ShowMission(loc("Basketball"), loc("Not So Friendly Match"), loc("Bat your opponents through the|baskets and out of the map!"), -amBaseballBat, 0) |
3240 | 24 |
started = true |
3000 | 25 |
end |
26 |
||
27 |
function onGameTick() |
|
28 |
end |
|
29 |
||
30 |
function onAmmoStoreInit() |
|
3346 | 31 |
SetAmmo(amBaseballBat, 9, 0, 0, 0) |
32 |
SetAmmo(amSkip, 9, 0, 0, 0) |
|
3000 | 33 |
end |
34 |
||
35 |
function onGearAdd(gear) |
|
36 |
end |
|
37 |
||
38 |
function onGearDelete(gear) |
|
3240 | 39 |
if not started then |
40 |
return |
|
3257 | 41 |
end |
3003 | 42 |
if (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then |
43 |
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
|
44 |
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
|
45 |
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
|
46 |
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
|
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 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
|
49 |
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
|
50 |
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
|
51 |
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
|
52 |
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
|
53 |
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
|
54 |
for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end |
12082
ce3860c82c8b
Rewrite 2nd line of mission panel of most missions for consistency
Wuzzy <almikes@aol.com>
parents:
11202
diff
changeset
|
55 |
ShowMission(loc("Basketball"), loc("Not So Friendly Match"), s, -amBaseballBat, 0) |
3003 | 56 |
end |
3000 | 57 |
end |
58 |
end |
|
11202
cc308446f90d
preselect baseball bat in Knockball and Basketball
sheepluva
parents:
10631
diff
changeset
|
59 |
|
cc308446f90d
preselect baseball bat in Knockball and Basketball
sheepluva
parents:
10631
diff
changeset
|
60 |
function onNewTurn() |
cc308446f90d
preselect baseball bat in Knockball and Basketball
sheepluva
parents:
10631
diff
changeset
|
61 |
SetWeapon(amBaseballBat) |
cc308446f90d
preselect baseball bat in Knockball and Basketball
sheepluva
parents:
10631
diff
changeset
|
62 |
end |