|
@@ -39,7 +39,8 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
public virtual async Task Dispatch()
|
|
public virtual async Task Dispatch()
|
|
{
|
|
{
|
|
await Room.PlayersCh.SendExcept(Player.Id, $"{strings.to_player} {Player.NickName} {strings.issued_posthumous_minute}");
|
|
await Room.PlayersCh.SendExcept(Player.Id, $"{strings.to_player} {Player.NickName} {strings.issued_posthumous_minute}");
|
|
- await SpeakAction();
|
|
|
|
|
|
+ await Bot.SendWithMarkdown2(Player.ChatId, strings.you_turn_say);
|
|
|
|
+ await SpeakAction(enableTimer: true);
|
|
await Kill();
|
|
await Kill();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -74,16 +75,16 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
return NightTargetId;
|
|
return NightTargetId;
|
|
}
|
|
}
|
|
|
|
|
|
- public async Task SpeakAction(int seconds = 60)
|
|
|
|
|
|
+ public async Task SpeakAction(int seconds = 60, bool enableTimer = false)
|
|
{
|
|
{
|
|
TalkingActionComplete.Reset();
|
|
TalkingActionComplete.Reset();
|
|
- await Bot.SendWithMarkdown2(Player.ChatId, $"{strings.your_turn}\n{strings.you_turn_say}", Keyboard.InGamePlayerMenuWithEndTurn);
|
|
|
|
|
|
+ await Bot.SendWithMarkdown2(Player.ChatId, $"{strings.your_turn}", Keyboard.InGamePlayerMenuWithEndTurn);
|
|
Player.IsSpeaker = true;
|
|
Player.IsSpeaker = true;
|
|
var timer = new Timer(seconds * 1000) {AutoReset = false};
|
|
var timer = new Timer(seconds * 1000) {AutoReset = false};
|
|
timer.Elapsed += (_, _) => TalkingActionComplete.Set();
|
|
timer.Elapsed += (_, _) => TalkingActionComplete.Set();
|
|
- timer.Start();
|
|
|
|
|
|
+ if (Room.TimerEnabled || enableTimer) timer.Start();
|
|
TalkingActionComplete.WaitOne();
|
|
TalkingActionComplete.WaitOne();
|
|
- timer.Stop();
|
|
|
|
|
|
+ if (Room.TimerEnabled || enableTimer) timer.Stop();
|
|
await Bot.SendWithMarkdown2(Player.ChatId, strings.your_turn_ended, Keyboard.InGamePlayerMenu);
|
|
await Bot.SendWithMarkdown2(Player.ChatId, strings.your_turn_ended, Keyboard.InGamePlayerMenu);
|
|
Player.IsSpeaker = false;
|
|
Player.IsSpeaker = false;
|
|
}
|
|
}
|