]> git.deb.at Git - rhonda/theotherroles.git/commitdiff
Update 4.3.1
authorgendelo3 <gendelo3@gmail.com>
Fri, 31 Mar 2023 13:38:25 +0000 (15:38 +0200)
committergendelo3 <gendelo3@gmail.com>
Fri, 31 Mar 2023 13:38:25 +0000 (15:38 +0200)
22 files changed:
.github/workflows/build.yml
README.md
TheOtherRoles/Buttons.cs
TheOtherRoles/CustomGameModes/HideNSeekGM.cs
TheOtherRoles/CustomOptionHolder.cs
TheOtherRoles/Helpers.cs
TheOtherRoles/Main.cs
TheOtherRoles/Modules/CustomOptions.cs
TheOtherRoles/Patches/EndGamePatch.cs
TheOtherRoles/Patches/ExileControllerPatch.cs
TheOtherRoles/Patches/IntroPatch.cs
TheOtherRoles/Patches/MapBehaviourPatch.cs
TheOtherRoles/Patches/MeetingPatch.cs
TheOtherRoles/Patches/PlayerControlPatch.cs
TheOtherRoles/Patches/RoleAssignmentPatch.cs
TheOtherRoles/Patches/UpdatePatch.cs
TheOtherRoles/Patches/UsablesPatch.cs
TheOtherRoles/RPC.cs
TheOtherRoles/TheOtherRoles.cs
TheOtherRoles/TheOtherRoles.csproj
TheOtherRoles/Utilities/EventUtility.cs
TheOtherRoles/packages.lock.json

index 6ef5f68bd8557e6b329169d62b24969701178eb1..bd61d4954db0037667ed14cac244b26ab5fed276 100644 (file)
@@ -36,3 +36,4 @@ jobs:
         with:
           name: TheOtherRoles.dll
           path: TheOtherRoles/bin/Release/net6.0/TheOtherRoles.dll
+
index cdfd156452c33ffce5dcb4e90c30b9d9c6be3410..5b3507b6934cd9b7ee29876d60c557b397a602d3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -42,7 +42,8 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
 # Releases
 | Among Us - Version| Mod Version | Link |
 |----------|-------------|-----------------|
-| 2023.2.28s| v4.3.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v4.3.0/TheOtherRoles.zip)
+| 2023.03.28s| v4.3.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v4.3.1/TheOtherRoles.zip)
+| 2023.02.28s| v4.3.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v4.3.0/TheOtherRoles.zip)
 | 2022.12.14s| v4.2.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v4.2.1/TheOtherRoles.zip)
 <details>
   <summary>Click to show older versions</summary>
@@ -121,6 +122,20 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
 <details>
   <summary>Click to show the Changelog</summary>
 
+**Version 4.3.1**
+- Update to Among Us 2023.3.28
+- Added new options (Information mode - Chat/Map/Both, Roles - Evil Killing / Evil)  to the snitch and fixed bugs affecting the snitch
+- Changed the maximum amount per modifier to 15 (where applicable)
+- Changed the colorblind text and player name to be behind certain objects again (rock on Polus etc.)
+- Fixed a bug where a sidekicked bomber would not lose the bomber role
+- Fixed a bug where enabled vanilla roles would be assigned even if "block vanilla roles" was turned on
+- Fixed several Bugs in both Hide N Seek modes (should be playable again)
+- Fixed a bug where Trickster JackInTheBoxes could sometimes not be used if they were placed behind objects
+- Fixed a bug where the cosmetics of an invisible Ninja became visible when the camouflage ended
+- Fixed a bug where the mini would show a "jump" in age at the end of a meeting due to the time spent in cutscenes
+- Fixed a bug where the mayor would always have the mobile emergency button, no matter which setting was selected 
+
+
 **Version 4.3.0**
 - Updated to Among Us version 2023.2.28
 - Added a new role: [Bomber](#bomber)
@@ -1597,6 +1612,8 @@ When the Snitch only has a configurable amount of tasks left, it will be reveale
 |----------|:-------------:|
 | Snitch Spawn Chance | -
 | Task Count Where The Snitch Will Be Revealed | -
+| Information Mode  | Whether the snitch will get info on the map and/or in the chat 
+| Targets | Snitch Will See All Evil Players or Killing Evil Players
 -----------------------
 
 ## Spy
index 41e73b45b2c6e70697d5634fd13f0ccf5474bfa6..72cc7a8a7e293a89cec235ec7778750667f6ed4a 100644 (file)
@@ -64,7 +64,7 @@ namespace TheOtherRoles
         private static CustomButton huntedShieldButton;
 
         public static Dictionary<byte, List<CustomButton>> deputyHandcuffedButtons = null;
-        public static PoolablePlayer morphTargetDisplay;
+        public static PoolablePlayer targetDisplay;
 
         public static TMPro.TMP_Text securityGuardButtonScrewsText;
         public static TMPro.TMP_Text securityGuardChargesText;
@@ -236,6 +236,30 @@ namespace TheOtherRoles
             }
         }
 
+        private static void setButtonTargetDisplay(PlayerControl target, CustomButton button = null, Vector3? offset=null) {
+            if (target == null || button == null) {
+                if (targetDisplay != null) {  // Reset the poolable player
+                    targetDisplay.gameObject.SetActive(false);
+                    GameObject.Destroy(targetDisplay.gameObject);
+                    targetDisplay = null;
+                }
+                return;
+            }
+            // Add poolable player to the button so that the target outfit is shown
+            button.actionButton.cooldownTimerText.transform.localPosition = new Vector3(0, 0, -1f);  // Before the poolable player
+            targetDisplay = UnityEngine.Object.Instantiate<PoolablePlayer>(Patches.IntroCutsceneOnDestroyPatch.playerPrefab, button.actionButton.transform);
+            GameData.PlayerInfo data = target.Data;
+            target.SetPlayerMaterialColors(targetDisplay.cosmetics.currentBodySprite.BodySprite);
+            targetDisplay.SetSkin(data.DefaultOutfit.SkinId, data.DefaultOutfit.ColorId);
+            targetDisplay.SetHat(data.DefaultOutfit.HatId, data.DefaultOutfit.ColorId);
+            targetDisplay.cosmetics.nameText.text = "";  // Hide the name!
+            targetDisplay.transform.localPosition = new Vector3(0f, 0.22f, -0.01f);
+            if (offset != null) targetDisplay.transform.localPosition += (Vector3)offset;
+            targetDisplay.transform.localScale = Vector3.one * 0.33f;
+            targetDisplay.setSemiTransparent(false);
+            targetDisplay.gameObject.SetActive(true);
+        }
+
         public static void Postfix(HudManager __instance) {
             initialized = false;
 
@@ -470,7 +494,7 @@ namespace TheOtherRoles
                     RPCProcedure.setFutureShifted(Shifter.currentTarget.PlayerId);
                     SoundEffectsManager.play("shifterShift");
                 },
-                () => { return Shifter.shifter != null && Shifter.shifter == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; },
+                () => { return Shifter.shifter != null && Shifter.shifter == CachedPlayer.LocalPlayer.PlayerControl && Shifter.futureShift == null && !CachedPlayer.LocalPlayer.Data.IsDead; },
                 () => { return Shifter.currentTarget && Shifter.futureShift == null && CachedPlayer.LocalPlayer.PlayerControl.CanMove; },
                 () => { },
                 Shifter.getButtonSprite(),
@@ -499,18 +523,7 @@ namespace TheOtherRoles
                         SoundEffectsManager.play("morphlingSample");
 
                         // Add poolable player to the button so that the target outfit is shown
-                        morphlingButton.actionButton.cooldownTimerText.transform.localPosition = new Vector3(0, 0, -1f);  // Before the poolable player
-                        morphTargetDisplay = UnityEngine.Object.Instantiate<PoolablePlayer>(Patches.IntroCutsceneOnDestroyPatch.playerPrefab, morphlingButton.actionButton.transform);
-                        GameData.PlayerInfo data = Morphling.sampledTarget.Data;
-                        Morphling.sampledTarget.SetPlayerMaterialColors(morphTargetDisplay.cosmetics.currentBodySprite.BodySprite);
-                        morphTargetDisplay.SetSkin(data.DefaultOutfit.SkinId, data.DefaultOutfit.ColorId);
-                        morphTargetDisplay.SetHat(data.DefaultOutfit.HatId, data.DefaultOutfit.ColorId);
-                       // PlayerControl.SetPetImage(data.DefaultOutfit.PetId, data.DefaultOutfit.ColorId, morphTargetDisplay.PetSlot);
-                        morphTargetDisplay.cosmetics.nameText.text = "";  // Hide the name!
-                        morphTargetDisplay.transform.localPosition = new Vector3(0f, 0.22f, -0.01f);
-                        morphTargetDisplay.transform.localScale = Vector3.one * 0.33f;
-                        morphTargetDisplay.setSemiTransparent(false);
-                        morphTargetDisplay.gameObject.SetActive(true);
+                        setButtonTargetDisplay(Morphling.sampledTarget, morphlingButton);
                     }
                 },
                 () => { return Morphling.morphling != null && Morphling.morphling == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; },
@@ -521,11 +534,7 @@ namespace TheOtherRoles
                     morphlingButton.isEffectActive = false;
                     morphlingButton.actionButton.cooldownTimerText.color = Palette.EnabledColor;
                     Morphling.sampledTarget = null;
-                    if (morphTargetDisplay != null) {  // Reset the poolable player
-                        morphTargetDisplay.gameObject.SetActive(false);
-                        GameObject.Destroy(morphTargetDisplay.gameObject);
-                        morphTargetDisplay = null;
-                    }
+                    setButtonTargetDisplay(null);
                 },
                 Morphling.getSampleSprite(),
                 CustomButton.ButtonPositions.upperRowLeft,
@@ -540,9 +549,7 @@ namespace TheOtherRoles
                         SoundEffectsManager.play("morphlingMorph");
 
                         // Reset the poolable player
-                        morphTargetDisplay.gameObject.SetActive(false);
-                        GameObject.Destroy(morphTargetDisplay.gameObject);
-                        morphTargetDisplay = null;
+                        setButtonTargetDisplay(null);
                     }
                 }
             );
@@ -1680,7 +1687,7 @@ namespace TheOtherRoles
                    AmongUsClient.Instance.FinishRpcImmediately(writer);
                    mayorMeetingButton.Timer = 1f;
                },
-               () => { return Mayor.mayor != null && Mayor.mayor == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; },
+               () => { return Mayor.mayor != null && Mayor.mayor == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead && Mayor.meetingButton; },
                () => {
                    mayorMeetingButton.actionButton.OverrideText("Emergency ("+ Mayor.remoteMeetingsLeft + ")");
                    bool sabotageActive = false;
@@ -1772,7 +1779,12 @@ namespace TheOtherRoles
                 () => {
                     defuseButton.HasEffect = true;
                 },
-                () => { return Bomber.bomb != null && Bomb.canDefuse && !CachedPlayer.LocalPlayer.Data.IsDead; },
+                () => {
+                    if (shifterShiftButton.HasButton())
+                        defuseButton.PositionOffset = new Vector3(0f, 2f, 0f);
+                    else
+                        defuseButton.PositionOffset = new Vector3(0f, 1f, 0f);
+                    return Bomber.bomb != null && Bomb.canDefuse && !CachedPlayer.LocalPlayer.Data.IsDead; },
                 () => {
                     if (defuseButton.isEffectActive && !Bomb.canDefuse) {
                         defuseButton.Timer = 0f;
@@ -1785,7 +1797,7 @@ namespace TheOtherRoles
                     defuseButton.isEffectActive = false;
                 },
                 Bomb.getDefuseSprite(),
-                new Vector3(1f, 1f, 0),
+                new Vector3(0f, 1f, 0),
                 __instance,
                 null,
                 true,
@@ -1838,9 +1850,6 @@ namespace TheOtherRoles
                         AmongUsClient.Instance.FinishRpcImmediately(writer);
                         RPCProcedure.uncheckedMurderPlayer(thief.PlayerId, target.PlayerId, byte.MaxValue);
                     }
-
-                    
-
                 },
                () => { return Thief.thief != null && CachedPlayer.LocalPlayer.PlayerControl == Thief.thief && !CachedPlayer.LocalPlayer.Data.IsDead; },
                () => { return Thief.currentTarget != null && CachedPlayer.LocalPlayer.PlayerControl.CanMove; },
@@ -1894,7 +1903,7 @@ namespace TheOtherRoles
                     hunterLighterButton.actionButton.graphic.color = Palette.EnabledColor;
                 },
                 Hunter.getLightSprite(),
-                CustomButton.ButtonPositions.upperRowCenter,
+                CustomButton.ButtonPositions.upperRowFarLeft,
                 __instance,
                 KeyCode.F,
                 true,
index 1a597ef83dacb84924396125a8d82c0a0e6abd00..0908fd3971d1e748740a1229a653759a77ccbe8d 100644 (file)
@@ -75,22 +75,23 @@ namespace TheOtherRoles.CustomGameModes {
         public static float ArrowCooldown = 30f;
         public static float ArrowDuration = 5f;
         public static float ArrowPunish = 5f;
-        private static Sprite buttonSprite;
+        private static Sprite buttonSpriteLight;
+        private static Sprite buttonSpriteArrow;
 
         public static bool isLightActive (byte playerId) {
             return lightActive.Contains(playerId);
         }
 
         public static Sprite getArrowSprite() {
-            if (buttonSprite) return buttonSprite;
-            buttonSprite = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.HideNSeekArrowButton.png", 115f);
-            return buttonSprite;
+            if (buttonSpriteArrow) return buttonSpriteArrow;
+            buttonSpriteArrow = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.HideNSeekArrowButton.png", 115f);
+            return buttonSpriteArrow;
         }
 
         public static Sprite getLightSprite() {
-            if (buttonSprite) return buttonSprite;
-            buttonSprite = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.LighterButton.png", 115f);
-            return buttonSprite;
+            if (buttonSpriteLight) return buttonSpriteLight;
+            buttonSpriteLight = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.LighterButton.png", 115f);
+            return buttonSpriteLight;
         }
 
         public static void clearAndReload() {
index bca9a45ce8e3a3514141552b89479ea2f2a9bfef..07528095ac74d31b41c325f671e113f02e0ce78e 100644 (file)
@@ -6,7 +6,7 @@ using Types = TheOtherRoles.CustomOption.CustomOptionType;
 namespace TheOtherRoles {
     public class CustomOptionHolder {
         public static string[] rates = new string[]{"0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"};
-        public static string[] ratesModifier = new string[]{"1", "2", "3"};
+        public static string[] ratesModifier = new string[]{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" };
         public static string[] presets = new string[]{"Preset 1", "Preset 2", "Random Preset Skeld", "Random Preset Mira HQ", "Random Preset Polus", "Random Preset Airship", "Random Preset Submerged" };
 
         public static CustomOption presetSelection;
@@ -22,6 +22,7 @@ namespace TheOtherRoles {
         public static CustomOption modifiersCountMax;
 
         public static CustomOption enableCodenameHorsemode;
+        public static CustomOption enableCodenameDisableHorses;
 
         public static CustomOption mafiaSpawnRate;
         public static CustomOption janitorCooldown;
@@ -176,6 +177,8 @@ namespace TheOtherRoles {
 
         public static CustomOption snitchSpawnRate;
         public static CustomOption snitchLeftTasksForReveal;
+        public static CustomOption snitchMode;
+        public static CustomOption snitchTargets;
 
         public static CustomOption spySpawnRate;
         public static CustomOption spyCanDieToSheriff;
@@ -376,7 +379,8 @@ namespace TheOtherRoles {
             presetSelection = CustomOption.Create(0, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Preset"), presets, null, true);
             activateRoles = CustomOption.Create(1, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Enable Mod Roles And Block Vanilla Roles"), true, null, true);
 
-            if (Utilities.EventUtility.canBeEnabled) enableCodenameHorsemode = CustomOption.Create(10423, Types.General, cs(Color.green, "Enable Codename Horse"), false, null, true);
+            if (Utilities.EventUtility.canBeEnabled) enableCodenameHorsemode = CustomOption.Create(10423, Types.General, cs(Color.green, "Enable Codename Horsemode"), true, null, true);
+            if (Utilities.EventUtility.canBeEnabled) enableCodenameDisableHorses = CustomOption.Create(10424, Types.General, cs(Color.green, "Disable Horses"), false, enableCodenameHorsemode, false);
 
             // Using new id's for the options to not break compatibilty with older versions
             crewmateRolesCountMin = CustomOption.Create(300, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Minimum Crewmate Roles"), 15f, 0f, 15f, 1f, null, true);
@@ -572,6 +576,8 @@ namespace TheOtherRoles {
                            
             snitchSpawnRate = CustomOption.Create(210, Types.Crewmate, cs(Snitch.color, "Snitch"), rates, null, true);
             snitchLeftTasksForReveal = CustomOption.Create(219, Types.Crewmate, "Task Count Where The Snitch Will Be Revealed", 5f, 0f, 25f, 1f, snitchSpawnRate);
+            snitchMode = CustomOption.Create(211, Types.Crewmate, "Information Mode", new string[] { "Chat", "Map", "Chat & Map" }, snitchSpawnRate);
+            snitchTargets = CustomOption.Create(212, Types.Crewmate, "Targets", new string[] { "All Evil Players", "Killing Players" }, snitchSpawnRate);
 
             spySpawnRate = CustomOption.Create(240, Types.Crewmate, cs(Spy.color, "Spy"), rates, null, true);
             spyCanDieToSheriff = CustomOption.Create(241, Types.Crewmate, "Spy Can Die To Sheriff", false, spySpawnRate);
index d07e2300b78498a154f7f3636e3a7129919696a9..c35bdb2a43f38b349b4f9c35ab77c091afd838e4 100644 (file)
@@ -482,6 +482,20 @@ namespace TheOtherRoles {
             return false;
         }
 
+        public static bool isKiller(PlayerControl player) {
+            return player.Data.Role.IsImpostor || 
+                (isNeutral(player) && 
+                player != Jester.jester && 
+                player != Arsonist.arsonist && 
+                player != Vulture.vulture && 
+                player != Lawyer.lawyer && 
+                player != Pursuer.pursuer);
+
+        }
+
+        public static bool isEvil(PlayerControl player) {
+            return player.Data.Role.IsImpostor || isNeutral(player);
+        }
 
         public static bool zoomOutStatus = false;
         public static void toggleZoom(bool reset=false) {
@@ -493,8 +507,10 @@ namespace TheOtherRoles {
                 if (cam != null && cam.gameObject.name == "UI Camera") cam.orthographicSize = orthographicSize;  // The UI is scaled too, else we cant click the buttons. Downside: map is super small.
             }
 
-            HudManagerStartPatch.zoomOutButton.Sprite = zoomOutStatus ? Helpers.loadSpriteFromResources("TheOtherRoles.Resources.PlusButton.png", 75f) : Helpers.loadSpriteFromResources("TheOtherRoles.Resources.MinusButton.png", 150f);
-            HudManagerStartPatch.zoomOutButton.PositionOffset = zoomOutStatus ? new Vector3(0f, 3f, 0) : new Vector3(0.4f, 2.8f, 0);
+            if (HudManagerStartPatch.zoomOutButton != null) {
+                HudManagerStartPatch.zoomOutButton.Sprite = zoomOutStatus ? Helpers.loadSpriteFromResources("TheOtherRoles.Resources.PlusButton.png", 75f) : Helpers.loadSpriteFromResources("TheOtherRoles.Resources.MinusButton.png", 150f);
+                HudManagerStartPatch.zoomOutButton.PositionOffset = zoomOutStatus ? new Vector3(0f, 3f, 0) : new Vector3(0.4f, 2.8f, 0);
+            }
             ResolutionManager.ResolutionChanged.Invoke((float)Screen.width / Screen.height); // This will move button positions to the correct position.
         }
 
index 99a02f967ef950e1d71239a25e853a0d1b9ecc01..25d9afe1801a46e9535f3efd9d3aa0a1b656ce03 100644 (file)
@@ -31,7 +31,7 @@ namespace TheOtherRoles
     public class TheOtherRolesPlugin : BasePlugin
     {
         public const string Id = "me.eisbison.theotherroles";
-        public const string VersionString = "4.3.0";
+        public const string VersionString = "4.3.1";
         public static uint betaDays = 0;  // amount of days for the build to be usable (0 for infinite!)
 
         public static Version Version = Version.Parse(VersionString);
index 93615cc3ff9f8e83bb5326ce6957f11a1d80eb28..ac0d83b700c2fb2ff99371e428f429ed63cc860e 100644 (file)
@@ -12,6 +12,7 @@ using TheOtherRoles.Utilities;
 using static TheOtherRoles.TheOtherRoles;
 using static TheOtherRoles.CustomOption;
 using Reactor.Utilities.Extensions;
+using AmongUs.GameOptions;
 
 namespace TheOtherRoles {
     public class CustomOption {
@@ -665,7 +666,7 @@ namespace TheOtherRoles {
     [HarmonyPatch(typeof(PlayerPhysics), nameof(PlayerPhysics.CoSpawnPlayer))]
     public class AmongUsClientOnPlayerJoinedPatch {
         public static void Postfix() {
-            if (PlayerControl.LocalPlayer != null) {
+            if (PlayerControl.LocalPlayer != null && AmongUsClient.Instance.AmHost) {
                 CustomOption.ShareOptionSelections();
             }
         }
@@ -1042,7 +1043,9 @@ namespace TheOtherRoles {
         private static TMPro.TextMeshPro[] settingsTMPs = new TMPro.TextMeshPro[3];
         private static GameObject settingsBackground;
         public static void OpenSettings(HudManager __instance) {
-            if (__instance.FullScreen == null || MapBehaviour.Instance && MapBehaviour.Instance.IsOpen /*|| AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GameStates.Started*/) return;
+            if (__instance.FullScreen == null || MapBehaviour.Instance && MapBehaviour.Instance.IsOpen
+                /*|| AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GameStates.Started*/
+                || GameOptionsManager.Instance.currentGameOptions.GameMode == GameModes.HideNSeek) return;
             settingsBackground = GameObject.Instantiate(__instance.FullScreen.gameObject, __instance.transform);
             settingsBackground.SetActive(true);
             var renderer = settingsBackground.GetComponent<SpriteRenderer>();
@@ -1084,7 +1087,7 @@ namespace TheOtherRoles {
                 toggleSettingsButton.OnClick.RemoveAllListeners();
                 toggleSettingsButton.OnClick.AddListener((Action)(() => ToggleSettings(__instance)));
             }
-            toggleSettingsButtonObject.SetActive(__instance.MapButton.gameObject.active && !(MapBehaviour.Instance && MapBehaviour.Instance.IsOpen));
+            toggleSettingsButtonObject.SetActive(__instance.MapButton.gameObject.active && !(MapBehaviour.Instance && MapBehaviour.Instance.IsOpen) && GameOptionsManager.Instance.currentGameOptions.GameMode != GameModes.HideNSeek);
             toggleSettingsButtonObject.transform.localPosition = __instance.MapButton.transform.localPosition + new Vector3(0, -0.66f, -500f);
         }
     }
index b611b9cc5cd4fcc5ea07cac0e620c5155ebcce0f..e95583dae7c7478af62af0a5d9ea590d1e6e6e82 100644 (file)
@@ -332,7 +332,7 @@ namespace TheOtherRoles.Patches {
             if (TORMapOptions.showRoleSummary || HideNSeek.isHideNSeekGM) {
                 var position = Camera.main.ViewportToWorldPoint(new Vector3(0f, 1f, Camera.main.nearClipPlane));
                 GameObject roleSummary = UnityEngine.Object.Instantiate(__instance.WinText.gameObject);
-                roleSummary.transform.position = new Vector3(__instance.Navigation.ExitButton.transform.position.x + 0.1f, position.y - 0.1f, -14f); 
+                roleSummary.transform.position = new Vector3(__instance.Navigation.ExitButton.transform.position.x + 0.1f, position.y - 0.1f, -214f); 
                 roleSummary.transform.localScale = new Vector3(1f, 1f, 1f);
 
                 var roleSummaryText = new StringBuilder();
index bbf07c516c4b12a74602c24294f717cf41ac090f..6620fe2a1288b11b9818e9f52a853f49d1695766 100644 (file)
@@ -137,8 +137,12 @@ namespace TheOtherRoles.Patches {
         }
 
         static void WrapUpPostfix(GameData.PlayerInfo exiled) {
+            // Prosecutor win condition
+            if (exiled != null && Lawyer.lawyer != null && Lawyer.target != null && Lawyer.isProsecutor && Lawyer.target.PlayerId == exiled.PlayerId && !Lawyer.lawyer.Data.IsDead)
+                Lawyer.triggerProsecutorWin = true;
+
             // Mini exile lose condition
-            if (exiled != null && Mini.mini != null && Mini.mini.PlayerId == exiled.PlayerId && !Mini.isGrownUp() && !Mini.mini.Data.Role.IsImpostor && !RoleInfo.getRoleInfoForPlayer(Mini.mini).Any(x => x.isNeutral)) {
+            else if (exiled != null && Mini.mini != null && Mini.mini.PlayerId == exiled.PlayerId && !Mini.isGrownUp() && !Mini.mini.Data.Role.IsImpostor && !RoleInfo.getRoleInfoForPlayer(Mini.mini).Any(x => x.isNeutral)) {
                 Mini.triggerMiniLose = true;
             }
             // Jester win condition
@@ -149,6 +153,7 @@ namespace TheOtherRoles.Patches {
             else if (exiled != null && Lawyer.lawyer != null && Lawyer.target != null && Lawyer.isProsecutor && Lawyer.target.PlayerId == exiled.PlayerId && !Lawyer.lawyer.Data.IsDead)
                 Lawyer.triggerProsecutorWin = true;
 
+
             // Reset custom button timers where necessary
             CustomButton.MeetingEndedUpdate();
 
index fe0f5e0a08e3e00cecb813307359cbe3cb33fc7b..6c98285fcf838309b18ae9feed22f90e9a77986a 100644 (file)
@@ -269,7 +269,7 @@ namespace TheOtherRoles.Patches {
     [HarmonyPatch(typeof(Constants), nameof(Constants.ShouldHorseAround))]
     public static class ShouldAlwaysHorseAround {
         public static bool Prefix(ref bool __result) {
-            __result = false;
+            __result = EventUtility.isEnabled && !EventUtility.disableHorses;
             return false;
         }
     }
index 9faed3f60a1c37e2c302cacb6e2a058e6d9527aa..84635910d16cd155e132414746247107318a04d0 100644 (file)
@@ -1,4 +1,6 @@
 using HarmonyLib;
+using Reactor.Utilities.Extensions;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using TheOtherRoles.Objects;
@@ -11,7 +13,7 @@ namespace TheOtherRoles.Patches {
 
        [HarmonyPatch(typeof(MapBehaviour))]
        class MapBehaviourPatch {
-               private static Dictionary<PlayerControl, SpriteRenderer> herePoints = new Dictionary<PlayerControl, SpriteRenderer>();
+               public static Dictionary<PlayerControl, SpriteRenderer> herePoints = new Dictionary<PlayerControl, SpriteRenderer>();
 
                [HarmonyPatch(typeof(MapBehaviour), nameof(MapBehaviour.FixedUpdate))]
                static void Postfix(MapBehaviour __instance) {
@@ -35,6 +37,40 @@ namespace TheOtherRoles.Patches {
                                        UnityEngine.Object.Destroy(s.Value);
                                        herePoints.Remove(s.Key);
                                }
+                       } else if (Snitch.snitch != null && CachedPlayer.LocalPlayer.PlayerId == Snitch.snitch.PlayerId && !Snitch.snitch.Data.IsDead && Snitch.mode != Snitch.Mode.Chat) {
+                var (playerCompleted, playerTotal) = TasksHandler.taskInfo(Snitch.snitch.Data);
+                int numberOfTasks = playerTotal - playerCompleted;
+
+                if (numberOfTasks == 0) {
+                                       if (MeetingHud.Instance == null) {
+                        foreach (PlayerControl player in CachedPlayer.AllPlayers) {
+                            if (Snitch.targets == Snitch.Targets.EvilPlayers && !Helpers.isEvil(player)) continue;
+                            else if (Snitch.targets == Snitch.Targets.Killers && !Helpers.isKiller(player)) continue;
+                                                       if (player.Data.IsDead) continue;
+                            Vector3 v = player.transform.position;
+                            v /= MapUtilities.CachedShipStatus.MapScale;
+                            v.x *= Mathf.Sign(MapUtilities.CachedShipStatus.transform.localScale.x);
+                            v.z = -1f;
+                                                       if (herePoints.ContainsKey(player)) {
+                                                               herePoints[player].transform.localPosition = v;
+                                                               continue;
+                                                       }
+                            var herePoint = UnityEngine.Object.Instantiate(__instance.HerePoint, __instance.HerePoint.transform.parent, true);
+                            herePoint.transform.localPosition = v;
+                            herePoint.enabled = true;
+                            int colorId = player.CurrentOutfit.ColorId;
+                            player.CurrentOutfit.ColorId = 6;
+                            player.SetPlayerMaterialColors(herePoint);
+                            player.CurrentOutfit.ColorId = colorId;
+                            herePoints.Add(player, herePoint);
+                        }
+                    } else {
+                        foreach (var s in herePoints) {
+                            UnityEngine.Object.Destroy(s.Value);
+                            herePoints.Remove(s.Key);
+                        }
+                    }
+                }
                        }
                        HudManagerUpdate.CloseSettings();
                }
index f2e5e94c885612cf60c8943b4b6303caa67d5eb3..02c540a911651f7dc5014c64b77267817da9f80c 100644 (file)
@@ -224,7 +224,12 @@ namespace TheOtherRoles.Patches {
                 }
 
                 // Mini
-                if (!Mini.isGrowingUpInMeeting) Mini.timeOfGrowthStart = Mini.timeOfGrowthStart.Add(DateTime.UtcNow.Subtract(Mini.timeOfMeetingStart));
+                if (!Mini.isGrowingUpInMeeting) Mini.timeOfGrowthStart = Mini.timeOfGrowthStart.Add(DateTime.UtcNow.Subtract(Mini.timeOfMeetingStart)).AddSeconds(10);
+
+                // Snitch
+                if (Snitch.snitch != null && !Snitch.needsUpdate && Snitch.snitch.Data.IsDead && Snitch.text != null) {
+                    UnityEngine.Object.Destroy(Snitch.text);
+                }
             }
         }
 
@@ -599,10 +604,14 @@ namespace TheOtherRoles.Patches {
         class StartMeetingPatch {
             public static void Prefix(PlayerControl __instance, [HarmonyArgument(0)]GameData.PlayerInfo meetingTarget) {
                 RoomTracker roomTracker = FastDestroyableSingleton<HudManager>.Instance?.roomTracker;
+                byte roomId = Byte.MinValue;
+                if (roomTracker != null && roomTracker.LastRoom != null) {
+                    roomId = (byte)roomTracker.LastRoom?.RoomId;
+                }
                 if (Snitch.snitch != null && roomTracker != null) {
                     MessageWriter roomWriter = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.ShareRoom, Hazel.SendOption.Reliable, -1);
                     roomWriter.Write(CachedPlayer.LocalPlayer.PlayerId);
-                    roomWriter.Write(roomTracker.LastRoom ? (byte)roomTracker.LastRoom.RoomId : Byte.MinValue);
+                    roomWriter.Write(roomId);
                     AmongUsClient.Instance.FinishRpcImmediately(roomWriter);
                 }
 
@@ -664,15 +673,16 @@ namespace TheOtherRoles.Patches {
                 // Add Snitch info
                 string output = "";
 
-                if (Snitch.snitch != null && (CachedPlayer.LocalPlayer.PlayerControl == Snitch.snitch || Helpers.shouldShowGhostInfo()) && !Snitch.snitch.Data.IsDead) {
+                if (Snitch.snitch != null && Snitch.mode != Snitch.Mode.Map && (CachedPlayer.LocalPlayer.PlayerControl == Snitch.snitch || Helpers.shouldShowGhostInfo()) && !Snitch.snitch.Data.IsDead) {
                     var (playerCompleted, playerTotal) = TasksHandler.taskInfo(Snitch.snitch.Data);
                     int numberOfTasks = playerTotal - playerCompleted;
                     if (numberOfTasks == 0) {
                         output = $"Bad alive roles in game: \n \n";
-                        FastDestroyableSingleton<HudManager>.Instance.StartCoroutine(Effects.Lerp(0.3f, new Action<float>((x) => {
+                        FastDestroyableSingleton<HudManager>.Instance.StartCoroutine(Effects.Lerp(0.4f, new Action<float>((x) => {
                             if (x == 1f) {
                                 foreach (PlayerControl p in CachedPlayer.AllPlayers) {
-                                    if (!Helpers.isNeutral(p) && !p.Data.Role.IsImpostor) continue;
+                                    if (Snitch.targets == Snitch.Targets.Killers && !Helpers.isKiller(p)) continue;
+                                    else if (Snitch.targets == Snitch.Targets.EvilPlayers && !Helpers.isEvil(p)) continue;
                                     if (!Snitch.playerRoomMap.ContainsKey(p.PlayerId)) continue;
                                     if (p.Data.IsDead) continue;
                                     var room = Snitch.playerRoomMap[p.PlayerId];
@@ -680,7 +690,7 @@ namespace TheOtherRoles.Patches {
                                     if (room != byte.MinValue) {
                                         roomName = DestroyableSingleton<TranslationController>.Instance.GetString((SystemTypes)room);
                                     }
-                                    output += "- " + RoleInfo.GetRolesString(p, false, false, true) + ", was last seen in " + roomName + "\n";
+                                    output += "- " + RoleInfo.GetRolesString(p, false, false, true) + ", was last seen " + roomName + "\n";
                                 }
                                 FastDestroyableSingleton<HudManager>.Instance.Chat.AddChat(Snitch.snitch, $"{output}");
                             }
index aa1d4049e49f1c15678fdd815d950687c7969dcd..6669eb1920d322998bb31419c36e04dfa3004087 100644 (file)
@@ -12,6 +12,7 @@ using UnityEngine;
 using TheOtherRoles.CustomGameModes;
 using static UnityEngine.GraphicsBuffer;
 using AmongUs.GameOptions;
+using Sentry.Internal.Extensions;
 
 namespace TheOtherRoles.Patches {
     [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.FixedUpdate))]
@@ -479,9 +480,11 @@ namespace TheOtherRoles.Patches {
 
                 // Colorblind Text During the round
                 if (p.cosmetics.colorBlindText != null && p.cosmetics.showColorBlindText && p.cosmetics.colorBlindText.gameObject.active) {
-                    p.cosmetics.colorBlindText.transform.localPosition = new Vector3(0, -1f, -0.001f);
+                    p.cosmetics.colorBlindText.transform.localPosition = new Vector3(0, -1f, 0f);
                 }
 
+                p.cosmetics.nameText.transform.parent.SetLocalZ(-0.0001f);  // This moves both the name AND the colorblindtext behind objects (if the player is behind the object), like the rock on polus
+
                 if ((Lawyer.lawyerKnowsRole && CachedPlayer.LocalPlayer.PlayerControl == Lawyer.lawyer && p == Lawyer.target) || p == CachedPlayer.LocalPlayer.PlayerControl || CachedPlayer.LocalPlayer.Data.IsDead) {
                     Transform playerInfoTransform = p.cosmetics.nameText.transform.parent.FindChild("Info");
                     TMPro.TextMeshPro playerInfo = playerInfoTransform != null ? playerInfoTransform.GetComponent<TMPro.TextMeshPro>() : null;
@@ -594,12 +597,17 @@ namespace TheOtherRoles.Patches {
 
         static void snitchUpdate() {
             if (Snitch.snitch == null) return;
-            bool snitchIsDead = Snitch.snitch.Data.IsDead;
+            if (!Snitch.needsUpdate) return;
 
+            bool snitchIsDead = Snitch.snitch.Data.IsDead;
             var (playerCompleted, playerTotal) = TasksHandler.taskInfo(Snitch.snitch.Data);
+
+            if (playerTotal == 0) return;
+            PlayerControl local = CachedPlayer.LocalPlayer.PlayerControl;
+
             int numberOfTasks = playerTotal - playerCompleted;
 
-            if (Snitch.isRevealed && (CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor || Helpers.isNeutral(CachedPlayer.LocalPlayer.PlayerControl))) {
+            if (Snitch.isRevealed && ((Snitch.targets == Snitch.Targets.EvilPlayers && Helpers.isEvil(local)) || (Snitch.targets == Snitch.Targets.Killers && Helpers.isKiller(local)))) {
                 if (Snitch.text == null) {
                     Snitch.text = GameObject.Instantiate(FastDestroyableSingleton<HudManager>.Instance.KillButton.cooldownTimerText, FastDestroyableSingleton<HudManager>.Instance.transform);
                     Snitch.text.enableWordWrapping = false;
@@ -610,9 +618,12 @@ namespace TheOtherRoles.Patches {
                     Snitch.text.text = $"Snitch is alive: " + playerCompleted + "/" + playerTotal;
                     if (snitchIsDead) Snitch.text.text = $"Snitch is dead!";
                 }
+            }
 
+            if (snitchIsDead) {
+                if (MeetingHud.Instance == null) Snitch.needsUpdate = false;
+                return;
             }
-            if (snitchIsDead) return;
             if (numberOfTasks <= Snitch.taskCountForReveal) Snitch.isRevealed = true;
         }
 
@@ -1278,6 +1289,14 @@ namespace TheOtherRoles.Patches {
                     }
                 }
             }
+
+            // Snitch
+            if (Snitch.snitch != null && CachedPlayer.LocalPlayer.PlayerId == Snitch.snitch.PlayerId && MapBehaviourPatch.herePoints.Keys.Any(x => x.PlayerId == target.PlayerId)) {
+                foreach (var a in MapBehaviourPatch.herePoints.Where(x => x.Key.PlayerId == target.PlayerId)) {
+                    UnityEngine.Object.Destroy(a.Value);
+                    MapBehaviourPatch.herePoints.Remove(a.Key);
+                }
+            }
         }
     }
 
@@ -1386,6 +1405,8 @@ namespace TheOtherRoles.Patches {
     [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.IsFlashlightEnabled))]
     public static class IsFlashlightEnabledPatch {
         public static bool Prefix(ref bool __result) {
+            if (GameOptionsManager.Instance.currentGameOptions.GameMode == GameModes.HideNSeek)
+                return true;
             __result = false;
             if (!CachedPlayer.LocalPlayer.Data.IsDead && Lighter.lighter != null && Lighter.lighter.PlayerId == CachedPlayer.LocalPlayer.PlayerId) {
                 __result = true;
index d65bdcb5c76afc8c1a1da1d82d30649cdc4f7d3c..0ccd5702ab7620a5f616c79f67a1fb2e30e24537 100644 (file)
@@ -11,10 +11,10 @@ using static TheOtherRoles.TheOtherRoles;
 using TheOtherRoles.CustomGameModes;
 
 namespace TheOtherRoles.Patches {
-    [HarmonyPatch(typeof(RoleOptionsData), nameof(RoleOptionsData.GetNumPerGame))]
+    [HarmonyPatch(typeof(RoleOptionsCollectionV07), nameof(RoleOptionsCollectionV07.GetNumPerGame))]
     class RoleOptionsDataGetNumPerGamePatch{
         public static void Postfix(ref int __result) {
-            if (CustomOptionHolder.activateRoles.getBool()) __result = 0; // Deactivate Vanilla Roles if the mod roles are active
+            if (CustomOptionHolder.activateRoles.getBool() && GameOptionsManager.Instance.CurrentGameOptions.GameMode == GameModes.Normal) __result = 0; // Deactivate Vanilla Roles if the mod roles are active
         }
     }
 
index 6dcf2255c66633b0b989b3b24b654966fe791b83..f3bda2d87c098c4bff1268ce66378f5cd500131f 100644 (file)
@@ -8,6 +8,7 @@ using System.Linq;
 using TheOtherRoles.Players;
 using TheOtherRoles.Utilities;
 using TheOtherRoles.CustomGameModes;
+using AmongUs.GameOptions;
 
 namespace TheOtherRoles.Patches {
     [HarmonyPatch(typeof(HudManager), nameof(HudManager.Update))]
@@ -252,7 +253,7 @@ namespace TheOtherRoles.Patches {
         }
 
         public static void miniUpdate() {
-            if (Mini.mini == null || Camouflager.camouflageTimer > 0f || Mini.mini == Morphling.morphling && Morphling.morphTimer > 0f || Mini.mini == Ninja.ninja && Ninja.isInvisble) return;
+            if (Mini.mini == null || Camouflager.camouflageTimer > 0f || Mini.mini == Morphling.morphling && Morphling.morphTimer > 0f || Mini.mini == Ninja.ninja && Ninja.isInvisble || SurveillanceMinigamePatch.nightVisionIsActive) return;
                 
             float growingProgress = Mini.growingProgress();
             float scale = growingProgress * 0.35f + 0.35f;
@@ -300,6 +301,7 @@ namespace TheOtherRoles.Patches {
          
         static void updateVentButton(HudManager __instance)
         {
+            if (GameOptionsManager.Instance.currentGameOptions.GameMode == GameModes.HideNSeek) return;
             if (Deputy.handcuffedKnows.ContainsKey(CachedPlayer.LocalPlayer.PlayerId) && Deputy.handcuffedKnows[CachedPlayer.LocalPlayer.PlayerId] > 0 || MeetingHud.Instance) __instance.ImpostorVentButton.Hide();
             else if (CachedPlayer.LocalPlayer.PlayerControl.roleCanUseVents() && !__instance.ImpostorVentButton.isActiveAndEnabled) __instance.ImpostorVentButton.Show();
 
index d8a299ba65c7976c0e0fa8240e0b348670f51b64..5e1af9c9f7b5dfaa4fb4c992a1b7e26f8ff67eb2 100644 (file)
@@ -12,13 +12,15 @@ using TheOtherRoles.Utilities;
 using TheOtherRoles.Objects;
 using TheOtherRoles.CustomGameModes;
 using Reactor.Utilities.Extensions;
+using AmongUs.GameOptions;
 
 namespace TheOtherRoles.Patches {
 
     [HarmonyPatch(typeof(Vent), nameof(Vent.CanUse))]
     public static class VentCanUsePatch
     {
-        public static bool Prefix(Vent __instance, ref float __result, [HarmonyArgument(0)] GameData.PlayerInfo pc, [HarmonyArgument(1)] out bool canUse, [HarmonyArgument(2)] out bool couldUse) {
+        public static bool Prefix(Vent __instance, ref float __result, [HarmonyArgument(0)] GameData.PlayerInfo pc, [HarmonyArgument(1)] ref bool canUse, [HarmonyArgument(2)] ref bool couldUse) {
+            if (GameOptionsManager.Instance.currentGameOptions.GameMode == GameModes.HideNSeek) return true;
             float num = float.MaxValue;
             PlayerControl @object = pc.Object;
 
@@ -77,7 +79,7 @@ namespace TheOtherRoles.Patches {
                 Vector3 center = @object.Collider.bounds.center;
                 Vector3 position = __instance.transform.position;
                 num = Vector2.Distance(center, position);
-                canUse &= (num <= usableDistance && !PhysicsHelpers.AnythingBetween(@object.Collider, center, position, Constants.ShipOnlyMask, false));
+                canUse &= (num <= usableDistance && (!PhysicsHelpers.AnythingBetween(@object.Collider, center, position, Constants.ShipOnlyMask, false) || __instance.name.StartsWith("JackInTheBoxVent_")));
             }
             __result = num;
             return false;
@@ -96,6 +98,7 @@ namespace TheOtherRoles.Patches {
     [HarmonyPatch(typeof(Vent), nameof(Vent.Use))]
     public static class VentUsePatch {
         public static bool Prefix(Vent __instance) {
+            if (GameOptionsManager.Instance.currentGameOptions.GameMode == GameModes.HideNSeek) return true;
             // Deputy handcuff disables the vents
             if (Deputy.handcuffedPlayers.Contains(CachedPlayer.LocalPlayer.PlayerId)) {
                 Deputy.setHandcuffedKnows();
@@ -133,7 +136,7 @@ namespace TheOtherRoles.Patches {
         }
     }
 
-    [HarmonyPatch(typeof(Vent), nameof(Vent.MoveToVent))]
+    [HarmonyPatch(typeof(Vent), nameof(Vent.TryMoveToVent))]
     public static class MoveToVentPatch {
         public static bool Prefix(Vent otherVent) {
             return !Trapper.playersOnMap.Contains(CachedPlayer.LocalPlayer.PlayerControl);
@@ -636,7 +639,7 @@ namespace TheOtherRoles.Patches {
                 }
                 // Dead Bodies
                 foreach (DeadBody deadBody in GameObject.FindObjectsOfType<DeadBody>()) {
-                    SpriteRenderer component = deadBody.bodyRenderer;
+                    SpriteRenderer component = deadBody.bodyRenderers.FirstOrDefault();
                     component.material.SetColor("_BackColor", Palette.ShadowColors[11]);
                     component.material.SetColor("_BodyColor", Palette.PlayerColors[11]);
                 }
@@ -668,7 +671,7 @@ namespace TheOtherRoles.Patches {
                     // Dead Bodies
                     foreach (DeadBody deadBody in GameObject.FindObjectsOfType<DeadBody>()) {
                         var colorId = GameData.Instance.GetPlayerById(deadBody.ParentId).Object.Data.DefaultOutfit.ColorId;
-                        SpriteRenderer component = deadBody.bodyRenderer;
+                        SpriteRenderer component = deadBody.bodyRenderers.FirstOrDefault();
                         component.material.SetColor("_BackColor", Palette.ShadowColors[colorId]);
                         component.material.SetColor("_BodyColor", Palette.PlayerColors[colorId]);
                     }
@@ -687,7 +690,7 @@ namespace TheOtherRoles.Patches {
         public static void Postfix(PlayerControl __instance, SpriteRenderer rend) {
             if (!nightVisionIsActive) return;
             foreach (DeadBody deadBody in GameObject.FindObjectsOfType<DeadBody>()) {
-                foreach (SpriteRenderer component in new SpriteRenderer[2] { deadBody.bodyRenderer, deadBody.bloodSplatter }) { 
+                foreach (SpriteRenderer component in new SpriteRenderer[2] { deadBody.bodyRenderers.FirstOrDefault(), deadBody.bloodSplatter }) { 
                     component.material.SetColor("_BackColor", Palette.ShadowColors[11]);
                     component.material.SetColor("_BodyColor", Palette.PlayerColors[11]);
                 }
index 57f31a2555bef8b1e93a71db0d207f7205cc7e3c..9405f5f096058ffca562fe240c20291cbb5c9674 100644 (file)
@@ -719,6 +719,7 @@ namespace TheOtherRoles
             if (player == Warlock.warlock) Warlock.clearAndReload();
             if (player == Witch.witch) Witch.clearAndReload();
             if (player == Ninja.ninja) Ninja.clearAndReload();
+            if (player == Bomber.bomber) Bomber.clearAndReload();
 
             // Other roles
             if (player == Jester.jester) Jester.clearAndReload();
index 512f662feeb3af410b788f28da7bb2eed6ba71ce..fbd9a3da42e8860e728d50b68309f74d3620eaba 100644 (file)
@@ -635,9 +635,12 @@ namespace TheOtherRoles
 
         public static void resetCamouflage() {
             camouflageTimer = 0f;
-            foreach (PlayerControl p in CachedPlayer.AllPlayers)
+            foreach (PlayerControl p in CachedPlayer.AllPlayers) {
+                if (p == Ninja.ninja && Ninja.isInvisble)
+                    continue;
                 p.setDefaultLook();
         }
+        }
 
         public static void clearAndReload() {
             resetCamouflage();
@@ -821,11 +824,24 @@ namespace TheOtherRoles
     public static class Snitch {
         public static PlayerControl snitch;
         public static Color color = new Color32(184, 251, 79, byte.MaxValue);
+        public enum Mode {
+            Chat = 0,
+            Map = 1,
+            ChatAndMap = 2
+        }
+        public enum Targets {
+            EvilPlayers = 0,
+            Killers = 1
+        }
 
+        public static Mode mode = Mode.Chat;
+        public static Targets targets = Targets.EvilPlayers;
         public static int taskCountForReveal = 1;
+
         public static bool isRevealed = false;
         public static Dictionary<byte, byte> playerRoomMap = new Dictionary<byte, byte>();
         public static TMPro.TextMeshPro text = null;
+        public static bool needsUpdate = true;
 
         public static void clearAndReload() {
             taskCountForReveal = Mathf.RoundToInt(CustomOptionHolder.snitchLeftTasksForReveal.getFloat());
@@ -834,6 +850,9 @@ namespace TheOtherRoles
             playerRoomMap = new Dictionary<byte, byte>();
             if (text != null) UnityEngine.Object.Destroy(text);
             text = null;
+            needsUpdate = true;
+            mode = (Mode) CustomOptionHolder.snitchMode.getSelection();
+            targets = (Targets) CustomOptionHolder.snitchTargets.getSelection();
         }
     }
 
index 0e0b3b421a1f64e0b40416d37f04751aa1582491..cda0696ab9be386a2b4d61384049117f149957e4 100644 (file)
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
     <PropertyGroup>
         <TargetFramework>net6.0</TargetFramework>
-        <Version>4.3.0</Version>
+        <Version>4.3.1</Version>
         <Description>TheOtherRoles</Description>
         <Authors>Eisbison</Authors>
                <LangVersion>latest</LangVersion>
     </ItemGroup>
 
     <ItemGroup>
-    </ItemGroup>
-
-       <ItemGroup>
-               <PackageReference Include="AmongUs.GameLibs.Steam" Version="2023.02.28" />
+        <PackageReference Include="AmongUs.GameLibs.Steam" Version="2023.03.28" />
         <PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.664" />
         <PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.0.1" />
         <PackageReference Include="Reactor" Version="2.1.0" />
index b9334865ec0bd9c2435a2a28ae9c1663369eaa49..b04f2cb35f2a45ee8a21a009a7304ed840c73f7a 100644 (file)
@@ -24,6 +24,7 @@ namespace TheOtherRoles.Utilities {
         public static readonly float[] eventDurations = {0f, 1f, 5f, 0f};
         public static double[] eventProbabilities;
         private static bool knocked = false;
+        public static bool disableHorses = false;
 
         public static void Load() {
             if (!isEnabled) return;
@@ -41,7 +42,8 @@ namespace TheOtherRoles.Utilities {
         public static void clearAndReload() {
             eventQueue = new List<EventTypes>();
             eventInvert = false;
-
+            if (canBeEnabled && CustomOptionHolder.enableCodenameDisableHorses != null)
+                disableHorses = CustomOptionHolder.enableCodenameDisableHorses.getBool();
         }
 
         public static void Update() {
@@ -97,6 +99,10 @@ namespace TheOtherRoles.Utilities {
             if (!isEnabled) return;
             defaultHat = PlayerControl.LocalPlayer.Data.DefaultOutfit.HatId;
             meetingEndsUpdate();
+            List<CachedPlayer> relevantPlayers = CachedPlayer.AllPlayers.Where(x => !x.Data.IsDead && x != CachedPlayer.LocalPlayer).ToList();
+            foreach (CachedPlayer pc in relevantPlayers)
+                pc.PlayerControl.MyPhysics.SetBodyType(disableHorses ? PlayerBodyTypes.Normal : PlayerBodyTypes.Horse);
+
         }
 
         public static void gameEndsUpdate() {
@@ -110,10 +116,10 @@ namespace TheOtherRoles.Utilities {
             switch (eventToStart) {
                 case EventTypes.Animation:
                     CachedPlayer animationPlayer = relevantPlayers[rnd.Next(relevantPlayers.Count)];
-                    animationPlayer.PlayerPhysics.SetBodyType(rnd.Next(2) > 0 ? PlayerBodyTypes.Horse : PlayerBodyTypes.Seeker);
+                    animationPlayer.PlayerPhysics.SetBodyType(rnd.Next(2) > 0 ? (disableHorses ? PlayerBodyTypes.Horse : PlayerBodyTypes.Normal) : PlayerBodyTypes.Seeker);
                     FastDestroyableSingleton<HudManager>.Instance.StartCoroutine(Effects.Lerp(eventDurations[(int)EventTypes.Animation], new Action<float>((p) => {
                         if (p==1)
-                            animationPlayer.PlayerControl.MyPhysics.SetBodyType(PlayerBodyTypes.Normal);
+                            animationPlayer.PlayerControl.MyPhysics.SetBodyType(disableHorses ? PlayerBodyTypes.Normal : PlayerBodyTypes.Horse);
                     })));
                     break;
                 case EventTypes.Communication:
index eb054c700e8bf900a978ce42e44f1d15906db25b..406faf4d93f4864ca3a223838eb29e444244778f 100644 (file)
@@ -4,9 +4,9 @@
     "net6.0": {
       "AmongUs.GameLibs.Steam": {
         "type": "Direct",
-        "requested": "[2023.2.28, )",
-        "resolved": "2023.2.28",
-        "contentHash": "GEcFs++dUrI+6Q+RTWvnm1a7l3Q/bUNNuCy9h8R17WISTOrV7g9QrZZmUiJka0JvVnj/J9Hygx5FaqApzFZKiQ=="
+        "requested": "[2023.3.28, )",
+        "resolved": "2023.3.28",
+        "contentHash": "EIaXNPlV9DMxlPfrC1yGZPXUIKbN7hAbmizYoL72gmxZVWiLLiJ8VbelM86OgyLocQ8+ma/UD7laPYIbePlrxw=="
       },
       "BepInEx.IL2CPP.MSBuild": {
         "type": "Direct",