author | unc0rr |
Wed, 01 Jan 2014 14:16:01 +0400 | |
changeset 9902 | eb8e8b09b2f0 |
parent 9898 | b87695f82d2e |
child 9906 | 93c16a4b0c6a |
permissions | -rw-r--r-- |
9836 | 1 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
2 |
||
3 |
local gravity = 100 |
|
4 |
local wdGameTicks = 0 |
|
5 |
local wdTTL = 0 |
|
6 |
||
9816 | 7 |
function onNewTurn() |
9836 | 8 |
SetGravity(gravity) |
9 |
wdGameTicks = GameTime |
|
9816 | 10 |
end |
11 |
||
12 |
function onGameTick20() |
|
9898
b87695f82d2e
Don't set gravity to normal immediately on turn end, let watchdog do its job if game gets frozen
unc0rr
parents:
9836
diff
changeset
|
13 |
if wdGameTicks + 15000 < GameTime then |
9816 | 14 |
SetGravity(100) |
9836 | 15 |
elseif wdTTL ~= TurnTimeLeft then |
16 |
wdGameTicks = GameTime |
|
17 |
SetGravity(gravity) |
|
9816 | 18 |
end |
9836 | 19 |
|
20 |
wdTTL = TurnTimeLeft |
|
9816 | 21 |
end |
9836 | 22 |
|
23 |
function onGameInit() |
|
9902 | 24 |
gravity = ScriptParam |
9836 | 25 |
end |
26 |
||
27 |
function onGameStart() |
|
28 |
ShowMission(loc("Gravity"), |
|
29 |
loc("Current value is ") .. gravity .. "%", |
|
30 |
loc("Set any gravity value you want by adjusting get away time"), |
|
31 |
0, 5000) |
|
9902 | 32 |
end |