Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions docs/enemies/behavior-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<stat>` - Any combat statistic on the target

### Condition Examples

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -329,6 +334,7 @@ Strategic cultivator with multiple approaches:
],
rotationOverrides: [
{
kind: 'single',
stance: 'defensive',
condition: 'hp < 0.3 * maxhp',
repeatable: false
Expand Down
11 changes: 7 additions & 4 deletions docs/enemies/design-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,13 @@ stances: [
],
rotationOverrides: [
{
kind: 'single',
stance: 'summon_phase',
condition: '1',
repeatable: false
},
{
kind: 'single',
stance: 'buff_phase',
condition: '1',
repeatable: false
Expand Down Expand Up @@ -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
]
};
```
Expand All @@ -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],
Expand All @@ -520,4 +523,4 @@ export const tournamentFighter: EnemyEntity = {
{ condition: 'hp < 0.5 * maxhp', pill: healingPill }
]
};
```
```
26 changes: 17 additions & 9 deletions docs/enemies/enemy-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<stat>` — 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