diff options
-rw-r--r-- | index.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/index.js b/index.js index 5138e92..ca01536 100644 --- a/index.js +++ b/index.js @@ -1312,9 +1312,14 @@ const basicAI = function() { if (mostHurtAlly.hp / mostHurtAlly.maxHP <= 0.5) { // We can only heal them if we have healing actions available! if (this.getValidActions('ally').find(a => isHealingAction(a))) { - this.targetType = 'ally' - this.targetCharacter = mostHurtAlly - break determineTarget + // If we're an enemy, be nice: only heal 50% of the time. + // This also lets the enemy be "tough", more focused towards fighting + // than defending. + if (this.team === this.battle.playerCharacter.team || Math.random() <= 0.5) { + this.targetType = 'ally' + this.targetCharacter = mostHurtAlly + break determineTarget + } } } |