author | unc0rr |
Wed, 01 Jan 2014 23:41:49 +0400 | |
changeset 9906 | 93c16a4b0c6a |
parent 9902 | eb8e8b09b2f0 |
child 9908 | 81eb25ddf594 |
permissions | -rw-r--r-- |
9836 | 1 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
9906
93c16a4b0c6a
Only emit roomNameUpdated when it actually is changed
unc0rr
parents:
9902
diff
changeset
|
2 |
HedgewarsScriptLoad("/Scripts/Params.lua") |
9836 | 3 |
|
4 |
local gravity = 100 |
|
5 |
local wdGameTicks = 0 |
|
6 |
local wdTTL = 0 |
|
7 |
||
9816 | 8 |
function onNewTurn() |
9836 | 9 |
SetGravity(gravity) |
10 |
wdGameTicks = GameTime |
|
9816 | 11 |
end |
12 |
||
13 |
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
|
14 |
if wdGameTicks + 15000 < GameTime then |
9816 | 15 |
SetGravity(100) |
9836 | 16 |
elseif wdTTL ~= TurnTimeLeft then |
17 |
wdGameTicks = GameTime |
|
18 |
SetGravity(gravity) |
|
9816 | 19 |
end |
9836 | 20 |
|
21 |
wdTTL = TurnTimeLeft |
|
9816 | 22 |
end |
9836 | 23 |
|
24 |
function onGameInit() |
|
9906
93c16a4b0c6a
Only emit roomNameUpdated when it actually is changed
unc0rr
parents:
9902
diff
changeset
|
25 |
parseParams() |
9902 | 26 |
gravity = ScriptParam |
9836 | 27 |
end |
28 |
||
29 |
function onGameStart() |
|
30 |
ShowMission(loc("Gravity"), |
|
31 |
loc("Current value is ") .. gravity .. "%", |
|
32 |
loc("Set any gravity value you want by adjusting get away time"), |
|
33 |
0, 5000) |
|
9902 | 34 |
end |