diff --git a/CommandIncrement.cs b/CommandIncrement.cs index 88caae0..0660d9e 100644 --- a/CommandIncrement.cs +++ b/CommandIncrement.cs @@ -15,9 +15,9 @@ public class CommandIncrement : IRocketCommand public string Syntax => ""; - public List Aliases => new List { }; + public List Aliases => new List(); - public List Permissions => new List() { "killstreaks.increment" }; + public List Permissions => new List { "killstreaks.increment" }; public void Execute(IRocketPlayer caller, string[] args) { diff --git a/CommandKills.cs b/CommandKills.cs index 27dc77e..886920e 100644 --- a/CommandKills.cs +++ b/CommandKills.cs @@ -17,7 +17,7 @@ public class CommandKills : IRocketCommand public List Aliases => new List { "killstreak" }; - public List Permissions => new List() { "killstreaks.kills" }; + public List Permissions => new List { "killstreaks.kills" }; public void Execute(IRocketPlayer caller, string[] args) { diff --git a/CommandRemoveKS.cs b/CommandRemoveKS.cs index d285412..c7124b1 100644 --- a/CommandRemoveKS.cs +++ b/CommandRemoveKS.cs @@ -15,9 +15,9 @@ public class CommandRemoveKS : IRocketCommand public string Syntax => ""; - public List Aliases => new List { }; + public List Aliases => new List(); - public List Permissions => new List() { "killstreaks.remove" }; + public List Permissions => new List { "killstreaks.remove" }; public void Execute(IRocketPlayer caller, string[] args) { diff --git a/KillStreaks.cs b/KillStreaks.cs index d1daf8a..6a6853d 100644 --- a/KillStreaks.cs +++ b/KillStreaks.cs @@ -1,17 +1,17 @@ -using Rocket.Core.Plugins; -using System.Linq; +using Rocket.API.Collections; +using Rocket.Core; using Rocket.Core.Logging; -using Rocket.Unturned.Player; +using Rocket.Core.Plugins; +using Rocket.Unturned; +using Rocket.Unturned.Chat; using Rocket.Unturned.Events; +using Rocket.Unturned.Player; using Steamworks; using System.Collections.Generic; -using Rocket.Unturned.Chat; -using Rocket.Unturned; -using System.Xml.Serialization; using System.IO; +using System.Linq; using System.Xml; -using Rocket.API.Collections; -using Rocket.Core; +using System.Xml.Serialization; namespace ExtraConcentratedJuice.KillStreaks { @@ -62,7 +62,6 @@ protected override void Load() UnturnedPlayerEvents.OnPlayerDeath += OnDeath; U.Events.OnPlayerDisconnected += OnDisconnected; U.Events.OnPlayerConnected += OnConnected; - } protected override void Unload() @@ -140,7 +139,6 @@ private void OnDisconnected(UnturnedPlayer player) if (killCount.TryGetValue(player.Id, out int count) && Configuration.Instance.remove_streak_on_disconnect) { killCount.Remove(player.Id); - } } @@ -185,7 +183,7 @@ private void OnDeath(UnturnedPlayer player, SDG.Unturned.EDeathCause cause, SDG. { if (killCount[killerPlayer.Id] >= group.KillMin && (killCount[killerPlayer.Id] <= group.KillMax || group.KillMax <= 0)) { - foreach(string cmd in group.Commands) + foreach (string cmd in group.Commands) { R.Commands.Execute(new Rocket.API.ConsolePlayer(), string.Format(cmd, killerPlayer.DisplayName)); } @@ -194,17 +192,12 @@ private void OnDeath(UnturnedPlayer player, SDG.Unturned.EDeathCause cause, SDG. } } - public override TranslationList DefaultTranslations - { - get - { - return new TranslationList() + public override TranslationList DefaultTranslations => + new TranslationList { {"killstreak_increment", "[KillStreaks] Your killstreak has been incremented."}, {"killstreak_count", "[KillStreaks] You are on a {0} killstreak."}, {"killstreak_remove", "[KillStreaks] Your killstreak has been reset."}, }; - } - } } } \ No newline at end of file diff --git a/KillStreaksConfig.cs b/KillStreaksConfig.cs index 9715673..dd04061 100644 --- a/KillStreaksConfig.cs +++ b/KillStreaksConfig.cs @@ -15,6 +15,7 @@ public class KillStreaksConfig : IRocketPluginConfiguration public int kill_streak_lost_threshold; public string kill_streak_lose_message; public string kill_streak_lost_message_color; + [XmlArrayItem(ElementName = "Group")] public List CommandGroups; @@ -29,9 +30,9 @@ public void LoadDefaults() kill_streak_lost_threshold = 25; kill_streak_lose_message = "{0} DIED AND LOST THEIR KILL STREAK OF {1}!"; kill_streak_lost_message_color = "red"; - CommandGroups = new List() + CommandGroups = new List { - new CommandGroup { Commands = new List() { "/heal {0}", "/give {0} 8 1", "/say woah" }, KillMin = 4, KillMax = 20 } + new CommandGroup { Commands = new List { "/heal {0}", "/give {0} 8 1", "/say woah" }, KillMin = 4, KillMax = 20 } }; } @@ -43,8 +44,9 @@ public CommandGroup() [XmlArrayItem(ElementName = "Command")] public List Commands; + public int KillMin; public int KillMax; } } -} +} \ No newline at end of file diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index f0c06b4..35a819c 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -33,4 +32,4 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file