/** * Strategy (decreasing priority): * - Choose defensive orders * - Choose offensive orders */ private static void computeOrders() { myAttackHero = myHeroes.iterator().next(); Queue heroesToCompute = new LinkedList<>(myHeroes.stream() .filter(hero -> hero != myAttackHero) .collect(Collectors.toList()) ); computeDefensiveOrders(heroesToCompute); if (myAttackHero != null) { computeOffensiveOrders(myAttackHero); } } /** * Strategy (decreasing priority): * - Use wind spell (save the base or farm wild mana) * - Move toward near base targets * - Move toward threat targets * - Generate wild mana * - Patrol near the base to detect spiders */ private static void computeDefensiveOrders(Queue heroesToCompute) { computeDefensiveWindOrders(heroesToCompute); computeDefensiveShieldOrders(heroesToCompute); computeNearMyBaseTargetOrders(heroesToCompute); computeThreatTargetOrders(heroesToCompute); computeWildManaTargetOrders(heroesToCompute); computeDefensivePatrolOrders(heroesToCompute); } /** * Strategy (decreasing priority): * - Use wind spell on spider if it can remove instantly 1 hp to enemy base * - Use shield on spider if it guarantees the spider can reach the enemy base before the shield expires * and have enough hp to survive Constants.HERO_DAMAGE damage per turn until then * - Use wind spell on spiders to move them toward the enemy base, without bringing the enemy heroes * - Use control spell on his heroes to protect in base spiders if it can prevent wind on unshielded spider * or damage on shielded spider * - Move toward the closest spider near hisBase to assist it, not damaging it * - Move toward the visible spiders to spell them. Score the possible positions to * maximise the number of spiders in wind range and minimise the damage dealt to them * - Patrol near enemy base to detect close spiders */ private static void computeOffensiveOrders(Hero hero) { computeKillerWindOrder(hero); computeKillerShieldOrder(hero); computeOffensiveWindOrder(hero); computeOffensiveControlOrder(hero); computeTrackNearHisBaseSpiderOrder(hero); computeOffensiveMoveToSpellOrder(hero); computeOffensivePatrolOrder(hero); }