]> git.deb.at Git - rhonda/theotherroles.git/commitdiff
Update source code
authorEisbison <eisbison.creator@gmail.com>
Wed, 7 Apr 2021 13:36:10 +0000 (15:36 +0200)
committerEisbison <eisbison.creator@gmail.com>
Wed, 7 Apr 2021 13:36:10 +0000 (15:36 +0200)
12 files changed:
Source Code/Buttons.cs
Source Code/CredentialsPatch.cs
Source Code/EndGamePatch.cs
Source Code/IntroPatch.cs
Source Code/Main.cs
Source Code/MeetingPatch.cs
Source Code/PlayerControlPatch.cs
Source Code/RPC.cs
Source Code/RoleAssignmentPatch.cs
Source Code/RoleInfo.cs
Source Code/TheOtherRoles.cs
Source Code/UpdatePatch.cs

index c4426157c8c84f2c7bacc73def3cb87478f7c9af..a435c393abae2816b93ef3357bc584aa7a5dbc96 100644 (file)
@@ -243,11 +243,11 @@ namespace TheOtherRoles
                         AmongUsClient.Instance.FinishRpcImmediately(writer);
                         RPCProcedure.morphlingMorph(Morphling.sampledTarget.PlayerId);
                         Morphling.sampledTarget = null;
-                        morphlingButton.HasEffect = true; // Trigger effect on this click
+                        morphlingButton.EffectDuration = 10f;
                     } else if (Morphling.currentTarget != null) {
                         Morphling.sampledTarget = Morphling.currentTarget;
                         morphlingButton.Sprite = Morphling.getMorphSprite();
-                        morphlingButton.HasEffect = false; // Block effect on this click
+                        morphlingButton.EffectDuration = 1f;
                     }
                 },
                 () => { return Morphling.morphling != null && Morphling.morphling == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ; },
@@ -265,8 +265,10 @@ namespace TheOtherRoles
                 true,
                 10f,
                 () => {
-                    morphlingButton.Timer = morphlingButton.MaxTimer;
-                    morphlingButton.Sprite = Morphling.getSampleSprite();
+                    if (Morphling.sampledTarget == null) {
+                        morphlingButton.Timer = morphlingButton.MaxTimer;
+                        morphlingButton.Sprite = Morphling.getSampleSprite();
+                    }
                 }
             );
 
@@ -512,6 +514,8 @@ namespace TheOtherRoles
                 __instance
             );
 
+            // Set the default (or settings from the previous game) timers/durations when spawning the buttons
+            setCustomButtonCooldowns();
         }
     }
 }
\ No newline at end of file
index 1cb48b2ac5d65c1fdd4ee0323a9d21b2a3326d98..3c24d598df32aa5164c4795e7735573d06ca9e91 100644 (file)
@@ -15,7 +15,7 @@ namespace TheOtherRoles
         {
             static void Postfix(VersionShower __instance) {
                 string spacer = new String('\n', 21);
-                string fullCredentials = "[FCCE03FF]TheOtherRoles[] v2.0.0 beta:\n- Modded by [FCCE03FF]Eisbison[] and [FFEB91FF]Thunderstorm584[]\n- Balanced with [FFEB91FF]Dhalucard[]\n- Button design by [FFEB91FF]Bavari[]";
+                string fullCredentials = "[FCCE03FF]TheOtherRoles[] v2.0.1 beta:\n- Modded by [FCCE03FF]Eisbison[] and [FFEB91FF]Thunderstorm584[]\n- Balanced with [FFEB91FF]Dhalucard[]\n- Button design by [FFEB91FF]Bavari[]";
                 if (__instance.text.Text.Contains(spacer))
                     __instance.text.Text += "\n" + fullCredentials;
                 else
index 897e4aaeed62bd149425643e7eeb2eac0238b497..e51fa584a68f4e5e006f0fcf7dfe90588e8bbda1 100644 (file)
@@ -24,7 +24,8 @@ namespace TheOtherRoles {
     enum CustomGameOverReason {
         LoversWin = 10,
         TeamJackalWin = 11,
-        ChildLose = 12
+        ChildLose = 12,
+        JesterWin = 13
     }
 
     enum WinCondition {
@@ -32,8 +33,6 @@ namespace TheOtherRoles {
         LoversTeamWin,
         LoversSoloWin,
         JesterWin,
-        BountyHunterWin,
-        JesterAndBountyHunterWin,
         JackalWin,
         ChildLose
     }
@@ -89,10 +88,9 @@ namespace TheOtherRoles {
             }
 
             bool childLose = Child.child != null && gameOverReason == (GameOverReason)CustomGameOverReason.ChildLose;
-            bool jesterWin = Jester.jester != null && Jester.jester.IDOFAMCIJKE.CIDDOFDJHJH;
-            bool bountyHunterWin = BountyHunter.bountyHunter != null && BountyHunter.bountyHunter.IDOFAMCIJKE.CIDDOFDJHJH;
+            bool jesterWin = Jester.jester != null && gameOverReason == (GameOverReason)CustomGameOverReason.JesterWin;
 
-            // Child lose condition (should be implemented using a proper GameOverReason in the future)
+            // Child lose
             if (childLose) {
                 TempData.BDGOKPKHCNB = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
                 WinningPlayerData wpd = new WinningPlayerData(Child.child.IDOFAMCIJKE);
@@ -101,27 +99,15 @@ namespace TheOtherRoles {
                 AdditionalTempData.winCondition = WinCondition.ChildLose;  
             }
 
-            // Jester and Bounty Hunter win condition (should be implemented using a proper GameOverReason in the future)
-            else if (jesterWin || bountyHunterWin) {
+            // Jester win
+            else if (jesterWin) {
                 TempData.BDGOKPKHCNB = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
-                if (jesterWin) {
-                    WinningPlayerData wpd = new WinningPlayerData(Jester.jester.IDOFAMCIJKE);
-                    wpd.CIDDOFDJHJH = false; 
-                    TempData.BDGOKPKHCNB.Add(wpd);
-                    AdditionalTempData.winCondition = WinCondition.JesterWin;
-                }
-                if (bountyHunterWin) {
-                    WinningPlayerData wpd = new WinningPlayerData(BountyHunter.bountyHunter.IDOFAMCIJKE);
-                    wpd.CIDDOFDJHJH = false; 
-                    TempData.BDGOKPKHCNB.Add(wpd);
-                    if (AdditionalTempData.winCondition == WinCondition.JesterWin)
-                        AdditionalTempData.winCondition = WinCondition.JesterAndBountyHunterWin;
-                    else
-                        AdditionalTempData.winCondition = WinCondition.BountyHunterWin;  
-                }
+                WinningPlayerData wpd = new WinningPlayerData(Jester.jester.IDOFAMCIJKE);
+                TempData.BDGOKPKHCNB.Add(wpd);
+                AdditionalTempData.winCondition = WinCondition.JesterWin;
             }
 
-            // Lovers win conditions (should be implemented using a proper GameOverReason in the future)
+            // Lovers win conditions
             else if (Lovers.existingAndAlive() && gameOverReason == (GameOverReason)CustomGameOverReason.LoversWin) {
                 AdditionalTempData.localIsLover = (PlayerControl.LocalPlayer == Lovers.lover1 || PlayerControl.LocalPlayer == Lovers.lover2);
                 // Double win for lovers, crewmates also win
@@ -184,14 +170,6 @@ namespace TheOtherRoles {
                 textRenderer.Text = "Jester Wins";
                 textRenderer.Color = Jester.color;
             }
-            else if (AdditionalTempData.winCondition == WinCondition.BountyHunterWin) {
-                textRenderer.Text = "Bounty Hunter Wins";
-                textRenderer.Color = BountyHunter.color;
-            }
-            else if (AdditionalTempData.winCondition == WinCondition.JesterAndBountyHunterWin) {
-                textRenderer.Text = "[AD653BFF]Bounty Hunter[FFFFFFFF] and [FF54A7FF]Jester[FFFFFFFF] Win";
-                textRenderer.Color = Color.white;
-            }
             else if (AdditionalTempData.winCondition == WinCondition.LoversTeamWin) {
                 if (AdditionalTempData.localIsLover) {
                     __instance.WinText.Text = "Double Victory";
@@ -225,12 +203,13 @@ namespace TheOtherRoles {
             if (!GameData.Instance) return false;
             var statistics = new PlayerStatistics(__instance);
             if (CheckAndEndGameForChildLose(__instance)) return false;
-            if(CheckAndEndGameForSabotageWin(__instance)) return false;
-            if(CheckAndEndGameForTaskWin(__instance)) return false;
-            if(CheckAndEndGameForLoverWin(__instance, statistics)) return false;
-            if(CheckAndEndGameForJackalWin(__instance, statistics)) return false;
-            if(CheckAndEndGameForImpostorWin(__instance, statistics)) return false;
-            if(CheckAndEndGameForCrewmateWin(__instance, statistics)) return false;
+            if (CheckAndEndGameForJesterWin(__instance)) return false;
+            if (CheckAndEndGameForSabotageWin(__instance)) return false;
+            if (CheckAndEndGameForTaskWin(__instance)) return false;
+            if (CheckAndEndGameForLoverWin(__instance, statistics)) return false;
+            if (CheckAndEndGameForJackalWin(__instance, statistics)) return false;
+            if (CheckAndEndGameForImpostorWin(__instance, statistics)) return false;
+            if (CheckAndEndGameForCrewmateWin(__instance, statistics)) return false;
             return false;
         }
 
@@ -248,6 +227,19 @@ namespace TheOtherRoles {
             return false;
         }
 
+        private static bool CheckAndEndGameForJesterWin(ShipStatus __instance) {
+            if (Jester.triggerJesterWin) {
+                if (!DestroyableSingleton<TutorialManager>.JECNDKBIOFO)
+                {
+                    __instance.enabled = false;
+                    ShipStatus.PBKIGLMJEDH((GameOverReason)CustomGameOverReason.JesterWin, false);
+                }
+                DestroyableSingleton<HudManager>.CMJOLNCMAPD.ShowPopUp(DestroyableSingleton<TranslationController>.CMJOLNCMAPD.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray<Il2CppSystem.Object>(0)));
+                ReviveEveryone();
+                return true;
+            }
+            return false;
+        }
 
         private static bool CheckAndEndGameForSabotageWin(ShipStatus __instance) {
             if (__instance.Systems == null) return false;
index 62581c540b61cc1b0cbd18e9d7e19b89dedcf248..26cb872c2cd09c677bf90e6efb5c1ea8df4345f3 100644 (file)
@@ -40,13 +40,6 @@ namespace TheOtherRoles
                 __instance.__4__this.ImpostorText.gameObject.SetActive(true);
                 __instance.__4__this.BackgroundBar.material.color = Lovers.color;
             }
-            else if (PlayerControl.LocalPlayer == BountyHunter.bountyHunter)
-            {
-                __instance.__4__this.Title.Text = "Bounty Hunter";
-                __instance.__4__this.Title.Color = BountyHunter.color;
-                __instance.__4__this.ImpostorText.Text = "Hunt [ED653BFF]" + BountyHunter.target?.IDOFAMCIJKE?.HGGCLJHCDBM + "[FFFFFFFF] down";
-                __instance.__4__this.BackgroundBar.material.color = BountyHunter.color;
-            }
             else if (roleInfo.name == "Crewmate" || roleInfo.name == "Impostor") {}
             else {
                 __instance.__4__this.Title.Text = roleInfo.name;
index b9109bdf2e11cdace176c788560cffb305e49ea5..ea3310a8112de33e19ace404d9a812a12d5bdd20 100644 (file)
@@ -15,7 +15,7 @@ using static TheOtherRoles.TheOtherRoles;
 
 namespace TheOtherRoles
 {
-    [BepInPlugin(Id, "The Other Roles", "2.0.0")]
+    [BepInPlugin(Id, "The Other Roles", "2.0.1")]
     [BepInProcess("Among Us.exe")]
     public class TheOtherRolesPlugin : BasePlugin
     {
index 3d079bde7e11942f710b807f2ec8a5992328f4c0..fad5f2e6a94deef027def6a337737a0a2f317360 100644 (file)
@@ -361,24 +361,6 @@ namespace TheOtherRoles
                     Child.child.SetKillTimer(PlayerControl.GameOptions.ELBDIKIOHHH * multiplier);
                 }
 
-                if (ExileController.Instance.KLHCDCKJHKC != null) {
-                    byte exiledId = ExileController.Instance.KLHCDCKJHKC.GMBAIPNOKLP;
-
-                    // Child lose condition
-                    if (Child.child != null && Child.child.PlayerId == exiledId && !Child.isGrownUp() && !Child.child.IDOFAMCIJKE.CIDDOFDJHJH) {
-                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ChildLose, Hazel.SendOption.Reliable, -1);
-                        AmongUsClient.Instance.FinishRpcImmediately(writer);
-                        RPCProcedure.childLose();
-                    }
-                    // Jester and Bounty Hunter win condition
-                    else if ((Jester.jester != null && Jester.jester.PlayerId == exiledId) || (BountyHunter.bountyHunter != null && !BountyHunter.bountyHunter.IDOFAMCIJKE.FGNJJFABIHJ && BountyHunter.target != null && BountyHunter.target.PlayerId == exiledId)) {
-                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JesterBountyHunterWin, Hazel.SendOption.Reliable, -1);
-                        writer.Write(exiledId);
-                        AmongUsClient.Instance.FinishRpcImmediately(writer);
-                        RPCProcedure.jesterBountyHunterWin(exiledId);
-                    }
-                }
-
                 // Seer spawn souls
                 if (Seer.deadBodyPositions != null && Seer.seer != null && PlayerControl.LocalPlayer == Seer.seer && (Seer.mode == 0 || Seer.mode == 2)) {
                     foreach (Vector3 pos in Seer.deadBodyPositions) {
@@ -443,8 +425,6 @@ namespace TheOtherRoles
                         __result = ExileController.Instance.KLHCDCKJHKC.HGGCLJHCDBM + " was The Hacker.";
                     else if(Child.child != null && ExileController.Instance.KLHCDCKJHKC.GPBBCHGPABL.PlayerId == Child.child.PlayerId)
                         __result = ExileController.Instance.KLHCDCKJHKC.HGGCLJHCDBM + " was The Child.";
-                    else if(BountyHunter.bountyHunter != null && ExileController.Instance.KLHCDCKJHKC.GPBBCHGPABL.PlayerId == BountyHunter.bountyHunter.PlayerId)
-                        __result = ExileController.Instance.KLHCDCKJHKC.HGGCLJHCDBM + " was The Bounty Hunter.";
                     else if(Tracker.tracker != null && ExileController.Instance.KLHCDCKJHKC.GPBBCHGPABL.PlayerId == Tracker.tracker.PlayerId)
                         __result = ExileController.Instance.KLHCDCKJHKC.HGGCLJHCDBM + " was The Tracker.";
                     else if(Snitch.snitch != null && ExileController.Instance.KLHCDCKJHKC.GPBBCHGPABL.PlayerId == Snitch.snitch.PlayerId)
index c1cc418070a12d52d68552d53f50b13a02c0482b..4c20f0c87f61f5f7fc6dfd8073714e91d6292e68 100644 (file)
@@ -201,11 +201,32 @@ namespace TheOtherRoles {
             }
         }
 
+        public static void playerSizeUpdate(PlayerControl p) {
+            if (Child.child == null) return;
+
+            float growingProgress = Child.growingProgress();
+            float scale = growingProgress * 0.35f + 0.35f;
+            
+            if (p == Child.child)
+                Child.child.transform.localScale = new Vector3(scale, scale, 1f);
+            if (Morphling.morphling != null && p == Morphling.morphling && Morphling.morphTarget == Child.child && Morphling.morphTimer > 0f)
+                p.transform.localScale = new Vector3(scale, scale, 1f);
+        }
+
+        public static void Prefix(PlayerControl __instance) {
+            if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.CJDCOJJNIGL.Started) return;
+
+            // Reset player sizes
+            __instance.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
+        }
+
         public static void Postfix(PlayerControl __instance) {
             if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.CJDCOJJNIGL.Started) return;
 
             // Update Role Description
             Helpers.refreshRoleDescription(__instance);
+            // Child and Morphling shrink
+            playerSizeUpdate(__instance);
             
             if (PlayerControl.LocalPlayer == __instance) {
                 // Time Master
@@ -297,7 +318,7 @@ namespace TheOtherRoles {
                         if (timeSinceDeath < Detective.reportNameDuration * 1000) {
                             msg =  $"Body Report: The killer appears to be {deadPlayer.killerIfExisting.name}!";
                         } else if (timeSinceDeath < Detective.reportColorDuration * 1000) {
-                            var typeOfColor = Helpers.isLighterColor(deadPlayer.killerIfExisting.IDOFAMCIJKE.JFHFMIKFHGG) ? "darker" : "lighter";
+                            var typeOfColor = Helpers.isLighterColor(deadPlayer.killerIfExisting.IDOFAMCIJKE.JFHFMIKFHGG) ? "lighter" : "darker";
                             msg =  $"Body Report: The killer appears to be a {typeOfColor} color!";
                         } else {
                             msg = $"Body Report: The corpse is too old to gain information from!";
@@ -399,6 +420,17 @@ namespace TheOtherRoles {
     [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.Exiled))]
     public static class ExilePlayerPatch
     {
+        public static void Prefix(PlayerControl __instance) {
+            // Child exile lose condition
+            if (Child.child != null && Child.child == __instance && !Child.isGrownUp() && !Child.child.IDOFAMCIJKE.CIDDOFDJHJH) {
+                Child.triggerChildLose = true;
+            }
+            // Jester win condition
+            else if (Jester.jester != null && Jester.jester == __instance) {
+                Jester.triggerJesterWin = true;
+            } 
+        }
+
         public static void Postfix(PlayerControl __instance)
         {
             // Collect dead player info
index 7cd28cbef0159bba92620accf1b205a6a82c1ecd..fb5bf8519452e7129777e52bf97c134fd4de4160 100644 (file)
@@ -39,7 +39,6 @@ namespace TheOtherRoles
         Camouflager,
         Hacker,
         Child,
-        BountyHunter,
         Tracker,
         Vampire,
         Snitch,
@@ -59,8 +58,7 @@ namespace TheOtherRoles
 
         // Role functionality
 
-        JesterBountyHunterWin = 80,
-        EngineerFixLights,
+        EngineerFixLights = 81,
         EngineerUsedRepair,
         JanitorClean,
         SheriffKill,
@@ -74,7 +72,6 @@ namespace TheOtherRoles
         CamouflagerCamouflage,
         TrackerUsedTracker,
         LoverSuicide,
-        SetBountyHunterTarget,
         VampireSetBitten,
         VampireTryKill,
         PlaceGarlic,
@@ -82,7 +79,6 @@ namespace TheOtherRoles
         SidekickKill,
         JackalCreatesSidekick,
         SidekickPromotes,
-        ChildLose,
         ErasePlayerRole,
         SetFutureErased,
         SetFutureShifted
@@ -181,9 +177,6 @@ namespace TheOtherRoles
                     case RoleId.Child:
                         Child.child = player;
                         break;
-                    case RoleId.BountyHunter:
-                        BountyHunter.bountyHunter = player;
-                        break;
                     case RoleId.Tracker:
                         Tracker.tracker = player;
                         break;
@@ -208,47 +201,6 @@ namespace TheOtherRoles
 
         // Role functionality
 
-        public static void jesterBountyHunterWin(byte exiledId) {
-            PlayerControl exiled = Helpers.playerById(exiledId);
-            if (exiled == null) return;
-
-            bool jesterWin = false;
-            bool bountyHunterWin = false;
-
-            if (Jester.jester != null && exiled == Jester.jester) {
-                Jester.jester.Revive();
-                Jester.jester.IDOFAMCIJKE.FGNJJFABIHJ = false;
-                Jester.jester.IDOFAMCIJKE.CIDDOFDJHJH = true;
-                jesterWin = true;
-            }
-            if (BountyHunter.bountyHunter != null && !BountyHunter.bountyHunter.IDOFAMCIJKE.FGNJJFABIHJ && BountyHunter.target == exiled) {
-                BountyHunter.bountyHunter.IDOFAMCIJKE.CIDDOFDJHJH = true;
-                bountyHunterWin = true;
-            }
-
-            foreach (PlayerControl player in PlayerControl.AllPlayerControls)
-            {
-                if (player != null && player != Jester.jester && player != BountyHunter.bountyHunter)
-                {
-                    player.RemoveInfected();
-                    player.Die(DeathReason.Exile);
-                    player.IDOFAMCIJKE.FGNJJFABIHJ = true;
-                    player.IDOFAMCIJKE.CIDDOFDJHJH = false;
-                }
-            }
-            if (jesterWin && !bountyHunterWin && BountyHunter.bountyHunter != null) {
-                BountyHunter.bountyHunter.RemoveInfected();
-                BountyHunter.bountyHunter.Die(DeathReason.Exile);
-                BountyHunter.bountyHunter.IDOFAMCIJKE.FGNJJFABIHJ = true;
-                BountyHunter.bountyHunter.IDOFAMCIJKE.CIDDOFDJHJH = false;
-            } else if (bountyHunterWin && !jesterWin && Jester.jester != null) {
-                Jester.jester.RemoveInfected();
-                Jester.jester.Die(DeathReason.Exile);
-                Jester.jester.IDOFAMCIJKE.FGNJJFABIHJ = true;
-                Jester.jester.IDOFAMCIJKE.CIDDOFDJHJH = false;
-            }
-        }
-
         public static void engineerFixLights() {
             SwitchSystem switchSystem = ShipStatus.Instance.Systems[SystemTypes.Electrical].Cast<SwitchSystem>();
             switchSystem.GNPBPJHLPAO = switchSystem.KNFBDAFFMGF;
@@ -396,8 +348,6 @@ namespace TheOtherRoles
                 Hacker.hacker = oldShifter;
             } else if (Child.child != null && Child.child == player) {
                 Child.child = oldShifter;
-            } else if (BountyHunter.bountyHunter != null && BountyHunter.bountyHunter == player) {
-                BountyHunter.bountyHunter = oldShifter;
             } else if (Tracker.tracker != null && Tracker.tracker == player) {
                 Tracker.tracker = oldShifter;
             } else if (Snitch.snitch != null && Snitch.snitch == player) {
@@ -439,12 +389,6 @@ namespace TheOtherRoles
             }
         }
 
-        public static void setBountyHunterTarget(byte targetId) {
-            foreach (PlayerControl player in PlayerControl.AllPlayerControls)
-                if (player.PlayerId == targetId)
-                    BountyHunter.target = player;
-        }
-
         public static void vampireSetBitten(byte targetId, byte reset) {
             if (reset != 0) {
                 Vampire.bitten = null;
@@ -531,10 +475,6 @@ namespace TheOtherRoles
             Sidekick.clearAndReload();
             return;
         }
-
-        public static void childLose() {
-            Child.triggerChildLose = true;
-        }
         
         public static void erasePlayerRole(byte playerId) {
             PlayerControl player = Helpers.playerById(playerId);
@@ -553,7 +493,6 @@ namespace TheOtherRoles
             if (player == Hacker.hacker) Hacker.clearAndReload();
             if (player == Child.child) Child.clearAndReload();
             if (player == Tracker.tracker) Tracker.clearAndReload();
-            if (player == BountyHunter.bountyHunter) BountyHunter.clearAndReload();
             if (player == Snitch.snitch) Snitch.clearAndReload();
             if (player == Swapper.swapper) Swapper.clearAndReload();
 
@@ -623,9 +562,6 @@ namespace TheOtherRoles
 
                 // Role functionality
 
-                case (byte)CustomRPC.JesterBountyHunterWin:
-                    RPCProcedure.jesterBountyHunterWin(DOOILGKLBBF.ReadByte());
-                    break;
                 case (byte)CustomRPC.EngineerFixLights:
                     RPCProcedure.engineerFixLights();
                     break;
@@ -667,9 +603,6 @@ namespace TheOtherRoles
                 case (byte)CustomRPC.LoverSuicide:
                     RPCProcedure.loverSuicide(DOOILGKLBBF.ReadByte());
                     break;
-                case (byte)CustomRPC.SetBountyHunterTarget:
-                    RPCProcedure.setBountyHunterTarget(DOOILGKLBBF.ReadByte());
-                    break;
                 case (byte)CustomRPC.VampireSetBitten:
                     byte bittenId = DOOILGKLBBF.ReadByte();
                     byte reset = DOOILGKLBBF.ReadByte();
@@ -696,9 +629,6 @@ namespace TheOtherRoles
                 case (byte)CustomRPC.SidekickPromotes:
                     RPCProcedure.sidekickPromotes();
                     break;
-                case (byte)CustomRPC.ChildLose:
-                    RPCProcedure.childLose();
-                    break;
                 case (byte)CustomRPC.ErasePlayerRole:
                     RPCProcedure.erasePlayerRole(DOOILGKLBBF.ReadByte());
                     break;
index da0a3d2dca4b178307daf47f72c237622325baf4..04bb8b3c858ad56556237e9c7db637a4a0ccda08 100644 (file)
@@ -72,7 +72,6 @@ namespace TheOtherRoles
             crewSettings.Add((byte)RoleId.Tracker, CustomOptionHolder.trackerSpawnRate.getSelection());
             crewSettings.Add((byte)RoleId.Snitch, CustomOptionHolder.snitchSpawnRate.getSelection());
             crewSettings.Add((byte)RoleId.Jackal, CustomOptionHolder.jackalSpawnRate.getSelection());
-            // crewSettings.Add((byte)RoleId.BountyHunter, CustomOptionHolder.bountyHunterSpawnRate.getSelection()); BOUNTY HUNTER
 
             // Set special roles
             if (impostors.Count >= 3 && maxImpostorRoles >= 3 && (rnd.Next(1, 101) <= CustomOptionHolder.mafiaSpawnRate.getSelection() * 10)) {
@@ -153,24 +152,6 @@ namespace TheOtherRoles
                     setRoleToRandomPlayer(roleId, impostors);
                 }
             }
-
-            // if (crewmates.Count > 0 && (rnd.Next(1, 101) <= CustomOptionHolder.bountyHunterSpawnRate.getSelection())) {
-            //     List<PlayerControl> availableTargets = PlayerControl.AllPlayerControls.ToArray().ToList();
-            //     var bountyHunterIndex = rnd.Next(0, crewmates.Count);
-            //     byte bountyHunterId = crewmates[bountyHunterIndex].PlayerId;
-
-            //     availableTargets.RemoveAll(x => x.IDOFAMCIJKE.CIDDOFDJHJH || x.PlayerId == bountyHunterId);
-
-            //     if (availableTargets.Count > 0) {
-            //         byte targetId = availableTargets[rnd.Next(0, availableTargets.Count)].PlayerId;
-            //         crewmates.RemoveAt(bountyHunterIndex);
-            //         setRoleToPlayer((byte)RoleId.BountyHunter, bountyHunterId);
-            //         writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetBountyHunterTarget, Hazel.SendOption.Reliable, -1);
-            //         writer.Write(targetId);
-            //         AmongUsClient.Instance.FinishRpcImmediately(writer);
-            //         RPCProcedure.setBountyHunterTarget(targetId);
-            //     }
-            // }
         }
     }
 }
index 7d1682d436b528ae66f68021543790d026bbfcd4..0fee9f8f360da82178c1b0b8dbedbdd4fb88215e 100644 (file)
@@ -154,13 +154,6 @@ namespace TheOtherRoles
                 "No one will harm you until you grow up",
                 "No one will harm you"));
             }
-            if (BountyHunter.bountyHunter != null && p == BountyHunter.bountyHunter) {
-                infos.Add(new RoleInfo("Bounty Hunter",
-                BountyHunter.color,
-                "Hunt your bounty down",
-                "Hunt your bounty"));
-                ;
-            }
             if (Tracker.tracker != null && p == Tracker.tracker) {
                 infos.Add(new RoleInfo("Tracker",
                 Tracker.color,
index 801de9c5fd011a4d133f42838d5127928ac31643..fe2f64960e3db60630d0987e220c60234dfd2de0 100644 (file)
@@ -40,7 +40,6 @@ namespace TheOtherRoles
             Camouflager.clearAndReload();
             Hacker.clearAndReload();
             Child.clearAndReload();
-            BountyHunter.clearAndReload();
             Tracker.clearAndReload();
             Vampire.clearAndReload();
             Snitch.clearAndReload();
@@ -53,8 +52,11 @@ namespace TheOtherRoles
             public static PlayerControl jester;
             public static Color color = new Color(255f / 255f, 84f / 255f, 167f / 255f, 1);
 
+            public static bool triggerJesterWin = false;
+
             public static void clearAndReload() {
                 jester = null;
+                triggerJesterWin = false;
             }
         }
 
@@ -108,7 +110,7 @@ namespace TheOtherRoles
             public static PlayerControl janitor;
             public static Color color = Palette.LDCHDOFJPGH;
 
-            public static float cooldown = float.MaxValue;
+            public static float cooldown = 30f;
 
             private static Sprite buttonSprite;
             public static Sprite getButtonSprite() {
@@ -127,7 +129,7 @@ namespace TheOtherRoles
             public static PlayerControl sheriff;
             public static Color color = new Color(255f / 255f, 204f / 255f, 0f / 255f, 1);
 
-            public static float cooldown = float.MaxValue;
+            public static float cooldown = 30f;
             public static bool jesterCanDieToSheriff = false;
 
             public static PlayerControl currentTarget;
@@ -147,7 +149,7 @@ namespace TheOtherRoles
             public static float lighterModeLightsOnVision = 2f;
             public static float lighterModeLightsOffVision = 0.75f;
 
-            public static float cooldown = float.MaxValue;
+            public static float cooldown = 30f;
             public static float duration = 5f;
 
             public static float lighterTimer = 0f;
@@ -178,8 +180,7 @@ namespace TheOtherRoles
             public static bool anonymousFootprints = false;
             public static float reportNameDuration = 0f;
             public static float reportColorDuration = 20f;
-
-            public static float timer = 1f;
+            public static float timer = 6.2f;
 
             public static void clearAndReload() {
                 detective = null;
@@ -188,7 +189,7 @@ namespace TheOtherRoles
                 footprintDuration = CustomOptionHolder.detectiveFootprintDuration.getFloat();
                 reportNameDuration = CustomOptionHolder.detectiveReportNameDuration.getFloat();
                 reportColorDuration = CustomOptionHolder.detectiveReportColorDuration.getFloat();
-                timer = footprintIntervall;
+                timer = 6.2f;
             }
         }
     }
@@ -200,7 +201,7 @@ namespace TheOtherRoles
         public static bool reviveDuringRewind = false;
         public static float rewindTime = 3f;
         public static float shieldDuration = 3f; // Constant
-        public static float cooldown = float.MaxValue;
+        public static float cooldown = 30f;
 
         public static bool shieldActive = false;
         public static bool isRewinding = false;
@@ -348,7 +349,7 @@ namespace TheOtherRoles
         private static Sprite sampleSprite;
         private static Sprite morphSprite;
     
-        public static float cooldown = float.MaxValue;
+        public static float cooldown = 30f;
 
         public static PlayerControl currentTarget;
         public static PlayerControl sampledTarget;
@@ -395,7 +396,7 @@ namespace TheOtherRoles
         public static PlayerControl camouflager;
         public static Color color = Palette.LDCHDOFJPGH;
     
-        public static float cooldown = float.MaxValue;
+        public static float cooldown = 30f;
         public static float camouflageTimer = 0f;
 
         private static Sprite buttonSprite;
@@ -433,7 +434,7 @@ namespace TheOtherRoles
         private static Sprite adminTableIcon;
         public static Color color = new Color(252f / 255f, 90f / 255f, 30f / 255f, 1);
 
-        public static float cooldown = float.MaxValue;
+        public static float cooldown = 30f;
         public static float duration = 10f;
         public static bool onlyColorType = false;
 
@@ -465,7 +466,7 @@ namespace TheOtherRoles
         public static PlayerControl child;
         public static Color color = Color.white;
         
-        public static float growingUpDuration = float.MaxValue;
+        public static float growingUpDuration = 400f;
         public static DateTime timeOfGrowthStart = DateTime.UtcNow;
         public static bool triggerChildLose = false;
 
@@ -488,20 +489,6 @@ namespace TheOtherRoles
         }
     }
 
-    public static class BountyHunter {
-        public static PlayerControl bountyHunter;
-        public static Color color = new Color(237f / 255f, 101f / 255f, 59f / 255f, 1);
-
-        public static bool notifyBounty = true;
-        public static PlayerControl target;
-    
-        public static void clearAndReload() {
-            bountyHunter = null;
-            target = null;
-            // notifyBounty = CustomOptionHolder.bountyHunterNotifyBounty.getBool();
-        }
-    }
-
     public static class Tracker {
         public static PlayerControl tracker;
         public static Color color = new Color(117f / 255f, 209f / 255f, 255f / 255f, 1);
@@ -539,7 +526,7 @@ namespace TheOtherRoles
         public static Color color = Palette.LDCHDOFJPGH;
 
         public static float delay = 10f;
-        public static float cooldown = float.MaxValue;
+        public static float cooldown = 30f;
         public static bool canKillNearGarlics = true;
         public static bool localPlacedGarlic = false;
         public static bool garlicsActive = true;
@@ -602,8 +589,8 @@ namespace TheOtherRoles
         public static PlayerControl currentTarget;
         public static List<PlayerControl> formerJackals = new List<PlayerControl>();
         
-        public static float cooldown = float.MaxValue;
-        public static float createSidekickCooldown = float.MaxValue;
+        public static float cooldown = 30f;
+        public static float createSidekickCooldown = 30f;
         public static bool canUseVents = true;
         public static bool canCreateSidekick = true;
         public static Sprite buttonSprite;
@@ -646,7 +633,7 @@ namespace TheOtherRoles
 
         public static PlayerControl currentTarget;
 
-        public static float cooldown = float.MaxValue;
+        public static float cooldown = 30f;
         public static bool canUseVents = true;
         public static bool canKill = true;
         public static bool promotesToJackal = true;
@@ -667,7 +654,7 @@ namespace TheOtherRoles
 
         public static List<PlayerControl> futureErased = new List<PlayerControl>();
         public static PlayerControl currentTarget;
-        public static float cooldown = float.MaxValue;
+        public static float cooldown = 30f;
 
         private static Sprite buttonSprite;
         public static Sprite getButtonSprite() {
index 3cdcd80727ec55a1c4fc33eb6058ea32b45c54cc..c928765b51ee95614e5abbd608a45196c2cf127d 100644 (file)
@@ -90,10 +90,6 @@ namespace TheOtherRoles
                 setPlayerNameColor(Seer.seer, Seer.color);  
             else if (Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer) 
                 setPlayerNameColor(Hacker.hacker, Hacker.color);
-            else if (BountyHunter.bountyHunter != null && BountyHunter.target != null && BountyHunter.bountyHunter == PlayerControl.LocalPlayer) {
-                setPlayerNameColor(BountyHunter.bountyHunter, BountyHunter.color);
-                setPlayerNameColor(BountyHunter.target, BountyHunter.color);
-            }
             else if (Tracker.tracker != null && Tracker.tracker == PlayerControl.LocalPlayer) 
                 setPlayerNameColor(Tracker.tracker, Tracker.color);
             else if (Snitch.snitch != null && Snitch.snitch == PlayerControl.LocalPlayer) 
@@ -243,7 +239,18 @@ namespace TheOtherRoles
                     p.LNMJKMLHMIM.material.SetFloat("_Outline",  0f);
                     p.HatRenderer.SetHat(0, 0);
                     Helpers.setSkinWithAnim(p.MyPhysics, 0);
-                    if (p.CurrentPet) UnityEngine.Object.Destroy(p.CurrentPet.gameObject);
+                    bool spawnPet = false;
+                    if (p.CurrentPet == null) spawnPet = true;
+                    else if (p.CurrentPet.EKONGILOOPE != DestroyableSingleton<HatManager>.CMJOLNCMAPD.AllPets[0].EKONGILOOPE) {
+                        UnityEngine.Object.Destroy(p.CurrentPet.gameObject);
+                        spawnPet = true;
+                    }
+
+                    if (spawnPet) {
+                        p.CurrentPet = UnityEngine.Object.Instantiate<PetBehaviour>(DestroyableSingleton<HatManager>.CMJOLNCMAPD.AllPets[0]);
+                        p.CurrentPet.transform.position = p.transform.position;
+                        p.CurrentPet.Source = p;
+                    }
                 }
             } 
             
@@ -259,45 +266,23 @@ namespace TheOtherRoles
         }
 
         public static void childUpdate() {
-            foreach (PlayerControl p in PlayerControl.AllPlayerControls) {
-                if (p == null) continue;
-                p.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
-                if (Child.child == null) continue;
+            if (Child.child == null) return;
                 
-                float growingProgress = Child.growingProgress();
-                float scale = growingProgress * 0.35f + 0.35f;
-                string suffix = "";
-                if (growingProgress != 1f)
-                    suffix = " [FAD934FF](" + Mathf.FloorToInt(growingProgress * 18) + ")"; 
-
-                if (Child.child == p) {
-                    p.transform.localScale = new Vector3(scale, scale, 1f);
-                    p.nameText.Text += suffix;
-                    if (MeetingHud.Instance != null)
-                        foreach (PlayerVoteArea player in MeetingHud.Instance.DHCOPOOJCLN)
-                            if (player.NameText != null && p.PlayerId == player.HMPHKKGPLAG)
-                                player.NameText.Text += suffix;
-                }
-                else if (Morphling.morphling != null && Morphling.morphling == p && Morphling.morphTarget != null && Morphling.morphTarget == Child.child && Morphling.morphTimer > 0f) {
-                    p.transform.localScale = new Vector3(scale, scale, 1f);
-                    p.nameText.Text += suffix;
-                }
-                else
-                    p.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
-            }
-        }
-
-        public static void bountyHunterUpdate() {
-            if (BountyHunter.bountyHunter == null || BountyHunter.target == null) return;
+            float growingProgress = Child.growingProgress();
+            float scale = growingProgress * 0.35f + 0.35f;
+            string suffix = "";
+            if (growingProgress != 1f)
+                suffix = " [FAD934FF](" + Mathf.FloorToInt(growingProgress * 18) + ")"; 
 
-            if (BountyHunter.notifyBounty && PlayerControl.LocalPlayer == BountyHunter.target) {
-                string suffix = "[AD653BFF] (Bounty)[FFFFFFFF]";
-                PlayerControl.LocalPlayer.nameText.Text += suffix;
-                if (MeetingHud.Instance != null)
-                    foreach (PlayerVoteArea player in MeetingHud.Instance.DHCOPOOJCLN)
-                        if (player.NameText != null && PlayerControl.LocalPlayer.PlayerId == player.HMPHKKGPLAG)
-                            player.NameText.Text += suffix;
+            Child.child.nameText.Text += suffix;
+            if (MeetingHud.Instance != null) {
+                foreach (PlayerVoteArea player in MeetingHud.Instance.DHCOPOOJCLN)
+                    if (player.NameText != null && Child.child.PlayerId == player.HMPHKKGPLAG)
+                        player.NameText.Text += suffix;
             }
+
+            if (Morphling.morphling != null && Morphling.morphTarget == Child.child && Morphling.morphTimer > 0f)
+                Morphling.morphling.nameText.Text += suffix;
         }
 
         static void vampireDeactivateKillButton(HudManager __instance) {
@@ -369,8 +354,6 @@ namespace TheOtherRoles
             camouflageAndMorphActions();
             // Child
             childUpdate();
-            // Bounty Hunter
-            bountyHunterUpdate();
             // Vampire
             vampireDeactivateKillButton(__instance);
             // Snitch