diff --git a/BetterCoinflips/Configs/Config.cs b/BetterCoinflips/Configs/Config.cs index 73ea814..37f02ed 100644 --- a/BetterCoinflips/Configs/Config.cs +++ b/BetterCoinflips/Configs/Config.cs @@ -100,6 +100,14 @@ public class Config : IConfig RoleTypeId.Scp939, }; + [Description("List of ignored roles for the PlayerSwapEffect (#18)")] + public List IgnoredRoles = new() + { + RoleTypeId.Spectator, + RoleTypeId.Filmmaker, + RoleTypeId.Overwatch, + }; + [Description("The chance of these good effects happening. It's a proportional chance not a % chance.")] public int KeycardChance { get; set; } = 20; public int MedicalKitChance { get; set; } = 35; diff --git a/BetterCoinflips/Plugin.cs b/BetterCoinflips/Plugin.cs index 0ebad27..7652e72 100644 --- a/BetterCoinflips/Plugin.cs +++ b/BetterCoinflips/Plugin.cs @@ -10,7 +10,7 @@ public class Plugin : Plugin { public static Plugin Instance; public override Version RequiredExiledVersion => new(8, 2, 1, 0); - public override Version Version => new(4, 2, 0); + public override Version Version => new(4, 2, 1, 0); public override string Author => "Miki_hero"; public override string Name => "BetterCoinflips"; public override string Prefix => "better_cf"; diff --git a/BetterCoinflips/Types/CoinEffect.cs b/BetterCoinflips/Types/CoinEffect.cs index c496ace..ed45321 100644 --- a/BetterCoinflips/Types/CoinEffect.cs +++ b/BetterCoinflips/Types/CoinEffect.cs @@ -19,8 +19,8 @@ namespace BetterCoinflips.Types { public class CoinFlipEffect { - private static readonly Config Cfg = Plugin.Instance.Config; - private static readonly Configs.Translations Translations = Plugin.Instance.Translation; + private static Config Cfg => Plugin.Instance.Config; + private static Configs.Translations Translations => Plugin.Instance.Translation; private static readonly System.Random Rd = new(); public Action Execute { get; set; } @@ -332,7 +332,7 @@ public CoinFlipEffect(Action execute, string message) //17 new CoinFlipEffect(player => { - var playerList = Player.List.Where(x => x.Role.Type != RoleTypeId.Spectator).ToList(); + var playerList = Player.List.Where(x => !Cfg.IgnoredRoles.Contains(x.Role.Type)).ToList(); playerList.Remove(player); if (playerList.IsEmpty()) {