예제 #1
0
        public static bool Prefix(ref float __result, ShipStatus __instance, [HarmonyArgument(0)] GameData.OFKOJOKOOAK player)
        {
            ISystemType systemType = __instance.Systems.ContainsKey(SystemTypes.Electrical) ? __instance.Systems[SystemTypes.Electrical] : null;

            if (systemType == null)
            {
                return(true);
            }
            SwitchSystem switchSystem = systemType.TryCast <SwitchSystem>();

            if (switchSystem == null)
            {
                return(true);
            }

            float num = (float)switchSystem.OBNIGODIBIO / 255f;

            if (player == null || player.FGNJJFABIHJ)
            {
                __result = __instance.MaxLightRadius;
            }
            else if (player.CIDDOFDJHJH)
            {
                __result = __instance.MaxLightRadius * PlayerControl.GameOptions.AFGNADFLBDB;
            }
            else if (Lighter.lighter != null && Lighter.lighter.PlayerId == player.GMBAIPNOKLP && Lighter.lighterTimer > 0f)
            {
                __result = Mathf.Lerp(__instance.MaxLightRadius * Lighter.lighterModeLightsOffVision, __instance.MaxLightRadius * Lighter.lighterModeLightsOnVision, num);
            }
            else
            {
                __result = Mathf.Lerp(__instance.MinLightRadius, __instance.MaxLightRadius, num) * PlayerControl.GameOptions.OJCJDCMDKKC;
            }
            return(false);
        }
예제 #2
0
 static bool Prefix(MeetingHud __instance)
 {
     if (__instance.DHCOPOOJCLN.All((PlayerVoteArea ps) => ps.isDead || ps.didVote))
     {
         byte[] self = calculateVotes(__instance);
         bool   tie;
         int    maxIdx = IndexOfMax(self, (byte p) => (int)p, out tie) - 1;
         GameData.OFKOJOKOOAK exiled = null;
         foreach (GameData.OFKOJOKOOAK pi in GameData.Instance.AllPlayers)
         {
             if (pi.GMBAIPNOKLP == maxIdx)
             {
                 exiled = pi;
                 break;
             }
         }
         byte[] array = new byte[10];
         for (int i = 0; i < __instance.DHCOPOOJCLN.Length; i++)
         {
             PlayerVoteArea playerVoteArea = __instance.DHCOPOOJCLN[i];
             array[(int)playerVoteArea.HMPHKKGPLAG] = playerVoteArea.GetState();
         }
         // RPCVotingComplete
         if (AmongUsClient.Instance.HNMILJEOEKN)
         {
             __instance.MJIJGEBBMAO(array, exiled, tie);
         }
         MessageWriter messageWriter = AmongUsClient.Instance.StartRpc(__instance.NetId, 23, Hazel.SendOption.Reliable);
         messageWriter.WriteBytesAndSize(array);
         messageWriter.Write((exiled != null) ? exiled.GMBAIPNOKLP : byte.MaxValue);
         messageWriter.Write(tie);
         messageWriter.EndMessage();
     }
     return(false);
 }
예제 #3
0
        static void Postfix(VitalsMinigame __instance)
        {
            // Hacker show time since death
            bool showHackerInfo = Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer && Hacker.hackerTimer > 0;

            for (int k = 0; k < __instance.MCCBOPIEOEC.Length; k++)
            {
                VitalsPanel          vitalsPanel = __instance.MCCBOPIEOEC[k];
                GameData.OFKOJOKOOAK OFKOJOKOOAK = GameData.Instance.AllPlayers[k];

                if (vitalsPanel.IsDead)
                {
                    DeadPlayer deadPlayer = deadPlayers?.Where(x => x.player?.PlayerId == OFKOJOKOOAK?.GMBAIPNOKLP)?.FirstOrDefault();
                    if (deadPlayer != null && deadPlayer.timeOfDeath != null)
                    {
                        float timeSinceDeath = ((float)(DateTime.UtcNow - deadPlayer.timeOfDeath).TotalMilliseconds);

                        if (showHackerInfo)
                        {
                            vitalsPanel.Text.Text = Math.Round(timeSinceDeath / 1000) + "s";
                        }
                        else
                        {
                            vitalsPanel.Text.Text = DestroyableSingleton <TranslationController> .CMJOLNCMAPD.GetString(Palette.OCCIKHJPJPK[(int)OFKOJOKOOAK.JFHFMIKFHGG], new UnhollowerBaseLib.Il2CppReferenceArray <Il2CppSystem.Object>(0));
                        }
                    }
                }
            }
        }
예제 #4
0
        public static void Prefix(ref GameData.OFKOJOKOOAK KLHCDCKJHKC, bool EMLKEPIBJLK)
        {
            // Shifter shift
            if (Shifter.shifter != null && AmongUsClient.Instance.CBKCIKKEJHI && Shifter.futureShift != null)   // We need to send the RPC from the host here, to make sure that the order of shifting and erasing is correct (for that reason the futureShifted and futureErased are being synced)
            {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShifterShift, Hazel.SendOption.Reliable, -1);
                writer.Write(Shifter.futureShift.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.shifterShift(Shifter.futureShift.PlayerId);
            }
            Shifter.futureShift = null;

            // Eraser erase
            if (Eraser.eraser != null && AmongUsClient.Instance.CBKCIKKEJHI && Eraser.futureErased != null)    // We need to send the RPC from the host here, to make sure that the order of shifting and erasing is correct (for that reason the futureShifted and futureErased are being synced)
            {
                foreach (PlayerControl target in Eraser.futureErased)
                {
                    if (target != null)
                    {
                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ErasePlayerRole, Hazel.SendOption.Reliable, -1);
                        writer.Write(target.PlayerId);
                        AmongUsClient.Instance.FinishRpcImmediately(writer);
                        RPCProcedure.erasePlayerRole(target.PlayerId);
                    }
                }
            }
            Eraser.futureErased = new List <PlayerControl>();
        }
예제 #5
0
        public PlayerControl FindClosestTarget(PlayerControl player)
        {
            PlayerControl result = null;
            float         num    = GameOptionsData.FECFGOOCIJL[Mathf.Clamp(PlayerControl.GameOptions.MLLMFMOMIAC, 0, 2)]; //killrange

            if (!ShipStatus.Instance)
            {
                return(null);
            }
            Vector2 truePosition = player.GetTruePosition();
            var     allPlayers   = GameData.Instance.AllPlayers;

            for (int i = 0; i < allPlayers.Count; i++)
            {
                PlayerInfo playerInfo = allPlayers[i];
                if (!playerInfo.GBPMEHJFECK && playerInfo.GMBAIPNOKLP != player.PlayerId && !playerInfo.FGNJJFABIHJ && !playerInfo.GPBBCHGPABL.inVent)
                {
                    PlayerControl obj = playerInfo.GPBBCHGPABL;
                    if (obj)
                    {
                        Vector2 vector    = obj.GetTruePosition() - truePosition;
                        float   magnitude = vector.magnitude;
                        if (magnitude <= num && !PhysicsHelpers.HKFKKEKGLHF(truePosition, vector.normalized, magnitude, Constants.DHLPLBPJNBA)) //in range and prevent killing through walls
                        {
                            result = obj;
                            num    = magnitude;
                        }
                    }
                }
            }
            return(result);
        }
예제 #6
0
        private void GetBCFPPIDIMJKs()
        {
            int  numJackalAlive    = 0;
            int  numImpostorsAlive = 0;
            int  numLoversAlive    = 0;
            int  numTotalAlive     = 0;
            bool impLover          = false;
            bool jackalLover       = false;

            for (int i = 0; i < GameData.Instance.BCFPPIDIMJK; i++)
            {
                GameData.OFKOJOKOOAK OFKOJOKOOAK = GameData.Instance.AllPlayers[i];
                if (!OFKOJOKOOAK.GBPMEHJFECK)
                {
                    if (!OFKOJOKOOAK.FGNJJFABIHJ)
                    {
                        numTotalAlive++;

                        bool lover = isLover(OFKOJOKOOAK);
                        if (lover)
                        {
                            numLoversAlive++;
                        }

                        if (OFKOJOKOOAK.CIDDOFDJHJH)
                        {
                            numImpostorsAlive++;
                            if (lover)
                            {
                                impLover = true;
                            }
                        }
                        if (Jackal.jackal != null && Jackal.jackal.PlayerId == OFKOJOKOOAK.GMBAIPNOKLP)
                        {
                            numJackalAlive++;
                            if (lover)
                            {
                                jackalLover = true;
                            }
                        }
                        if (Sidekick.sidekick != null && Sidekick.sidekick.PlayerId == OFKOJOKOOAK.GMBAIPNOKLP)
                        {
                            numJackalAlive++;
                            if (lover)
                            {
                                jackalLover = true;
                            }
                        }
                    }
                }
            }

            TeamJackalAlive           = numJackalAlive;
            TeamImpostorsAlive        = numImpostorsAlive;
            TeamLoversAlive           = numLoversAlive;
            TotalAlive                = numTotalAlive;
            TeamImpostorHasAliveLover = impLover;
            TeamJackalHasAliveLover   = jackalLover;
        }
 public static void Prefix(PlayerControl __instance, GameData.OFKOJOKOOAK IGLDJOKKFJE)
 {
     // Reset vampire bitten
     Vampire.bitten = null;
     // Count meetings
     if (IGLDJOKKFJE == null)
     {
         meetingsCount++;
     }
 }
예제 #8
0
            static void Postfix(MeetingHud __instance, byte[] HIDHPMAKEKH, GameData.OFKOJOKOOAK KLHCDCKJHKC, bool EMLKEPIBJLK)
            {
                // Reset swapper values
                Swapper.playerId1 = Byte.MaxValue;
                Swapper.playerId2 = Byte.MaxValue;

                // Lovers save next to be exiled, because RPC of ending game comes before RPC of exiled
                Lovers.notAckedExiledIsLover = false;
                if (KLHCDCKJHKC != null)
                {
                    Lovers.notAckedExiledIsLover = ((Lovers.lover1 != null && Lovers.lover1.PlayerId == KLHCDCKJHKC.GMBAIPNOKLP) || (Lovers.lover2 != null && Lovers.lover2.PlayerId == KLHCDCKJHKC.GMBAIPNOKLP));
                }
            }
        static void Postfix(PlayerControl __instance, GameData.OFKOJOKOOAK IGLDJOKKFJE)
        {
            // Medic or Detective report
            bool isMedicReport     = Medic.medic != null && Medic.medic == PlayerControl.LocalPlayer && __instance.PlayerId == Medic.medic.PlayerId;
            bool isDetectiveReport = Detective.detective != null && Detective.detective == PlayerControl.LocalPlayer && __instance.PlayerId == Detective.detective.PlayerId;

            if (isMedicReport || isDetectiveReport)
            {
                DeadPlayer deadPlayer = deadPlayers?.Where(x => x.player?.PlayerId == IGLDJOKKFJE?.GMBAIPNOKLP)?.FirstOrDefault();

                if (deadPlayer != null && deadPlayer.killerIfExisting != null)
                {
                    float  timeSinceDeath = ((float)(DateTime.UtcNow - deadPlayer.timeOfDeath).TotalMilliseconds);
                    string msg            = "";

                    if (isMedicReport)
                    {
                        msg = $"Body Report: Killed {Math.Round(timeSinceDeath / 1000)}s ago!";
                    }
                    else if (isDetectiveReport)
                    {
                        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) ? "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!";
                        }
                    }

                    if (!string.IsNullOrWhiteSpace(msg))
                    {
                        if (AmongUsClient.Instance.HNMILJEOEKN && DestroyableSingleton <HudManager> .CMJOLNCMAPD)
                        {
                            DestroyableSingleton <HudManager> .CMJOLNCMAPD.Chat.AddChat(PlayerControl.LocalPlayer, msg);
                        }
                        if (msg.IndexOf("who", StringComparison.OrdinalIgnoreCase) >= 0)
                        {
                            DestroyableSingleton <Assets.CoreScripts.Telemetry> .CMJOLNCMAPD.SendWho();
                        }
                    }
                }
            }
        }
예제 #10
0
        public static bool Prefix(Vent __instance, ref float __result, [HarmonyArgument(0)] GameData.OFKOJOKOOAK pc, [HarmonyArgument(1)] out bool canUse, [HarmonyArgument(2)] out bool couldUse)
        {
            float         num     = float.MaxValue;
            PlayerControl @object = pc.GPBBCHGPABL;


            bool roleCouldUse = false;

            if (Engineer.engineer != null && Engineer.engineer == @object)
            {
                roleCouldUse = true;
            }
            else if (Jackal.canUseVents && Jackal.jackal != null && Jackal.jackal == @object)
            {
                roleCouldUse = true;
            }
            else if (Sidekick.canUseVents && Sidekick.sidekick != null && Sidekick.sidekick == @object)
            {
                roleCouldUse = true;
            }
            else if (pc.CIDDOFDJHJH)
            {
                if (Janitor.janitor != null && Janitor.janitor == PlayerControl.LocalPlayer)
                {
                    roleCouldUse = false;
                }
                else if (Mafioso.mafioso != null && Mafioso.mafioso == PlayerControl.LocalPlayer && Godfather.godfather != null && !Godfather.godfather.IDOFAMCIJKE.FGNJJFABIHJ)
                {
                    roleCouldUse = false;
                }
                else
                {
                    roleCouldUse = true;
                }
            }

            couldUse = ((@object.inVent || roleCouldUse) && !pc.FGNJJFABIHJ && (@object.AMDJMEEHNIG || @object.inVent));
            canUse   = couldUse;
            if (canUse)
            {
                Vector2 truePosition = @object.GetTruePosition();
                Vector3 position     = __instance.transform.position;
                num     = Vector2.Distance(truePosition, position);
                canUse &= (num <= __instance.GBFKHOCBAOF && !PhysicsHelpers.GCFCONMBBOF(truePosition, position, Constants.NCOONMPDEDB, false));
            }
            __result = num;
            return(false);
        }
        static PlayerControl setTarget(bool onlyCrewmates = false, bool targetPlayersInVents = false, List <PlayerControl> untargetablePlayers = null)
        {
            PlayerControl result = null;
            float         num    = GameOptionsData.FECFGOOCIJL[Mathf.Clamp(PlayerControl.GameOptions.MLLMFMOMIAC, 0, 2)];

            if (!ShipStatus.Instance)
            {
                return(result);
            }

            Vector2 truePosition = PlayerControl.LocalPlayer.GetTruePosition();

            Il2CppSystem.Collections.Generic.List <GameData.OFKOJOKOOAK> allPlayers = GameData.Instance.AllPlayers;
            for (int i = 0; i < allPlayers.Count; i++)
            {
                GameData.OFKOJOKOOAK OFKOJOKOOAK = allPlayers[i];
                if (!OFKOJOKOOAK.GBPMEHJFECK && OFKOJOKOOAK.GMBAIPNOKLP != PlayerControl.LocalPlayer.PlayerId && !OFKOJOKOOAK.FGNJJFABIHJ && (!onlyCrewmates || !OFKOJOKOOAK.CIDDOFDJHJH))
                {
                    PlayerControl @object = OFKOJOKOOAK.GPBBCHGPABL;
                    if (untargetablePlayers != null && untargetablePlayers.Any(x => x == @object))
                    {
                        // if that player is not targetable: skip check
                        continue;
                    }

                    if (@object && ([email protected] || targetPlayersInVents))
                    {
                        Vector2 vector    = @object.GetTruePosition() - truePosition;
                        float   magnitude = vector.magnitude;
                        if (magnitude <= num && !PhysicsHelpers.HKFKKEKGLHF(truePosition, vector.normalized, magnitude, Constants.DHLPLBPJNBA))
                        {
                            result = @object;
                            num    = magnitude;
                        }
                    }
                }
            }
            return(result);
        }
예제 #12
0
            static bool Prefix(MapCountOverlay __instance)
            {
                // Save colors for the Hacker
                __instance.HAHFHCCIEGH += Time.deltaTime;
                if (__instance.HAHFHCCIEGH < 0.1f)
                {
                    return(false);
                }
                __instance.HAHFHCCIEGH = 0f;
                players = new Dictionary <SystemTypes, List <Color> >();
                bool commsActive = false;

                foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks)
                {
                    if (task.TaskType == TaskTypes.FixComms)
                    {
                        commsActive = true;
                    }
                }


                if (!__instance.KGMLJDGMIND && commsActive)
                {
                    __instance.KGMLJDGMIND = true;
                    __instance.BackgroundColor.SetColor(Palette.JMELLHINKGM);
                    __instance.SabotageText.gameObject.SetActive(true);
                    return(false);
                }
                if (__instance.KGMLJDGMIND && !commsActive)
                {
                    __instance.KGMLJDGMIND = false;
                    __instance.BackgroundColor.SetColor(Color.green);
                    __instance.SabotageText.gameObject.SetActive(false);
                }

                for (int i = 0; i < __instance.CountAreas.Length; i++)
                {
                    CounterArea  counterArea = __instance.CountAreas[i];
                    List <Color> roomColors  = new List <Color>();
                    players.Add(counterArea.RoomType, roomColors);

                    if (!commsActive)
                    {
                        PlainShipRoom plainShipRoom = ShipStatus.Instance.EMIBABGLHIO[counterArea.RoomType];

                        if (plainShipRoom != null && plainShipRoom.roomArea)
                        {
                            int num  = plainShipRoom.roomArea.OverlapCollider(__instance.CGAANOHJEKD, __instance.BLDONECDJFJ);
                            int num2 = num;
                            for (int j = 0; j < num; j++)
                            {
                                Collider2D collider2D = __instance.BLDONECDJFJ[j];
                                if (!(collider2D.tag == "DeadBody"))
                                {
                                    PlayerControl component = collider2D.GetComponent <PlayerControl>();
                                    if (!component || component.IDOFAMCIJKE == null || component.IDOFAMCIJKE.GBPMEHJFECK || component.IDOFAMCIJKE.FGNJJFABIHJ)
                                    {
                                        num2--;
                                    }
                                    else if (component?.LNMJKMLHMIM?.material != null)
                                    {
                                        Color color = component.LNMJKMLHMIM.material.GetColor("_BodyColor");
                                        if (Hacker.onlyColorType)
                                        {
                                            var id = Mathf.Max(0, Palette.CALCLMEEPGL.IndexOf(color));
                                            color = Helpers.isLighterColor((byte)id) ? Palette.CALCLMEEPGL[7] : Palette.CALCLMEEPGL[6];
                                        }
                                        roomColors.Add(color);
                                    }
                                }
                                else
                                {
                                    DeadBody component = collider2D.GetComponent <DeadBody>();
                                    if (component)
                                    {
                                        GameData.OFKOJOKOOAK OFKOJOKOOAK = GameData.Instance.GetPlayerById(component.ParentId);
                                        if (OFKOJOKOOAK != null)
                                        {
                                            var color = Palette.CALCLMEEPGL[OFKOJOKOOAK.JFHFMIKFHGG];
                                            if (Hacker.onlyColorType)
                                            {
                                                color = Helpers.isLighterColor(OFKOJOKOOAK.JFHFMIKFHGG) ? Palette.CALCLMEEPGL[7] : Palette.CALCLMEEPGL[6];
                                            }
                                            roomColors.Add(color);
                                        }
                                    }
                                }
                            }
                            counterArea.UpdateCount(num2);
                        }
                        else
                        {
                            Debug.LogWarning("Couldn't find counter for:" + counterArea.RoomType);
                        }
                    }
                    else
                    {
                        counterArea.UpdateCount(0);
                    }
                }
                return(false);
            }
예제 #13
0
        static void snitchUpdate()
        {
            if (Snitch.localArrows == null)
            {
                return;
            }

            foreach (Arrow arrow in Snitch.localArrows)
            {
                arrow.arrow.SetActive(false);
            }

            if (Snitch.snitch == null || Snitch.snitch.IDOFAMCIJKE.FGNJJFABIHJ)
            {
                return;
            }

            int numberOfTasks = 0;

            GameData.OFKOJOKOOAK OFKOJOKOOAK = Snitch.snitch.IDOFAMCIJKE;
            if (!OFKOJOKOOAK.GBPMEHJFECK && OFKOJOKOOAK.CLLMDIJHALO != null)
            {
                for (int i = 0; i < OFKOJOKOOAK.CLLMDIJHALO.Count; i++)
                {
                    if (!OFKOJOKOOAK.CLLMDIJHALO[i].FNCBODEIJCN)
                    {
                        numberOfTasks++;
                    }
                }
            }

            if (PlayerControl.LocalPlayer.IDOFAMCIJKE.CIDDOFDJHJH && numberOfTasks <= Snitch.taskCountForImpostors)
            {
                if (Snitch.localArrows.Count == 0)
                {
                    Snitch.localArrows.Add(new Arrow(Color.blue));
                }
                if (Snitch.localArrows.Count != 0 && Snitch.localArrows[0] != null)
                {
                    Snitch.localArrows[0].arrow.SetActive(true);
                    Snitch.localArrows[0].Update(Snitch.snitch.transform.position);
                }
            }
            else if (PlayerControl.LocalPlayer == Snitch.snitch && numberOfTasks == 0)
            {
                int arrowIndex = 0;
                foreach (PlayerControl p in PlayerControl.AllPlayerControls)
                {
                    if (p.IDOFAMCIJKE.CIDDOFDJHJH && !p.IDOFAMCIJKE.FGNJJFABIHJ)
                    {
                        if (arrowIndex >= Snitch.localArrows.Count)
                        {
                            Snitch.localArrows.Add(new Arrow(Color.blue));
                        }
                        if (arrowIndex < Snitch.localArrows.Count && Snitch.localArrows[arrowIndex] != null)
                        {
                            Snitch.localArrows[arrowIndex].arrow.SetActive(true);
                            Snitch.localArrows[arrowIndex].Update(p.transform.position);
                        }
                        arrowIndex++;
                    }
                }
            }
        }
예제 #14
0
 private bool isLover(GameData.OFKOJOKOOAK p)
 {
     return((Lovers.lover1 != null && Lovers.lover1.PlayerId == p.GMBAIPNOKLP) || (Lovers.lover2 != null && Lovers.lover2.PlayerId == p.GMBAIPNOKLP));
 }
예제 #15
0
        static bool Prefix(MeetingHud __instance, Il2CppStructArray <byte> HIDHPMAKEKH)
        {
            // Swapper swap votes
            PlayerVoteArea swapped1 = null;
            PlayerVoteArea swapped2 = null;

            foreach (PlayerVoteArea playerVoteArea in __instance.DHCOPOOJCLN)
            {
                if (playerVoteArea.HMPHKKGPLAG == Swapper.playerId1)
                {
                    swapped1 = playerVoteArea;
                }
                if (playerVoteArea.HMPHKKGPLAG == Swapper.playerId2)
                {
                    swapped2 = playerVoteArea;
                }
            }

            bool doSwap = swapped1 != null && swapped2 != null;

            if (doSwap)
            {
                __instance.StartCoroutine(Effects.NFAIFCPOFJK(swapped1.transform, swapped1.transform.localPosition, swapped2.transform.localPosition, 2f));
                __instance.StartCoroutine(Effects.NFAIFCPOFJK(swapped2.transform, swapped2.transform.localPosition, swapped1.transform.localPosition, 2f));
            }

            // Mayor display vote twice
            __instance.TitleText.Text = DestroyableSingleton <TranslationController> .CMJOLNCMAPD.GetString(StringNames.MeetingVotingResults, new Il2CppReferenceArray <Il2CppSystem.Object>(0));

            int num = doSwap ? 4 : 0; // Delay animaton if swapping

            for (int i = 0; i < __instance.DHCOPOOJCLN.Length; i++)
            {
                PlayerVoteArea playerVoteArea = __instance.DHCOPOOJCLN[i];
                playerVoteArea.ClearForResults();
                int  num2 = doSwap ? 4 : 0; // Delay animaton if swapping
                bool mayorFirstVoteDisplayed = false;

                for (int j = 0; j < __instance.DHCOPOOJCLN.Length; j++)
                {
                    PlayerVoteArea playerVoteArea2 = __instance.DHCOPOOJCLN[j];
                    byte           self            = HIDHPMAKEKH[(int)playerVoteArea2.HMPHKKGPLAG];

                    if (!((self & 128) > 0))
                    {
                        GameData.OFKOJOKOOAK playerById = GameData.Instance.GetPlayerById((byte)playerVoteArea2.HMPHKKGPLAG);
                        int votedFor = (int)PlayerVoteArea.GetVotedFor(self);
                        if (votedFor == (int)playerVoteArea.HMPHKKGPLAG)
                        {
                            SpriteRenderer spriteRenderer = UnityEngine.Object.Instantiate <SpriteRenderer>(__instance.PlayerVotePrefab);
                            if (PlayerControl.GameOptions.LNMFPEMGKOB)
                            {
                                PlayerControl.SetPlayerMaterialColors(Palette.JMELLHINKGM, spriteRenderer);
                            }
                            else
                            {
                                PlayerControl.SetPlayerMaterialColors((int)playerById.JFHFMIKFHGG, spriteRenderer);
                            }
                            spriteRenderer.transform.SetParent(playerVoteArea.transform);
                            spriteRenderer.transform.localPosition = __instance.ALGONDAMLHA + new Vector3(__instance.LKIOFMMBOBJ.x * (float)num2, 0f, 0f);
                            spriteRenderer.transform.localScale    = Vector3.zero;
                            spriteRenderer.transform.SetParent(playerVoteArea.transform.parent); // Reparent votes so they don't move with their playerVoteArea
                            __instance.StartCoroutine(Effects.POFLJMGFBEJ((float)num2 * 0.5f, spriteRenderer.transform, 1f, 0.5f));
                            num2++;
                        }
                        else if (i == 0 && votedFor == -1)
                        {
                            SpriteRenderer spriteRenderer2 = UnityEngine.Object.Instantiate <SpriteRenderer>(__instance.PlayerVotePrefab);
                            if (PlayerControl.GameOptions.LNMFPEMGKOB)
                            {
                                PlayerControl.SetPlayerMaterialColors(Palette.JMELLHINKGM, spriteRenderer2);
                            }
                            else
                            {
                                PlayerControl.SetPlayerMaterialColors((int)playerById.JFHFMIKFHGG, spriteRenderer2);
                            }
                            spriteRenderer2.transform.SetParent(__instance.SkippedVoting.transform);
                            spriteRenderer2.transform.localPosition = __instance.ALGONDAMLHA + new Vector3(__instance.LKIOFMMBOBJ.x * (float)num, 0f, 0f);
                            spriteRenderer2.transform.localScale    = Vector3.zero;
                            spriteRenderer2.transform.SetParent(playerVoteArea.transform.parent); // Reparent votes so they don't move with their playerVoteArea
                            __instance.StartCoroutine(Effects.POFLJMGFBEJ((float)num * 0.5f, spriteRenderer2.transform, 1f, 0.5f));
                            num++;
                        }

                        // Major vote, redo this iteration to place a second vote
                        if (Mayor.mayor != null && playerVoteArea2.HMPHKKGPLAG == (sbyte)Mayor.mayor.PlayerId && !mayorFirstVoteDisplayed)
                        {
                            mayorFirstVoteDisplayed = true;
                            j--;
                        }
                    }
                }
            }

            return(false);
        }
예제 #16
0
        public static void Postfix(HudManager __instance)
        {
            // Engineer Repair
            engineerRepairButton = new CustomButton(
                () => {
                engineerRepairButton.Timer = 0f;

                MessageWriter usedRepairWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.EngineerUsedRepair, Hazel.SendOption.Reliable, -1);
                AmongUsClient.Instance.FinishRpcImmediately(usedRepairWriter);
                RPCProcedure.engineerUsedRepair();

                foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks)
                {
                    if (task.TaskType == TaskTypes.FixLights)
                    {
                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.EngineerFixLights, Hazel.SendOption.Reliable, -1);
                        AmongUsClient.Instance.FinishRpcImmediately(writer);
                        RPCProcedure.engineerFixLights();
                    }
                    else if (task.TaskType == TaskTypes.RestoreOxy)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.LifeSupp, 0 | 64);
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.LifeSupp, 1 | 64);
                    }
                    else if (task.TaskType == TaskTypes.ResetReactor)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 16);
                    }
                    else if (task.TaskType == TaskTypes.ResetSeismic)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Laboratory, 16);
                    }
                    else if (task.TaskType == TaskTypes.FixComms)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Comms, 16 | 0);
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Comms, 16 | 1);
                    }
                    else if (task.TaskType == TaskTypes.StopCharles)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 0 | 16);
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 1 | 16);
                    }
                }
            },
                () => { return(Engineer.engineer != null && Engineer.engineer == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => {
                bool sabotageActive = false;
                foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks)
                {
                    if (task.TaskType == TaskTypes.FixLights || task.TaskType == TaskTypes.RestoreOxy || task.TaskType == TaskTypes.ResetReactor || task.TaskType == TaskTypes.ResetSeismic || task.TaskType == TaskTypes.FixComms || task.TaskType == TaskTypes.StopCharles)
                    {
                        sabotageActive = true;
                    }
                }
                return(sabotageActive && !Engineer.usedRepair && PlayerControl.LocalPlayer.AMDJMEEHNIG);
            },
                () => {},
                Engineer.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Janitor Clean
            janitorCleanButton = new CustomButton(
                () => {
                foreach (Collider2D collider2D in Physics2D.OverlapCircleAll(PlayerControl.LocalPlayer.GetTruePosition(), PlayerControl.LocalPlayer.MaxReportDistance, Constants.NFGGONLDDAN))
                {
                    if (collider2D.tag == "DeadBody")
                    {
                        DeadBody component = collider2D.GetComponent <DeadBody>();
                        if (component && !component.Reported)
                        {
                            Vector2 truePosition  = PlayerControl.LocalPlayer.GetTruePosition();
                            Vector2 truePosition2 = component.NCMFGFMFDJB;
                            if (Vector2.Distance(truePosition2, truePosition) <= PlayerControl.LocalPlayer.MaxReportDistance && PlayerControl.LocalPlayer.AMDJMEEHNIG && !PhysicsHelpers.GCFCONMBBOF(truePosition, truePosition2, Constants.DHLPLBPJNBA, false))
                            {
                                GameData.OFKOJOKOOAK OFKOJOKOOAK = GameData.Instance.GetPlayerById(component.ParentId);

                                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JanitorClean, Hazel.SendOption.Reliable, -1);
                                writer.Write(OFKOJOKOOAK.GMBAIPNOKLP);
                                AmongUsClient.Instance.FinishRpcImmediately(writer);
                                RPCProcedure.janitorClean(OFKOJOKOOAK.GMBAIPNOKLP);
                                janitorCleanButton.Timer = janitorCleanButton.MaxTimer;

                                break;
                            }
                        }
                    }
                }
            },
                () => { return(Janitor.janitor != null && Janitor.janitor == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(__instance.ReportButton.renderer.color == Palette.MKAFGNEBHKC && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { janitorCleanButton.Timer = janitorCleanButton.MaxTimer; },
                Janitor.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Sheriff Kill
            sheriffKillButton = new CustomButton(
                () => {
                if (Medic.shielded != null && Medic.shielded == Sheriff.currentTarget)
                {
                    MessageWriter attemptWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShieldedMurderAttempt, Hazel.SendOption.Reliable, -1);
                    AmongUsClient.Instance.FinishRpcImmediately(attemptWriter);
                    RPCProcedure.shieldedMurderAttempt();
                    return;
                }

                byte targetId = 0;
                if ((Sheriff.currentTarget.IDOFAMCIJKE.CIDDOFDJHJH && (Sheriff.currentTarget != Child.child || Child.isGrownUp())) ||
                    Sheriff.currentTarget == Jackal.jackal ||
                    Sheriff.currentTarget == Sidekick.sidekick ||
                    (Sheriff.spyCanDieToSheriff && Spy.spy != null && Spy.spy == Sheriff.currentTarget) ||
                    (Sheriff.jesterCanDieToSheriff && Jester.jester != null && Jester.jester == Sheriff.currentTarget))
                {
                    targetId = Sheriff.currentTarget.PlayerId;
                }
                else
                {
                    targetId = PlayerControl.LocalPlayer.PlayerId;
                }
                MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SheriffKill, Hazel.SendOption.Reliable, -1);
                killWriter.Write(targetId);
                AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                RPCProcedure.sheriffKill(targetId);

                sheriffKillButton.Timer = sheriffKillButton.MaxTimer;
                Sheriff.currentTarget   = null;
            },
                () => { return(Sheriff.sheriff != null && Sheriff.sheriff == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(Sheriff.currentTarget && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { sheriffKillButton.Timer = sheriffKillButton.MaxTimer; },
                __instance.KillButton.renderer.sprite,
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Time Master Rewind Time
            timeMasterShieldButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.TimeMasterShield, Hazel.SendOption.Reliable, -1);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.timeMasterShield();
            },
                () => { return(TimeMaster.timeMaster != null && TimeMaster.timeMaster == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {
                timeMasterShieldButton.Timer          = timeMasterShieldButton.MaxTimer;
                timeMasterShieldButton.isEffectActive = false;
                timeMasterShieldButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
            },
                TimeMaster.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                true,
                TimeMaster.shieldDuration,
                () => { timeMasterShieldButton.Timer = timeMasterShieldButton.MaxTimer; }
                );

            // Medic Shield
            medicShieldButton = new CustomButton(
                () => {
                medicShieldButton.Timer = 0f;

                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.MedicSetShielded, Hazel.SendOption.Reliable, -1);
                writer.Write(Medic.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.medicSetShielded(Medic.currentTarget.PlayerId);
            },
                () => { return(Medic.medic != null && Medic.medic == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(!Medic.usedShield && Medic.currentTarget && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {},
                Medic.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance
                );


            // Shifter shift
            shifterShiftButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetFutureShifted, Hazel.SendOption.Reliable, -1);
                writer.Write(Shifter.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.setFutureShifted(Shifter.currentTarget.PlayerId);
            },
                () => { return(Shifter.shifter != null && Shifter.shifter == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(Shifter.currentTarget && Shifter.futureShift == null && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { },
                Shifter.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Morphling morph
            morphlingButton = new CustomButton(
                () => {
                if (Morphling.sampledTarget != null)
                {
                    MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.MorphlingMorph, Hazel.SendOption.Reliable, -1);
                    writer.Write(Morphling.sampledTarget.PlayerId);
                    AmongUsClient.Instance.FinishRpcImmediately(writer);
                    RPCProcedure.morphlingMorph(Morphling.sampledTarget.PlayerId);
                    Morphling.sampledTarget        = null;
                    morphlingButton.EffectDuration = 10f;
                }
                else if (Morphling.currentTarget != null)
                {
                    Morphling.sampledTarget        = Morphling.currentTarget;
                    morphlingButton.Sprite         = Morphling.getMorphSprite();
                    morphlingButton.EffectDuration = 1f;
                }
            },
                () => { return(Morphling.morphling != null && Morphling.morphling == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return((Morphling.currentTarget || Morphling.sampledTarget) && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {
                morphlingButton.Timer          = morphlingButton.MaxTimer;
                morphlingButton.Sprite         = Morphling.getSampleSprite();
                morphlingButton.isEffectActive = false;
                morphlingButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
                Morphling.sampledTarget = null;
            },
                Morphling.getSampleSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                true,
                10f,
                () => {
                if (Morphling.sampledTarget == null)
                {
                    morphlingButton.Timer  = morphlingButton.MaxTimer;
                    morphlingButton.Sprite = Morphling.getSampleSprite();
                }
            }
                );

            // Camouflager camouflage
            camouflagerButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.CamouflagerCamouflage, Hazel.SendOption.Reliable, -1);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.camouflagerCamouflage();
            },
                () => { return(Camouflager.camouflager != null && Camouflager.camouflager == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {
                camouflagerButton.Timer          = camouflagerButton.MaxTimer;
                camouflagerButton.isEffectActive = false;
                camouflagerButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
            },
                Camouflager.getButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                true,
                10f,
                () => { camouflagerButton.Timer = camouflagerButton.MaxTimer; }
                );

            // Hacker button
            hackerButton = new CustomButton(
                () => {
                Hacker.hackerTimer = Hacker.duration;
            },
                () => { return(Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {
                hackerButton.Timer          = hackerButton.MaxTimer;
                hackerButton.isEffectActive = false;
                hackerButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
            },
                Hacker.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                true,
                0f,
                () => {
                hackerButton.Timer = hackerButton.MaxTimer;
            }
                );

            // Tracker button
            trackerButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.TrackerUsedTracker, Hazel.SendOption.Reliable, -1);
                writer.Write(Tracker.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.trackerUsedTracker(Tracker.currentTarget.PlayerId);
            },
                () => { return(Tracker.tracker != null && Tracker.tracker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG && Tracker.currentTarget != null && !Tracker.usedTracker); },
                () => { },
                Tracker.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            vampireKillButton = new CustomButton(
                () => {
                if (Helpers.handleMurderAttempt(Vampire.currentTarget))
                {
                    if (Vampire.targetNearGarlic)
                    {
                        PlayerControl.LocalPlayer.RpcMurderPlayer(Vampire.currentTarget);
                        vampireKillButton.HasEffect = false;     // Block effect on this click
                        vampireKillButton.Timer     = vampireKillButton.MaxTimer;
                    }
                    else
                    {
                        Vampire.bitten = Vampire.currentTarget;
                        // Notify players about bitten
                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireSetBitten, Hazel.SendOption.Reliable, -1);
                        writer.Write(Vampire.bitten.PlayerId);
                        writer.Write(0);
                        AmongUsClient.Instance.FinishRpcImmediately(writer);
                        RPCProcedure.vampireSetBitten(Vampire.bitten.PlayerId, 0);

                        PlayerControl.LocalPlayer.StartCoroutine(Effects.LDACHPMFOIF(Vampire.delay, new Action <float>((p) => {    // Delayed action
                            if (p == 1f)
                            {
                                if (Vampire.bitten != null && !Vampire.bitten.IDOFAMCIJKE.FGNJJFABIHJ && Helpers.handleMurderAttempt(Vampire.bitten))
                                {
                                    // Perform kill
                                    MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireTryKill, Hazel.SendOption.Reliable, -1);
                                    AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                                    RPCProcedure.vampireTryKill();
                                }
                                else
                                {
                                    // Notify players about clearing bitten
                                    MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireSetBitten, Hazel.SendOption.Reliable, -1);
                                    writer.Write(byte.MaxValue);
                                    writer.Write(byte.MaxValue);
                                    AmongUsClient.Instance.FinishRpcImmediately(writer);
                                    RPCProcedure.vampireSetBitten(byte.MaxValue, byte.MaxValue);
                                }
                            }
                        })));

                        vampireKillButton.HasEffect = true;     // Trigger effect on this click
                    }
                }
                else
                {
                    vampireKillButton.HasEffect = false;     // Block effect if no action was fired
                }
            },
                () => { return(Vampire.vampire != null && Vampire.vampire == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => {
                if (Vampire.targetNearGarlic && Vampire.canKillNearGarlics)
                {
                    vampireKillButton.killButtonManager.renderer.sprite = __instance.KillButton.renderer.sprite;
                }
                else
                {
                    vampireKillButton.killButtonManager.renderer.sprite = Vampire.getButtonSprite();
                }
                return(Vampire.currentTarget != null && PlayerControl.LocalPlayer.AMDJMEEHNIG && (!Vampire.targetNearGarlic || Vampire.canKillNearGarlics));
            },
                () => {
                vampireKillButton.Timer          = vampireKillButton.MaxTimer;
                vampireKillButton.isEffectActive = false;
                vampireKillButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
            },
                Vampire.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                false,
                0f,
                () => {
                vampireKillButton.Timer = vampireKillButton.MaxTimer;
            }
                );

            garlicButton = new CustomButton(
                () => {
                Vampire.localPlacedGarlic = true;
                var pos     = PlayerControl.LocalPlayer.transform.position;
                byte[] buff = new byte[sizeof(float) * 2];
                Buffer.BlockCopy(BitConverter.GetBytes(pos.x), 0, buff, 0 * sizeof(float), sizeof(float));
                Buffer.BlockCopy(BitConverter.GetBytes(pos.y), 0, buff, 1 * sizeof(float), sizeof(float));

                MessageWriter writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.PlaceGarlic, Hazel.SendOption.Reliable);
                writer.WriteBytesAndSize(buff);
                writer.EndMessage();
                RPCProcedure.placeGarlic(buff);
            },
                () => { return(!Vampire.localPlacedGarlic && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ && Vampire.garlicsActive); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG && !Vampire.localPlacedGarlic); },
                () => { },
                Vampire.getGarlicButtonSprite(),
                Vector3.zero,
                __instance,
                true
                );


            // Jackal Sidekick Button
            jackalSidekickButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JackalCreatesSidekick, Hazel.SendOption.Reliable, -1);
                writer.Write(Jackal.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.jackalCreatesSidekick(Jackal.currentTarget.PlayerId);
            },
                () => { return(Jackal.canCreateSidekick && Sidekick.sidekick == null && Jackal.fakeSidekick == null && Jackal.jackal != null && Jackal.jackal == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(Sidekick.sidekick == null && Jackal.fakeSidekick == null && Jackal.currentTarget != null && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { jackalSidekickButton.Timer = jackalSidekickButton.MaxTimer; },
                Jackal.getSidekickButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance
                );

            // Jackal Kill
            jackalKillButton = new CustomButton(
                () => {
                if (!Helpers.handleMurderAttempt(Jackal.currentTarget))
                {
                    return;
                }
                byte targetId            = Jackal.currentTarget.PlayerId;
                MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JackalKill, Hazel.SendOption.Reliable, -1);
                killWriter.Write(targetId);
                AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                RPCProcedure.jackalKill(targetId);
                jackalKillButton.Timer = jackalKillButton.MaxTimer;
                Jackal.currentTarget   = null;
            },
                () => { return(Jackal.jackal != null && Jackal.jackal == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(Jackal.currentTarget && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { jackalKillButton.Timer = jackalKillButton.MaxTimer; },
                __instance.KillButton.renderer.sprite,
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Sidekick Kill
            sidekickKillButton = new CustomButton(
                () => {
                if (!Helpers.handleMurderAttempt(Sidekick.currentTarget))
                {
                    return;
                }
                byte targetId            = Sidekick.currentTarget.PlayerId;
                MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SidekickKill, Hazel.SendOption.Reliable, -1);
                killWriter.Write(targetId);
                AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                RPCProcedure.sidekickKill(targetId);

                sidekickKillButton.Timer = sidekickKillButton.MaxTimer;
                Sidekick.currentTarget   = null;
            },
                () => { return(Sidekick.canKill && Sidekick.sidekick != null && Sidekick.sidekick == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(Sidekick.currentTarget && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { sidekickKillButton.Timer = sidekickKillButton.MaxTimer; },
                __instance.KillButton.renderer.sprite,
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Lighter light
            lighterButton = new CustomButton(
                () => {
                Lighter.lighterTimer = Lighter.duration;
            },
                () => { return(Lighter.lighter != null && Lighter.lighter == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {
                lighterButton.Timer          = lighterButton.MaxTimer;
                lighterButton.isEffectActive = false;
                lighterButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
            },
                Lighter.getButtonSprite(),
                new Vector3(-1.3f, 0f, 0f),
                __instance,
                true,
                Lighter.duration,
                () => { lighterButton.Timer = lighterButton.MaxTimer; }
                );

            // Eraser erase button
            eraserButton = new CustomButton(
                () => {
                eraserButton.MaxTimer += 10;
                eraserButton.Timer     = eraserButton.MaxTimer;

                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetFutureErased, Hazel.SendOption.Reliable, -1);
                writer.Write(Eraser.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.setFutureErased(Eraser.currentTarget.PlayerId);
            },
                () => { return(Eraser.eraser != null && Eraser.eraser == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG && Eraser.currentTarget != null); },
                () => { eraserButton.Timer = eraserButton.MaxTimer; },
                Eraser.getButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance
                );

            // Set the default (or settings from the previous game) timers/durations when spawning the buttons
            setCustomButtonCooldowns();
        }