Beispiel #1
0
        protected override async Task GameOver()
        {
            var winners = Battle.GetTeam(Battle.GetWinner());
            var losers  = winners.First().battle.GetTeam(winners.First().enemies);

            winners.ConvertAll(s => (PlayerFighter)s).ForEach(async p => await ServerGames.UserWonBattle(p.avatar, 1, 0, p.battleStats, BattleDifficulty.Easy, lobbyChannel, winners, false));
            losers.ConvertAll(s => (PlayerFighter)s).ForEach(async p => await ServerGames.UserLostBattle(p.avatar, lobbyChannel));

            _ = WriteGameOver();
            await Task.CompletedTask;
        }
Beispiel #2
0
        internal async Task GameOver()
        {
            var winners = Battle.GetTeam(Battle.GetWinner());

            if (Battle.SizeTeamB == 0)
            {
                Console.WriteLine("Game Over with no enemies existing.");
            }
            if (winners.First() is PlayerFighter)
            {
                winsInARow++;
                var wasMimic = Battle.TeamB.Any(e => e.name.Contains("Mimic"));
                winners.ConvertAll(s => (PlayerFighter)s).ForEach(async p => await ServerGames.UserWonBattle(p.avatar, winsInARow, LureCaps, p.battleStats, Diff, TextChannel, winners, wasMimic));
                if (!IsEndless)
                {
                    _ = WriteGameOver();
                }
                else
                {
                    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 StatusMsg.ModifyAsync(m => { m.Content = text; m.Embed = null; });

                    await Task.Delay(2000);

                    Diff = (BattleDifficulty)Math.Min(4, 1 + winsInARow / stageLength);
                    SetRandomEnemies(ColossoBattle.Team.B);
                    Battle.turn = 0;
                    _           = StartBattle();
                }
            }
            else
            {
                if (IsEndless)
                {
                    Diff = BattleDifficulty.Easy;
                }

                var losers = winners.First().battle.GetTeam(winners.First().enemies);
                losers.ConvertAll(s => (PlayerFighter)s).ForEach(async p => await ServerGames.UserLostBattle(p.avatar, Diff, TextChannel));
                _ = WriteGameOver();
            }
        }
Beispiel #3
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();
            }
        }
        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();
            }
        }
Beispiel #5
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)
            {
                var RewardTables = Rewards;
                // Get the appropiate chest rewards table
                var chests = chestTable[Difficulty];
                chests.RemoveAll(s => s is DefaultReward);

                // If there was *no* mimic, add a counter weight
                if (!Battle.TeamB.Any(f => f.Name.Contains("Mimic")))
                {
                    chests.Add(new DefaultReward {
                        Weight = chests.Weight * (14 - 2 * LureCaps - Battle.SizeTeamA)
                    });
                }
                RewardTables.Add(chests);
                winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserWonBattle(p.avatar, RewardTables.GetRewards(), p.battleStats, lobbyChannel, BattleChannel));
                chests.RemoveAll(s => s is DefaultReward);
                _ = 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();
            }
            LureCaps = 0;
            await Task.CompletedTask;
        }
Beispiel #6
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)
            {
                var RewardTables = Rewards;
                // Get the appropiate chest rewards table
                var chests = chestTable[Difficulty];
                chests.RemoveAll(s => s is DefaultReward d && !d.HasChest);

                // If there was *no* mimic, add a counter weight
                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("enus Djinn")))
                    {
                        djinnTable.Add(new DefaultReward()
                        {
                            Djinn = "Venus", Weight = 1
                        });
                    }
                    if (Battle.TeamB.Any(f => f.Name.Contains("ars Djinn")))
                    {
                        djinnTable.Add(new DefaultReward()
                        {
                            Djinn = "Mars", Weight = 1
                        });
                    }
                    if (Battle.TeamB.Any(f => f.Name.Contains("upiter Djinn")))
                    {
                        djinnTable.Add(new DefaultReward()
                        {
                            Djinn = "Jupiter", Weight = 1
                        });
                    }
                    if (Battle.TeamB.Any(f => f.Name.Contains("ercury Djinn")))
                    {
                        djinnTable.Add(new DefaultReward()
                        {
                            Djinn = "Mercury", Weight = 1
                        });
                    }
                    djinnTable.Add(new DefaultReward()
                    {
                        Weight = djinnTable.Weight * (10 - (int)Difficulty) * 3 - djinnTable.Weight
                    });
                    RewardTables.Add(djinnTable);
                }

                winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserWonBattle(UserAccountProvider.GetById(p.Id), RewardTables.GetRewards(), p.battleStats, lobbyChannel, BattleChannel));
                winners.OfType <PlayerFighter>().ToList().ForEach(async p => await ServerGames.UserWonSingleBattle(UserAccountProvider.GetById(p.Id), lobbyChannel, Difficulty));

                chests.RemoveAll(s => s is DefaultReward d && !d.HasChest);
                _ = WriteGameOver();
            }
            else
            {
                var losers = winners.First().battle.GetTeam(winners.First().enemies);
                losers.ForEach(p => p.Moves.OfType <Djinn>().ToList().ForEach(d => { d.Summon(p); d.CoolDown = 0; }));
                losers.ConvertAll(s => (PlayerFighter)s).ForEach(async p => await ServerGames.UserLostBattle(UserAccountProvider.GetById(p.Id), lobbyChannel));
                _ = WriteGameOver();
            }

            await Task.CompletedTask;
        }
Beispiel #7
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();
            }
        }
Beispiel #8
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();
            }
        }