Пример #1
0
        static void Prefix(UnityEngine.Object obj)
        {
            if (ExileController.Instance != null && obj == ExileController.Instance.gameObject)
            {
                // Reset custom button timers where necessary
                CustomButton.MeetingEndedUpdate();

                // Jester win condition
                if (Jester.jester != null && ExileController.Instance.exiled != null && ExileController.Instance.exiled.PlayerId == Jester.jester.PlayerId)
                {
                    MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JesterWin, Hazel.SendOption.None, -1);
                    AmongUsClient.Instance.FinishRpcImmediately(writer);

                    RPCProcedure.jesterWin();
                }

                // Child win condition
                if (Child.child != null && ExileController.Instance.exiled != null && ExileController.Instance.exiled.PlayerId == Child.child.PlayerId)
                {
                    MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ChildDied, Hazel.SendOption.None, -1);
                    AmongUsClient.Instance.FinishRpcImmediately(writer);
                    RPCProcedure.childDied();
                }
            }
        }
Пример #2
0
        static void Postfix(byte ACCJCEHMKLN, MessageReader HFPCBBHJIPJ)
        {
            byte          packetId = ACCJCEHMKLN;
            MessageReader reader   = HFPCBBHJIPJ;

            switch (packetId)
            {
            // Main Controls

            case (byte)CustomRPC.ResetVaribles:
                RPCProcedure.resetVariables();
                break;

            case (byte)CustomRPC.ForceEnd:
                RPCProcedure.forceEnd();
                break;

            case (byte)CustomRPC.SetRole:
                byte roleId   = HFPCBBHJIPJ.ReadByte();
                byte playerId = HFPCBBHJIPJ.ReadByte();
                RPCProcedure.setRole(roleId, playerId);
                break;


            // Role functionality

            case (byte)CustomRPC.JesterWin:
                RPCProcedure.jesterWin();
                break;

            case (byte)CustomRPC.EngineerFixLights:
                RPCProcedure.engineerFixLights();
                break;

            case (byte)CustomRPC.EngineerUsedRepair:
                RPCProcedure.engineerUsedRepair();
                break;

            case (byte)CustomRPC.JanitorClean:
                RPCProcedure.janitorClean(HFPCBBHJIPJ.ReadByte());
                break;

            case (byte)CustomRPC.SheriffKill:
                RPCProcedure.sheriffKill(HFPCBBHJIPJ.ReadByte());
                break;

            case (byte)CustomRPC.TimeMasterRewindTime:
                RPCProcedure.timeMasterRewindTime();
                break;

            case (byte)CustomRPC.MedicSetShielded:
                RPCProcedure.medicSetShielded(HFPCBBHJIPJ.ReadByte());
                break;

            case (byte)CustomRPC.ShieldedMurderAttempt:
                RPCProcedure.shieldedMurderAttempt();
                break;

            case (byte)CustomRPC.TimeMasterRevive:
                RPCProcedure.timeMasterRevive(HFPCBBHJIPJ.ReadByte());
                break;

            case (byte)CustomRPC.ShifterShift:
                RPCProcedure.shifterShift(HFPCBBHJIPJ.ReadByte());
                break;

            case (byte)CustomRPC.SwapperSwap:
                byte playerId1 = HFPCBBHJIPJ.ReadByte();
                byte playerId2 = HFPCBBHJIPJ.ReadByte();
                RPCProcedure.swapperSwap(playerId1, playerId2);
                break;

            case (byte)CustomRPC.SeerReveal:
                RPCProcedure.seerReveal(HFPCBBHJIPJ.ReadByte());
                break;

            case (byte)CustomRPC.MorphlingMorph:
                RPCProcedure.morphlingMorph(HFPCBBHJIPJ.ReadByte());
                break;

            case (byte)CustomRPC.CamouflagerCamouflage:
                RPCProcedure.camouflagerCamouflage();
                break;

            case (byte)CustomRPC.ChildDied:
                RPCProcedure.childDied();
                break;

            case (byte)CustomRPC.LoverSuicide:
                RPCProcedure.loverSuicide(HFPCBBHJIPJ.ReadByte());
                break;
            }
        }