private Portal GetMostDangerousPortal() { float mostDangerousPortalScore = 0; Portal mostDangerousPortal = null; float currentPortalScore = 0; foreach (Portal enemyPortal in Constants.GameCaching.GetEnemyPortals()) { int lavaGiantsSpawned = TrackPortalCreations.GetPortalLavaGiantsCount(enemyPortal); currentPortalScore = enemyPortal.PredictLavaGiantDamageDoneToCastleIfNotHitByEnemy(Constants.Game.GetMyCastle()) + (enemyPortal.CurrentlySummoning == "LavaGiant" ? 10 : 0); currentPortalScore += lavaGiantsSpawned * 200; if (lavaGiantsSpawned >= numberOfLavaGiantsSpawnedForInstantGoto) { currentPortalScore *= 4f; } if (currentPortalScore > mostDangerousPortalScore) { mostDangerousPortalScore = currentPortalScore; mostDangerousPortal = enemyPortal; } } return(mostDangerousPortal); }
/// <summary> /// You most likely don't need to override this. Is is only for some very special cases /// /// I made this virtual so that it can be overwritten. There are some specific challenge bots we shouldn't/don't need to call this on. /// </summary> /// <param name="game"></param> public virtual void PostDoTurn(Game game) { LastHealth.UpdateLastHealths(); LastPosition.UpdateLastPositions(); TrackPortalCreations.UpdateEnemyPortalCreations(); }