From 6d0470308c1217d4e12dfbfde3f172bf02b74dc3 Mon Sep 17 00:00:00 2001 From: Gurge44 Date: Mon, 4 Mar 2024 19:15:37 +0100 Subject: [PATCH] Fix no kill button for NNKs --- Roles/Neutral/FFF.cs | 5 +++++ Roles/Neutral/Maverick.cs | 7 ++----- Roles/Neutral/Romantic.cs | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Roles/Neutral/FFF.cs b/Roles/Neutral/FFF.cs index e627e2dd1..8e8979254 100644 --- a/Roles/Neutral/FFF.cs +++ b/Roles/Neutral/FFF.cs @@ -64,6 +64,11 @@ namespace TOHE.Roles.Neutral public override bool IsEnable => On; public override bool CanUseImpostorVentButton(PlayerControl pc) => false; + public override bool CanUseKillButton(PlayerControl pc) + { + return pc.IsAlive() && !isWon; + } + public override void ApplyGameOptions(IGameOptions opt, byte playerId) { opt.SetVision(true); diff --git a/Roles/Neutral/Maverick.cs b/Roles/Neutral/Maverick.cs index c01dc481b..10da9919a 100644 --- a/Roles/Neutral/Maverick.cs +++ b/Roles/Neutral/Maverick.cs @@ -50,11 +50,8 @@ public class Maverick : RoleBase public override void SetKillCooldown(byte id) => Main.AllPlayerKillCooldown[id] = KillCooldown.GetFloat(); public override void ApplyGameOptions(IGameOptions opt, byte id) => opt.SetVision(HasImpostorVision.GetBool()); public override bool CanUseImpostorVentButton(PlayerControl pc) => CanVent.GetBool(); - - public override bool CanUseSabotage(PlayerControl pc) - { - return false; - } + public override bool CanUseKillButton(PlayerControl pc) => pc.IsAlive(); + public override bool CanUseSabotage(PlayerControl pc) => false; public override string GetProgressText(byte playerId, bool comms) { diff --git a/Roles/Neutral/Romantic.cs b/Roles/Neutral/Romantic.cs index 23b49f45f..69c0fe4ea 100644 --- a/Roles/Neutral/Romantic.cs +++ b/Roles/Neutral/Romantic.cs @@ -171,6 +171,7 @@ public class Romantic : RoleBase public override void OnReportDeadBody() => IsPartnerProtected = false; public override bool CanUseImpostorVentButton(PlayerControl pc) => false; + public override bool CanUseKillButton(PlayerControl pc) => pc.IsAlive(); public static void ChangeRole() {