Пример #1
0
        private static bool Prefix(KillButtonManager __instance)
        {
            KillEvent killEvent = new KillEvent(__instance);

            GameEventManager.callPerformKill(killEvent);

            return(killEvent.consume);
        }
Пример #2
0
        public override void PerformKill(object sender, KillEvent killEvent)
        {
            if (!player.CanMove)
            {
                return;
            }
            if (player.Data.IsDead)
            {
                return;
            }

            if (SheriffKillTimer() != 0f)
            {
                return;
            }

            Role  target = GetClosestPlayer();
            float dist   = (float)GetDistanceTo(this, target);

            if (dist < (double)GameOptionsData.KillDistances[PlayerControl.GameOptions.KillDistance])
            {
                bool hasKilled = false;
                if (target.roleInfo.type == RoleTypes.Crewmate && Sheriff.sheriffKillOther.GetValue())
                {
                    hasKilled = KillManager.AttemptMurder(this, target);
                    if (hasKilled)
                    {
                        KillManager.Suicide(this);
                    }
                }
                else
                {
                    hasKilled = KillManager.AttemptMurder(this, target);
                }

                killEvent.Consume(true);
                return;
            }
        }
Пример #3
0
 public static void callPerformKill(KillEvent __event)
 {
     PerformKill?.Invoke(null, __event);
 }
Пример #4
0
 public virtual void PerformKill(object sender, KillEvent killEvent)
 {
 }