Пример #1
0
        public static void promoteToLastImpostor()
        {
            if (!isEnable)
            {
                return;
            }

            var impList = new List <PlayerControl>();

            foreach (var p in PlayerControl.AllPlayerControls)
            {
                if (p.isImpostor() && p.isAlive())
                {
                    impList.Add(p);
                }
            }
            if (impList.Count == 1)
            {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ImpostorPromotesToLastImpostor, Hazel.SendOption.Reliable, -1);
                writer.Write(impList[0].PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.impostorPromotesToLastImpostor(impList[0].PlayerId);
            }
        }