diff --git a/src/game/combat.ts b/src/game/combat.ts index a4f933b..402667a 100644 --- a/src/game/combat.ts +++ b/src/game/combat.ts @@ -66,6 +66,8 @@ export interface CombatOptions { readonly playerManaPerAttack: number /** Ticks before a dead player is restored, at full resources. */ readonly respawnTicks: number + /** When true, monsters ignore aggro distance and remain standing still (idle). */ + readonly disableMonsterAggro?: boolean } /** One monster's immutable numbers, read from a table row. */ @@ -731,6 +733,11 @@ function tickMonsters(world: CombatWorld, options: CombatOptions, terrain: Comba if (monster.hitFlash > 0) monster.hitFlash -= 1 if (monster.cooldown > 0) monster.cooldown -= 1 + if (options.disableMonsterAggro) { + monster.state = 'idle' + continue + } + const player = nearestTarget(monster, targets) if (player === null) { monster.state = 'idle' diff --git a/src/scene/act-scene.ts b/src/scene/act-scene.ts index 4579b54..7492354 100644 --- a/src/scene/act-scene.ts +++ b/src/scene/act-scene.ts @@ -1155,6 +1155,7 @@ function runScene(runtime: MapRuntime, renderer: SpriteRenderer, started: number playerDamage: 7, playerManaPerAttack: 2, respawnTicks: 75, + disableMonsterAggro: true, }, lootSeed: 0x5eed, talkRadius: 80,