Exemple #1
0
        public static async Task GameOver(PlayerGameContext winner, PlayerGameContext loser)
        {
            var kb = new Telegram.Bot.Types.ReplyMarkups.ReplyKeyboardHide();

            winner.User.AddWin();
            winner.User.status = User.Status.Default;
            await winner.SendAsync(lang => lang.GameFinished, kb);

            await winner.SendAsync(lang => GetWinMessage(winner, loser, lang));

            await winner.SendAsync(lang => GetMessageForMe(lang, winner.hero));

            await winner.SendAsync(lang => GetMessageForEnemy(lang, loser.hero));

            loser.User.AddLose();
            loser.User.status = User.Status.Default;
            await loser.SendAsync(lang => lang.GameFinished, kb);

            await loser.SendAsync(lang => GetWinMessage(winner, loser, lang));

            await loser.SendAsync(lang => GetMessageForMe(lang, loser.hero));

            await loser.SendAsync(lang => GetMessageForEnemy(lang, winner.hero));

            await winner.User.Sender.SendPhotoWithText(lang => lang.GetAds(), "http://cdn1.savepice.ru/uploads/2017/6/18/f3a68821810058281cb2e19aa0dd1bc0-full.png");

            await loser.User.Sender.SendPhotoWithText(lang => lang.GetAds(), "http://cdn1.savepice.ru/uploads/2017/6/18/f3a68821810058281cb2e19aa0dd1bc0-full.png");
        }
Exemple #2
0
        public async Task LeaveConfirming()
        {
            var kb = new Telegram.Bot.Types.ReplyMarkups.ReplyKeyboardHide();
            await player.SendAsync(lang => lang.SearchingModeStopped, kb);

            await enemyPlayer.SendAsync(lang => lang.PlayerLeftThisLobby, kb);

            game.Reset();
        }
Exemple #3
0
        private async void SetAttackerAndExcepter(PlayerGameContext attacker, PlayerGameContext excepter)
        {
            attacker.User.LastMoveTime = Main.Time;
            excepter.User.LastMoveTime = Main.Time;
            attacker.User.status       = User.Status.Attacking;
            excepter.User.status       = User.Status.Excepting;

            await attacker.SendAsync(lang => lang.YourEnemyMessage + ": " + excepter.User.Name);

            await excepter.SendAsync(lang => lang.YourEnemyMessage + ": " + attacker.User.Name);

            //Временно вызывается из game
            await SendHeroesStates();

            await attacker.SendAsync(lang => lang.FirstAttackNotify);

            await excepter.SendAsync(lang => lang.EnemyFirstAttackNotify);

            IHero temp = attacker.hero;

            await attacker.SendAsync(lang => attacker.hero.GetMessageAbilitesList(lang));

            await excepter.SendAsync(lang => lang.WaitingForAnotherPlayerAction);
        }