Exemplo n.º 1
0
        private static bool Prefix(Intercom __instance)
        {
            if (!string.IsNullOrEmpty(__instance.CustomContent))
            {
                __instance.IntercomState        = Intercom.State.Custom;
                __instance.Network_intercomText = __instance.CustomContent;
            }
            else if (__instance.Muted)
            {
                //IntercomState = State.Muted;
                SetContent(__instance, Intercom.State.Muted);
            }
            else if (Intercom.AdminSpeaking)
            {
                //IntercomState = State.AdminSpeaking;
                SetContent(__instance, Intercom.State.AdminSpeaking);
            }
            else if (__instance.remainingCooldown > 0f)
            {
                int num = Mathf.CeilToInt(__instance.remainingCooldown);
                //IntercomState = State.Restarting;
                __instance.NetworkIntercomTime = (ushort)((num >= 0) ? ((ushort)num) : 0);
                SetContent(__instance, Intercom.State.Restarting);
            }
            else if (__instance.Networkspeaker != null)
            {
                if (__instance.bypassSpeaking)
                {
                    //IntercomState = State.TransmittingBypass;
                    SetContent(__instance, Intercom.State.TransmittingBypass);
                }
                else
                {
                    int num2 = Mathf.CeilToInt(__instance.speechRemainingTime);
                    //IntercomState = State.Transmitting;
                    __instance.NetworkIntercomTime = (ushort)((num2 >= 0) ? ((ushort)num2) : 0);
                    SetContent(__instance, Intercom.State.Transmitting);
                }
            }
            else
            {
                //IntercomState = State.Ready;
                SetContent(__instance, Intercom.State.Ready);
            }

            if (Intercom.AdminSpeaking != Intercom.LastState)
            {
                Intercom.LastState = Intercom.AdminSpeaking;
                __instance.RpcUpdateAdminStatus(Intercom.AdminSpeaking);
            }

            return(false);
        }
Exemplo n.º 2
0
        public static bool Prefix(Intercom __instance)
        {
            if (!Configs.intercom_information)
            {
                return(true);
            }

            int  leftdecont      = (int)((Math.Truncate(((11.74f * 60) * 100f)) / 100f) - (Math.Truncate(PlayerManager.localPlayer.GetComponent <DecontaminationLCZ>().time * 100f) / 100f));
            int  leftautowarhead = Mathf.Clamp(Configs.auto_warhead_start - RoundSummary.roundTime, 0, Configs.auto_warhead_start);
            int  nextRespawn     = (int)Math.Truncate(PlayerManager.localPlayer.GetComponent <MTFRespawn>().timeToNextRespawn + PlayerManager.localPlayer.GetComponent <MTFRespawn>().respawnCooldown);
            bool isContain       = PlayerManager.localPlayer.GetComponent <CharacterClassManager>()._lureSpj.NetworkallowContain;
            bool isAlreadyUsed   = UnityEngine.Object.FindObjectOfType <OneOhSixContainer>().Networkused;

            float totalvoltagefloat = 0f;

            foreach (var i in Generator079.generators)
            {
                totalvoltagefloat += i.localVoltage;
            }
            totalvoltagefloat *= 1000f;

            string contentfix = string.Concat(
                $"作戦経過時間 : {RoundSummary.roundTime / 60:00}:{RoundSummary.roundTime % 60:00}\n",
                $"残存SCPオブジェクト : {RoundSummary.singleton.CountTeam(Team.SCP):00}/{RoundSummary.singleton.classlistStart.scps_except_zombies:00}\n",
                $"残存Dクラス職員 : {RoundSummary.singleton.CountTeam(Team.CDP):00}/{RoundSummary.singleton.classlistStart.class_ds:00}\n",
                $"残存科学者 : {RoundSummary.singleton.CountTeam(Team.RSC):00}/{RoundSummary.singleton.classlistStart.scientists:00}\n",
                $"施設内余剰電力 : {totalvoltagefloat:0000}kVA\n",
                $"AlphaWarheadのステータス : {(AlphaWarheadOutsitePanel.nukeside.Networkenabled ? "READY" : "DISABLED")}\n",
                $"SCP-106再収用設備:{(isContain ? (isAlreadyUsed ? "使用済み" : "準備完了") : "人員不在")}\n",
                $"軽度収用区画閉鎖まで : {leftdecont / 60:00}:{leftdecont % 60:00}\n",
                $"自動施設爆破開始まで : {leftautowarhead / 60:00}:{leftautowarhead % 60:00}\n",
                $"接近中の部隊突入まで : {nextRespawn / 60:00}:{nextRespawn % 60:00}\n"
                );


            if (__instance.Muted)
            {
                __instance._content = contentfix + "あなたは管理者によってミュートされている";
            }
            else if (Intercom.AdminSpeaking)
            {
                __instance._content = contentfix + "管理者が放送設備をオーバーライド中";
            }
            else if (__instance.remainingCooldown > 0f)
            {
                __instance._content = contentfix + "放送設備再起動中 : " + Mathf.CeilToInt(__instance.remainingCooldown) + "秒必要";
            }
            else if (__instance.Networkspeaker != null)
            {
                if (__instance.speechRemainingTime == -77f)
                {
                    __instance._content = contentfix + "放送中... : オーバーライド";
                }
                else
                {
                    __instance._content = contentfix + $"{ReferenceHub.GetHub(__instance.Networkspeaker).GetNickname()}が放送中... : 残り" + Mathf.CeilToInt(__instance.speechRemainingTime) + "秒";
                }
            }
            else
            {
                __instance._content = contentfix + "放送設備準備完了";
            }
            if (__instance._contentDirty)
            {
                __instance.NetworkintercomText = __instance._content;
                __instance._contentDirty       = false;
            }
            if (Intercom.AdminSpeaking != Intercom.LastState)
            {
                Intercom.LastState = Intercom.AdminSpeaking;
                __instance.RpcUpdateAdminStatus(Intercom.AdminSpeaking);
            }

            return(false);
        }