Skip to content

Commit

Permalink
set up map scale factor system
Browse files Browse the repository at this point in the history
will be used to scale stuff in heists individually
stuff like spawnrates spawncap etc (i mean anything i want, really)
  • Loading branch information
nikitawastaken committed Jul 3, 2024
1 parent 9648d96 commit 9f53388
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lua/groupaistatebase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ end)
function GroupAIStateBase:register_marking_sentry(unit)
if unit:base().sentry_gun and unit:base():has_marking() then
self._marking_sentries[unit:key()] = unit
EclipseDebug:log(1, "Marking sentry set!")
Eclipse:log(1, "Marking sentry set!")
end
end

Expand Down
25 changes: 25 additions & 0 deletions lua/groupaitweakdata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,31 @@ Hooks:PostHook(GroupAITweakData, "_init_task_data", "eclipse__init_task_data", f
-- difficulty scaling
local f = ((difficulty_index ^ 2) / (difficulty_index * 3))
local is_pro = Global.game_settings and Global.game_settings.one_down
local map_scale_factor = 1

for _, sd in pairs(Eclipse.severely_decreased_scaling_heists) do
if job == vl then
map_scale_factor = 0.5
end
end

for _, d in pairs(Eclipse.decreased_scaling_heists) do
if job == l then
map_scale_factor = 0.75
end
end

for _, i in pairs(Eclipse.increased_scaling_heists) do
if job == t then
map_scale_factor = 1.25
end
end

for _, si in pairs(Eclipse.severely_increased_scaling_heists) do
if job == vt then
map_scale_factor = 1.5
end
end

-- Assault Data
-- AI Tickrate
Expand Down
15 changes: 11 additions & 4 deletions mod.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
if not EclipseDebug then
EclipseDebug = {}
if not Eclipse then

Eclipse = {
severely_decreased_scaling_heists = {},
decreased_scaling_heists = {},
increased_scaling_heists = {},
severely_increased_scaling_heists = {},
}

local log_levels = {
"Debug",
"Warning",
"Error"
}

function EclipseDebug:log(level, message)
function Eclipse:log(level, message)
assert(0 < level and level < 4, "Eclipse log level must be between 1-3.")
assert(message ~= nil, "Eclipse empty log message.")

log(string.format("Eclipse %s: %s", log_levels[level], message))
end

function EclipseDebug:log_chat(message)
function Eclipse:log_chat(message)
managers.chat:_receive_message(managers.chat.GAME, "Eclipse", message, Color.green)
end
end
Expand Down

0 comments on commit 9f53388

Please sign in to comment.