From 80eaeef1bace46b41149da6f53e17d68b5d151cc Mon Sep 17 00:00:00 2001 From: Azzy <29222142+AzzyIsNotHere@users.noreply.github.com> Date: Fri, 9 May 2025 06:41:31 -0600 Subject: [PATCH 1/8] feat: stats command This should maintain backwards compatibility with the previous kills command implementation. --- SillySCP/Commands/{Kills.cs => Stats.cs} | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename SillySCP/Commands/{Kills.cs => Stats.cs} (70%) diff --git a/SillySCP/Commands/Kills.cs b/SillySCP/Commands/Stats.cs similarity index 70% rename from SillySCP/Commands/Kills.cs rename to SillySCP/Commands/Stats.cs index 6b42949..b097f08 100644 --- a/SillySCP/Commands/Kills.cs +++ b/SillySCP/Commands/Stats.cs @@ -5,13 +5,13 @@ namespace SillySCP.Commands { [CommandHandler(typeof(ClientCommandHandler))] - public class Kills : ICommand + public class Stats : ICommand { - public string Command { get; } = "kills"; + public string Command { get; } = "stats"; - public string[] Aliases { get; } = new [] { "k" }; + public string[] Aliases { get; } = new [] { "k", "s", "kills" }; - public string Description { get; } = "Get the amount of kills you have."; + public string Description { get; } = "Get your stats for this round."; public bool Execute( ArraySegment arguments, @@ -30,18 +30,18 @@ out string response if (player.DoNotTrack) { response = - "You have do not track enabled, disable it so we can start tracking your kills!"; + "You have do not track enabled, disable it so we can start tracking your stats!"; return false; } PlayerStat playerStat = Plugin.Instance.PlayerStats.Find((p) => p.Player == player); if (playerStat == null) { - response = "You have 0 kills!"; + response = "You have no stats to show!"; return true; } - response = "You have " + (playerStat.Kills ?? 0) + " player kills and " + (playerStat.ScpKills ?? 0) + " SCP kills!"; + response = "You have " + (playerStat.Kills ?? 0) + " player kills, " + (playerStat.ScpKills ?? 0) + " SCP kills, and " + (playerStat.Damage ?? 0) + " damage!"; return true; } } From 20a21650489931eb299d766c972b71512f7150fa Mon Sep 17 00:00:00 2001 From: Azzy <29222142+AzzyIsNotHere@users.noreply.github.com> Date: Fri, 9 May 2025 07:34:43 -0600 Subject: [PATCH 2/8] revert: oops i didnt read the issue reverts 80eaeef1bace46b41149da6f53e17d68b5d151cc --- SillySCP/Commands/{Stats.cs => Kills.cs} | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename SillySCP/Commands/{Stats.cs => Kills.cs} (70%) diff --git a/SillySCP/Commands/Stats.cs b/SillySCP/Commands/Kills.cs similarity index 70% rename from SillySCP/Commands/Stats.cs rename to SillySCP/Commands/Kills.cs index b097f08..6b42949 100644 --- a/SillySCP/Commands/Stats.cs +++ b/SillySCP/Commands/Kills.cs @@ -5,13 +5,13 @@ namespace SillySCP.Commands { [CommandHandler(typeof(ClientCommandHandler))] - public class Stats : ICommand + public class Kills : ICommand { - public string Command { get; } = "stats"; + public string Command { get; } = "kills"; - public string[] Aliases { get; } = new [] { "k", "s", "kills" }; + public string[] Aliases { get; } = new [] { "k" }; - public string Description { get; } = "Get your stats for this round."; + public string Description { get; } = "Get the amount of kills you have."; public bool Execute( ArraySegment arguments, @@ -30,18 +30,18 @@ out string response if (player.DoNotTrack) { response = - "You have do not track enabled, disable it so we can start tracking your stats!"; + "You have do not track enabled, disable it so we can start tracking your kills!"; return false; } PlayerStat playerStat = Plugin.Instance.PlayerStats.Find((p) => p.Player == player); if (playerStat == null) { - response = "You have no stats to show!"; + response = "You have 0 kills!"; return true; } - response = "You have " + (playerStat.Kills ?? 0) + " player kills, " + (playerStat.ScpKills ?? 0) + " SCP kills, and " + (playerStat.Damage ?? 0) + " damage!"; + response = "You have " + (playerStat.Kills ?? 0) + " player kills and " + (playerStat.ScpKills ?? 0) + " SCP kills!"; return true; } } From 1ac3882688d2def3268607b1ea1ecedde4f812d3 Mon Sep 17 00:00:00 2001 From: Azzy <29222142+AzzyIsNotHere@users.noreply.github.com> Date: Fri, 9 May 2025 07:54:06 -0600 Subject: [PATCH 3/8] feat: stats command, but for real --- SillySCP/Commands/Stats.cs | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 SillySCP/Commands/Stats.cs diff --git a/SillySCP/Commands/Stats.cs b/SillySCP/Commands/Stats.cs new file mode 100644 index 0000000..273d6a9 --- /dev/null +++ b/SillySCP/Commands/Stats.cs @@ -0,0 +1,52 @@ +using CommandSystem; +using Exiled.API.Features; +using SillySCP.API.Features; + +namespace SillySCP.Commands +{ + [CommandHandler(typeof(ClientCommandHandler))] + public class Damage : ICommand + { + public string Command { get; } = "damage"; + public string[] Aliases { get; } = new [] { "d", "dam" }; + public string Description { get; } = "Get the amount of damage you've dealt."; + + public bool Execute( + ArraySegment arguments, + ICommandSender sender, + out string response + ) + { + Player.TryGet(sender, out Player player); + + if (player == null) + { + response = "Only players can use this command!"; + return false; + } + + if (player.DoNotTrack) + { + response = + "You have do not track enabled, disable it so we can start tracking your damage!"; + return false; + } + + if (player.IsAlive) + { + response = "You must be dead to run this command!"; + return false; + } + + PlayerStat playerStat = Plugin.Instance.PlayerStats.Find((p) => p.Player == player); + if (playerStat == null) + { + response = "You have dealt 0 damage!"; + return true; + } + + response = "You have dealt " + (playerStat.Damage ?? 0) + "damage!"; + return true; + } + } +} From 0162dcd2aefd3b458fbae3726e3aafd725f1fda4 Mon Sep 17 00:00:00 2001 From: Azzy <29222142+AzzyIsNotHere@users.noreply.github.com> Date: Fri, 9 May 2025 08:28:48 -0600 Subject: [PATCH 4/8] fix: typo in damage response --- SillySCP/Commands/Stats.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SillySCP/Commands/Stats.cs b/SillySCP/Commands/Stats.cs index 273d6a9..107312a 100644 --- a/SillySCP/Commands/Stats.cs +++ b/SillySCP/Commands/Stats.cs @@ -45,7 +45,7 @@ out string response return true; } - response = "You have dealt " + (playerStat.Damage ?? 0) + "damage!"; + response = "You have dealt " + (playerStat.Damage ?? 0) + " damage!"; return true; } } From b5d41b2b38860222608d83448d9241cba5356607 Mon Sep 17 00:00:00 2001 From: Azzy <29222142+AzzyIsNotHere@users.noreply.github.com> Date: Fri, 9 May 2025 08:28:48 -0600 Subject: [PATCH 5/8] style: typo in damage response --- SillySCP/Commands/Stats.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SillySCP/Commands/Stats.cs b/SillySCP/Commands/Stats.cs index 273d6a9..107312a 100644 --- a/SillySCP/Commands/Stats.cs +++ b/SillySCP/Commands/Stats.cs @@ -45,7 +45,7 @@ out string response return true; } - response = "You have dealt " + (playerStat.Damage ?? 0) + "damage!"; + response = "You have dealt " + (playerStat.Damage ?? 0) + " damage!"; return true; } } From 582d12cf529e8b8f79adeeaaf8de95470f7b4747 Mon Sep 17 00:00:00 2001 From: Azzy <29222142+AzzyIsNotHere@users.noreply.github.com> Date: Fri, 9 May 2025 08:39:22 -0600 Subject: [PATCH 6/8] fix: floor the damage (what is flooring???) --- SillySCP/Commands/Stats.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SillySCP/Commands/Stats.cs b/SillySCP/Commands/Stats.cs index 107312a..230a671 100644 --- a/SillySCP/Commands/Stats.cs +++ b/SillySCP/Commands/Stats.cs @@ -45,7 +45,7 @@ out string response return true; } - response = "You have dealt " + (playerStat.Damage ?? 0) + " damage!"; + response = "You have dealt " + Math.Floor(playerStat.Damage ?? 0) + " damage!"; return true; } } From 064cf4cb4a5f1ef7f25e4afac12a7a572338e85b Mon Sep 17 00:00:00 2001 From: Azzy <29222142+AzzyIsNotHere@users.noreply.github.com> Date: Fri, 9 May 2025 08:52:41 -0600 Subject: [PATCH 7/8] fix: modify command name and aliases --- SillySCP/Commands/Stats.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SillySCP/Commands/Stats.cs b/SillySCP/Commands/Stats.cs index 230a671..1743397 100644 --- a/SillySCP/Commands/Stats.cs +++ b/SillySCP/Commands/Stats.cs @@ -7,8 +7,8 @@ namespace SillySCP.Commands [CommandHandler(typeof(ClientCommandHandler))] public class Damage : ICommand { - public string Command { get; } = "damage"; - public string[] Aliases { get; } = new [] { "d", "dam" }; + public string Command { get; } = "stats"; + public string[] Aliases { get; } = new [] { "s" }; public string Description { get; } = "Get the amount of damage you've dealt."; public bool Execute( From 069f41c6362c1cf9648d7fdec62f653818170cd9 Mon Sep 17 00:00:00 2001 From: Azzy <29222142+AzzyIsNotHere@users.noreply.github.com> Date: Fri, 9 May 2025 09:09:45 -0600 Subject: [PATCH 8/8] chore: it's pronounced damage --- SillySCP/Commands/{Stats.cs => Damage.cs} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename SillySCP/Commands/{Stats.cs => Damage.cs} (92%) diff --git a/SillySCP/Commands/Stats.cs b/SillySCP/Commands/Damage.cs similarity index 92% rename from SillySCP/Commands/Stats.cs rename to SillySCP/Commands/Damage.cs index 1743397..8ac7a91 100644 --- a/SillySCP/Commands/Stats.cs +++ b/SillySCP/Commands/Damage.cs @@ -7,8 +7,8 @@ namespace SillySCP.Commands [CommandHandler(typeof(ClientCommandHandler))] public class Damage : ICommand { - public string Command { get; } = "stats"; - public string[] Aliases { get; } = new [] { "s" }; + public string Command { get; } = "damage"; + public string[] Aliases { get; } = new [] { "d", "dmg" }; public string Description { get; } = "Get the amount of damage you've dealt."; public bool Execute(