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()
|
9836
|
13 |
if (TurnTimeLeft < 20) or (TurnTimeLeft > 0 and 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()
|
|
24 |
gravity = GetAwayTime
|
|
25 |
GetAwayTime = 100
|
|
26 |
end
|
|
27 |
|
|
28 |
function onGameStart()
|
|
29 |
ShowMission(loc("Gravity"),
|
|
30 |
loc("Current value is ") .. gravity .. "%",
|
|
31 |
loc("Set any gravity value you want by adjusting get away time"),
|
|
32 |
0, 5000)
|
|
33 |
end |