|
@@ -15,18 +15,23 @@ namespace MafiaTelegramBot.Game.GameRoles
|
|
|
if (!_actionApplied)
|
|
|
{
|
|
|
NightTargetList = Room.Players.Values.Where(p => !p.IsAlive).ToList();
|
|
|
- var message = await Room.PlayersCh.SendTo(Player.Id, strings.choose_player_to_ressurect,
|
|
|
- Keyboard.NightChooseTargetKeyboard(NightTargetList, Player.Id, true));
|
|
|
+ var message = NightTargetList.Count > 0
|
|
|
+ ? await Room.PlayersCh.SendTo(Player.Id, strings.choose_player_to_ressurect,
|
|
|
+ Keyboard.NightChooseTargetKeyboard(NightTargetList, Player.Id, true))
|
|
|
+ : await Room.PlayersCh.SendTo(Player.Id, strings.nothing_to_ressurect);
|
|
|
MessageId = message.MessageId;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public override Task ApplyNightActionResult()
|
|
|
+ public override async Task ApplyNightActionResult()
|
|
|
{
|
|
|
- if (NightTargetId is -2 or -1 || !Room.Players.ContainsKey(NightTargetId)) return Task.CompletedTask;
|
|
|
- _actionApplied = true;
|
|
|
- Room.Players[NightTargetId].IsAlive = true;
|
|
|
- return Task.CompletedTask;
|
|
|
+ if(NightTargetId == -1) await Room.PlayersCh.EditTo(Player.Id, MafiaMessageId, strings.you_skip_vote);
|
|
|
+ else if (_actionApplied || NightTargetId == -2 || !Room.Players.ContainsKey(NightTargetId)) { }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _actionApplied = true;
|
|
|
+ Room.Players[NightTargetId].IsAlive = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public override async Task SetNightTarget(long userId)
|