static void TestCounterattackTeam(ClanBoss.Level clanBossLevel, List <Champion.CreateChampion> championCreators, ClanBossBattle.StunTargetExtractor getStunTarget) { List <ChampionInBattle> cibs = new List <ChampionInBattle>(); foreach (Champion.CreateChampion cc in championCreators) { Tuple <Champion, List <Constants.SkillId>, List <Constants.SkillId> > tuple = cc(clanBossLevel); cibs.Add(new ChampionInBattle(tuple.Item1, tuple.Item2, tuple.Item3)); } ClanBossBattle battle = new ClanBossBattle(clanBossLevel, cibs); battle.GetStunTarget = getStunTarget; List <ClanBossBattleResult> results = battle.Run(); ClanBossBattleResultsAnalysis.PrintResults(results, CBBRA.None); }
static void TestUnkillableClanBossRun(ClanBoss.Level clanBossLevel, List <Champion.CreateChampion> championCreators, bool startupSequenceSearch, string allyAttackChampionToExclude = "") { List <Tuple <Champion, List <Constants.SkillId>, List <Constants.SkillId> > > champTuples = new List <Tuple <Champion, List <Constants.SkillId>, List <Constants.SkillId> > >(); foreach (Champion.CreateChampion cc in championCreators) { champTuples.Add(cc(clanBossLevel)); } List <Champion> champions = new List <Champion>(); List <ChampionInBattle> cibs = new List <ChampionInBattle>(); foreach (Tuple <Champion, List <Constants.SkillId>, List <Constants.SkillId> > tuple in champTuples) { champions.Add(tuple.Item1); ChampionInBattle cib = new ChampionInBattle(tuple.Item1, tuple.Item2, tuple.Item3); if (cib.Name == allyAttackChampionToExclude) { cib.LeaveOutOfAllyAttack = true; } cibs.Add(cib); } ClanBossBattle baseline = new ClanBossBattle(clanBossLevel, cibs); List <ClanBossBattleResult> baselineResult = baseline.Run(); Console.WriteLine("Baseline Results:"); ClanBossBattleResultsAnalysis.PrintSummary(baselineResult, Utils.FindSlowestChampion(champions), CBBRA.None); ClanBossBattleResultsAnalysis.PrintFrozenBansheeA1WithPoisonSensitivityOn(baselineResult); if (startupSequenceSearch) { cibs = new List <ChampionInBattle>(); foreach (Tuple <Champion, List <Constants.SkillId>, List <Constants.SkillId> > tuple in champTuples) { cibs.Add(new ChampionInBattle(tuple.Item1, tuple.Item2, tuple.Item3)); } ClanBossBattle battle = new ClanBossBattle(clanBossLevel, cibs); IEnumerable <List <ClanBossBattleResult> > resultSet; if (startupSequenceSearch) { resultSet = battle.FindUnkillableStartupSequences(); } else { resultSet = new List <List <ClanBossBattleResult> >() { battle.Run() }; } List <ClanBossBattleResult> optimalResults = null; int optimalAutoAfterCBTurn = int.MaxValue; foreach (List <ClanBossBattleResult> results in resultSet) { int autoAfterCBTurn = 0; Console.WriteLine(); Console.WriteLine("Run is over!"); ClanBossBattleResultsAnalysis.PrintResults(results, CBBRA.IncludeUnkillable); foreach (ClanBossBattleResult result in results) { if (result.AttackDetails.ActorName != Constants.Names.ClanBoss) { if (result.AttackDetails.ExpectedAISkill != result.AttackDetails.Skill) { autoAfterCBTurn = result.ClanBossTurn; } } } int lastKillableTurn = ClanBossBattleResultsAnalysis.LastClanBossTurnThatHitKillableChampion(results, Utils.FindSlowestChampion(champions)); Console.WriteLine("Last turn where there was a hit on a champion that wasn't unkillable: {0}", lastKillableTurn); Console.WriteLine("This setup runs on auto after turn {0}", autoAfterCBTurn); Console.WriteLine(); if (optimalAutoAfterCBTurn > autoAfterCBTurn) { optimalAutoAfterCBTurn = autoAfterCBTurn; optimalResults = results; } } if (optimalResults != null) { Console.WriteLine("Optimal Result:"); ClanBossBattleResultsAnalysis.PrintResults(optimalResults, CBBRA.IncludeUnkillable); Console.WriteLine("This setup runs on auto after turn {0}", optimalAutoAfterCBTurn); Console.WriteLine(); Console.WriteLine("Maneater setup"); foreach (ClanBossBattleResult result in optimalResults.Where(r => r.AttackDetails.ActorName == "Maneater")) { if (result.ClanBossTurn > optimalAutoAfterCBTurn) { break; } Console.WriteLine("Turn {0,2}, Skill {1} ({2})", result.AttackDetails.ActorTurn, result.AttackDetails.Skill, result.AttackDetails.SkillName); } Console.WriteLine(); Console.WriteLine("Painkeeper setup"); foreach (ClanBossBattleResult result in optimalResults.Where(r => r.AttackDetails.ActorName == "Painkeeper")) { if (result.ClanBossTurn > optimalAutoAfterCBTurn) { break; } Console.WriteLine("Turn {0,2}, Skill {1} ({2})", result.AttackDetails.ActorTurn, result.AttackDetails.Skill, result.AttackDetails.SkillName); } } else { Console.WriteLine("No results!"); } } }