feat(slay-the-spire-like): support source entity in effect targeting

Update `getEffectTargets` to accept a `sourceEntityKey`. This allows
"self" targets to correctly resolve to the entity triggering the
effect (e.g., a player or a specific enemy) rather than defaulting
to a hardcoded player reference.
This commit is contained in:
2026-04-22 08:56:06 +08:00
parent 6cb0626f05
commit 5235ba7def
3 changed files with 28 additions and 10 deletions
@@ -382,12 +382,6 @@ describe("desert triggers", () => {
}),
);
const triggers = getTriggers();
const stormEffect = createEffect("storm", "permanent");
ctx._state.produce((draft) => {
const enemy = draft.enemies[0];
enemy.effects.storm = { data: stormEffect, stacks: 2 };
});
await triggers.onEnemyIntent.execute(ctx, { enemyId: "风暴之灵-0" });