Skip to Content
The Alchemy Project

include/battle/formations.h

The enemy formations.

Included by battle_internal.h, formations.c, battle_effect_internal.h and encounter_zones.c.

Structures

NameDescription
structFORMATIONAn enemy formation: up to five kinds of enemy, each with the fewest and most of it that appear.

Macros

NameDescription
#defineFORMATION_LAYOUT_SHUFFLED 0Each kind's enemies together, the kinds in a random order.
#defineFORMATION_LAYOUT_INTERLEAVED 1Unused: each enemy drawn from a random kind with any left; no formation has it.
#defineFORMATION_LAYOUT_CENTERED 2The formation's own order, its first enemy in the centre and the rest alternately either side: the bosses' and the scripted battles'.
#defineFORMATION_MEMBERS 5The kinds of enemy a formation may hold.
#defineFORMATION_COUNT 660The rows of Formations.
#defineFORMATION_KARST_AND_AGATIO_A 74The formations the battle code itself tests for.
#defineFORMATION_KARST_AND_AGATIO_B 75
#defineFORMATION_KARST_AND_AGATIO_C 76
#defineFORMATION_DOOM_DRAGON_A 78The Doom Dragon's three forms, each changing into the next (btPlayFormChange).
#defineFORMATION_DOOM_DRAGON_B 79
#defineFORMATION_DOOM_DRAGON_C 80
#defineFORMATION_KARST_AND_AGATIO_VS_ISAAC 638Karst and Agatio against Isaac's party (ENEMY_KARST_VS_ISAAC), lost after the first action.

Variables

NameDescription
extern FORMATIONFormations []The formations, by formation id (formations.c).
extern Uint16BattleFormationExcludedEnemies [87]The 87 enemies whose defeated flags (0x600 + id) a monster battle clears before it picks a formation (btFormationSelectLevelMatchedCandidate).

Description

The enemy formations.

Macros in detail

FORMATION_LAYOUT_SHUFFLED

#define FORMATION_LAYOUT_SHUFFLED 0

Each kind's enemies together, the kinds in a random order. A link battle's opponents stand this way too.

Referenced by btFormationBuildEnemyList(), btRun() and btUnitCollect().

Definition at line 17 of file formations.h.

FORMATION_LAYOUT_INTERLEAVED

#define FORMATION_LAYOUT_INTERLEAVED 1

Unused: each enemy drawn from a random kind with any left; no formation has it.

Referenced by btFormationBuildEnemyList() and btUnitCollect().

Definition at line 20 of file formations.h.

FORMATION_LAYOUT_CENTERED

#define FORMATION_LAYOUT_CENTERED 2

The formation's own order, its first enemy in the centre and the rest alternately either side: the bosses' and the scripted battles'.

Referenced by Formations.

Definition at line 23 of file formations.h.

FORMATION_MEMBERS

#define FORMATION_MEMBERS 5

The kinds of enemy a formation may hold.

Referenced by btFormationAverageLevel(), btFormationBuildEnemyList() and btFormationGetRandomMember().

Definition at line 26 of file formations.h.

FORMATION_COUNT

#define FORMATION_COUNT 660

The rows of Formations.

Referenced by btFormationBuildEnemyList(), btFormationGetRandomMember() and btFormationSelectLevelMatchedCandidate().

Definition at line 42 of file formations.h.

FORMATION_KARST_AND_AGATIO_A

#define FORMATION_KARST_AND_AGATIO_A 74

The formations the battle code itself tests for. Karst and Agatio's battle, fought in three parts: the first two end after two turns, and each part takes up the five units as the last left them (btScriptedBattleSaveUnits); the third is ENEMY_KARST_B and ENEMY_AGATIO_B.

Referenced by btRun(), btTransitionRun(), EncounterZones and Formations.

Definition at line 48 of file formations.h.

FORMATION_KARST_AND_AGATIO_B

#define FORMATION_KARST_AND_AGATIO_B 75

Referenced by btRun(), EncounterZones and Formations.

Definition at line 49 of file formations.h.

FORMATION_KARST_AND_AGATIO_C

#define FORMATION_KARST_AND_AGATIO_C 76

Referenced by btRun(), btTransitionRun(), EncounterZones and Formations.

Definition at line 50 of file formations.h.

FORMATION_DOOM_DRAGON_A

#define FORMATION_DOOM_DRAGON_A 78

The Doom Dragon's three forms, each changing into the next (btPlayFormChange).

Referenced by btChangeEnemyForm(), btEffectRunFormChange(), btRun(), btTransitionRun(), EncounterZones and Formations.

Definition at line 53 of file formations.h.

FORMATION_DOOM_DRAGON_B

#define FORMATION_DOOM_DRAGON_B 79

Referenced by btEffectRunFormChange(), btRun() and Formations.

Definition at line 54 of file formations.h.

FORMATION_DOOM_DRAGON_C

#define FORMATION_DOOM_DRAGON_C 80

Referenced by btEffectRunFormChange(), btRun(), btTransitionRun() and Formations.

Definition at line 55 of file formations.h.

FORMATION_KARST_AND_AGATIO_VS_ISAAC

#define FORMATION_KARST_AND_AGATIO_VS_ISAAC 638

Karst and Agatio against Isaac's party (ENEMY_KARST_VS_ISAAC), lost after the first action.

Referenced by btRun(), btTransitionRun(), EncounterZones and Formations.

Definition at line 58 of file formations.h.