|
@@ -186,7 +186,8 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
.GroupBy(p => p.CurrentRole.MafiaTargetId)
|
|
.GroupBy(p => p.CurrentRole.MafiaTargetId)
|
|
.Select(item => new {id = item.Key, count = item.Count()})
|
|
.Select(item => new {id = item.Key, count = item.Count()})
|
|
.ToList();
|
|
.ToList();
|
|
- if (votes.Count == 0) mafiaNotAgree = strings.mafia_not_kill_message;
|
|
|
|
|
|
+ var hookerBlock = Players.Values.Any(p => p.CurrentRole.MafiaTargetId == -2);
|
|
|
|
+ if (votes.Count == 0 && !hookerBlock) mafiaNotAgree = strings.mafia_not_kill_message;
|
|
else {
|
|
else {
|
|
var max = votes.Max(item => item.count);
|
|
var max = votes.Max(item => item.count);
|
|
var maxObjects = votes.Where(item => item.count == max).ToList();
|
|
var maxObjects = votes.Where(item => item.count == max).ToList();
|
|
@@ -366,7 +367,10 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
{
|
|
{
|
|
await Task.Run(async () =>
|
|
await Task.Run(async () =>
|
|
{
|
|
{
|
|
- var aliveMafia = Players.Values.Where(p => p.GetRole() is Roles.Don or Roles.Mafia && p.IsAlive).ToList();
|
|
|
|
|
|
+ var aliveMafia = Players.Values.Count(p => p.GetRole() is Roles.Don or Roles.Dame or Roles.Mafia && p.IsAlive);
|
|
|
|
+ if (PlayersRole.ContainsKey(Roles.Werewolf)
|
|
|
|
+ && PlayersRole[Roles.Werewolf].Count == 1 && PlayersRole[Roles.Werewolf][0].IsAlive
|
|
|
|
+ && ((WerewolfRole) PlayersRole[Roles.Werewolf][0].CurrentRole).IsMafia) aliveMafia++;
|
|
var additionalResult = "";
|
|
var additionalResult = "";
|
|
foreach (var (_, value) in PlayersRole)
|
|
foreach (var (_, value) in PlayersRole)
|
|
{
|
|
{
|
|
@@ -375,7 +379,7 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
if (yellowResult != "") additionalResult += "\n" + yellowResult;
|
|
if (yellowResult != "") additionalResult += "\n" + yellowResult;
|
|
}
|
|
}
|
|
|
|
|
|
- if (aliveMafia.Count == 0)
|
|
|
|
|
|
+ if (aliveMafia == 0)
|
|
{
|
|
{
|
|
await PlayersCh.Send(strings.villagers_won + additionalResult, exceptDied: false);
|
|
await PlayersCh.Send(strings.villagers_won + additionalResult, exceptDied: false);
|
|
await PlayersCh.SendSticker(Stickers.Sticker["VillagerWins"]);
|
|
await PlayersCh.SendSticker(Stickers.Sticker["VillagerWins"]);
|
|
@@ -412,7 +416,7 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
|
|
|
|
//Yellow get Wins++
|
|
//Yellow get Wins++
|
|
|
|
|
|
- if (aliveMafia.Count() == 0)
|
|
|
|
|
|
+ if (aliveMafia == 0)
|
|
{
|
|
{
|
|
//then civil roles get Wins++;
|
|
//then civil roles get Wins++;
|
|
}
|
|
}
|