Skip to Content
The Alchemy Project

struct ENEMY_DEFINITION

An enemy's definition: its level and stats, items, element preset, the actions it chooses from and its rewards.

Declared in character.h.

Fields

NameDescription
Uint8name [15]Blank in every row: gmBattleUnitSet takes the
Uint8levelenemy's name from the messages instead.
Uint16hpThe base stats gmBattleUnitSet copies into the unit.
Uint16pp
Uint16attack
Uint16defense
Uint16agility
Uint8luck
Uint8actionCountActions a turn (UNIT.baseActionCount).
Uint8hpRegenHP restored at each turn's end (UNIT.baseHpRegen).
Uint8ppRegenPP restored at each turn's end (UNIT.basePpRegen).
Uint8reservedBeforeAiState [2]0 in every row.
BATTLE_AI_STATEaiState0 in every row; the unit's first UNIT.aiState.
Uint8reservedAfterAiState [4]0 in every row.
Uint16carriedItems [4]Items the enemy carries into battle, copied into its unit's inventory to use (itemActions), 0 for none.
Uint8carriedCounts [4]How many of each item it carries.
Uint8elementPresetRow of EnemyElementPresetTable, 0 to 43.
Sint8targetStrategyWhom a single-target attack favours: an ENEMY_TARGET_STRATEGY.
Sint8actionStrategyHow the action is chosen from abilities (btAIChooseAction): an ENEMY_ACTION_STRATEGY.
Uint8itemActionsOne bit per place in abilities (ITEM_ACTION): the enemy uses an item it carries there instead.
Uint16abilities [8]The abilities the enemy chooses from.
Uint8weakEffects [4][0] to [2]: the ability effects the enemy is weak to (gmBattleAbilityIsWeakToEffect); [3] is 0 in every row.
Uint16coinsCoins won.
Sint16spoilsItemThe spoils: the one item it may leave behind when defeated, 0 for none.
Sint16spoilsChanceThe chance of the item: 1 in 2 to the power spoilsChance - 1, two powers better with btEnemyRecordDefeat's Djinn bonus; 0 for none.
Uint16experienceExperience won.

Description

An enemy's definition: its level and stats, items, element preset, the actions it chooses from and its rewards.

struct ENEMY_DEFINITION

Referenced by btAIChooseAction(), btEnemyRecordDefeat(), btFormationAverageLevel(), EnemyDefinitions, gmBattleUnitSet(), gmEnemyGetAttackElement() and gmEnemyGetDefinition().

Definition at line 164 of file character.h.

Fields in detail

name

Uint8 name[15]

Blank in every row: gmBattleUnitSet takes the

level

Uint8 level

enemy's name from the messages instead.

hp

Uint16 hp

The base stats gmBattleUnitSet copies into the unit.

pp

Uint16 pp

attack

Uint16 attack

defense

Uint16 defense

agility

Uint16 agility

luck

Uint8 luck

actionCount

Uint8 actionCount

Actions a turn (UNIT.baseActionCount).

hpRegen

Uint8 hpRegen

HP restored at each turn's end (UNIT.baseHpRegen).

ppRegen

Uint8 ppRegen

PP restored at each turn's end (UNIT.basePpRegen).

reservedBeforeAiState

Uint8 reservedBeforeAiState[2]

0 in every row.

aiState

BATTLE_AI_STATE aiState

0 in every row; the unit's first UNIT.aiState.

reservedAfterAiState

Uint8 reservedAfterAiState[4]

0 in every row.

carriedItems

Uint16 carriedItems[4]

Items the enemy carries into battle, copied into its unit's inventory to use (itemActions), 0 for none.

carriedCounts

Uint8 carriedCounts[4]

How many of each item it carries.

elementPreset

Uint8 elementPreset

Row of EnemyElementPresetTable, 0 to 43.

targetStrategy

Sint8 targetStrategy

Whom a single-target attack favours: an ENEMY_TARGET_STRATEGY.

actionStrategy

Sint8 actionStrategy

How the action is chosen from abilities (btAIChooseAction): an ENEMY_ACTION_STRATEGY.

itemActions

Uint8 itemActions

One bit per place in abilities (ITEM_ACTION): the enemy uses an item it carries there instead.

abilities

Uint16 abilities[8]

The abilities the enemy chooses from.

weakEffects

Uint8 weakEffects[4]

[0] to [2]: the ability effects the enemy is weak to (gmBattleAbilityIsWeakToEffect); [3] is 0 in every row.

coins

Uint16 coins

Coins won.

spoilsItem

Sint16 spoilsItem

The spoils: the one item it may leave behind when defeated, 0 for none.

spoilsChance

Sint16 spoilsChance

The chance of the item: 1 in 2 to the power spoilsChance - 1, two powers better with btEnemyRecordDefeat's Djinn bonus; 0 for none.

experience

Uint16 experience

Experience won.