mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using HarmonyLib;
|
|
|
|
namespace EHR.Patches;
|
|
|
|
[HarmonyPatch(typeof(DeconSystem), nameof(DeconSystem.UpdateSystem))]
|
|
public static class DeconSystemUpdateSystemPatch
|
|
{
|
|
public static void Prefix(DeconSystem __instance)
|
|
{
|
|
if (!AmongUsClient.Instance.AmHost || SubmergedCompatibility.IsSubmerged()) return;
|
|
|
|
if (Options.ChangeDecontaminationTime.GetBool())
|
|
{
|
|
bool bedwars = Options.CurrentGameMode == CustomGameMode.BedWars;
|
|
bool roomrush = Options.CurrentGameMode == CustomGameMode.RoomRush;
|
|
|
|
__instance.DoorOpenTime = bedwars
|
|
? 2f
|
|
: Main.CurrentMap switch
|
|
{
|
|
MapNames.MiraHQ => Options.DecontaminationDoorOpenTimeOnMiraHQ.GetFloat(),
|
|
MapNames.Polus => Options.DecontaminationDoorOpenTimeOnPolus.GetFloat(),
|
|
_ => 3f
|
|
};
|
|
|
|
__instance.DeconTime = bedwars || roomrush
|
|
? 0.1f
|
|
: Main.CurrentMap switch
|
|
{
|
|
MapNames.MiraHQ => Options.DecontaminationTimeOnMiraHQ.GetFloat(),
|
|
MapNames.Polus => Options.DecontaminationTimeOnPolus.GetFloat(),
|
|
_ => 3f
|
|
};
|
|
}
|
|
else
|
|
{
|
|
__instance.DoorOpenTime = 3f;
|
|
__instance.DeconTime = 3f;
|
|
}
|
|
}
|
|
} |