Beispiel #1
0
        private static bool OnPanelInteract(PlayerInteract __instance, PlayerInteract.AlphaPanelOperations n)
        {
            try
            {
                if (Map.Get.Nuke.InsidePanel.Locked)
                {
                    return(false);
                }

                if (!__instance.CanInteract || !__instance.ChckDis(AlphaWarheadOutsitePanel.nukeside.transform.position))
                {
                    return(false);
                }
                var player = __instance.GetPlayer();

                Get.Map.InvokeWarheadPanel(player, n == PlayerInteract.AlphaPanelOperations.Cancel, out var allow);

                return(allow);
            }
            catch (Exception e)
            {
                Synapse.Api.Logger.Get.Error($"Synapse-Event: WarheadPanelInteract Event failed!!\n{e}");
                return(false);
            }
        }
        public static bool Prefix(PlayerInteract __instance)
        {
            try
            {
                var allow = true;
                Events.InvokeScp106ContainmentEvent(__instance.GetPlayer(), ref allow);

                return(allow);
            }
            catch (Exception e)
            {
                Log.Error($"Scp106ContainmentErr: {e}");
                return(true);
            }
        }
        private static bool OnCmdDetonate(PlayerInteract __instance)
        {
            try
            {
                if (!__instance.CanInteract || !Nuke.Get.OutsidePanel.KeyCardEntered || !Nuke.Get.InsidePanel.Enabled)
                {
                    return(false);
                }
                var player = __instance.GetPlayer();

                Get.Map.InvokeWarheadStart(player, out var allow);

                return(allow);
            }
            catch (Exception e)
            {
                Logger.Get.Error($"Synapse-Event: WarheadStart Event failed!!\n{e}");
                return(true);
            }
        }
Beispiel #4
0
        private static bool Contain106(PlayerInteract __instance)
        {
            try
            {
                var player = __instance.GetPlayer();
                if (!SynapseExtensions.CanHarmScp(player) || !__instance.CanInteract)
                {
                    return(false);
                }

                var allow = true;
                EventHandler.Get.Scp.Scp106.InvokeScp106ContainmentEvent(player, ref allow);
                return(allow);
            }
            catch (Exception e)
            {
                Logger.Get.Error($"Synapse-Event: Scp106Containment failed!!\n{e}");
                return(true);
            }
        }