From 52aa95e317a9cd20653fd6e6ffadbc7a7cde7107 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Tue, 4 Aug 2020 22:57:20 -0400 Subject: [PATCH] Allow random AI to self-target --- src/game/ai.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/ai.ts b/src/game/ai.ts index 64eef09..74e9acd 100644 --- a/src/game/ai.ts +++ b/src/game/ai.ts @@ -20,7 +20,7 @@ export class NoAI implements AI { export class RandomAI implements AI { name = "Random AI" decide (actor: Creature, encounter: Encounter): LogEntry { - const actions = encounter.combatants.filter(enemy => enemy !== actor).flatMap(enemy => actor.validActions(enemy).map(action => ({ + const actions = encounter.combatants.flatMap(enemy => actor.validActions(enemy).map(action => ({ target: enemy, action: action })))