Skip to content

Commit

Permalink
feat: Defend remotes mostly with ranged creeps.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirroar committed May 19, 2024
1 parent ee8f8d7 commit f029c00
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/spawn-role/brawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default class BrawlerSpawnRole extends SpawnRole {
}

// For small attackers that should be defeated easily, use simple brawler.
if (enemyPower < smallDefenderPower && !isRangedEnemy) {
if (enemyPower < smallDefenderPower / 2 && !isRangedEnemy) {
return RESPONSE_MINI_BRAWLER;
}

Expand All @@ -180,12 +180,12 @@ export default class BrawlerSpawnRole extends SpawnRole {
}

// If damage and heal suffices, use single melee / heal creep.
const brawlerBody = this.getBrawlerCreepBody(room);
const numberBrawlerAttack = _.filter(brawlerBody, p => p === ATTACK).length;
const numberBrawlerHeal = _.filter(brawlerBody, p => p === HEAL).length;
if (!isRangedEnemy && enemyPower < (numberBrawlerAttack * ATTACK_POWER) + (numberBrawlerHeal * HEAL_POWER * meleeWithHealValue)) {
return RESPONSE_FULL_BRAWLER;
}
// const brawlerBody = this.getBrawlerCreepBody(room);
// const numberBrawlerAttack = _.filter(brawlerBody, p => p === ATTACK).length;
// const numberBrawlerHeal = _.filter(brawlerBody, p => p === HEAL).length;
// if (!isRangedEnemy && enemyPower < (numberBrawlerAttack * ATTACK_POWER) + (numberBrawlerHeal * HEAL_POWER * meleeWithHealValue)) {
// return RESPONSE_FULL_BRAWLER;
// }

// If damage and heal suffices, use single range / heal creep.
const blinkyBody = this.getBlinkyCreepBody(room);
Expand All @@ -203,9 +203,9 @@ export default class BrawlerSpawnRole extends SpawnRole {
const numberTrainRanged = _.filter(rangedBody, p => p === RANGED_ATTACK).length;
const numberTrainHeal = _.filter(healBody, p => p === HEAL).length;

if (!isRangedEnemy && enemyPower < (numberTrainAttack * ATTACK_POWER) + (numberTrainHeal * HEAL_POWER * healValue)) {
return RESPONSE_ATTACK_HEAL_TRAIN;
}
// if (!isRangedEnemy && enemyPower < (numberTrainAttack * ATTACK_POWER) + (numberTrainHeal * HEAL_POWER * healValue)) {
// return RESPONSE_ATTACK_HEAL_TRAIN;
// }

if (!isRangedEnemy && enemyPower < (numberTrainAttack * ATTACK_POWER) + (numberBlinkyRanged * RANGED_ATTACK_POWER) + (numberBlinkyHeal * HEAL_POWER * healValue)) {
return RESPONSE_ATTACK_BLINKY_TRAIN;
Expand Down

0 comments on commit f029c00

Please sign in to comment.