private static VariantOffer CheckBuildAndMoveNavy(Context context, PlayerInfoCM player, AIOptions options, int restOfGold) { VariantOfferPackage package = new VariantOfferPackage(); int restUnits = Math.Min(Constants.maxArmyCount - context.map.Navy.Where(e => e.OwnerID == player.ID).Count(), Constants.armyPrices.Count); if (restUnits < 1) return null; List<IslandCM> enemyNeibourIslands = Library.Map.GetEnemyNeibourIslands(context.map, player.ID, false); float maxNeedBridgeVP = 0; for (int i = 0; i < enemyNeibourIslands.Count; ++i) { IslandCM enemyIsland = enemyNeibourIslands[i]; float vp = Library.Map.GetIslandPriceVP(context.map, enemyIsland.ID, player.ID, options) * options.coefficients.BridgeToIslandPriceCoeff; if (vp > maxNeedBridgeVP) maxNeedBridgeVP = vp; } if (maxNeedBridgeVP > 0) package.Add(new VariantOffer(0, maxNeedBridgeVP)); if (Library.Map.GetAccessibleSeaHorns(context.map, player.ID, false, false).Count > 0) package.Add(new VariantOffer(Constants.moveNavyCost + Constants.navyPrices[1], options.coefficients.HornVPT * options.turnsToEnd)); return package.GetSum(); }
private static VariantOffer CheckPhilosopher(Context context, PlayerInfoCM player, AIOptions options, int restOfGold) { VariantOfferPackage package = new VariantOfferPackage(); for (int i = 0; i < Cyclades.Constants.philosopherPrices.Count; ++i) { int cost = Cyclades.Constants.philosopherPrices[i]; if (cost > restOfGold) break; package.Add(new VariantOffer(cost, options.coefficients.PhilosopherVP)); restOfGold -= cost; } package.CheckAll(options); return package.GetSum(); }