Esempio n. 1
0
        private static bool ServerKillPlayerPatch(PlayableScps.Scp173 __instance, ReferenceHub target)
        {
            try
            {
                var scp    = __instance.GetPlayer();
                var player = target.GetPlayer();

                if (target == __instance.Hub || player.ClassManager.IsAnyScp() || player.ClassManager.CurClass == RoleType.Spectator)
                {
                    return(false);
                }

                if (!SynapseExtensions.GetHarmPermission(scp, player))
                {
                    return(false);
                }

                SynapseController.Server.Events.Scp.InvokeScpAttack(scp, player, Api.Enum.ScpAttackType.Scp173_Snap, out var allow);

                return(allow);
            }
            catch (Exception e)
            {
                Synapse.Api.Logger.Get.Error($"Synapse-Event: ScpAttackEvent(Scp173) failed!!\n{e}");
                return(true);
            }
        }
Esempio n. 2
0
        private static bool Blink(PlayableScps.Scp173 __instance, ref Vector3 blinkPos)
        {
            try
            {
                if (!__instance.BlinkReady)
                {
                    return(false);
                }
                if ((__instance.Hub.PlayerCameraReference.transform.position - blinkPos).magnitude > __instance.EffectiveBlinkDistance() * 1.05)
                {
                    return(false);
                }

                Server.Get.Events.Scp.Scp173.InvokeScp173BlinkEvent(__instance.GetPlayer(), ref blinkPos, out var allow);
                return(allow);
            }
            catch (System.Exception e)
            {
                Synapse.Api.Logger.Get.Error($"Synapse-Event: Scp173BlinkEvent(Scp173) failed!!\n{e}");
                return(true);
            }
        }