|
@@ -28,20 +28,25 @@ namespace MafiaTelegramBot.Game.GameRoles
|
|
|
public override async Task ApplyNightActionResult()
|
|
|
{
|
|
|
Player.IsSpeaker = false;
|
|
|
- if (MafiaTargetId == -1) await Room.PlayersCh.EditTo(Player.Id, MafiaMessageId, strings.you_have_not_choosen_target);
|
|
|
- else MafiaTargetId = -1;
|
|
|
- if (NightTargetId == -1)
|
|
|
+ if (NightTargetId != -2 && MafiaTargetId != -2)
|
|
|
{
|
|
|
- NightTargetId = NightTargetList[Utilities.Rnd.Next(NightTargetList.Count)].Id;
|
|
|
- await Room.PlayersCh.EditTo(Player.Id, MessageId, $"{strings.automatically_choosed_target} {Room.Players[NightTargetId].NickName}");
|
|
|
+ if (MafiaTargetId == -1) await Room.PlayersCh.EditTo(Player.Id, MafiaMessageId, strings.you_have_not_choosen_target);
|
|
|
+ else MafiaTargetId = -1;
|
|
|
+ if (NightTargetId == -1)
|
|
|
+ {
|
|
|
+ NightTargetId = NightTargetList[Utilities.Rnd.Next(NightTargetList.Count)].Id;
|
|
|
+ await Room.PlayersCh.EditTo(Player.Id, MessageId,
|
|
|
+ $"{strings.automatically_choosed_target} {Room.Players[NightTargetId].NickName}");
|
|
|
+ }
|
|
|
+ var user = Room.Players[NightTargetId];
|
|
|
+ NightTargetId = -1;
|
|
|
+ KnownRoles.Add(user);
|
|
|
+ var role = user.GetRole() is Roles.Cop
|
|
|
+ ? roles.Cop
|
|
|
+ : roles.Villager;
|
|
|
+ await Room.PlayersCh.EditTo(Player.Id, MessageId,
|
|
|
+ $"{strings.role_of_your_target} {user.NickName} - {role}");
|
|
|
}
|
|
|
- var user = Room.Players[NightTargetId];
|
|
|
- NightTargetId = -1;
|
|
|
- KnownRoles.Add(user);
|
|
|
- var role = user.GetRole() is Roles.Cop
|
|
|
- ? roles.Cop
|
|
|
- : roles.Villager;
|
|
|
- await Room.PlayersCh.EditTo(Player.Id, MessageId, $"{strings.role_of_your_target} {user.NickName} - {role}");
|
|
|
}
|
|
|
|
|
|
public override async Task SetNightTarget(long userId)
|