Skip to content

Commit

Permalink
Revert rounding tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Oct 25, 2024
1 parent a5331fd commit e1c8367
Show file tree
Hide file tree
Showing 31 changed files with 220 additions and 220 deletions.
4 changes: 2 additions & 2 deletions games/doom/factory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9577,8 +9577,8 @@ function DOOM.factory_setup()
error("Prefab not a multiple of four: " .. tostring(P.name))
end

P.long = math.round(f_long / 4)
P.deep = math.round(f_deep / 4)
P.long = math.floor(f_long / 4)
P.deep = math.floor(f_deep / 4)
else
error("Unsupported scale " .. tostring(P.scale) .. " in prefab: " .. tostring(P.name))
end
Expand Down
4 changes: 2 additions & 2 deletions games/doom/x_doom1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10595,8 +10595,8 @@ function ULTDOOM.factory_setup()
error("Prefab not a multiple of four: " .. tostring(P.name))
end

P.long = math.round(f_long / 4)
P.deep = math.round(f_deep / 4)
P.long = math.floor(f_long / 4)
P.deep = math.floor(f_deep / 4)
else
error("Unsupported scale " .. tostring(P.scale) .. " in prefab: " .. tostring(P.name))
end
Expand Down
4 changes: 2 additions & 2 deletions games/heretic/factory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6004,8 +6004,8 @@ function HERETIC.factory_setup()
error("Prefab not a multiple of four: " .. tostring(P.name))
end

P.long = math.round(f_long / 4)
P.deep = math.round(f_deep / 4)
P.long = math.floor(f_long / 4)
P.deep = math.floor(f_deep / 4)
else
error("Unsupported scale " .. tostring(P.scale) .. " in prefab: " .. tostring(P.name))
end
Expand Down
8 changes: 4 additions & 4 deletions games/noah/factory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5171,7 +5171,7 @@ function NOAH.get_factory_levels(episode)
end
end

ob_size = math.clamp(low, math.round(rand.irange(low, high) * result_skew), high)
ob_size = math.clamp(low, math.floor(rand.irange(low, high) * result_skew), high)
goto foundsize
end

Expand Down Expand Up @@ -5209,7 +5209,7 @@ function NOAH.get_factory_levels(episode)
local def_large = PARAM.float_level_upper_bound_wolf_3d - def_small or 42

-- this basically ramps up
ob_size = math.round(def_small + along * def_large)
ob_size = math.floor(def_small + along * def_large)
end

::foundsize::
Expand Down Expand Up @@ -5364,8 +5364,8 @@ function NOAH.factory_setup()
error("Prefab not a multiple of four: " .. tostring(P.name))
end

P.long = math.round(f_long / 4)
P.deep = math.round(f_deep / 4)
P.long = math.floor(f_long / 4)
P.deep = math.floor(f_deep / 4)
else
error("Unsupported scale " .. tostring(P.scale) .. " in prefab: " .. tostring(P.name))
end
Expand Down
8 changes: 4 additions & 4 deletions games/obc/factory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5128,7 +5128,7 @@ function OBC.get_factory_levels(episode)
end
end

ob_size = math.clamp(low, math.round(rand.irange(low, high) * result_skew), high)
ob_size = math.clamp(low, math.floor(rand.irange(low, high) * result_skew), high)
goto foundsize
end

Expand Down Expand Up @@ -5166,7 +5166,7 @@ function OBC.get_factory_levels(episode)
local def_large = PARAM.float_level_upper_bound_wolf_3d - def_small or 42

-- this basically ramps up
ob_size = math.round(def_small + along * def_large)
ob_size = math.floor(def_small + along * def_large)
end

::foundsize::
Expand Down Expand Up @@ -5321,8 +5321,8 @@ function OBC.factory_setup()
error("Prefab not a multiple of four: " .. tostring(P.name))
end

P.long = math.round(f_long / 4)
P.deep = math.round(f_deep / 4)
P.long = math.floor(f_long / 4)
P.deep = math.floor(f_deep / 4)
else
error("Unsupported scale " .. tostring(P.scale) .. " in prefab: " .. tostring(P.name))
end
Expand Down
8 changes: 4 additions & 4 deletions games/wolf/factory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5580,7 +5580,7 @@ function WOLF.get_factory_levels(episode)
end
end

ob_size = math.clamp(low, math.round(rand.irange(low, high) * result_skew), high)
ob_size = math.clamp(low, math.floor(rand.irange(low, high) * result_skew), high)
goto foundsize
end

Expand Down Expand Up @@ -5618,7 +5618,7 @@ function WOLF.get_factory_levels(episode)
local def_large = PARAM.float_level_upper_bound_wolf_3d - def_small or 42

-- this basically ramps up
ob_size = math.round(def_small + along * def_large)
ob_size = math.floor(def_small + along * def_large)
end

::foundsize::
Expand Down Expand Up @@ -5773,8 +5773,8 @@ function WOLF.factory_setup()
error("Prefab not a multiple of four: " .. tostring(P.name))
end

P.long = math.round(f_long / 4)
P.deep = math.round(f_deep / 4)
P.long = math.floor(f_long / 4)
P.deep = math.floor(f_deep / 4)
else
error("Unsupported scale " .. tostring(P.scale) .. " in prefab: " .. tostring(P.name))
end
Expand Down
4 changes: 2 additions & 2 deletions games/wolf/x_spear.lua
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function SPEAR.get_factory_levels(episode)
end
end

ob_size = math.clamp(low, math.round(rand.irange(low, high) * result_skew), high)
ob_size = math.clamp(low, math.floor(rand.irange(low, high) * result_skew), high)
goto foundsize
end

Expand Down Expand Up @@ -344,7 +344,7 @@ function SPEAR.get_factory_levels(episode)
local def_large = PARAM.float_level_upper_bound_wolf_3d - def_small or 42

-- this basically ramps up
ob_size = math.round(def_small + along * def_large)
ob_size = math.floor(def_small + along * def_large)
end

::foundsize::
Expand Down
2 changes: 1 addition & 1 deletion modules/export_map.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function EXPORT_MAP.add_entity(ent, model)
end

if origin then
export_printf("\"origin\" \"%d %d %d\"\n", math.round(origin.x) or 0, math.round(origin.y) or 0, math.round(origin.z) or 0)
export_printf("\"origin\" \"%d %d %d\"\n", math.floor(origin.x) or 0, math.floor(origin.y) or 0, math.floor(origin.z) or 0)
end

if light then
Expand Down
4 changes: 2 additions & 2 deletions modules/modded_game_extras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ function MODDED_GAME_EXTRAS.create_hn_info(self, LEVEL)
end

if R.lev_along and not R.is_start and #LEVEL.rooms > 2 then
goal_string = goal_string .. " (" .. math.round(R.lev_along * 100) .. "%%)"
goal_string = goal_string .. " (" .. math.floor(R.lev_along * 100) .. "%%)"
end

return goal_string
Expand Down Expand Up @@ -2028,7 +2028,7 @@ function MODDED_GAME_EXTRAS.generate_hn_decorate()
local thing_chunk = MODDED_GAME_EXTRAS.HELLSCAPE_NAVIGATOR_TEMPLATE.COPIES
thing_chunk = string.gsub(thing_chunk, "NUMNUMNUM", editor_num)
thing_chunk = string.gsub(thing_chunk, "NAMENAMENAME", name)
thing_chunk = string.gsub(thing_chunk, "SIZESIZESIZE", math.round(radius))
thing_chunk = string.gsub(thing_chunk, "SIZESIZESIZE", math.floor(radius))

decorate_string = decorate_string .. thing_chunk
end
Expand Down
6 changes: 3 additions & 3 deletions modules/procedural_gotcha_zdoom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ function PROCEDURAL_GOTCHA_FINE_TUNE_ZDOOM.grab_random_trait(btype, etraits)
if einfo == info.name then
stack = stack + 1
if PARAM.boss_gen_tmult < 0 then
tprob = math.round(tprob * 0.25)
tprob = math.floor(tprob * 0.25)
elseif PARAM.boss_gen_tmult > 1 then
tprob = tprob * 2
end
Expand Down Expand Up @@ -1632,15 +1632,15 @@ function PROCEDURAL_GOTCHA_FINE_TUNE_ZDOOM.all_done()
else mult=1.0 end
end

hpcalc = math.round(rand.pick({5000,5200,5400,5600,5800,6000})*mult*PARAM.float_boss_gen_mult)
hpcalc = math.floor(rand.pick({5000,5200,5400,5600,5800,6000})*mult*PARAM.float_boss_gen_mult)

if batk == "hitscan" and PARAM.boss_gen_dmult<3.0 then hpcalc = hpcalc*0.75 end

bhealth = PROCEDURAL_GOTCHA_FINE_TUNE_ZDOOM.syntaxize(bhealth,hpcalc)

local sumcalc

sumcalc = math.round(rand.pick({400,450,500,550,600})*PARAM.boss_gen_rmult)
sumcalc = math.floor(rand.pick({400,450,500,550,600})*PARAM.boss_gen_rmult)
bsummon = PROCEDURAL_GOTCHA_FINE_TUNE_ZDOOM.syntaxize(bsummon,sumcalc)

end
Expand Down
8 changes: 4 additions & 4 deletions modules/zdoom_otex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -805,12 +805,12 @@ function OTEX_PROC_MODULE.synthesize_procedural_themes()
end
local scenic_fence_tab = table.copy(OTEX_SPECIAL_RESOURCES.rail_scenic_fences)
for fence,prob in pairs(scenic_fence_tab.tech) do
GAME.THEMES.tech.scenic_fences[fence] = math.round(prob * 0.75)
GAME.THEMES.urban.scenic_fences[fence] = math.round(prob * 0.75)
GAME.THEMES.tech.scenic_fences[fence] = math.floor(prob * 0.75)
GAME.THEMES.urban.scenic_fences[fence] = math.floor(prob * 0.75)
end
for fence,prob in pairs(scenic_fence_tab.gothic) do
GAME.THEMES.hell.scenic_fences[fence] = math.round(prob * 0.75)
GAME.THEMES.urban.scenic_fences[fence] = math.round(prob * 0.75)
GAME.THEMES.hell.scenic_fences[fence] = math.floor(prob * 0.75)
GAME.THEMES.urban.scenic_fences[fence] = math.floor(prob * 0.75)
end

-- create liquid attachments
Expand Down
Loading

0 comments on commit e1c8367

Please sign in to comment.