Beispiel #1
0
        private static bool Prefix(AlphaWarheadController __instance)
        {
            if (Recontainer079.isLocked)
            {
                return(false);
            }

            __instance.doorsOpen = false;

            ServerLogs.AddLog(ServerLogs.Modules.Warhead, "Countdown started.", ServerLogs.ServerLogType.GameEvent);

            if ((AlphaWarheadController._resumeScenario != -1 || __instance.scenarios_start[AlphaWarheadController._startScenario].SumTime() != (double)__instance.timeToDetonation) && (AlphaWarheadController._resumeScenario == -1 || __instance.scenarios_resume[AlphaWarheadController._resumeScenario].SumTime() != (double)__instance.timeToDetonation))
            {
                return(false);
            }

            var ev = new StartingEventArgs(API.Features.Server.Host);

            Warhead.OnStarting(ev);

            if (!ev.IsAllowed)
            {
                return(false);
            }

            __instance.NetworkinProgress = true;

            return(false);
        }
Beispiel #2
0
        private static bool Prefix(PlayerInteract __instance)
        {
            if (!__instance._playerInteractRateLimit.CanExecute(true) || (__instance._hc.CufferId > 0 && !PlayerInteract.CanDisarmedInteract))
            {
                return(false);
            }

            GameObject gameObject = GameObject.Find("OutsitePanelScript");

            if (!__instance.ChckDis(gameObject.transform.position) || !AlphaWarheadOutsitePanel.nukeside.enabled)
            {
                return(false);
            }

            if (!gameObject.GetComponent <AlphaWarheadOutsitePanel>().keycardEntered || Recontainer079.isLocked)
            {
                return(false);
            }

            AlphaWarheadController.Host.doorsOpen = false;

            ServerLogs.AddLog(ServerLogs.Modules.Warhead, "Countdown started.", ServerLogs.ServerLogType.GameEvent);
            if ((AlphaWarheadController._resumeScenario == -1 && AlphaWarheadController.Host.scenarios_start[AlphaWarheadController._startScenario].SumTime() == AlphaWarheadController.Host.timeToDetonation) ||
                (AlphaWarheadController._resumeScenario != -1 && AlphaWarheadController.Host.scenarios_resume[AlphaWarheadController._resumeScenario].SumTime() == AlphaWarheadController.Host.timeToDetonation))
            {
                var ev = new StartingEventArgs(API.Features.Player.Get(__instance.gameObject) ?? API.Features.Server.Host);

                Warhead.OnStarting(ev);

                if (!ev.IsAllowed)
                {
                    return(false);
                }

                AlphaWarheadController.Host.NetworkinProgress = true;
            }

            ServerLogs.AddLog(ServerLogs.Modules.Warhead, __instance.GetComponent <NicknameSync>().MyNick + " (" + __instance.GetComponent <CharacterClassManager>().UserId + ") started the Alpha Warhead detonation.", ServerLogs.ServerLogType.GameEvent);

            __instance.OnInteract();

            return(false);
        }