---
name: set-anima-stratagems
description: How an Anima decides what to do in scene-based combat, and how to implement it in your own game. A stratagem is an ordered list of rules, each a condition (about the Anima itself, an ally or a foe) and an act, read from the top whenever the Anima rethinks. Gives the universal JSON format, every condition and act, the reading algorithm, the hand and melee-range rules, the default stratagem every Anima starts with, and import and export. Use when giving Animas behaviour, writing or exchanging stratagem files, or reproducing Set's own Animas.
license: "Free to use when obtained from set.world, commercially too (the API, what it returns and the skills). Its models, animations and textures, Anima included, are CC BY 4.0: free to use with attribution to Jimmy Lee (j@internet.dev). The source code of Set is © Jimmy Lee under CC BY-NC 4.0 and its commercial use needs a paid waiver."
metadata:
  version: "0.15.20"
  title: Stratagems
---

# Stratagems (AnimaSystem)

A **stratagem** is how an Anima chooses what to do in scene-based combat: an ordered list of rules, each a **condition** and an **act**. When the condition names an Anima and the act can be done, the Anima does it. Every Anima in Set's scene-based pages acts by one: `/anima-stratagem` and `/anima-battle` let you edit, reorder, import and export each Anima's, and on `/anima-scene` each member of a model-designed team acts by the stratagem its designer wrote for it ([Scenes](https://set.world/skills/anima-scenes) has each page's build sheet). Like the rest of AnimaSystem, this is Set's own game layer on top of the API: no endpoint stores or runs a stratagem, and your game may use these rules as they are, change them, or ignore them.

This skill is the whole rule (`set-world-0-15-20-stratagem-play-16`). The scene it runs in (movement, bodies, clocks) is in [Scenes](https://set.world/skills/anima-scenes); what each item does when an act uses it is in [Derived combat](https://set.world/skills/anima-derived-combat); the reference is §13.77 in [Algorithms](https://set.world/skills/algorithms).

## When a stratagem is read

- **In combat only.** With combat off an Anima keeps its routine: a team member holds its station, a neutral follows the chain or patrols ([Scenes](https://set.world/skills/anima-scenes)). Dungeon mode, the turn-based mode, has no stratagems.
- **At every rethink.** An Anima rethinks several times a second and at once after its action ends, a hit lands, or a WorldSphere is picked up or dropped. Nothing is remembered between readings: each reading starts again from the top, so the Anima changes course the moment a different rule becomes the first to fire.
- **Between actions.** An attack, throw, pickup or hurt reaction already under way finishes first; the new choice takes effect after it.
- **Unless a status effect decides.** An Anima that is afraid, hysterical, taunted or scared does what its effect says and reads no rule; a provoked one reads every rule but its defensive acts (Guard, Guard-advance, Backstep, Run and Kite); a sleeping or petrified one does not think at all. No condition names a hidden Anima but the Anima itself, unless the Anima reading it is under Foresight, which sees it, and no condition of the other side names a stalking Anima, unless the Anima reading it is under Keen or Foresight ([Derived combat](https://set.world/skills/anima-derived-combat) has each effect).

## Reading a stratagem

```text
for each rule, top to bottom:
  target = the Anima the rule's condition names       (none → next rule)
  if the act can be done on target:                    (no → next rule)
    this rule decides; stop reading
no rule decided → the routine
```

The rule that decides is the **active** rule; `/anima-stratagem` and `/anima-battle` show it in red in the stratagem columns while the fight runs.

### Who a condition can name

| Side | Candidates |
| --- | --- |
| Self | The Anima itself |
| Ally | Another Anima of the same team within its sight range (`8 × visionRange`, never less than 5 units), never itself; on `/anima-battle-effects`, only the Anima of its own cell |
| Foe | Any Anima of another team; neutrals and both teams oppose each other, neutrals never oppose neutrals. A SEDUCED Anima sides with its seducer's team and is a foe to every Anima, that team included; a hysterical one that turns on a friend makes it its foe ([Derived combat](https://set.world/skills/anima-derived-combat)) |

A candidate must be **standing**: alive, not dressing, and not down, held, falling or landing (an Anima staggered by a rupture wave's pull, a blast's knockdown or a Javelin knock counts as standing). The only exception is `status = DEAD`, which names downed Animas.

### Which candidate it names

- A **ranking** condition (lowest HP, fastest, furthest…) names the candidate with the extreme value.
- A **filtering** condition (HP below a share, targeting self, in melee range…) names the **nearest** candidate that passes.
- Ties go to the nearer candidate, then to the one placed earlier. Distance is between body centres and counts the height between the two Animas (the ground distance and the height gap, combined as a hypotenuse; [Derived combat](https://set.world/skills/anima-derived-combat)); sight range and the forward cone are measured on the floor.

| Value | Read from |
| --- | --- |
| HP, max HP | Current and maximum health |
| Stamina, max Stamina | Current and maximum stamina |
| HP %, STAMINA % | Current divided by maximum |
| Level | The character's level |
| Speed (slowest, fastest) | `walkSpeed`, after AnimaSystem's armour weight ([Derived stats](https://set.world/skills/anima-derived-stats)) |
| Strongest weapon | The highest AnimaSystem hit power among its held items |
| Defense, magic | `physicalDamageReduction`, `magicalDamageReduction` |
| Nearest visible | In sight: within the sight range and inside the forward cone of about 160°, or within 5 units, or already its target |
| Targeted by ally, targeting self, targeting ally | Each Anima's current target; the allies counted are the living allies within the reader's sight range |
| Targeted by 2+ foes | Self only: at least two living foes have the Anima as their current target, wherever they are |
| In melee range | Within the longer of the two Animas' melee reaches, plus 1 unit (below) |
| Item quality (best, worst) | The mean effect strength of its equipped items: each item's quality read as AnimaSystem's effect strength, Plain 1, better qualities higher and worse ones lower, and 0 with nothing equipped ([Item attributes](https://set.world/skills/anima-item-attributes)) |
| Most prefixes and suffixes | How many prefixes and suffixes its equipped items carry |
| Answers melee | It carries thorns, or a chance to give an effect to whoever strikes it in melee (a worn prefix's effect on hit, [Item attributes](https://set.world/skills/anima-item-attributes)) |
| Gives effects on hit | It carries a chance to give an effect on hit, from a held item's prefix or from any suffix ([Item attributes](https://set.world/skills/anima-item-attributes)) |
| `status = …` of an effect | It has that status effect now ([Derived combat](https://set.world/skills/anima-derived-combat)); any debuff and any buff read every effect of that side: a debuff is an effect an item gives a foe, a buff one an item gains ([Item attributes](https://set.world/skills/anima-item-attributes)) |

### Every condition (243)

The 96 conditions below, then 147 status-effect conditions, one for each side and each of the 49 status effects: `self-status-<id>`, `ally-status-<id>` and `foe-status-<id>`, labelled `Self: status = BURNED` and so on, for BURNED (`burned`), POISONED (`poisoned`), BLEEDING (`bleeding`), BLIGHTED (`blighted`), DECAYING (`decaying`), WITHERING (`withering`), FROZEN (`frozen`), PETRIFIED (`petrified`), SLEEPING (`sleeping`), SEDUCED (`seduced`), SILENCED (`silenced`), AFRAID (`afraid`), HYSTERIA (`hysteria`), TAUNTED (`taunted`), PROVOKED (`provoked`), SCARED (`scared`), EXPOSED (`exposed`), HIDDEN (`hidden`), STALKING (`stalking`), PHASED (`phased`), RESIST (`resist`), HASTED (`hasted`), SLOWED (`slowed`), SHIELDED (`shielded`), REGEN (`regen`), DEATH (`death`), RESURRECTION (`resurrection`), FORESIGHT (`foresight`), FORTIFIED (`fortified`), REINFORCED (`reinforced`), WARDED (`warded`), LEECHED (`leeched`), VIGOR (`vigor`), VIGILANCE (`vigilance`), BERSERK (`berserk`), FRENZY (`frenzy`), PROWESS (`prowess`), KEEN (`keen`), EXALTED (`exalted`), HEAVY (`heavy`), LIGHT (`light`), FLOAT (`float`), FADED (`faded`), DOOMED (`doomed`), BLINDED (`blinded`), FRAIL (`frail`), ELECTROCUTED (`electrocuted`), COURAGE (`courage`), CURSED (`cursed`).

| Id | Condition |
| --- | --- |
| `self-any` | Self: any |
| `self-hp-below-100` | Self: HP < 100% |
| `self-hp-below-90` | Self: HP < 90% |
| `self-hp-below-80` | Self: HP < 80% |
| `self-hp-below-70` | Self: HP < 70% |
| `self-hp-below-60` | Self: HP < 60% |
| `self-hp-below-50` | Self: HP < 50% |
| `self-hp-below-40` | Self: HP < 40% |
| `self-hp-below-30` | Self: HP < 30% |
| `self-hp-below-20` | Self: HP < 20% |
| `self-hp-below-10` | Self: HP < 10% |
| `self-targeted-by-2-foes` | Self: targeted by 2+ foes |
| `self-worldsphere-in-melee-range` | Self: WorldSphere in melee range |
| `self-stamina-below-100` | Self: STAMINA < 100% |
| `self-stamina-below-90` | Self: STAMINA < 90% |
| `self-stamina-below-80` | Self: STAMINA < 80% |
| `self-stamina-below-70` | Self: STAMINA < 70% |
| `self-stamina-below-60` | Self: STAMINA < 60% |
| `self-stamina-below-50` | Self: STAMINA < 50% |
| `self-stamina-below-40` | Self: STAMINA < 40% |
| `self-stamina-below-30` | Self: STAMINA < 30% |
| `self-stamina-below-20` | Self: STAMINA < 20% |
| `self-stamina-below-10` | Self: STAMINA < 10% |
| `ally-lowest-hp` | Ally: lowest HP |
| `ally-slowest` | Ally: slowest |
| `ally-fastest` | Ally: fastest |
| `ally-strongest-weapon` | Ally: strongest weapon |
| `ally-lowest-defense` | Ally: lowest defense |
| `ally-lowest-magic` | Ally: lowest magic |
| `ally-best-quality` | Ally: best item quality |
| `ally-hp-below-100` | Ally: HP < 100% |
| `ally-hp-below-90` | Ally: HP < 90% |
| `ally-hp-below-80` | Ally: HP < 80% |
| `ally-hp-below-70` | Ally: HP < 70% |
| `ally-hp-below-60` | Ally: HP < 60% |
| `ally-hp-below-50` | Ally: HP < 50% |
| `ally-hp-below-40` | Ally: HP < 40% |
| `ally-hp-below-30` | Ally: HP < 30% |
| `ally-hp-below-20` | Ally: HP < 20% |
| `ally-hp-below-10` | Ally: HP < 10% |
| `ally-stamina-below-100` | Ally: STAMINA < 100% |
| `ally-stamina-below-90` | Ally: STAMINA < 90% |
| `ally-stamina-below-80` | Ally: STAMINA < 80% |
| `ally-stamina-below-70` | Ally: STAMINA < 70% |
| `ally-stamina-below-60` | Ally: STAMINA < 60% |
| `ally-stamina-below-50` | Ally: STAMINA < 50% |
| `ally-stamina-below-40` | Ally: STAMINA < 40% |
| `ally-stamina-below-30` | Ally: STAMINA < 30% |
| `ally-stamina-below-20` | Ally: STAMINA < 20% |
| `ally-stamina-below-10` | Ally: STAMINA < 10% |
| `foe-nearest-visible` | Foe: nearest visible |
| `foe-in-melee-range` | Foe: in melee range |
| `foe-any` | Foe: any |
| `foe-targeted-by-ally` | Foe: targeted by ally |
| `foe-not-targeted-by-ally` | Foe: not targeted by ally |
| `foe-targeting-self` | Foe: targeting self |
| `foe-targeting-ally` | Foe: targeting ally |
| `foe-furthest` | Foe: furthest |
| `foe-nearest` | Foe: nearest |
| `foe-highest-hp` | Foe: highest HP |
| `foe-lowest-hp` | Foe: lowest HP |
| `foe-highest-max-hp` | Foe: highest max HP |
| `foe-lowest-max-hp` | Foe: lowest max HP |
| `foe-highest-stamina` | Foe: highest Stamina |
| `foe-lowest-stamina` | Foe: lowest Stamina |
| `foe-highest-max-stamina` | Foe: highest max Stamina |
| `foe-lowest-max-stamina` | Foe: lowest max Stamina |
| `foe-highest-level` | Foe: highest level |
| `foe-lowest-level` | Foe: lowest level |
| `foe-highest-speed` | Foe: highest speed |
| `foe-lowest-speed` | Foe: lowest speed |
| `foe-best-quality` | Foe: best item quality |
| `foe-worst-quality` | Foe: worst item quality |
| `foe-most-words` | Foe: most prefixes and suffixes |
| `foe-answers-melee` | Foe: answers melee |
| `foe-gives-on-hit` | Foe: gives effects on hit |
| `foe-hp-full` | Foe: HP = 100% |
| `foe-hp-at-least-90` | Foe: HP ≧ 90% |
| `foe-hp-at-least-70` | Foe: HP ≧ 70% |
| `foe-hp-at-least-50` | Foe: HP ≧ 50% |
| `foe-hp-at-least-30` | Foe: HP ≧ 30% |
| `foe-hp-at-least-10` | Foe: HP ≧ 10% |
| `self-status-disarmed` | Self: status = DISARMED |
| `self-status-stuck` | Self: status = STUCK |
| `ally-status-dead` | Ally: status = DEAD |
| `ally-status-disarmed` | Ally: status = DISARMED |
| `ally-status-stuck` | Ally: status = STUCK |
| `foe-status-dead` | Foe: status = DEAD |
| `foe-status-disarmed` | Foe: status = DISARMED |
| `foe-status-stuck` | Foe: status = STUCK |
| `self-status-debuffed` | Self: status = any debuff |
| `self-status-buffed` | Self: status = any buff |
| `ally-status-debuffed` | Ally: status = any debuff |
| `ally-status-buffed` | Ally: status = any buff |
| `foe-status-debuffed` | Foe: status = any debuff |
| `foe-status-buffed` | Foe: status = any buff |

Statuses: `status = DEAD` reads health at zero; self has no `status = DEAD`, since a downed Anima does not act. `status = DISARMED` (`set-world-0-15-20-disarm-2`) names a standing Anima whose offhand item lies on the floor, knocked away by a DISARM! ([Derived combat](https://set.world/skills/anima-derived-combat)), dropped asleep or in hysteria, or put down to grab a WorldSphere, while it holds no WorldSphere; `Self: status = DISARMED` with **Pick up offhand** sends it back for the item. `status = STUCK` (`set-world-0-15-20-stick-1`) names a standing Anima held by a STICK! ([Derived combat](https://set.world/skills/anima-derived-combat)): it cannot move farther from the Anima that stuck it and fights with its offhand alone until the hold breaks (Derived combat lists how); `Foe: status = STUCK` finds a held target, one that cannot back away, though any landed hit on it frees it; `Ally: status = STUCK` finds one to rescue. A stuck Anima ignores **Pick up offhand** until it is free. Every status effect has its own `status = …` condition on each side, and `status = any debuff` (`status-debuffed`) and `status = any buff` (`status-buffed`) name an Anima with at least one effect of that side; each names a standing Anima only, so `Foe: status = SLEEPING` waits until the sleeper stands again. `Foe: status = EXPOSED` finds the foe that takes double damage; `Ally: status = any debuff` finds an ally to cleanse with a ring or a song; `Foe: answers melee` finds a foe that punishes a melee strike, for a ranged act.

## Acts

| Id | Act | Does |
| --- | --- | --- |
| `mainhand` | Mainhand | Attack the foe with the mainhand, or with fists when it is empty. On an ally, only when the mainhand plays a ring or a song, and a song only when it is ready |
| `offhand` | Offhand | Attack the foe with the offhand item, fetching it first if it was dropped. On an ally, only when the offhand plays a ring or a song, and a song only when it is ready. Needs an offhand item |
| `melee` | Melee | Attack the foe with the held melee items, alternating when there are two, or with fists when the mainhand is empty. Rings and other close-area items count as melee |
| `ranged` | Ranged | Attack the foe with the held ranged items (projectiles and waves), alternating when there are two |
| `kite` | Kite | Keep the foe at the ranged item's range: close in when it is farther, and while its next shot is cooling down walk backwards at 25% of full running speed when it is closer than 60% of that range. Once the shot is ready it stops, settles and fires, then backs away again |
| `stop` | Stop | Stand still |
| `hold` | Hold | Stand still, facing the foe, and attack it with either hand whenever it is within reach; never move toward or away from it |
| `protect` | Protect | Get in front of the ally: stand 1.5 body widths from it on the side of the foe nearest to it, face that foe and fight it with either hand, moving to stay between them |
| `guard` | Guard | Cross the forearms and stand still, turning and stepping to face the nearest foe. A guarding Anima still takes damage: each hit deals 50% of its damage, after every other reduction, plays no hit reaction, pushes it back 20% as far (once the push fades it steps back to where it began guarding, at 25% of full running speed, still facing the foe; a guard that breaks and resumes within 8 seconds keeps that spot). Guarding is tiring: it recovers no stamina and costs 4 stamina every status tick, and a hit costs only what the attacker drains. With a shield, it blocks 100% of physical projectiles and thrown objects that strike from the front; the push and stamina effects still land. With no stamina left it still cuts every hit but is exhausted, losing health each tick, and the next hit breaks the guard. Needs a standing foe, no WorldSphere in hand and at least 20 stamina to begin |
| `run` | Run | Move as fast as it can away from the foe |
| `backstep` | Backstep | Walk backwards away from the foe at 25% of full running speed, facing it, and never step toward it. Whenever an action is ready and the foe is within its reach, stand and strike with either hand, then keep backing away |
| `lunge` | Lunge | Leap at the foe while striking, landing as the blow connects: one 2.6x speed attack with a melee item, or fists when the mainhand is empty, that closes the gap; once in reach it fights as Melee. The leap costs the strike's stamina and never less than 50, so it needs at least 50 stamina. A hit taken while lunging deals 2x damage and knocks the Anima into a tumble |
| `advance` | Advance | Attack-move toward the foe: close in and attack it with either hand, turning on any foe that comes closer on the way |
| `charge` | Charge | Run at the foe at 2.75x running speed without attacking, until it is in melee range; there Charge stops deciding and the next rule fires, such as Lunge. While charging, each hit deals 2.5x its damage, after every other reduction, and pushes it back 20% as far and costs 20 stamina, and stamina does not recover on its own; only an action or item that restores stamina adds any. Needs a standing foe out of melee range and no WorldSphere in hand |
| `guard-advance` | Guard-advance | With a shield, raise it as in Guard and walk toward the foe at 35% of full running speed, facing it, and stand guarding once it is within reach; it never attacks. Each hit deals 75% of its damage, after every other reduction, plays no hit reaction, pushes it back 20% as far and costs 40 stamina; the shield blocks 100% of physical projectiles and thrown objects that strike from the front. Needs at least 40 stamina to begin and no WorldSphere in hand. Without a shield, or once stamina runs out, it does what Advance does |
| `grab-worldsphere` | Grab WorldSphere | Fetch the nearest free WorldSphere, dropping the offhand item |
| `throw-worldsphere` | Throw WorldSphere | Throw the held WorldSphere at the foe. Needs a WorldSphere in hand |
| `pick-up-offhand` | Pick up offhand | Walk to the dropped offhand item and pick it back up. Needs an offhand item on the floor: knocked away by a DISARM!, or put down to grab a WorldSphere. Not while STUCK |
| `patrol` | Patrol | Move in the routine: a loop around the centre of the scene |

### Whether an act can be done

- **Stop** and **Patrol** can always be done. With **Guard** and **Pick up offhand**, which never use their condition's Anima, they are the only acts a `status = DEAD` condition can lead to.
- **Guard** needs a standing foe anywhere, no WorldSphere in hand, and at least 20 stamina to begin (it continues with none). It does not use the condition's Anima: a rule like `Self: HP < 10% → Guard` guards against the nearest foe.
- **Run**, **Advance**, **Guard-advance**, **Backstep** and **Hold** need a standing foe; **Charge** needs one out of melee range and no WorldSphere in hand; **Kite** needs what Ranged needs.
- **Protect** needs a living ally named by an Ally condition; it never acts on Self or a foe.
- **Lunge** needs what Melee needs and at least 50 stamina; below that the next rule is tried.
- **Grab WorldSphere** needs a free WorldSphere it can reach; **Throw WorldSphere** needs one in hand and a foe.
- **Pick up offhand** needs the Anima's own offhand item on the floor, no WorldSphere in hand, and not being STUCK.
- **Mainhand**, **Offhand**, **Melee** and **Ranged** need empty hands of WorldSpheres. Offhand needs an offhand item (held, or dropped and fetched first). Melee needs a melee item or an empty mainhand; Ranged needs a projectile or wave item. On an ally or on Self, Mainhand and Offhand need that hand to play a ring or a song (Unfurl; Play, Strum, Blow), and a song only while it is ready to start, so the rule is skipped while it plays or rests; Melee, Lunge, Ranged, Kite, Run, Advance, Charge, Guard-advance, Backstep and Hold never act on them.

An act that cannot be done does not stop the reading: the next rule is tried.

### Hands

- **Melee** uses every held melee item (rings, songs and other close-area items count as melee), offering each action to the other hand first, or fists when the mainhand is empty. A song reaches every teammate from anywhere, so a hand whose song is ready plays it at once, wherever the Anima stands and before any other hand; the player then stands and plays for the whole song, and while the song rests the hand is not offered, so the other hand or the fists fight on ([Derived combat](https://set.world/skills/anima-derived-combat), Songs). **Ranged** uses every held projectile or wave item the same way. Under every act a ready hand goes again, as often as it stays ready, while the other still reloads or recovers, so a quick weapon can act several times beside a slow one ([Derived combat](https://set.world/skills/anima-derived-combat)). **Lunge** uses Melee's hands and **Kite** Ranged's; **Hold** and **Protect** may use either hand. **Advance**, **Backstep** and, when it acts as Advance, **Guard-advance** may use either hand.
- When a **Mainhand** rule decides, a later **Offhand** rule that fires on the same Anima adds the offhand, and the other way round. With both hands allowed, the Anima prefers a projectile or wave hand beyond 5 units and a melee hand inside ([Derived combat](https://set.world/skills/anima-derived-combat)).
- No act drops an item. Each hand keeps its item; switching to melee only means using the other hand. Grab WorldSphere sets the offhand item down to take the sphere, and the Anima fetches it again afterwards.

### Melee range

`Self: WorldSphere in melee range` names the Anima itself while a free WorldSphere lies within its own melee reach plus 1 unit, measured to the sphere's centre. `Foe: in melee range` is not a fixed distance. An Anima's **melee reach** is the measured range of its longest held melee item, the same range its attacks start from ([Derived combat](https://set.world/skills/anima-derived-combat)), or its punch reach when it has no melee item. A foe is in melee range when it is within the longer of the two Animas' melee reaches plus 1 unit. A long spear therefore puts both sides in melee range while it is still coming, and its foe switches to melee before the point arrives.

### Moving

In combat an Anima moves at its fastest, its running pace, except where an act below says otherwise. **Hold** never moves: it faces the foe and attacks whatever of it comes within reach. **Kite** (`set-world-0-15-20-kite-2`) keeps the foe at its ranged item's range: it runs in when the foe is farther and holds still within that range. While its next shot is cooling down and the foe is closer than 60% of the range, it walks backwards at 25% of full running speed. The moment the shot is ready it stops, comes to rest and fires, then backs away again; it never fires on the move. **Protect** (`set-world-0-15-20-protect-1`) gets in front of an ally: it takes the foe nearest to that ally as its threat, runs to a post 1.5 body widths from the ally on the threat's side, and once within 2 body widths of the post faces the threat and fights it, moving to stay between the two. **Guard** does not travel: it turns in place to face the nearest foe, stepping as it turns. **Backstep** (`set-world-0-15-20-backstep-3`) never steps toward the foe. It walks straight backwards away from it at 25% of full running speed, still facing it. Whenever an action is ready and the foe is already within that hand's reach, it stands and strikes with either hand, then keeps backing away. It never closes in to find range. Backing away is a walk, so it pays no running stamina ([Derived combat](https://set.world/skills/anima-derived-combat)).

**Advance** closes in and attacks, turning on any foe that comes closer on the way. **Charge** (`set-world-0-15-20-charge-1`) runs at the foe at 2.75x running speed without attacking, and stops applying at melee range (below). **Guard-advance** (`set-world-0-15-20-guard-advance-2`) closes in behind a raised shield at 35% of full running speed and never attacks (below). **Run** heads 6 units further from the foe, re-aimed every step, for as long as its rule decides. **Patrol** walks the loop around the centre of the scene. A dropped offhand is fetched before any act except Grab WorldSphere, Stop, Run, Patrol, Guard, Backstep, Hold and Protect, and also when no rule decides, before the routine; never while STUCK or holding a WorldSphere.

### Lunge

Lunge (`set-world-0-15-20-lunge-5`) is a melee charge that uses Anima's jump. It is the first act that leaves the ground, and the riskiest.

- **It leaps and strikes in one motion.** When the foe is out of its strike reach by no more than 3 body widths plus 1 world unit, the Anima jumps at it while swinging: the melee item's action, or a punch, starts at takeoff at 2.6x speed, the body flies on Anima's jump arc, and it lands just inside its reach as the blow connects, aimed at where the foe will be by then, so a foe running at it is met rather than overshot. It leaps at any foe in that range it would still move toward, one already inside its reach included. The rest of the action finishes on the ground. Farther away it runs in until it can leap; once the foe is closer than its landing point, it fights as Melee does.
- **It is expensive.** The leap and its strike cost the strike's stamina, never less than 50, paid when it jumps. With less than 50 stamina the rule is skipped.
- **It is punished in the air.** A hit taken while lunging, from takeoff to the landing, cannot be blocked, deals 2x damage, and knocks the Anima into a tumble along the hit; it gets up as from any knock, and the strike and its stamina are lost.

### Guard

Guard (`set-world-0-15-20-guard-9`) is the act that trades attacking for staying power. The Anima crosses its forearms in front of its chest, holding its items in its fists, and stands its ground. With a shield it does not cross its arms: it plays its shield's own shield-bash animation and holds it at the push, shield thrust forward and standing upright, while its other hand keeps its own item at rest. With a shield in each hand, the better shield (the higher block chance) pushes and the other is carried, so the arms never cross (`set-world-0-15-20-shield-guard-3`).

- **It faces the nearest foe.** Every step it turns toward the nearest standing foe at its usual turn rate, and its feet step to follow the turn. It never walks toward or away from anyone; it only steps back to its post, the spot where it began guarding, when a hit has pushed it more than 0.25 body widths away. Once the push fades it walks back at 25% of full running speed, still facing the foe. The post outlasts a broken guard: if stamina runs out, or a knockback makes another rule fire for a moment, and it guards again within 8 seconds, it returns to the same spot.
- **It still takes damage.** Guard is not immunity: every hit that gets through still removes health, only 50% less of it, and every guarded hit also costs stamina (below). A hit that lands while it guards deals `round(damage × (1 − 50%))`, after the dodge, the critical, its physical or magic damage reduction, its shield's block chance and the glance; a PIERCE! skips the cut ([Derived combat](https://set.world/skills/anima-derived-combat)). Health stays whole.
- **The guard holds.** A hit plays no hit reaction and starts no hit recovery, so the Anima keeps guarding and turning. Knockback still pushes it, but 80% less far, and it staggers back on its feet with the push.
- **It does not attack.** Its hands are guarding, crossed or behind the shield; no action starts while Guard decides.
- **A shield stops every shot from the front.** With a shield, a guarding Anima blocks 100% of physical projectiles and thrown objects that strike it within its front 180°: arrows, bolts, sling stones, thrown tools and spears, Rifle shots, the Hand cannon's blast and WorldSpheres. Each shows BLOCK and takes no health, but its push (cut like any guarded push) and any stamina drain still land. Against melee and fists the shield keeps its ordinary block chance; from the side or behind, outside its front 180°, it blocks nothing, shots included ([Derived combat](https://set.world/skills/anima-derived-combat)). Magic is never blocked, the Cane's Missile included; it takes Guard's 50% like any other hit.
- **Guarding is tiring.** It recovers no stamina, and every status tick spent guarding costs 4 stamina, shown as a violet number. A hit costs nothing extra: only what the attacker does to stamina (a drain) lands. When stamina runs out it keeps guarding and still cuts every hit, but it is exhausted, losing 1 health a tick ([Derived combat](https://set.world/skills/anima-derived-combat)), and the next hit that lands breaks the guard: it plays the hit reaction and the Anima moves on to the next rule that fires. A low-health Anima that guards too long with no one to strike it dies of it, the price of a last stand. Guard can begin again only with at least 20 stamina; an Anima already guarding keeps it whatever its stamina.
- **It is still a target.** Guard softens hits; it never makes an Anima harder to hit. Stamina drains, a rupture wave's pull, a blast's knockdown and a Javelin knock affect it as usual.
- **It ends** as soon as a rule above it fires, its own condition stops naming an Anima, no standing foe remains, or a hit lands after its stamina ran out.

A stratagem such as `Foe: targeting self → Guard` above `Foe: in melee range → Melee` lets an Anima absorb a charge, then strike once the attacker turns away.

### Charge

Charge (`set-world-0-15-20-charge-1`) is a sprint into melee range, built to hand over to the act that follows it. The Anima runs straight at the foe its condition named at 2.75x its full running speed and never attacks on the way. Running stamina is charged per second as usual, and stamina does not recover on its own while it charges: the sprint spends what the Anima has. Only an action or item that restores stamina (an Unfurl ring's refresh or a song's tick, for one) still adds stamina. Recovery resumes once Charge hands over.

- **It stops at melee range.** The moment the foe is in melee range (the same test as `Foe: in melee range`), Charge no longer applies and the next rule that fires takes over. Put Lunge below it, such as `Foe: nearest → Charge` then `Foe: nearest → Lunge`, and the Anima sprints in and leaps the last stretch while striking. If the foe gets out of melee range again, Charge fires again.
- **It is hit hard.** While it charges, every hit that lands deals `round(damage × 2.5)`, after the dodge, the critical, both damage reductions, the shield's block chance and the glance. Once it is in melee range its hits are ordinary again.
- **It is hard to stop.** Knockback pushes it 80% less far, Guard's cut. Hits still play the hit reaction and its recovery.
- **Every hit that gets through costs stamina.** Each hit that lands while charging also costs 20 stamina, shown as a violet number; a hit its shield blocks (BLOCK) or that glances off its armor (GLANCED) costs none. With recovery off, a charger that is hit on the way in may arrive without the stamina its next act needs, such as Lunge's 50.
- **It needs** a standing foe out of melee range and no WorldSphere in hand; otherwise the next rule is tried. A dropped offhand is fetched first, as for Advance.

### Guard-advance

Guard-advance (`set-world-0-15-20-guard-advance-2`) is Guard on the move, for a shield bearer closing on a shooter. It needs a shield: without one it never starts and the Anima does exactly what Advance does.

- **It walks in behind the shield.** The Anima raises its shield as in Guard, the same held push, and walks straight toward the foe its condition named at 35% of full running speed, a little faster than Backstep, turning to face it and stepping as it goes. A push stops the walk until it fades. Once the foe is within its melee reach it stops and stands guarding.
- **It does not attack.** No action starts while Guard-advance decides; put an attacking rule above it, such as `Foe: in melee range → Melee`, to strike once it arrives.
- **Hits are cut less than in Guard.** A hit that lands deals `round(damage × (1 − 25%))`, after the dodge, the critical, both damage reductions, the shield's block chance and the glance; a PIERCE! skips the cut. It plays no hit reaction and starts no hit recovery, and knockback pushes it 80% less far.
- **The shield stops shots from the front** exactly as in Guard: 100% of physical projectiles and thrown objects within its front 180°.
- **It costs more stamina.** Every hit taken, blocked or cut, costs 40 stamina. It begins only with at least 40 stamina and no WorldSphere in hand. When stamina runs out the guard breaks, that hit still guarded, and the Anima does what Advance does until it has 40 stamina again.
- **It ends** as soon as a rule above it fires, its condition stops naming a standing foe, or it no longer holds a shield.

## The default stratagem

Every Anima starts with this stratagem unless it is given another:

1. Self: HP < 10% → Guard (`self-hp-below-10`, `guard`)
2. Self: WorldSphere in melee range → Grab WorldSphere (`self-worldsphere-in-melee-range`, `grab-worldsphere`)
3. Self: status = DISARMED → Pick up offhand (`self-status-disarmed`, `pick-up-offhand`)
4. Ally: status = any debuff → Mainhand (`ally-status-debuffed`, `mainhand`)
5. Ally: status = any debuff → Offhand (`ally-status-debuffed`, `offhand`)
6. Foe: nearest visible → Throw WorldSphere (`foe-nearest-visible`, `throw-worldsphere`)
7. Foe: nearest → Throw WorldSphere (`foe-nearest`, `throw-worldsphere`)
8. Foe: status = EXPOSED → Melee (`foe-status-exposed`, `melee`)
9. Foe: answers melee → Ranged (`foe-answers-melee`, `ranged`)
10. Foe: in melee range → Melee (`foe-in-melee-range`, `melee`)
11. Foe: nearest visible → Ranged (`foe-nearest-visible`, `ranged`)
12. Foe: nearest visible → Melee (`foe-nearest-visible`, `melee`)
13. Foe: nearest → Ranged (`foe-nearest`, `ranged`)
14. Foe: nearest → Melee (`foe-nearest`, `melee`)

Below 10% health it guards, turning to face the nearest foe and taking every hit at Guard's cut. It throws a WorldSphere it already holds first. When a hit breaks the spent guard it fights on with the rules below until it can guard again; if no hit comes, the tiring guard exhausts it, so a fight where every survivor guards still ends. Otherwise it picks up a WorldSphere only when one lies within its own melee range (`Self: WorldSphere in melee range`), so it never walks across the board for one, goes back for its own offhand item lying on the floor (`Self: status = DISARMED`: knocked away by DISARM!, or dropped asleep or in hysteria), plays for the nearest ally suffering any debuff when a hand plays a ring or a song, whose roll may CLEANSE! it ([Derived combat](https://set.world/skills/anima-derived-combat); an Anima without one skips both rules), and throws a WorldSphere it holds at the nearest foe for 1000 damage. An EXPOSED foe is struck in melee first, since it takes double damage. A foe that answers melee with thorns or an effect on its attacker is met by a ranged item when the Anima has one. A foe in melee range meets a melee item, or fists; otherwise the nearest foe in view, or the nearest at all, meets a ranged item if the Anima has one, else a melee item. A ranged mainhand with a melee offhand therefore shoots until a foe is in melee range, then fights with the offhand. To change when an Anima goes to melee, change these rules.

## The format

A stratagem file is JSON, the same in every game that reads it:

```json
{
  "format": "set-stratagem",
  "version": 3,
  "name": "Anima A",
  "rules": [
    {
      "condition": "self-hp-below-10",
      "act": "guard"
    },
    {
      "condition": "self-worldsphere-in-melee-range",
      "act": "grab-worldsphere"
    },
    {
      "condition": "self-status-disarmed",
      "act": "pick-up-offhand"
    },
    {
      "condition": "ally-status-debuffed",
      "act": "mainhand"
    },
    {
      "condition": "ally-status-debuffed",
      "act": "offhand"
    },
    {
      "condition": "foe-nearest-visible",
      "act": "throw-worldsphere"
    },
    {
      "condition": "foe-nearest",
      "act": "throw-worldsphere"
    },
    {
      "condition": "foe-status-exposed",
      "act": "melee"
    },
    {
      "condition": "foe-answers-melee",
      "act": "ranged"
    },
    {
      "condition": "foe-in-melee-range",
      "act": "melee"
    },
    {
      "condition": "foe-nearest-visible",
      "act": "ranged"
    },
    {
      "condition": "foe-nearest-visible",
      "act": "melee"
    },
    {
      "condition": "foe-nearest",
      "act": "ranged"
    },
    {
      "condition": "foe-nearest",
      "act": "melee"
    }
  ],
  "outfit": [
    {
      "slot": "tool",
      "gear": "sword",
      "material": null,
      "quality": null,
      "prefix": null,
      "suffix": null
    }
  ]
}
```

| Field | Value |
| --- | --- |
| `format` | Always `"set-stratagem"` |
| `version` | `3` |
| `name` | Optional text, or `null` |
| `rules` | At most 24 rules, read in order; each has a `condition` id and an `act` id from the tables above |
| `outfit` | What the Anima wears and holds, or `null` for none recorded: one entry per filled slot, each a `slot` (`tool` for the mainhand, `offhand`, or a worn slot), the `gear` name as the item tables spell it, a `material` name or `null` for the default ([Item models](https://set.world/skills/anima-item-models)), and the item's `quality`, `prefix` and `suffix` as the item tables spell them, or `null` for none (Plain, no prefix, no suffix; [Item attributes](https://set.world/skills/anima-item-attributes)) |

```ts
type StratagemRule = { condition: string; act: string };
type StratagemOutfitItem = { slot: string; gear: string; material: string | null; quality: string | null; prefix: string | null; suffix: string | null };
type StratagemDocument = { format: 'set-stratagem'; version: 3; name: string | null; rules: StratagemRule[]; outfit: StratagemOutfitItem[] | null };
```

A stratagem often only works with the right equipment (a Guard behind a shield, a Lunge with a melee item), so the file carries the outfit with the rules.

In a URL the same rules travel as `condition:act` pairs joined by commas, under the page's parameter for that Anima ([Scenes](https://set.world/skills/anima-scenes) names each page's). The default stratagem leaves no parameter, and an empty value means no rules.

### Import and export

- **Export** writes the document above, two-space indented, with the Anima's current outfit, as `<name>.stratagem.json`: the name lower-cased, every run of other characters a hyphen (`anima-a.stratagem.json`).
- **Import** replaces the side's rules and, when the file has an `outfit`, its outfit too: every slot it names is filled with that gear, material, quality, prefix and suffix, and every slot it does not name is emptied. A file without an outfit (or with `null`) leaves the outfit as it is.
- Set reads versions 1, 2 and 3. Version 1 files have no `outfit` and import their rules only; version 2 outfits have no `quality`, `prefix` or `suffix`, and their items import Plain, with none.
- **Import** refuses, with a message naming the problem, any file that is not JSON, has another `format` or an unread `version`, has more than 24 rules, names a condition or act that does not exist, or has an outfit item whose gear is not in its slot, whose quality, prefix or suffix is not in its table, whose material does not fit the slot, or whose slot is filled twice. Nothing is guessed, repaired or partly applied.
- A URL whose rules cannot be read falls back to the default stratagem.
- Ids are stable once published, because files name them.

## Implementing stratagems in your game

1. **Keep a stratagem per Anima.** Store the rule list beside the character; start with the default. Read and write files with the format above, refusing what does not validate.
2. **Give each Anima what the conditions read.** Position (the body centre), team, health and maximum, stamina and maximum, level, `walkSpeed`, `visionRange`, facing, its current target, its held items' hit power and deliveries ([Derived combat](https://set.world/skills/anima-derived-combat)), its two damage reductions ([Derived stats](https://set.world/skills/anima-derived-stats)), its melee reach, its status effects, and its items' qualities, prefixes and suffixes read as effects ([Item attributes](https://set.world/skills/anima-item-attributes)).
3. **Read at every rethink in combat.** Walk the rules from the top as in [Reading a stratagem](#reading-a-stratagem): name the target, check the act, stop at the first rule that decides. With combat off, or when no rule decides, run your routine.
4. **Turn the act into behaviour** as [Acts](#acts) and the sections under it describe, keeping the hand rules and melee range.
5. **Never let an act hide an Anima.** Attacking, charging, reloading, casting, kneeling and guarding all leave it a target; a damaging hit cancels its unfinished action whatever the active rule is ([Scenes](https://set.world/skills/anima-scenes)). Guard and Guard-advance are the only acts that soften hits, by 50% and 25%.
6. **Show the active rule** if your players edit stratagems: it is the clearest explanation of what an Anima is doing.

## Reference

§13.77 in [Algorithms](https://set.world/skills/algorithms) derives the reading, §13.76 the `/anima-stratagem` duel (`set-world-0-15-20-anima-stratagem-2`) and the `/anima-battle` battle (`set-world-0-15-20-anima-battle-5`). Source: `@common/stratagems.ts` (conditions, acts, statuses, the default, the document, its reader and the URL form), `three-isometric-engine/anima-scene/stratagem-play.ts` (who a condition names and what each filter reads), and `three-isometric-engine/anima-scene/model.ts` (`chooseStratagem`, `readyToAct` and `actableOn`: whether an act can be done and the hands; `think`: the directive).
