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 [UNIT_NAME_SIZE]Blank in every row; the name comes from the
Uint8levelmessages.
Uint16hpThe base stats copied into the unit.
Uint16pp
Uint16attack
Uint16defense
Uint16agility
Uint8luck
Uint8actionCountActions a turn.
Uint8hpRegenHP restored at each turn's end.
Uint8ppRegenPP restored at each turn's end.
Uint16carriedItems [4]The items the enemy carries into battle, copied into its unit's inventory to use (itemActions), 0 for none; they are not the spoils, which are spoilsItem below.
Uint8carriedCounts [4]How many of each of carriedItems it carries.
Uint8elementPresetRow of EnemyElementPresetTable.
Sint8targetStrategyWhom a single-target attack favours.
Sint8actionStrategyHow the action is chosen from abilities.
Uint8itemActionsOne bit per place in abilities (ITEM_ACTION): use an item held instead.
Uint16abilities [8]The abilities the enemy chooses from.
Uint8weakEffects [4]The ability effects the enemy is weak to.
Uint16coinsCoins won.
Sint16spoilsItemThe spoils: the one item it may leave behind when defeated (btEnemyRecordDefeat), 0 for none.
Sint16spoilsChanceThe chance of the item, as a power of two: 1 in 2 to the power n - 1 (1 always, 6 one in 32), four times as likely with btEnemyRecordDefeat's djinnBonus; 0 for none.
Uint16experienceExperience won.
Uint8padding [2]

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() and gmEnemyGetDefinition().

Definition at line 170 of file character.h.

Fields in detail

name

Uint8 name[UNIT_NAME_SIZE]

Blank in every row; the name comes from the

level

Uint8 level

messages.

hp

Uint16 hp

The base stats copied into the unit.

pp

Uint16 pp

attack

Uint16 attack

defense

Uint16 defense

agility

Uint16 agility

luck

Uint8 luck

actionCount

Uint8 actionCount

Actions a turn.

hpRegen

Uint8 hpRegen

HP restored at each turn's end.

ppRegen

Uint8 ppRegen

PP restored at each turn's end.

carriedItems

Uint16 carriedItems[4]

The items the enemy carries into battle, copied into its unit's inventory to use (itemActions), 0 for none; they are not the spoils, which are spoilsItem below.

carriedCounts

Uint8 carriedCounts[4]

How many of each of carriedItems it carries.

elementPreset

Uint8 elementPreset

Row of EnemyElementPresetTable.

targetStrategy

Sint8 targetStrategy

Whom a single-target attack favours.

actionStrategy

Sint8 actionStrategy

How the action is chosen from abilities.

itemActions

Uint8 itemActions

One bit per place in abilities (ITEM_ACTION): use an item held instead.

abilities

Uint16 abilities[8]

The abilities the enemy chooses from.

weakEffects

Uint8 weakEffects[4]

The ability effects the enemy is weak to.

coins

Uint16 coins

Coins won.

spoilsItem

Sint16 spoilsItem

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

spoilsChance

Sint16 spoilsChance

The chance of the item, as a power of two: 1 in 2 to the power n - 1 (1 always, 6 one in 32), four times as likely with btEnemyRecordDefeat's djinnBonus; 0 for none.

experience

Uint16 experience

Experience won.

padding

Uint8 padding[2]