mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-25 19:34:36 +00:00
NPCs only attack target when friendly, more bonus for larger attack vs defender troops
This commit is contained in:
@@ -221,7 +221,7 @@ export class DefaultConfig implements Config {
|
||||
|
||||
if (defender.isPlayer()) {
|
||||
return {
|
||||
attackerTroopLoss: within(defender.troops() / (5 * attackTroops), .5, 2) * mag,
|
||||
attackerTroopLoss: within(defender.troops() / (5 * attackTroops), .1, 10) * mag,
|
||||
defenderTroopLoss: defender.troops() / defender.numTilesOwned(),
|
||||
tilesPerTickUsed: within(defender.troops() / (5 * attackTroops), .2, 1.5) * speed
|
||||
}
|
||||
|
||||
@@ -160,13 +160,13 @@ export class FakeHumanExecution implements Execution {
|
||||
}
|
||||
|
||||
const target = this.player.allies()
|
||||
.filter(ally => this.player.relation(ally) >= Relation.Neutral)
|
||||
.filter(ally => this.player.relation(ally) == Relation.Friendly)
|
||||
.filter(ally => ally.targets().length > 0)
|
||||
.map(ally => ({ ally: ally, t: ally.targets() }))[0] ?? null
|
||||
.map(ally => ({ ally: ally, t: ally.targets()[0] }))[0] ?? null
|
||||
|
||||
if (target != null) {
|
||||
if (target != null && !this.player.isAlliedWith(target.t)) {
|
||||
this.player.updateRelation(target.ally, -20)
|
||||
this.enemy = target.t[0]
|
||||
this.enemy = target.t
|
||||
this.lastEnemyUpdateTick = this.mg.ticks()
|
||||
this.mg.addExecution(new EmojiExecution(this.player.id(), target.ally.id(), "👍"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user