Skip to Content
The Alchemy Project

include/game/character.h

The definitions of characters, classes, Djinn and enemies, and a level up's result.

Included by action_weights.c and game.h.

Structures

NameDescription
structCHARACTER_DEFINITIONA character's definition: the growth curves of its stats, its element bonus, starting level and starting equipment.
structCLASS_ABILITYAn ability a class teaches, and the level it is learned at.
structCLASS_DEFINITIONA class: its series, the element levels it needs, its stat multipliers and the abilities it teaches.
structDJINN_DEFINITIONA Djinni: its ability and the stat bonuses it gives while set.
structENEMY_DEFINITIONAn enemy's definition: its level and stats, items, element preset, the actions it chooses from and its rewards.
structENEMY_ELEMENT_PRESETAn enemy's element preset in EnemyElementPresetTable: the element it attacks with, its level in each element, and its base power and resistance in each element.
structLEVEL_UP_RESULTA level up's result: the level reached and the gain in each stat.

Macros

NameDescription
#defineGROWTH_BAND_LEVELS 20Levels between two points of a growth curve (CHARACTER_DEFINITION.hp and its siblings).
#defineGROWTH_POINTS 6Points on a growth curve: levels 0 to 100, GROWTH_BAND_LEVELS apart.
#defineCLASS_ABILITY_SLOTS 16How many actions a class can teach (CLASS_DEFINITION.abilities).
#defineITEM_ACTION (place) (1 << (place))ENEMY_DEFINITION.itemActions' bit for place in its abilities.
#defineENEMY_ELEMENT_PRESET_COUNT 44How many rows EnemyElementPresetTable has; an enemy's preset past them reads as row 0.

Enumerations

NameDescription
enumCLASS_SERIES { CLASS_SERIES_SQUIRE, CLASS_SERIES_GUARD, CLASS_SERIES_SWORDS … }CLASS_DEFINITION.series for the series a character's elements can choose (ClassSeriesByElements), each named by its first class, and two that no pair of elements chooses.
enumFIXED_CLASS { CLASS_ISAAC_CHILD, CLASS_GARET_CHILD, CLASS_FLAME_USER, CLAS … }The classes of CLASS_SERIES_FIXED, the last rows of ClassDefinitionTable.
enumENEMY_TARGET_STRATEGY { TARGET_STRATEGY_MOST_HP, TARGET_STRATEGY_MOST_MAX_HP, TARGET … }ENEMY_DEFINITION.targetStrategy: a single-target attacker favours the target with the most HP left, the most maximum HP, or no one (btAIChooseTarget).
enumENEMY_ACTION_STRATEGY { ACTION_STRATEGY_EVEN, ACTION_STRATEGY_FALLING, ACTION_STRATE … }ENEMY_DEFINITION.actionStrategy: how btAIChooseAction picks a place in the enemy's eight actions.
enumENEMY_ELEMENT_PRESET_ID { ELEMENT_PRESET_DEFAULT, ELEMENT_PRESET_BANDIT, ELEMENT_PRESE … }The rows of EnemyElementPresetTable (ENEMY_DEFINITION.elementPreset), each named by the first enemy that has it.

Variables

NameDescription
extern const CHARACTER_DEFINITIONCharacterDefinitionTable []The eight characters' definitions, by character id (game/character_table.c).
extern const CLASS_DEFINITIONClassDefinitionTable []The classes, by class index (game/class_table.c, 203 entries).

Description

The definitions of characters, classes, Djinn and enemies, and a level up's result.

Macros in detail

GROWTH_BAND_LEVELS

#define GROWTH_BAND_LEVELS 20

Levels between two points of a growth curve (CHARACTER_DEFINITION.hp and its siblings).

Referenced by gmUnitLevelUp().

Definition at line 18 of file character.h.

GROWTH_POINTS

#define GROWTH_POINTS 6

Points on a growth curve: levels 0 to 100, GROWTH_BAND_LEVELS apart.

Referenced by gmUnitLevelUp().

Definition at line 20 of file character.h.

CLASS_ABILITY_SLOTS

#define CLASS_ABILITY_SLOTS 16

How many actions a class can teach (CLASS_DEFINITION.abilities).

Referenced by gmUnitRefreshPsynergy().

Definition at line 86 of file character.h.

ITEM_ACTION

#define ITEM_ACTION(place) (1 << (place))

ENEMY_DEFINITION.itemActions' bit for place in its abilities.

Referenced by EnemyDefinitions.

Definition at line 221 of file character.h.

ENEMY_ELEMENT_PRESET_COUNT

#define ENEMY_ELEMENT_PRESET_COUNT 44

How many rows EnemyElementPresetTable has; an enemy's preset past them reads as row 0.

Referenced by gmEnemyGetAttackElement(), gmUnitCalculateBaseElements() and gmUnitGetElementLevels().

Definition at line 288 of file character.h.

Enumerations in detail

CLASS_SERIES

enum CLASS_SERIES

CLASS_DEFINITION.series for the series a character's elements can choose (ClassSeriesByElements), each named by its first class, and two that no pair of elements chooses.

EnumeratorValueDescription
CLASS_SERIES_SQUIRE1
CLASS_SERIES_GUARD
CLASS_SERIES_SWORDSMAN
CLASS_SERIES_BRUTE
CLASS_SERIES_APPRENTICE
CLASS_SERIES_WATER_SEER
CLASS_SERIES_WIND_SEER
CLASS_SERIES_SEER
CLASS_SERIES_PILGRIM
CLASS_SERIES_HERMIT
CLASS_SERIES_FIXEDThe classes gmClassDetermine gives outright, whatever the elements.
CLASS_SERIES_NPCClass 0, "NPC", an enemy's (CLASS_NONE).

Definition at line 57 of file character.h.

FIXED_CLASS

enum FIXED_CLASS

The classes of CLASS_SERIES_FIXED, the last rows of ClassDefinitionTable.

EnumeratorValueDescription
CLASS_ISAAC_CHILD200Isaac's while FLAG_CHILDHOOD is set; the text names it "?".
CLASS_GARET_CHILDGaret's while FLAG_CHILDHOOD is set; the text names it "?".
CLASS_FLAME_USERJenna's, "Flame User", whatever her elements.
CLASS_COUNT

Definition at line 75 of file character.h.

ENEMY_TARGET_STRATEGY

enum ENEMY_TARGET_STRATEGY

ENEMY_DEFINITION.targetStrategy: a single-target attacker favours the target with the most HP left, the most maximum HP, or no one (btAIChooseTarget). The same column steers btAIChooseAction: with any strategy but TARGET_STRATEGY_MOST_HP an enemy skips Psynergy it lacks the PP for, and with TARGET_STRATEGY_RANDOM any Psynergy while sealed; with TARGET_STRATEGY_MOST_HP, an enemy that picks an item place with no items left still commands COMMAND_ITEM.

EnumeratorValueDescription
TARGET_STRATEGY_MOST_HP0
TARGET_STRATEGY_MOST_MAX_HP1
TARGET_STRATEGY_RANDOM2

Definition at line 139 of file character.h.

ENEMY_ACTION_STRATEGY

enum ENEMY_ACTION_STRATEGY

ENEMY_DEFINITION.actionStrategy: how btAIChooseAction picks a place in the enemy's eight actions. The first three roll against BattleAIActionWeights; the next two remember the place in UNIT.aiState. No row of enemy_table.c has a strategy past ACTION_STRATEGY_RANDOM_START.

EnumeratorValueDescription
ACTION_STRATEGY_EVEN32 in 256 each
ACTION_STRATEGY_FALLINGfrom 53 in 256 down to 11
ACTION_STRATEGY_FIRST_FAVOUREDthe first 113 in 256, down to 5
ACTION_STRATEGY_RANDOM_STARTrandom place first time, then each in turn on enemy's turn
ACTION_STRATEGY_IN_ORDEReach in turn from the remembered place
ACTION_STRATEGY_NEXT_PICKthe next place at each new pick, from 0
ACTION_STRATEGY_SAMEthe place last picked

Definition at line 150 of file character.h.

ENEMY_ELEMENT_PRESET_ID

enum ENEMY_ELEMENT_PRESET_ID

The rows of EnemyElementPresetTable (ENEMY_DEFINITION.elementPreset), each named by the first enemy that has it. Rows 6, 10, 18, 22, 28 and 35 are spares no enemy has.

EnumeratorValueDescription
ELEMENT_PRESET_DEFAULT0The row an out-of-range preset reads as; only the unused "???" has it.
ELEMENT_PRESET_BANDIT1
ELEMENT_PRESET_AZART2
ELEMENT_PRESET_VERMIN3
ELEMENT_PRESET_GRISLY4
ELEMENT_PRESET_SPIDER5
ELEMENT_PRESET_WILD_MUSHROOM7
ELEMENT_PRESET_TRET8
ELEMENT_PRESET_DRONE_BEE9
ELEMENT_PRESET_BAT11
ELEMENT_PRESET_HARRIDAN12
ELEMENT_PRESET_ZOMBIE13
ELEMENT_PRESET_SKELETON14
ELEMENT_PRESET_GHOST15
ELEMENT_PRESET_LICH16
ELEMENT_PRESET_GARGOYLE17
ELEMENT_PRESET_CEREBUS19
ELEMENT_PRESET_MANTICORE20
ELEMENT_PRESET_TORNADO_LIZARD21
ELEMENT_PRESET_EARTH_LIZARD23
ELEMENT_PRESET_SLIME24
ELEMENT_PRESET_LIVING_STATUE25
ELEMENT_PRESET_STONE_SOLDIER26
ELEMENT_PRESET_SALAMANDER27
ELEMENT_PRESET_THUNDER_LIZARD29
ELEMENT_PRESET_GNOME_WIZARD30
ELEMENT_PRESET_ORC_LORD31
ELEMENT_PRESET_RAT_SOLDIER32
ELEMENT_PRESET_SIREN33
ELEMENT_PRESET_GNOME34
ELEMENT_PRESET_GNOME_MAGE36
ELEMENT_PRESET_NIGHTMARE37
ELEMENT_PRESET_MIMIC38
ELEMENT_PRESET_SATUROS39
ELEMENT_PRESET_MENARDI40
ELEMENT_PRESET_FUSION_DRAGON41
ELEMENT_PRESET_DEADBEARD42
ELEMENT_PRESET_GRYPHON43

Definition at line 243 of file character.h.