Ejemplo n.º 1
0
        protected override async Task WriteGameOver()
        {
            await Task.Delay(3000);

            var winners = Battle.GetTeam(Battle.GetWinner());
            var text    = GetWinMessageString();
            await StatusMessage.ModifyAsync(m => { m.Content = text; m.Embed = null; });

            await Task.Delay(2000);

            SetEnemy(DefaultDungeons.Random().Name);
        }
Ejemplo n.º 2
0
        protected override async Task GameOver()
        {
            var winners = Battle.GetTeam(Battle.GetWinner());

            if (Battle.SizeTeamB == 0)
            {
                Console.WriteLine("Game Over with no enemies existing.");
            }
            if (Battle.GetWinner() == ColossoBattle.Team.A)
            {
                winsInARow++;
                var RewardTables = Rewards;
                var chests       = chestTable[Difficulty];
                chests.RemoveAll(s => s is DefaultReward);
                if (!Battle.TeamB.Any(f => f.Name.Contains("Mimic")))
                {
                    chests.Add(new DefaultReward {
                        Weight = chests.Weight * (14 - 2 * LureCaps)
                    });
                }
                RewardTables.Add(chests);
                winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserWonBattle(p.avatar, RewardTables.GetRewards(), p.battleStats, lobbyChannel, BattleChannel, winsInARow, string.Join(", ", Battle.TeamA.Select(pl => pl.Name))));
                chests.RemoveAll(s => s is DefaultReward);

                Console.WriteLine("Winners rewarded.");
                Battle.TeamA.ForEach(p =>
                {
                    p.PPrecovery += (winsInARow <= 8 * 4 && winsInARow % 4 == 0) ? 1 : 0;
                    p.RemoveNearlyAllConditions();
                    p.Buffs = new List <Buff>();
                    p.Heal((uint)(p.Stats.HP * 5 / 100));
                });

                var text = $"{winners.First().Name}'s Party wins Battle {winsInARow}! Battle will reset shortly";
                await Task.Delay(2000);

                await StatusMessage.ModifyAsync(m => { m.Content = text; m.Embed = null; });

                await Task.Delay(2000);

                SetNextEnemy();
                Battle.turn = 0;
                _           = StartBattle();
            }
            else
            {
                var losers = winners.First().battle.GetTeam(winners.First().enemies);
                losers.ConvertAll(s => (PlayerFighter)s).ForEach(async p => await ServerGames.UserLostBattle(p.avatar, lobbyChannel));
                _ = WriteGameOver();
            }
        }
Ejemplo n.º 3
0
        protected override async Task GameOver()
        {
            var winners = Battle.GetTeam(Battle.GetWinner());

            if (Battle.GetWinner() == Team.A)
            {
                if (Battle.GetWinner() == Team.A)
                {
                    winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserWonBattle(p.avatar, matchup.RewardTables.GetRewards(), p.battleStats, lobbyChannel, BattleChannel));
                }

                Battle.TeamA.ForEach(p =>
                {
                    p.RemoveNearlyAllConditions();
                    p.Buffs = new List <Buff>();
                    p.Heal((uint)(p.Stats.HP * 5 / 100));
                });

                SetNextEnemy();

                if (!EndOfDungeon)
                {
                    await SummonsMessage.ModifyAsync(m => m.Content = matchup.FlavourText);

                    var text = $"{winners.First().Name}'s Party wins Battle!";
                    await Task.Delay(2000);

                    await StatusMessage.ModifyAsync(m => { m.Content = text; m.Embed = null; });

                    await Task.Delay(2000);

                    Battle.turn = 0;
                    _           = StartBattle();
                }
                else
                {
                    winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserWonDungeon(p.avatar, Dungeon, lobbyChannel));
                    _ = WriteGameOver();
                }
            }
            else
            {
                var losers = winners.First().battle.GetTeam(winners.First().enemies);

                losers.ConvertAll(s => (PlayerFighter)s).ForEach(async p => await ServerGames.UserLostBattle(p.avatar, lobbyChannel));

                _ = WriteGameOver();
            }
        }
Ejemplo n.º 4
0
        protected override async Task GameOver()
        {
            var winners = Battle.GetTeam(Battle.GetWinner());

            if (Battle.SizeTeamB == 0)
            {
                Console.WriteLine("Game Over with no enemies existing.");
            }
            if (Battle.GetWinner() == Team.A)
            {
                winsInARow++;
                var RewardTables = Rewards;
                var chests       = chestTable[Difficulty];
                chests.RemoveAll(s => s is DefaultReward d && !d.HasChest);
                var lurCapBonus = new[] { 16, 12, 10, 9, 8 };
                if (!Battle.TeamB.Any(f => f.Name.Contains("Mimic")))
                {
                    chests.Add(new DefaultReward {
                        Weight = chests.Weight * lurCapBonus[LureCaps]
                    });
                }
                RewardTables.Add(chests);

                if (Battle.TeamB.Any(f => f.Name.Contains("Djinn")))
                {
                    var djinnTable  = new RewardTable();
                    var djinnWeight = (int)Difficulty;
                    if (Battle.TeamB.Any(f => f.Name.Contains("Venus Djinn")))
                    {
                        djinnTable.Add(new DefaultReward()
                        {
                            Djinn = "Venus", Weight = 1
                        });
                    }
                    if (Battle.TeamB.Any(f => f.Name.Contains("Mars Djinn")))
                    {
                        djinnTable.Add(new DefaultReward()
                        {
                            Djinn = "Mars", Weight = 1
                        });
                    }
                    if (Battle.TeamB.Any(f => f.Name.Contains("Jupiter Djinn")))
                    {
                        djinnTable.Add(new DefaultReward()
                        {
                            Djinn = "Jupiter", Weight = 1
                        });
                    }
                    if (Battle.TeamB.Any(f => f.Name.Contains("Mercury Djinn")))
                    {
                        djinnTable.Add(new DefaultReward()
                        {
                            Djinn = "Mercury", Weight = 1
                        });
                    }
                    djinnTable.Add(new DefaultReward()
                    {
                        Weight = djinnTable.Weight * (10 - (int)Difficulty) * 2 - djinnTable.Weight
                    });
                    RewardTables.Add(djinnTable);
                }

                winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserWonBattle(p.avatar, RewardTables.GetRewards(), p.battleStats, lobbyChannel, BattleChannel));
                winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserWonEndless(p.avatar, lobbyChannel, winsInARow, mode, p.battleStats.TotalTeamMates + 1, string.Join(", ", Battle.TeamA.Select(pl => pl.Name))));

                chests.RemoveAll(s => s is DefaultReward d && !d.HasChest);

                Battle.TeamA.ForEach(p =>
                {
                    p.PPrecovery += (winsInARow <= 8 * 4 && winsInARow % 4 == 0) ? 1 : 0;
                    p.RemoveNearlyAllConditions();
                    p.Buffs = new List <Buff>();
                    p.Heal((uint)(p.Stats.HP * 5 / 100));
                });

                var text = $"{winners.First().Name}'s Party wins Battle {winsInARow}! Battle will reset shortly.";
                await Task.Delay(3000);

                await StatusMessage.ModifyAsync(m => { m.Content = text; m.Embed = null; });

                await Task.Delay(3000);

                SetNextEnemy();
                Battle.turn = 0;
                _           = StartBattle();
            }
            else
            {
                var losers = winners.First().battle.GetTeam(winners.First().enemies);
                losers.ConvertAll(s => (PlayerFighter)s).ForEach(async p => await ServerGames.UserLostBattle(p.avatar, lobbyChannel));
                winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserFinishedEndless(p.avatar, lobbyChannel, winsInARow, mode));
                _ = WriteGameOver();
            }
        }
Ejemplo n.º 5
0
        protected override async Task GameOver()
        {
            var winners = Battle.GetTeam(Battle.GetWinner());

            if (Battle.GetWinner() == Team.A)
            {
                if (Battle.GetWinner() == Team.A)
                {
                    winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserWonBattle(UserAccountProvider.GetById(p.Id), matchup.RewardTables.GetRewards(), p.battleStats, lobbyChannel, BattleChannel));
                }

                Battle.TeamA.ForEach(p =>
                {
                    p.RemoveNearlyAllConditions();
                    p.Buffs = new List <Buff>();
                    p.Heal((uint)(p.Stats.HP * 5 / 100));
                });

                SetNextEnemy();

                if (!EndOfDungeon)
                {
                    await SummonsMessage.ModifyAsync(m => m.Content = matchup.FlavourText);

                    var text = $"{winners.First().Name}'s Party wins Battle!";
                    await Task.Delay(2000);

                    await StatusMessage.ModifyAsync(m => { m.Content = text; m.Embed = null; });

                    await Task.Delay(2000);

                    Battle.turn = 0;
                    _           = StartBattle();
                }
                else
                {
                    winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserWonDungeon(UserAccountProvider.GetById(p.Id), Dungeon, lobbyChannel));

                    if (DateTime.Now <= new DateTime(2020, 11, 8) && Global.Random.Next(4) == 0)
                    {
                        var r = new List <Rewardable>()
                        {
                            new DefaultReward()
                            {
                                Dungeon = "Halloween Special"
                            }
                        };
                        winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserWonBattle(UserAccountProvider.GetById(p.Id), r, new BattleStats(), lobbyChannel, BattleChannel));
                    }

                    _ = WriteGameOver();
                }
            }
            else
            {
                var losers = winners.First().battle.GetTeam(winners.First().enemies);


                losers.ConvertAll(s => (PlayerFighter)s).ForEach(async p => await ServerGames.UserLostBattle(UserAccountProvider.GetById(p.Id), lobbyChannel));

                _ = WriteGameOver();
            }
        }