include/game/character.h
The definitions of characters, classes, Djinn and enemies, and a level up's result.
#include "edition.h"#include "static_assert.h"#include "types.h"#include "battle/battle_action_run.h"#include "battle/battle_unit.h"#include "battle/playback_queue.h"
Included by action_weights.c and game.h.
Structures
| Name | Description | |
|---|---|---|
struct | CHARACTER_DEFINITION | A character's definition: the growth curves of its stats, its element bonus, starting level and starting equipment. |
struct | CLASS_ABILITY | An ability a class teaches, and the level it is learned at. |
struct | CLASS_DEFINITION | A class: its series, the element levels it needs, its stat multipliers and the abilities it teaches. |
struct | DJINN_DEFINITION | A Djinni: its ability and the stat bonuses it gives while set. |
struct | ENEMY_DEFINITION | An enemy's definition: its level and stats, items, element preset, the actions it chooses from and its rewards. |
struct | ENEMY_ELEMENT_PRESET | An 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. |
struct | LEVEL_UP_RESULT | A level up's result: the level reached and the gain in each stat. |
Macros
| Name | Description | |
|---|---|---|
#define | GROWTH_BAND_LEVELS 20 | Levels between two points of a growth curve (CHARACTER_DEFINITION.hp and its siblings). |
#define | GROWTH_POINTS 6 | Points on a growth curve: levels 0 to 100, GROWTH_BAND_LEVELS apart. |
#define | CLASS_ABILITY_SLOTS 16 | How many actions a class can teach (CLASS_DEFINITION.abilities). |
#define | ITEM_ACTION (place) (1 << (place)) | ENEMY_DEFINITION.itemActions' bit for place in its abilities. |
#define | ENEMY_ELEMENT_PRESET_COUNT 44 | How many rows EnemyElementPresetTable has; an enemy's preset past them reads as row 0. |
Enumerations
| Name | Description | |
|---|---|---|
enum | CLASS_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. |
enum | FIXED_CLASS { CLASS_ISAAC_CHILD, CLASS_GARET_CHILD, CLASS_FLAME_USER, CLAS … } | The classes of CLASS_SERIES_FIXED, the last rows of ClassDefinitionTable. |
enum | ENEMY_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). |
enum | ENEMY_ACTION_STRATEGY { ACTION_STRATEGY_EVEN, ACTION_STRATEGY_FALLING, ACTION_STRATE … } | ENEMY_DEFINITION.actionStrategy: how btAIChooseAction picks a place in the enemy's eight actions. |
enum | ENEMY_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
| Name | Description | |
|---|---|---|
extern const CHARACTER_DEFINITION | CharacterDefinitionTable [] | The eight characters' definitions, by character id (game/character_table.c). |
extern const CLASS_DEFINITION | ClassDefinitionTable [] | 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.
| Enumerator | Value | Description |
|---|---|---|
CLASS_SERIES_SQUIRE | 1 | |
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_FIXED | The classes gmClassDetermine gives outright, whatever the elements. | |
CLASS_SERIES_NPC | Class 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.
| Enumerator | Value | Description |
|---|---|---|
CLASS_ISAAC_CHILD | 200 | Isaac's while FLAG_CHILDHOOD is set; the text names it "?". |
CLASS_GARET_CHILD | Garet's while FLAG_CHILDHOOD is set; the text names it "?". | |
CLASS_FLAME_USER | Jenna'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.
| Enumerator | Value | Description |
|---|---|---|
TARGET_STRATEGY_MOST_HP | 0 | |
TARGET_STRATEGY_MOST_MAX_HP | 1 | |
TARGET_STRATEGY_RANDOM | 2 |
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.
| Enumerator | Value | Description |
|---|---|---|
ACTION_STRATEGY_EVEN | 32 in 256 each | |
ACTION_STRATEGY_FALLING | from 53 in 256 down to 11 | |
ACTION_STRATEGY_FIRST_FAVOURED | the first 113 in 256, down to 5 | |
ACTION_STRATEGY_RANDOM_START | random place first time, then each in turn on enemy's turn | |
ACTION_STRATEGY_IN_ORDER | each in turn from the remembered place | |
ACTION_STRATEGY_NEXT_PICK | the next place at each new pick, from 0 | |
ACTION_STRATEGY_SAME | the 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.
| Enumerator | Value | Description |
|---|---|---|
ELEMENT_PRESET_DEFAULT | 0 | The row an out-of-range preset reads as; only the unused "???" has it. |
ELEMENT_PRESET_BANDIT | 1 | |
ELEMENT_PRESET_AZART | 2 | |
ELEMENT_PRESET_VERMIN | 3 | |
ELEMENT_PRESET_GRISLY | 4 | |
ELEMENT_PRESET_SPIDER | 5 | |
ELEMENT_PRESET_WILD_MUSHROOM | 7 | |
ELEMENT_PRESET_TRET | 8 | |
ELEMENT_PRESET_DRONE_BEE | 9 | |
ELEMENT_PRESET_BAT | 11 | |
ELEMENT_PRESET_HARRIDAN | 12 | |
ELEMENT_PRESET_ZOMBIE | 13 | |
ELEMENT_PRESET_SKELETON | 14 | |
ELEMENT_PRESET_GHOST | 15 | |
ELEMENT_PRESET_LICH | 16 | |
ELEMENT_PRESET_GARGOYLE | 17 | |
ELEMENT_PRESET_CEREBUS | 19 | |
ELEMENT_PRESET_MANTICORE | 20 | |
ELEMENT_PRESET_TORNADO_LIZARD | 21 | |
ELEMENT_PRESET_EARTH_LIZARD | 23 | |
ELEMENT_PRESET_SLIME | 24 | |
ELEMENT_PRESET_LIVING_STATUE | 25 | |
ELEMENT_PRESET_STONE_SOLDIER | 26 | |
ELEMENT_PRESET_SALAMANDER | 27 | |
ELEMENT_PRESET_THUNDER_LIZARD | 29 | |
ELEMENT_PRESET_GNOME_WIZARD | 30 | |
ELEMENT_PRESET_ORC_LORD | 31 | |
ELEMENT_PRESET_RAT_SOLDIER | 32 | |
ELEMENT_PRESET_SIREN | 33 | |
ELEMENT_PRESET_GNOME | 34 | |
ELEMENT_PRESET_GNOME_MAGE | 36 | |
ELEMENT_PRESET_NIGHTMARE | 37 | |
ELEMENT_PRESET_MIMIC | 38 | |
ELEMENT_PRESET_SATUROS | 39 | |
ELEMENT_PRESET_MENARDI | 40 | |
ELEMENT_PRESET_FUSION_DRAGON | 41 | |
ELEMENT_PRESET_DEADBEARD | 42 | |
ELEMENT_PRESET_GRYPHON | 43 |
Definition at line 243 of file character.h.