Example #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);
            }
        }
Example #2
0
        public static bool Prefix(PlayerInteract __instance, PlayerInteract.AlphaPanelOperations n)
        {
            Plugin.Log.Debug("UsePanelPatch");
            Player ply = Player.Get(__instance.gameObject);

            if (!Plugin.GhostList.Contains(ply))
            {
                return(true);
            }

            if (n == PlayerInteract.AlphaPanelOperations.Cancel)
            {
                ply.ClearBroadcasts();
                ply.Broadcast(3, Translation.Translation.GetText().DetonationCancelDenied);
            }
            else if (n == PlayerInteract.AlphaPanelOperations.Lever)
            {
                ply.ClearBroadcasts();
                ply.Broadcast(3, Translation.Translation.GetText().DetonationCancelDenied);
            }
            else
            {
                ply.ClearBroadcasts();
                ply.Broadcast(3, Translation.Translation.GetText().LeverDenied);
            }

            return(false);
        }