add some config params - speed,accel,delaytime,delayheight,nocake. water rise speed, water rise acceleration, time delay from start of turn for water rise, height delay for same, and disable cake. also set start boulder to indestructible
authornemo
Sat, 31 Jan 2015 22:13:44 -0500
changeset 10810 931dd8f42763
parent 10809 bb2e4e9944f7
child 10811 0d9c49e88142
add some config params - speed,accel,delaytime,delayheight,nocake. water rise speed, water rise acceleration, time delay from start of turn for water rise, height delay for same, and disable cake. also set start boulder to indestructible
share/hedgewars/Data/Maps/ClimbHome/map.lua
share/hedgewars/Data/Maps/ClimbHome/mask.png
--- a/share/hedgewars/Data/Maps/ClimbHome/map.lua	Sun Jan 25 16:10:20 2015 -0500
+++ b/share/hedgewars/Data/Maps/ClimbHome/map.lua	Sat Jan 31 22:13:44 2015 -0500
@@ -1,5 +1,6 @@
 HedgewarsScriptLoad("/Scripts/Locale.lua")
 HedgewarsScriptLoad("/Scripts/Utils.lua")
+HedgewarsScriptLoad("/Scripts/Params.lua")
 
 local hTag = nil
 local hTagHeight = 33000
@@ -25,6 +26,7 @@
 local WaterRise = nil
 local Cake = nil
 local CakeTries = 0
+local addCake = true
 local Stars = {}
 local tauntNoo = false
 local jokeAwardNavy = nil
@@ -36,6 +38,22 @@
 local scaleGraph = false
 local dummyHog = nil
 local dummySkip = 0
+local baseWaterSpeed = 2
+local waterSpeed = 0
+local waterAccel = 0
+local delayHeight = 32000
+local delayTime = 0
+
+function onParameters()
+    parseParams()
+
+    baseWaterSpeed = params["speed"]
+    waterAccel = params["accel"]
+    if waterAccel ~= 0 then waterAccel = div(32640000,waterAccel) end
+    delayTime = params["delaytime"]
+    delayHeight = 32768-params["delayheight"]
+    if params["nocake"] ~= nil then addCake = false end
+end
 
 function onGameInit()
     -- Ensure people get same map for same theme
@@ -237,7 +255,15 @@
     end
 
     if CurrentHedgehog ~= nil and TurnTimeLeft > 0 and band(GetState(CurrentHedgehog),gstHHDriven) ~= 0 then
-        if MaxHeight < 32000 and MaxHeight > 286 and WaterLine > 286  then SetWaterLine(WaterLine-2) end
+        if MaxHeight < delayHeight and
+           TurnTimeLeft<(999999999-delayTime) and 
+            MaxHeight > 286 and WaterLine > 286 then
+            if waterAccel ~= 0 then
+                SetWaterLine(WaterLine-(baseWaterSpeed+div(getActualHeight(MaxHeight)*100,waterAccel)))
+            else
+                SetWaterLine(WaterLine-baseWaterSpeed)
+            end
+        end
         if y > 0 and y < 30000 and MaxHeight > 286 and math.random(y) < 500 then
             local s = AddVisualGear(0, 0, vgtStraightShot, 0, true)
             local c = div(250000,y)
@@ -371,7 +397,7 @@
                 end
             end
 
-            if CakeTries < 10 and y < 32600 and y > 3000 and Cake == nil and band(GetState(CurrentHedgehog),gstHHDriven) ~= 0 then 
+            if addCake and CakeTries < 10 and y < 32600 and y > 3000 and Cake == nil and band(GetState(CurrentHedgehog),gstHHDriven) ~= 0 then 
                 -- doing this just after the start the first time to take advantage of randomness sources
                 -- Pick a clear y to start with
                 if y > 31000 then cy = 24585 elseif
Binary file share/hedgewars/Data/Maps/ClimbHome/mask.png has changed