diff --git a/Werewolf for Telegram/Shared/GameBalancing.cs b/Werewolf for Telegram/Shared/GameBalancing.cs index ad95e3e4..c8b8f246 100644 --- a/Werewolf for Telegram/Shared/GameBalancing.cs +++ b/Werewolf for Telegram/Shared/GameBalancing.cs @@ -186,7 +186,6 @@ public static List GetRoleList(int playerCount, List disabledRoles //for smaller games, all roles will be available and chosen randomly. For large games, it will be about the //same as it was before.... - if (rolesToAssign.Any(x => x == IRole.CultistHunter)) { rolesToAssign.Add(IRole.Cultist); @@ -294,6 +293,8 @@ public static int GetStrength(this IRole role, List allRoles) return 8; case IRole.Spumpkin: return 2; + case IRole.ScapeGoat: + return 1; default: throw new ArgumentOutOfRangeException(nameof(role), role, null); } diff --git a/Werewolf for Telegram/Shared/Roles.cs b/Werewolf for Telegram/Shared/Roles.cs index 4d31fb3f..162549a5 100644 --- a/Werewolf for Telegram/Shared/Roles.cs +++ b/Werewolf for Telegram/Shared/Roles.cs @@ -141,6 +141,9 @@ public enum IRole : long // NOTE: IN ROLE CONFIGURATION, FALSE WILL MEAN ENABLED [Role("🎃", false)] Spumpkin = 8796093022208, + + [Role("😰")] + ScapeGoat = 17592186044416, } public class RoleAttribute : Attribute diff --git a/Werewolf for Telegram/Werewolf Control/Commands/HelpCommands.cs b/Werewolf for Telegram/Werewolf Control/Commands/HelpCommands.cs index 40145638..b0f0efb5 100644 --- a/Werewolf for Telegram/Werewolf Control/Commands/HelpCommands.cs +++ b/Werewolf for Telegram/Werewolf Control/Commands/HelpCommands.cs @@ -152,6 +152,7 @@ public static void RoleList(Update update, string[] args) reply = "/aboutGraveDigger - " + GetLocaleString("GraveDigger", lang) + "\n"; reply += "/aboutArsonist - " + GetLocaleString("Arsonist", lang) + "\n"; reply += "/aboutAugur - " + GetLocaleString("Augur", lang) + "\n"; + reply += "/aboutScapeGoat - " + GetLocaleString("ScapeGoat", lang) + "\n"; Send(reply, update.Message.From.Id); } } diff --git a/Werewolf for Telegram/Werewolf Node/Werewolf.cs b/Werewolf for Telegram/Werewolf Node/Werewolf.cs index 39f73e37..862d101f 100644 --- a/Werewolf for Telegram/Werewolf Node/Werewolf.cs +++ b/Werewolf for Telegram/Werewolf Node/Werewolf.cs @@ -1574,6 +1574,7 @@ private static void SetTeam(IPlayer p) case IRole.Spumpkin: case IRole.Augur: case IRole.GraveDigger: + case IRole.ScapeGoat: p.Team = ITeam.Village; break; case IRole.Doppelgänger: @@ -2784,10 +2785,22 @@ private void LynchCycle() var t = choices.FirstOrDefault(x => x.PlayerRole == IRole.Tanner); if (t != null && t.Votes > 0) AddAchievement(t, AchievementsReworked.SoClose); + var scapeGoat = Players.FirstOrDefault(x => x.PlayerRole == IRole.ScapeGoat && !x.IsDead); + if (scapeGoat != null) //lets kill ScapeGoat + { + SendWithQueue(GetLocaleString("ScapeGoatLynched", scapeGoat.GetName())); + KillPlayer(scapeGoat, KillMthd.Lynch, killers: Players.Where(x => x.Choice > 0), isNight: false); + } } else // if (lynched.Votes == -2) // No lynch votes at all { SendWithQueue(GetLocaleString("NoLynchVotes")); + var scapeGoat = Players.FirstOrDefault(x => x.PlayerRole == IRole.ScapeGoat && !x.IsDead); + if (scapeGoat != null) //lets kill ScapeGoat + { + SendWithQueue(GetLocaleString("ScapeGoatLynched", scapeGoat.GetName())); + KillPlayer(scapeGoat, KillMthd.Lynch, killers: null, isNight: false); //nobody voted, so no killers! + } } if (CheckForGameEnd(true)) return;