示例#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)
 {
 }