merge
authorunc0rr
Wed, 25 Dec 2013 00:10:16 +0400
changeset 9838 91bc555c5df4
parent 9837 fa94ee96f006 (diff)
parent 9835 e89b42c55047 (current diff)
child 9839 96e3914e8154
child 9840 ff0d7954aabc
merge
--- a/gameServer/Utils.hs	Tue Dec 24 15:07:41 2013 -0500
+++ b/gameServer/Utils.hs	Wed Dec 25 00:10:16 2013 +0400
@@ -92,6 +92,8 @@
             , (44, "0.9.19-dev")
             , (45, "0.9.19")
             , (46, "0.9.20-dev")
+            , (47, "0.9.20")
+            , (48, "0.9.21-dev")
             ]
 
 askFromConsole :: B.ByteString -> IO B.ByteString
--- a/hedgewars/uScript.pas	Tue Dec 24 15:07:41 2013 -0500
+++ b/hedgewars/uScript.pas	Wed Dec 25 00:10:16 2013 +0400
@@ -2040,6 +2040,7 @@
 ScriptSetInteger('SuddenDeathTurns', cSuddenDTurns);
 ScriptSetInteger('WaterRise', cWaterRise);
 ScriptSetInteger('HealthDecrease', cHealthDecrease);
+ScriptSetInteger('GetAwayTime', cGetAwayTime);
 ScriptSetString('Map', cMapName);
 
 ScriptSetString('Theme', '');
@@ -2068,6 +2069,7 @@
 cSuddenDTurns    := ScriptGetInteger('SuddenDeathTurns');
 cWaterRise       := ScriptGetInteger('WaterRise');
 cHealthDecrease  := ScriptGetInteger('HealthDecrease');
+cGetAwayTime     := ScriptGetInteger('GetAwayTime');
 
 if cMapName <> ScriptGetString('Map') then
     ParseCommand('map ' + ScriptGetString('Map'), true, true);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Gravity.cfg	Wed Dec 25 00:10:16 2013 +0400
@@ -0,0 +1,2 @@
+Default
+Default
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Gravity.lua	Wed Dec 25 00:10:16 2013 +0400
@@ -0,0 +1,33 @@
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+
+local gravity = 100
+local wdGameTicks = 0
+local wdTTL = 0
+
+function onNewTurn()
+    SetGravity(gravity)
+    wdGameTicks = GameTime
+end
+
+function onGameTick20()
+    if (TurnTimeLeft < 20) or (TurnTimeLeft > 0 and wdGameTicks + 15000 < GameTime) then
+        SetGravity(100)
+    elseif wdTTL ~= TurnTimeLeft then
+        wdGameTicks = GameTime
+        SetGravity(gravity)
+    end
+
+    wdTTL = TurnTimeLeft
+end
+
+function onGameInit()
+    gravity = GetAwayTime
+    GetAwayTime = 100
+end
+
+function onGameStart()
+    ShowMission(loc("Gravity"),
+                loc("Current value is ") .. gravity .. "%",
+                loc("Set any gravity value you want by adjusting get away time"),
+                0, 5000)
+end
\ No newline at end of file
--- a/share/hedgewars/Data/Scripts/Multiplayer/No_Gravity.cfg	Tue Dec 24 15:07:41 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-Default
-Default
--- a/share/hedgewars/Data/Scripts/Multiplayer/No_Gravity.lua	Tue Dec 24 15:07:41 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-function onNewTurn()
-    SetGravity(0)
-end
-
-function onGameTick20()
-    if TurnTimeLeft < 20 then
-        SetGravity(100)
-    end
-end