# HG changeset patch # User nemo # Date 1544973936 18000 # Node ID 99117df5a3d3b32052df5240a5256a6ae7861f35 # Parent 98ef2913ec738e2370383343310f54d20d8b93aa fix DiagonalMaze after the drawing scaling change, add some params since ginormous maze is kinda entertaining diff -r 98ef2913ec73 -r 99117df5a3d3 share/hedgewars/Data/Scripts/Multiplayer/DiagonalMaze.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/DiagonalMaze.lua Sun Dec 16 00:12:29 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/DiagonalMaze.lua Sun Dec 16 10:25:36 2018 -0500 @@ -1,13 +1,38 @@ +HedgewarsScriptLoad("/Scripts/Params.lua") +local overrideFeatureSize = true +local mazeScale = 0 function onPreviewInit() onGameInit() end +function onParameters() + parseParams() + if params["scalemap"] ~= nil then + overrideFeatureSize = false + end + if params["mazescale"] ~= nil then + mazeScale = tonumber(params["mazescale"]) + end +end + + function onGameInit() + local step + local width + MapGen = mgDrawn TemplateFilter = 0 - local step = 80 + 10 * MapFeatureSize - local width = 1 + div(math.max(0, MapFeatureSize-12), 6) + + if mazeScale > 0 then + step = 80 + 10 * mazeScale + width = 1 + div(math.max(0, mazeScale-12), 6) + else + step = 80 + 10 * MapFeatureSize + width = 1 + div(math.max(0, MapFeatureSize-12), 6) + end + -- reset feature size after use, to disable scaling + if overrideFeatureSize then MapFeatureSize = 12 end -- center maze local xoff = div((4000 % step), 2) for y = 48,2048,step do