From c8010f9d606e68875fa7dacd041eeb9992cddbfc Mon Sep 17 00:00:00 2001 From: Gurge44 Date: Wed, 27 Nov 2024 21:58:53 +0100 Subject: [PATCH] too tired to think about what I just did --- EHR.csproj | 2 +- GameMode/AllInOneGameMode.cs | 105 ++++++++++++++++++++++++++++++- GameMode/HotPotato.cs | 4 +- GameMode/MoveAndStop.cs | 4 +- GameMode/NaturalDisasters.cs | 4 +- GameMode/RoomRush.cs | 11 ++-- GameMode/SpeedrunManager.cs | 4 +- Modules/CustomRoleSelector.cs | 94 +++++++++++++++++++-------- Modules/OptionHolder.cs | 4 +- Modules/OptionItem/OptionItem.cs | 6 +- Patches/PlayerControlPatch.cs | 2 + Patches/TaskAssignPatch.cs | 14 +++++ 12 files changed, 208 insertions(+), 46 deletions(-) diff --git a/EHR.csproj b/EHR.csproj index c7c0a547e..f8944e7e1 100644 --- a/EHR.csproj +++ b/EHR.csproj @@ -7,7 +7,7 @@ EHR Gurge44 preview - C:\Program Files\Epic Games\AmongUs + E:\Program Files\AmongUs true True $(MSBuildProjectName) diff --git a/GameMode/AllInOneGameMode.cs b/GameMode/AllInOneGameMode.cs index 0d9127938..b3f0a1871 100644 --- a/GameMode/AllInOneGameMode.cs +++ b/GameMode/AllInOneGameMode.cs @@ -1,7 +1,9 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using HarmonyLib; +using UnityEngine; namespace EHR { @@ -9,18 +11,117 @@ namespace EHR { public static HashSet Taskers = []; + public static readonly Dictionary GameModeIntegrationSettings = []; + + public static OptionItem HotPotatoTimerMultiplier; + public static OptionItem MoveAndStopMinGreenTimeBonus; + public static OptionItem MoveAndStopMaxGreenTimeBonus; + public static OptionItem NaturalDisastersDisasterSpawnCooldownMultiplier; + public static OptionItem NaturalDisastersWarningDurationMultiplier; + public static OptionItem RoomRushTimeLimitMultiplier; + public static OptionItem RoomRushDontKillLastPlayer; + public static OptionItem RoomRushDontLowerTimeLimitWhenTwoPlayersEnterCorrectRoom; + public static OptionItem RoomRushDontKillPlayersOutsideRoomWhenTimeRunsOut; + public static OptionItem SpeedrunTimeLimitMultiplier; + + public static void SetupCustomOption() + { + var id = 69_217_001; + var color = ColorUtility.TryParseHtmlString("#f542ad", out Color c) ? c : Color.magenta; + const CustomGameMode gameMode = CustomGameMode.AllInOne; + + foreach (CustomGameMode mode in Enum.GetValues()) + { + if (mode is CustomGameMode.Standard or gameMode) continue; + + bool defaultValue = mode is CustomGameMode.HotPotato or CustomGameMode.MoveAndStop or CustomGameMode.NaturalDisasters or CustomGameMode.RoomRush or CustomGameMode.SoloKombat or CustomGameMode.Speedrun; + + GameModeIntegrationSettings[mode] = new BooleanOptionItem(id++, $"AllInOne.{mode}.Integration", defaultValue, TabGroup.GameSettings) + .SetGameMode(gameMode) + .SetColor(color); + } + + HotPotatoTimerMultiplier = new IntegerOptionItem(id++, "AllInOne.HotPotato.TimerMultiplier", new(1, 10, 1), 3, TabGroup.GameSettings) + .SetValueFormat(OptionFormat.Multiplier) + .SetGameMode(gameMode) + .SetColor(color); + + MoveAndStopMinGreenTimeBonus = new IntegerOptionItem(id++, "AllInOne.MoveAndStop.MinGreenTimeBonus", new(0, 60, 1), 5, TabGroup.GameSettings) + .SetValueFormat(OptionFormat.Seconds) + .SetGameMode(gameMode) + .SetColor(color); + + MoveAndStopMaxGreenTimeBonus = new IntegerOptionItem(id++, "AllInOne.MoveAndStop.MaxGreenTimeBonus", new(0, 60, 1), 20, TabGroup.GameSettings) + .SetValueFormat(OptionFormat.Seconds) + .SetGameMode(gameMode) + .SetColor(color); + + NaturalDisastersDisasterSpawnCooldownMultiplier = new IntegerOptionItem(id++, "AllInOne.NaturalDisasters.DisasterSpawnCooldownMultiplier", new(1, 10, 1), 4, TabGroup.GameSettings) + .SetValueFormat(OptionFormat.Multiplier) + .SetGameMode(gameMode) + .SetColor(color); + + NaturalDisastersWarningDurationMultiplier = new IntegerOptionItem(id++, "AllInOne.NaturalDisasters.WarningDurationMultiplier", new(1, 10, 1), 6, TabGroup.GameSettings) + .SetValueFormat(OptionFormat.Multiplier) + .SetGameMode(gameMode) + .SetColor(color); + + RoomRushTimeLimitMultiplier = new IntegerOptionItem(id++, "AllInOne.RoomRush.TimeLimitMultiplier", new(1, 10, 1), 3, TabGroup.GameSettings) + .SetValueFormat(OptionFormat.Multiplier) + .SetGameMode(gameMode) + .SetColor(color); + + RoomRushDontKillLastPlayer = new BooleanOptionItem(id++, "AllInOne.RoomRush.DontKillLastPlayer", true, TabGroup.GameSettings) + .SetGameMode(gameMode) + .SetColor(color); + + RoomRushDontLowerTimeLimitWhenTwoPlayersEnterCorrectRoom = new BooleanOptionItem(id++, "AllInOne.RoomRush.DontLowerTimeLimitWhenTwoPlayersEnterCorrectRoom", true, TabGroup.GameSettings) + .SetGameMode(gameMode) + .SetColor(color); + + RoomRushDontKillPlayersOutsideRoomWhenTimeRunsOut = new BooleanOptionItem(id++, "AllInOne.RoomRush.DontKillPlayersOutsideRoomWhenTimeRunsOut", true, TabGroup.GameSettings) + .SetGameMode(gameMode) + .SetColor(color); + + SpeedrunTimeLimitMultiplier = new IntegerOptionItem(id, "AllInOne.Speedrun.TimeLimitMultiplier", new(1, 10, 1), 3, TabGroup.GameSettings) + .SetValueFormat(OptionFormat.Multiplier) + .SetGameMode(gameMode) + .SetColor(color); + } + public static void Init() { Taskers = []; } + public static CustomGameMode GetPrioritizedGameModeForRoles() + { + Dictionary order = new() + { + { CustomGameMode.HideAndSeek, 0 }, + { CustomGameMode.CaptureTheFlag, 1 }, + { CustomGameMode.FFA, 2 }, + { CustomGameMode.SoloKombat, 3 }, + { CustomGameMode.RoomRush, 4 }, + { CustomGameMode.Speedrun, 5 }, + { CustomGameMode.NaturalDisasters, 6 }, + { CustomGameMode.MoveAndStop, 7 }, + { CustomGameMode.HotPotato, 8 } + }; + + return order.Where(x => x.Key.IsActiveOrIntegrated()).MinBy(x => x.Value).Key; + } + [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.FixedUpdate))] private static class FixedUpdatePatch { [SuppressMessage("ReSharper", "UnusedMember.Local")] public static void Postfix(PlayerControl __instance) { - if (!AmongUsClient.Instance.AmHost || !GameStates.IsInTask || GameStates.IsEnded || !CustomGameMode.AllInOne.IsActiveOrIntegrated() || Main.HasJustStarted || __instance.Is(CustomRoles.Killer)) return; + if (!AmongUsClient.Instance.AmHost || !GameStates.IsInTask || GameStates.IsEnded || !CustomGameMode.AllInOne.IsActiveOrIntegrated() || Main.HasJustStarted || __instance.Is(CustomRoles.Killer) || CustomGameMode.HideAndSeek.IsActiveOrIntegrated()) return; + + var gameModes = Enum.GetValues().Where(x => x.IsActiveOrIntegrated()).Split(x => x is CustomGameMode.CaptureTheFlag or CustomGameMode.FFA or CustomGameMode.SoloKombat); + if (gameModes.TrueList.Count == 0 || gameModes.FalseList.Count == 0) return; bool doneWithTasks = Taskers.Contains(__instance.PlayerId) && __instance.GetTaskState().IsTaskFinished; diff --git a/GameMode/HotPotato.cs b/GameMode/HotPotato.cs index 02d7819c4..921e30acf 100644 --- a/GameMode/HotPotato.cs +++ b/GameMode/HotPotato.cs @@ -138,7 +138,9 @@ namespace EHR if (resetTime) { int time = Time.GetInt(); - HotPotatoState.TimeLeft = Options.CurrentGameMode == CustomGameMode.AllInOne ? time * 3 : time; + if (Options.CurrentGameMode == CustomGameMode.AllInOne) time *= AllInOneGameMode.HotPotatoTimerMultiplier.GetInt(); + + HotPotatoState.TimeLeft = time; HotPotatoState.RoundNum++; } diff --git a/GameMode/MoveAndStop.cs b/GameMode/MoveAndStop.cs index 0cb895225..0e7546d51 100644 --- a/GameMode/MoveAndStop.cs +++ b/GameMode/MoveAndStop.cs @@ -166,7 +166,7 @@ namespace EHR MapNames.Airship => ExtraGreenTimeOnAirhip.GetInt(), MapNames.Fungle => ExtraGreenTimeOnFungle.GetInt(), _ => 0 - } + (Options.CurrentGameMode == CustomGameMode.AllInOne ? IRandom.Instance.Next(10, 40) : 0); + } + (Options.CurrentGameMode == CustomGameMode.AllInOne ? IRandom.Instance.Next(AllInOneGameMode.MoveAndStopMinGreenTimeBonus.GetInt(), AllInOneGameMode.MoveAndStopMaxGreenTimeBonus.GetInt() + 1) : 0); private static IntegerValueRule CounterValueRule => new(1, 100, 1); private static IntegerValueRule ExtraTimeValue => new(0, 50, 1); @@ -177,7 +177,7 @@ namespace EHR private static int StartingGreenTime(PlayerControl pc) { - if (Options.CurrentGameMode == CustomGameMode.AllInOne) return 80; + if (Options.CurrentGameMode == CustomGameMode.AllInOne) return 60; bool tutorial = EnableTutorial.GetBool() && !HasPlayed.Contains(pc.FriendCode); return Main.CurrentMap == MapNames.Airship ? tutorial ? 57 : 47 : tutorial ? 47 : 37; } diff --git a/GameMode/NaturalDisasters.cs b/GameMode/NaturalDisasters.cs index 838dce069..aae43073c 100644 --- a/GameMode/NaturalDisasters.cs +++ b/GameMode/NaturalDisasters.cs @@ -255,7 +255,7 @@ namespace EHR long now = Utils.TimeStamp; int frequency = DisasterFrequency.GetInt(); - if (Options.CurrentGameMode == CustomGameMode.AllInOne) frequency *= 5; + if (Options.CurrentGameMode == CustomGameMode.AllInOne) frequency *= AllInOneGameMode.NaturalDisastersDisasterSpawnCooldownMultiplier.GetInt(); if (now - LastDisaster >= frequency) { @@ -277,7 +277,7 @@ namespace EHR SystemTypes? room = disaster.Name == "BuildingCollapse" ? roomKvp.Key : null; float warningTime = DisasterWarningTime.GetFloat(); - if (Options.CurrentGameMode == CustomGameMode.AllInOne) warningTime *= 6; + if (Options.CurrentGameMode == CustomGameMode.AllInOne) warningTime *= AllInOneGameMode.NaturalDisastersWarningDurationMultiplier.GetInt(); PreparingDisasters.Add(new(position, warningTime, Sprite(disaster.Name), disaster.Name, room)); } diff --git a/GameMode/RoomRush.cs b/GameMode/RoomRush.cs index c1c3973fe..d4699ed82 100644 --- a/GameMode/RoomRush.cs +++ b/GameMode/RoomRush.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using AmongUs.GameOptions; -using Beebyte.Obfuscator; using EHR.Modules; using HarmonyLib; using Hazel; @@ -231,7 +230,7 @@ namespace EHR aapc.Do(x => x.Notify(time.ToString())); yield return new WaitForSeconds(1f); } - + Skip: if (ventLimit > 0) aapc.Do(x => x.RpcChangeRoleBasis(CustomRoles.EngineerEHR)); @@ -295,7 +294,7 @@ namespace EHR } TimeLeft = Math.Max((int)Math.Round(time * GlobalTimeMultiplier.GetFloat()), 4); - if (Options.CurrentGameMode == CustomGameMode.AllInOne) TimeLeft *= 3; + if (Options.CurrentGameMode == CustomGameMode.AllInOne) TimeLeft *= AllInOneGameMode.RoomRushTimeLimitMultiplier.GetInt(); Logger.Info($"Starting a new round - Goal = from: {Translator.GetString(previous.ToString())}, to: {Translator.GetString(RoomGoal.ToString())} - Time: {TimeLeft} ({Main.CurrentMap})", "RoomRush"); Main.AllPlayerControls.Do(x => LocateArrow.RemoveAllTarget(x.PlayerId)); if (DisplayArrowToRoom.GetBool()) Main.AllPlayerControls.Do(x => LocateArrow.Add(x.PlayerId, goalPos)); @@ -384,7 +383,7 @@ namespace EHR int timeLeft = TimeWhenFirstPlayerEntersRoom.GetInt(); - if (DonePlayers.Count == 2 && timeLeft < TimeLeft && notAllInOne) + if (DonePlayers.Count == 2 && timeLeft < TimeLeft && (notAllInOne || !AllInOneGameMode.RoomRushDontLowerTimeLimitWhenTwoPlayersEnterCorrectRoom.GetBool())) { Logger.Info($"Two players entered the correct room, setting the timer to {timeLeft}", "RoomRush"); TimeLeft = timeLeft; @@ -394,7 +393,7 @@ namespace EHR Achievements.Type.WheresTheBlueShell.CompleteAfterGameEnd(); } - if (DonePlayers.Count == aapc.Length - 1 && notAllInOne) + if (DonePlayers.Count == aapc.Length - 1 && (notAllInOne || !AllInOneGameMode.RoomRushDontKillLastPlayer.GetBool())) { PlayerControl last = aapc.First(x => !DonePlayers.Contains(x.PlayerId)); Logger.Info($"All players entered the correct room except one, killing the last player ({last.GetRealName()})", "RoomRush"); @@ -404,7 +403,7 @@ namespace EHR return; } } - else if ((room == null || room.RoomId != RoomGoal) && notAllInOne) + else if ((room == null || room.RoomId != RoomGoal) && (notAllInOne || !AllInOneGameMode.RoomRushDontKillPlayersOutsideRoomWhenTimeRunsOut.GetBool())) DonePlayers.Remove(pc.PlayerId); } diff --git a/GameMode/SpeedrunManager.cs b/GameMode/SpeedrunManager.cs index 3bd6641fb..15c9cd733 100644 --- a/GameMode/SpeedrunManager.cs +++ b/GameMode/SpeedrunManager.cs @@ -57,7 +57,7 @@ namespace EHR public static void ResetTimer(PlayerControl pc) { int timer = TimeLimit.GetInt(); - if (Options.CurrentGameMode == CustomGameMode.AllInOne) timer *= 3; + if (Options.CurrentGameMode == CustomGameMode.AllInOne) timer *= AllInOneGameMode.SpeedrunTimeLimitMultiplier.GetInt(); if (TimeStacksUp.GetBool()) Timers[pc.PlayerId] += timer; @@ -73,7 +73,7 @@ namespace EHR CanKill.Add(pc.PlayerId); Main.AllPlayerKillCooldown[pc.PlayerId] = KillCooldown.GetInt(); - pc.RpcChangeRoleBasis(CustomRoles.Runner); + pc.RpcChangeRoleBasis(Options.CurrentGameMode == CustomGameMode.AllInOne ? CustomRoles.Killer : CustomRoles.Runner); pc.Notify(Translator.GetString("Speedrun_CompletedTasks")); pc.SyncSettings(); pc.SetKillCooldown(KillCooldown.GetInt()); diff --git a/Modules/CustomRoleSelector.cs b/Modules/CustomRoleSelector.cs index 7084e1256..afc183375 100644 --- a/Modules/CustomRoleSelector.cs +++ b/Modules/CustomRoleSelector.cs @@ -34,37 +34,79 @@ namespace EHR.Modules if (Main.GM.Value && Main.AllPlayerControls.Length == 1) return; - switch (Options.CurrentGameMode) + // switch (Options.CurrentGameMode) + // { + // case CustomGameMode.SoloKombat: + // AssignRoleToEveryone(CustomRoles.KB_Normal); + // return; + // case CustomGameMode.FFA: + // AssignRoleToEveryone(CustomRoles.Killer); + // return; + // case CustomGameMode.MoveAndStop: + // AssignRoleToEveryone(CustomRoles.Tasker); + // return; + // case CustomGameMode.HotPotato: + // AssignRoleToEveryone(CustomRoles.Potato); + // return; + // case CustomGameMode.Speedrun: + // AssignRoleToEveryone(CustomRoles.Runner); + // return; + // case CustomGameMode.CaptureTheFlag: + // AssignRoleToEveryone(CustomRoles.CTFPlayer); + // return; + // case CustomGameMode.NaturalDisasters: + // AssignRoleToEveryone(CustomRoles.NDPlayer); + // return; + // case CustomGameMode.RoomRush: + // AssignRoleToEveryone(CustomRoles.RRPlayer); + // return; + // case CustomGameMode.HideAndSeek: + // HnSManager.AssignRoles(); + // RoleResult = HnSManager.PlayerRoles.ToDictionary(x => x.Key, x => x.Value.Role); + // return; + // } + + if (Options.CurrentGameMode != CustomGameMode.Standard) { - case CustomGameMode.SoloKombat: - AssignRoleToEveryone(CustomRoles.KB_Normal); + Dictionary gameModeRoles = new() + { + { CustomGameMode.SoloKombat, CustomRoles.KB_Normal }, + { CustomGameMode.FFA, CustomRoles.Killer }, + { CustomGameMode.MoveAndStop, CustomRoles.Tasker }, + { CustomGameMode.HotPotato, CustomRoles.Potato }, + { CustomGameMode.Speedrun, CustomRoles.Runner }, + { CustomGameMode.CaptureTheFlag, CustomRoles.CTFPlayer }, + { CustomGameMode.NaturalDisasters, CustomRoles.NDPlayer }, + { CustomGameMode.RoomRush, CustomRoles.RRPlayer } + }; + + if (gameModeRoles.TryGetValue(Options.CurrentGameMode, out var role)) + { + AssignRoleToEveryone(role); return; - case CustomGameMode.FFA: - AssignRoleToEveryone(CustomRoles.Killer); - return; - case CustomGameMode.AllInOne: - case CustomGameMode.MoveAndStop: - AssignRoleToEveryone(CustomRoles.Tasker); - return; - case CustomGameMode.HotPotato: - AssignRoleToEveryone(CustomRoles.Potato); - return; - case CustomGameMode.Speedrun: - AssignRoleToEveryone(CustomRoles.Runner); - return; - case CustomGameMode.CaptureTheFlag: - AssignRoleToEveryone(CustomRoles.CTFPlayer); - return; - case CustomGameMode.NaturalDisasters: - AssignRoleToEveryone(CustomRoles.NDPlayer); - return; - case CustomGameMode.RoomRush: - AssignRoleToEveryone(CustomRoles.RRPlayer); - return; - case CustomGameMode.HideAndSeek: + } + + bool hns = Options.CurrentGameMode == CustomGameMode.HideAndSeek; + + if (Options.CurrentGameMode == CustomGameMode.AllInOne) + { + var prioritizedGameMode = AllInOneGameMode.GetPrioritizedGameModeForRoles(); + + if (gameModeRoles.TryGetValue(prioritizedGameMode, out var allInOneRole)) + { + AssignRoleToEveryone(allInOneRole); + return; + } + + hns = prioritizedGameMode == CustomGameMode.HideAndSeek; + } + + if (hns) + { HnSManager.AssignRoles(); RoleResult = HnSManager.PlayerRoles.ToDictionary(x => x.Key, x => x.Value.Role); return; + } } var rd = IRandom.Instance; diff --git a/Modules/OptionHolder.cs b/Modules/OptionHolder.cs index c245c2b10..160d4c659 100644 --- a/Modules/OptionHolder.cs +++ b/Modules/OptionHolder.cs @@ -811,7 +811,7 @@ namespace EHR _ => CustomGameMode.Standard }; - public static bool IsActiveOrIntegrated(this CustomGameMode customGameMode) => CurrentGameMode == customGameMode || (CurrentGameMode == CustomGameMode.AllInOne && customGameMode is not CustomGameMode.FFA and not CustomGameMode.CaptureTheFlag and not CustomGameMode.HideAndSeek and not CustomGameMode.Standard and not CustomGameMode.AllInOne); + public static bool IsActiveOrIntegrated(this CustomGameMode customGameMode) => CurrentGameMode == customGameMode || (CurrentGameMode == CustomGameMode.AllInOne && AllInOneGameMode.GameModeIntegrationSettings.TryGetValue(customGameMode, out var option) && option.GetBool()); [HarmonyPatch(typeof(TranslationController), nameof(TranslationController.Initialize))] [HarmonyPostfix] @@ -1363,6 +1363,8 @@ namespace EHR MainLoadingText = "Building Settings for Other Gamemodes"; + AllInOneGameMode.SetupCustomOption(); + // SoloKombat SoloKombatManager.SetupCustomOption(); // FFA diff --git a/Modules/OptionItem/OptionItem.cs b/Modules/OptionItem/OptionItem.cs index 7fef11ff1..8953e817b 100644 --- a/Modules/OptionItem/OptionItem.cs +++ b/Modules/OptionItem/OptionItem.cs @@ -212,7 +212,7 @@ namespace EHR public bool IsCurrentlyHidden() { var mode = EHR.Options.CurrentGameMode; - return CheckHidden() || (GameMode != CustomGameMode.All && GameMode != mode && !(mode == CustomGameMode.AllInOne && GameMode is CustomGameMode.SoloKombat or CustomGameMode.MoveAndStop or CustomGameMode.HotPotato or CustomGameMode.Speedrun or CustomGameMode.NaturalDisasters or CustomGameMode.RoomRush)); + return CheckHidden() || (GameMode != CustomGameMode.All && GameMode != mode && !(mode == CustomGameMode.AllInOne && AllInOneGameMode.GameModeIntegrationSettings.TryGetValue(GameMode, out var option) && option.GetBool())); } private bool CheckHidden() @@ -234,7 +234,7 @@ namespace EHR return string.Format(Translator.GetString("Format." + ValueFormat), value); } - protected void Refresh() + private void Refresh() { if (OptionBehaviour is StringOption opt) { @@ -334,7 +334,7 @@ namespace EHR private static readonly List Options = new(1024); public static IReadOnlyDictionary FastOptions => FastOpts; private static readonly Dictionary FastOpts = new(1024); - public static int CurrentPreset { get; set; } + public static int CurrentPreset { get; private set; } #endregion } diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index 8112dee72..4d5a7c56f 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -211,9 +211,11 @@ namespace EHR switch (Options.CurrentGameMode) { + case CustomGameMode.AllInOne when CustomGameMode.SoloKombat.IsActiveOrIntegrated() && !killer.Is(CustomRoles.Killer): case CustomGameMode.SoloKombat: SoloKombatManager.OnPlayerAttack(killer, target); return false; + case CustomGameMode.AllInOne when CustomGameMode.FFA.IsActiveOrIntegrated() && killer.Is(CustomRoles.Killer): case CustomGameMode.FFA: FFAManager.OnPlayerAttack(killer, target); return false; diff --git a/Patches/TaskAssignPatch.cs b/Patches/TaskAssignPatch.cs index dccacbeb9..f1b0a109b 100644 --- a/Patches/TaskAssignPatch.cs +++ b/Patches/TaskAssignPatch.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using AmongUs.GameOptions; using EHR.AddOns.Crewmate; using EHR.AddOns.GhostRoles; @@ -255,6 +256,19 @@ namespace EHR // Convert list of tasks to array (Il2CppStructArray) taskTypeIds = new(TasksList.Count); for (var i = 0; i < TasksList.Count; i++) taskTypeIds[i] = TasksList[i]; + + + Il2CppSystem.Text.StringBuilder sb = new(); + + foreach (TaskTypes taskType in usedTaskTypes) + { + GetTaskFromTaskType(taskType).AppendTaskText(sb); + } + + Logger.Info($" Assigned tasks:\n{sb.Replace("\r\n", "\n")}", pc.GetRealName(), multiLine: true); + return; + + PlayerTask GetTaskFromTaskType(TaskTypes type) => ShortTasks.ToArray().Concat(LongTasks.ToArray()).FirstOrDefault(t => t.TaskType == type); } private static void Shuffle(Il2CppSystem.Collections.Generic.List list)