private static void DebugThings(Playfield p) { Type t = typeof(Line); PropertyInfo[] properties = t.GetProperties(); PlayfieldAnalyse.AnalyseLines(p); Line[] line = PlayfieldAnalyse.lines; foreach (PropertyInfo nP in properties) { Console.WriteLine(nP.GetValue(line).ToString()); } IEnumerable <Handcard> damagingSpells = Classification.GetOwnHandCards(p, boardObjType.AOE, SpecificCardType.SpellsDamaging); if (damagingSpells != null) { var radiusOrderedDS = damagingSpells.OrderBy(n => n.card.DamageRadius).FirstOrDefault(); if (radiusOrderedDS != null) { @group Group = p.getGroup(false, 200, boPriority.byTotalNumber, radiusOrderedDS.card.DamageRadius); } } Logger.Debug("Name: " + p.ownKingsTower.Name); Logger.Debug("Name: " + p.ownPrincessTower1.Name); Logger.Debug("Name: " + p.ownPrincessTower2.Name); int i1 = p.ownKingsTower.HP; int i2 = p.ownPrincessTower1.HP; int i3 = p.ownPrincessTower2.HP; Logger.Debug("test"); }
public override Cast GetBestCast(Playfield p) { //DebugThings(p); Cast bc = null; Logger.Debug("Home = {Home}", p.home); #region Apollo Magic // Highest priority -> Can we kill the enemy with a spell BoardObj finisherTower = Decision.IsEnemyKillWithSpellPossible(p, out Handcard hc); if (finisherTower != null && (hc?.manacost > p.ownMana)) { return(new Cast(hc.name, finisherTower.Position, hc)); } // ------------------------------------------------------ PlayfieldAnalyse.AnalyseLines(p); // Danger- and Chancelevel currentSituation = GetCurrentFightState(p); // Attack, Defense or UnderAttack (and where it is) hc = CardChoosing.GetOppositeCard(p, currentSituation) ?? CardChoosing.GetMobInPeace(p, currentSituation); //hc = CardChoosing.GetMobInPeace(p, currentSituation); if (hc == null) { Logger.Debug("Part: SpellApolloWay"); Handcard hcApollo = SpellMagic(p, currentSituation, out VectorAI choosedPosition); if (hcApollo != null) { hc = hcApollo; if (choosedPosition != null && !(hc?.manacost > p.ownMana)) { return(new Cast(hcApollo.name, choosedPosition, hcApollo)); } } } if (hc == null) { return(null); } Logger.Debug("Part: GetSpellPosition"); VectorAI nextPosition = SpecialPositionHandling.GetPosition(p, hc); if (nextPosition == null) { nextPosition = PositionChoosing.GetNextSpellPosition(currentSituation, hc, p); } bc = new Cast(hc.name, nextPosition, hc); #endregion Logger.Debug("BestCast:" + bc.SpellName + " " + bc.Position.ToString()); if (bc?.hc?.manacost > p.ownMana) { return(null); } return(bc); }