author | Wuzzy <almikes@aol.com> |
Wed, 27 Sep 2017 06:38:51 +0200 | |
changeset 12559 | 194b00c4ba07 |
parent 12087 | c680b7db1e2e |
child 14406 | 6c21bd8547dd |
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 - Knockball for 2+ Players |
3263 | 2 |
|
9093 | 3 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
3263 | 4 |
|
5 |
local ball = nil |
|
6 |
||
7 |
function onGameInit() |
|
8 |
GameFlags = gfSolidLand + gfInvulnerable + gfDivideTeams |
|
9 |
TurnTime = 20000 |
|
10 |
CaseFreq = 0 |
|
4162 | 11 |
MinesNum = 0 |
3263 | 12 |
Explosives = 0 |
13 |
Delay = 500 |
|
12084
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12082
diff
changeset
|
14 |
-- Disable Sudden Death |
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12082
diff
changeset
|
15 |
WaterRise = 0 |
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12082
diff
changeset
|
16 |
HealthDecrease = 0 |
3263 | 17 |
end |
18 |
||
19 |
function onGameStart() |
|
12082
ce3860c82c8b
Rewrite 2nd line of mission panel of most missions for consistency
Wuzzy <almikes@aol.com>
parents:
11202
diff
changeset
|
20 |
ShowMission(loc("Knockball"), loc("Not So Friendly Match"), loc("Bat balls at your enemies and|push them into the sea!"), -amBaseballBat, 0) |
12087
c680b7db1e2e
Add custom ammo texts for Knockball
Wuzzy <almikes@aol.com>
parents:
12086
diff
changeset
|
21 |
SetAmmoTexts(amBaseballBat, loc("Baseball Bat with Ball"), loc("Knockball weapon"), loc("Throw a baseball at your foes|and send them flying!") .. "|" .. loc("Attack: Throw ball")) |
3263 | 22 |
end |
23 |
||
24 |
function onGameTick() |
|
25 |
if ball ~= nil and GetFollowGear() ~= nil then FollowGear(ball) end |
|
26 |
end |
|
27 |
||
28 |
function onAmmoStoreInit() |
|
3346 | 29 |
SetAmmo(amBaseballBat, 9, 0, 0, 0) |
30 |
SetAmmo(amSkip, 9, 0, 0, 0) |
|
3263 | 31 |
end |
32 |
||
33 |
function onGearAdd(gear) |
|
34 |
if GetGearType(gear) == gtShover then |
|
7777 | 35 |
ball = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtBall, 0, 0, 0, 0) |
3263 | 36 |
if ball ~= nil then |
4517
0618b31023dc
added team flag to AddTeam and made AI team allowed to have custom flags. added GetGearVelocity and SetGearVelocity and removed CopyPV2. changed knockball to use use these functions instead.
Henek
parents:
4506
diff
changeset
|
37 |
local dx, dy = GetGearVelocity(gear) |
0618b31023dc
added team flag to AddTeam and made AI team allowed to have custom flags. added GetGearVelocity and SetGearVelocity and removed CopyPV2. changed knockball to use use these functions instead.
Henek
parents:
4506
diff
changeset
|
38 |
SetGearVelocity(ball, dx * 2, dy * 2) |
3263 | 39 |
SetState(ball, 0x200) -- temporary - might change! |
40 |
SetTag(ball, 8) -- baseball skin |
|
41 |
FollowGear(ball) |
|
42 |
end |
|
43 |
end |
|
44 |
end |
|
45 |
||
46 |
function onGearDelete(gear) |
|
47 |
if gear == ball then |
|
48 |
ball = nil |
|
49 |
end |
|
50 |
end |
|
11202
cc308446f90d
preselect baseball bat in Knockball and Basketball
sheepluva
parents:
9093
diff
changeset
|
51 |
|
cc308446f90d
preselect baseball bat in Knockball and Basketball
sheepluva
parents:
9093
diff
changeset
|
52 |
function onNewTurn() |
cc308446f90d
preselect baseball bat in Knockball and Basketball
sheepluva
parents:
9093
diff
changeset
|
53 |
SetWeapon(amBaseballBat) |
cc308446f90d
preselect baseball bat in Knockball and Basketball
sheepluva
parents:
9093
diff
changeset
|
54 |
end |