Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Werewolf for Telegram/Shared/GameBalancing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ public static List<IRole> GetRoleList(int playerCount, List<IRole> 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);
Expand Down Expand Up @@ -294,6 +293,8 @@ public static int GetStrength(this IRole role, List<IRole> allRoles)
return 8;
case IRole.Spumpkin:
return 2;
case IRole.ScapeGoat:
return 1;
default:
throw new ArgumentOutOfRangeException(nameof(role), role, null);
}
Expand Down
3 changes: 3 additions & 0 deletions Werewolf for Telegram/Shared/Roles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
13 changes: 13 additions & 0 deletions Werewolf for Telegram/Werewolf Node/Werewolf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down