feat(combat): disable monster aggro in act-scene so monsters stay idle in place

This commit is contained in:
troytt 2026-09-16 02:21:17 +00:00
parent d4fb176031
commit dcd3da0a22
2 changed files with 8 additions and 0 deletions

View File

@ -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'

View File

@ -1155,6 +1155,7 @@ function runScene(runtime: MapRuntime, renderer: SpriteRenderer, started: number
playerDamage: 7,
playerManaPerAttack: 2,
respawnTicks: 75,
disableMonsterAggro: true,
},
lootSeed: 0x5eed,
talkRadius: 80,