private static bool Prefix(KillButtonManager __instance) { KillEvent killEvent = new KillEvent(__instance); GameEventManager.callPerformKill(killEvent); return(killEvent.consume); }
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; } }
public static void callPerformKill(KillEvent __event) { PerformKill?.Invoke(null, __event); }
public virtual void PerformKill(object sender, KillEvent killEvent) { }