diff --git a/docs/enemies/behavior-patterns.md b/docs/enemies/behavior-patterns.md index cf6d689..946fafa 100644 --- a/docs/enemies/behavior-patterns.md +++ b/docs/enemies/behavior-patterns.md @@ -175,17 +175,17 @@ Variables accessible in condition strings: - `toxicity` - Current toxicity - `maxtoxicity` - Maximum toxicity +**Buff Variables:** + +- `BuffName` - Stack count of named buff (e.g., `Rage` for rage stacks; `0` if absent) +- Use buff names directly in expressions + **Target Variables:** - `target.hp` - Player's current health - `target.maxhp` - Player's maximum health - `target.power` - Player's power -- Other target stats available as `target.statname` - -**Buff Variables:** - -- `BuffName` - Stack count of named buff (e.g., `Rage` for rage stacks) -- Use buff names directly in expressions +- `target.` - Any combat statistic on the target ### Condition Examples @@ -218,11 +218,13 @@ Respond to player's current state: // React to player's health rotationOverrides: [ { + kind: 'single', stance: 'aggressive', condition: 'target.hp < 0.3 * target.maxhp', // Player is wounded repeatable: true, }, { + kind: 'single', stance: 'defensive', condition: 'target.hp > 0.8 * target.maxhp', // Player is healthy repeatable: true, @@ -255,11 +257,13 @@ React to comparative power levels: ```typescript rotationOverrides: [ { + kind: 'single', stance: 'cautious', condition: 'target.power > power * 1.2', // Player much stronger repeatable: true, }, { + kind: 'single', stance: 'bullying', condition: 'power > target.power * 1.5', // Enemy much stronger repeatable: true, @@ -281,6 +285,7 @@ Enemies that build and spend resources: // Spend energy when enough is built rotationOverrides: [ { + kind: 'single', stance: 'unleash_power', condition: 'Energy >= 5', // Use buff name directly repeatable: false // Only spend once per build cycle @@ -329,6 +334,7 @@ Strategic cultivator with multiple approaches: ], rotationOverrides: [ { + kind: 'single', stance: 'defensive', condition: 'hp < 0.3 * maxhp', repeatable: false diff --git a/docs/enemies/design-guide.md b/docs/enemies/design-guide.md index 3a73de9..a50b965 100644 --- a/docs/enemies/design-guide.md +++ b/docs/enemies/design-guide.md @@ -213,11 +213,13 @@ stances: [ ], rotationOverrides: [ { + kind: 'single', stance: 'summon_phase', condition: '1', repeatable: false }, { + kind: 'single', stance: 'buff_phase', condition: '1', repeatable: false @@ -483,13 +485,14 @@ export const stackingEnemy: EnemyEntity = { ], rotationOverrides: [ { + kind: 'single', stance: 'powered_assault', condition: 'BuffName >= 3', // Switch when enough stacks repeatable: true } ], stanceRotation: [ - { stance: 'build_up' } // Default to building + { kind: 'single', stance: 'build_up' } // Default to building ] }; ``` @@ -507,10 +510,10 @@ export const tournamentFighter: EnemyEntity = { { name: 'main', techniques: [combo1, combo2, combo3, ultimate] } ], rotationOverrides: [ - { stance: 'setup', condition: '1' } // One-time setup + { kind: 'single', stance: 'setup', condition: '1' } // One-time setup ], stanceRotation: [ - { stance: 'main' } + { kind: 'single', stance: 'main' } ], artefacts: [weaponArtefact], @@ -520,4 +523,4 @@ export const tournamentFighter: EnemyEntity = { { condition: 'hp < 0.5 * maxhp', pill: healingPill } ] }; -``` \ No newline at end of file +``` diff --git a/docs/enemies/enemy-structure.md b/docs/enemies/enemy-structure.md index 93761c7..6892fc4 100644 --- a/docs/enemies/enemy-structure.md +++ b/docs/enemies/enemy-structure.md @@ -351,15 +351,23 @@ const exampleEnemy: EnemyEntity = { Conditions use mathematical expressions with available variables: -- `hp`, `maxhp` - Current and maximum health -- `round` - Current combat round -- `power`, `defense` - Combat stats -- `buffStacks('BuffName')` - Check buff stack count -- `hasBuff('BuffName')` - Check if buff exists -- `enemyhp`, `enemymaxhp` - Target's health values +**Self variables:** +- `hp`, `maxhp` — Current and maximum health +- `power`, `defense` — Combat stats +- `barrier`, `maxbarrier` — Barrier values +- `toxicity`, `maxtoxicity` — Toxicity values +- `BuffName` — Total stack count of a named buff (e.g., `Rage` for Rage stacks; evaluates to `0` if the buff is absent) + +**Target variables** (the opponent — player from the enemy's perspective): +- `target.hp`, `target.maxhp` — Target's current and maximum health +- `target.power`, `target.defense` — Target's combat stats +- `target.` — Any combat statistic on the target Examples: -- `"hp < 0.5 * maxhp"` - Below 50% health -- `"round > 3"` - After round 3 -- `"buffStacks('Rage') >= 3"` - 3+ Rage stacks +- `"hp < 0.5 * maxhp"` — Below 50% health +- `"Rage >= 3"` — 3+ Rage stacks +- `"Weakened > 0"` — Has the Weakened debuff +- `"target.hp < 0.3 * target.maxhp"` — Target below 30% health +- `"target.power > power * 1.2"` — Target has significantly more power +- `"barrier > 0 || Shielded > 0"` — Has barrier or Shielded buff