diff --git a/project/Aki.SinglePlayer/Patches/ScavMode/ScavLateStartPatch.cs b/project/Aki.SinglePlayer/Patches/ScavMode/ScavLateStartPatch.cs index cb6920b..79d9a8d 100644 --- a/project/Aki.SinglePlayer/Patches/ScavMode/ScavLateStartPatch.cs +++ b/project/Aki.SinglePlayer/Patches/ScavMode/ScavLateStartPatch.cs @@ -62,6 +62,7 @@ namespace Aki.SinglePlayer.Patches.ScavMode var serverResult = Json.Deserialize(json); // Set new raid time + Utils.ScavMode.ScavRaidChangesUtil.SetRaidTimeReduction(____raidSettings.SelectedLocation.EscapeTimeLimit - serverResult.RaidTimeMinutes); ____raidSettings.SelectedLocation.EscapeTimeLimit = serverResult.RaidTimeMinutes; // Handle survival time changes diff --git a/project/Aki.SinglePlayer/Utils/ScavMode/ScavRaidChangesUtil.cs b/project/Aki.SinglePlayer/Utils/ScavMode/ScavRaidChangesUtil.cs new file mode 100644 index 0000000..5bc5e32 --- /dev/null +++ b/project/Aki.SinglePlayer/Utils/ScavMode/ScavRaidChangesUtil.cs @@ -0,0 +1,29 @@ +namespace Aki.SinglePlayer.Utils.ScavMode +{ + /// + /// Allow mods to access changes made to map settings for Scav raids + /// + public static class ScavRaidChangesUtil + { + /// + /// The reduction in the escape time for the most recently loaded map, in minutes + /// + public static int RaidTimeReductionMinutes { get; private set; } = 0; + + /// + /// The reduction in the escape time for the most recently loaded map, in seconds + /// + public static int RaidTimeReductionSeconds => RaidTimeReductionMinutes * 60; + + /// + /// Updates the most recent raid-time reduction so it can be accessed by mods. + /// + /// This should be internal because mods shouldn't be able to call it. + /// + /// The raid-time reduction applied to the most recent Scav raid, in minutes + internal static void SetRaidTimeReduction(int raidTimeReduction) + { + RaidTimeReductionMinutes = raidTimeReduction; + } + } +}