Enemy Intent Patterns

Brief Overview
Without explaining too much about the scripting, all enemies act in a set pattern, which is often off-put by their enemy position on the field (their turn number). If an enemy on position 1 were to attack first and block second, the same enemy on position 2 would jump one intent number forward, causing them to block first and attack second and so on.

Variable Intents
Most enemies act using Variable Intent Patterns. These Intent Patterns have a set order, but skip forward in this order based on what enemy position they are in (and then loop).

To illustrate this, let's look at this simple Intent Pattern:

First Intent: Attack (Intent #0)

Second Intent: Block (Intent #1)

Now, it's important to note that the Player's Position is always 1, so the first enemy starts at position (Turn Number) 2, while the second enemy is at position 3 and so on.

The script calculates what Intent the enemy will use as follows:

(Amount of turns this enemy has played) + (Enemy Position) divided by (amount of intents this enemy has) and finding out the remainder of that

If the enemy hasn't played a turn yet (0 Turns) and is the first enemy (TurnNumber 2), those numbers add up to 2. Now, our enemy has two Intents, meaning we divide the number we just got by 2, leaving us with 0 as the remainder.

Intent #0 is Attack, meaning our enemy will Attack.

If you were to calculate this for the same enemy on position 3, you'd end up with 0+3/2, giving you 1 as the remainder, meaning that enemy would Block. On Position 4, you'd get the remainder 0 again, causing the enemy to Attack again.

Constant Intents
Some enemies always act the same, no matter what turn position they are in. This is either done for balancing purposes, or to keep a certain pattern consistent.

A good example of this is the Ocunea. An Ocunea is supposed to appear to be charging their attack by blocking twice beforehand. If there was an Ocunea on enemy position 2 and it's intent would take it's position into account, it would skip one charging step, making it attack way too early for the player to properly react.

Conditional Intents
Conditional Intents can be used to make an enemy use an intent only if certain conditions are met (first enemy turn, enemy on low health, etc.).

As an example, Mantical Swarmers only summon two more Swarmers during their first turn. From then on, they only summon one more Swarmer whenever there is only one left.