include/battle/battle_unit.h
UNIT, a party member's or an enemy's stats and statuses in battle, with the elements, abilities and actions it uses.
Included by battle_internal.h, scripted_battle_units.c, battle_effect_internal.h, level.c, field_engine_internal.h, main_routine.c, menu_internal.h, shop_internal.h, window_internal.h, battle_action_run.h, battle_effect.h, character.h and game.h.
Structures
| Name | Description | |
|---|---|---|
struct | PSYNERGY_ENTRY | An entry in a unit's action list: the action's id (PSYNERGY_ABILITY_MASK) and marks for an action its class or an equipped item gave. |
struct | BATTLE_ELEMENT_STATS | A unit's elemental power and resistance in one element. |
struct | ABILITY_DEFINITION | An ability's definition, a row of AbilityDefinitions: its targeting, kind, element, effect, range, PP cost and power. |
struct | BATTLE_AI_STATE | An enemy's memory of its action choice (btAIChooseAction). |
struct | UNIT | A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and statuses. |
struct | BATTLE_BASE_STATS | A unit's base stats from UNIT.baseHp on, as one block: an enemy's level or strength change keeps a copy to hold each new stat to 70 percent of the old (btEnemyAdjustLevel, btUnitStrengthen), and the Clear Data password writes its members' stats through it. |
Macros
| Name | Description | |
|---|---|---|
#define | NAME_LETTER_ALPHABET 26 | The letters A to Z, which the Japanese edition gives enemies as name suffixes. |
#define | NAME_SUFFIX_COUNT JAPANESE_OR(NAME_LETTER_ALPHABET, 9) | The name suffixes that tell enemies of one kind apart, one more character after the name (gmBattleUnitSet): the alphabet in Japanese, the digits 1 to 9 elsewhere, as btStringFindFirstDigit reads them back. |
#define | ABILITY_RANGE_ALL 255 | ABILITY_DEFINITION.range of an ability that reaches every unit on the side, each as if aimed at. |
#define | ABILITY_FORMULA_MASK 15 | The low four bits of ABILITY_DEFINITION.flags: the ability kind (enum ABILITY_FORMULA). |
#define | CLASS_NONE 0 | UNIT.classId of an enemy, which has no class of its own. |
#define | ALLY_MAX 7 | The last party unit id: ids 0 to 7, one for each character, ISAAC to PIERS. |
#define | PARTY_UNIT_COUNT (ALLY_MAX + 1) | How many party units there are, one for each character. |
#define | PARTY_BATTLE_SIZE 4 | The party fights four at a time, three in a link battle; six enemies at most, three in a link battle. |
#define | ENEMY_BATTLE_SIZE 6 | |
#define | UNIT_MAX (PARTY_UNIT_COUNT + ENEMY_BATTLE_SIZE) | The most units in a battle, every party unit and the most enemies: the length of a unit list such as btUnitListIds fills. |
#define | POISON_NORMAL 1 | UNIT.poison: poisoned, or deadly poisoned. |
#define | POISON_VENOM 2 | |
#define | DEFEND_NORMAL 1 | UNIT.defendLevel, 0 for no guard: each guard effect raises it to its own level and no lower (btAbilityApplyToTarget). |
#define | DEFEND_SHIELD 2 | |
#define | DEFEND_TOTAL 3 | |
#define | DEFEND_VANISHED 4 | |
#define | FIRST_ENEMY_UNIT 128 | Unit ids from 128 are the enemies'. |
#define | UNIT_ID_ENEMY_BIT FIRST_ENEMY_UNIT | The bit set in every enemy's unit id (FIRST_ENEMY_UNIT and up), and so the side a unit fights on. |
#define | PSYNERGY_SLOTS 32 | How many actions a unit's list holds (UNIT.psynergy). |
#define | UNIT_GAUGE_SHIFT 14 | A full HP or PP gauge (UNIT.hpGauge, UNIT.ppGauge): the gauge is the current value over the maximum in 2.14 fixed point, and the cap gmUnitClampGauge puts on hp / hpMax shifted up UNIT_GAUGE_SHIFT bits. |
#define | UNIT_GAUGE_FULL (1 << UNIT_GAUGE_SHIFT) | |
#define | UNIT_ACTION_COUNT_MASK 0xf | The bits of UNIT.baseActionCount that count the unit's actions a turn. |
#define | UNIT_NAME_SIZE 15 | A unit's name buffer: 14 characters and the 0 that ends them. |
#define | RESISTANCE_PER_STAGE 20 | The Resistance each of a unit's battle Resistance stages (UNIT.resistanceStage) adds to every element's. |
#define | PSY_SEAL_BIND_MASK 7 | UNIT.psySeal's layout: its low three bits Bind's turns left, the seal Bind casts (seven turns, which may end sooner); above them Luff's, cast as PSY_SEAL_LUFF and losing PSY_SEAL_LUFF_TURN a turn, so it lasts two and never ends early. |
#define | PSY_SEAL_BIND 7 | |
#define | PSY_SEAL_LUFF 16 | |
#define | PSY_SEAL_LUFF_TURN 8 | |
#define | UNIT_UPDATE_GAUGES (unit) | Recalculates HP and PP gauges, keeping at least one when any points remain. |
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { BATTLE_UNIT_SIZE } | Bytes in a UNIT, which the code clears and copies whole: the size the STATIC_ASSERTs below hold it to. |
enum | anonymous enum { PSYNERGY_ABILITY_MASK, PSYNERGY_FROM_ITEM, PSYNERGY_FROM_CLA … } | The action id's bits in an action list entry. |
enum | ELEMENT { ELEMENT_VENUS, ELEMENT_MERCURY, ELEMENT_MARS, ELEMENT_JUPITE … } | The elements, in the order of every table kept per element: a unit's element stats, the Djinn and the summons. |
enum | ABILITY_FORMULA { ABILITY_FORMULA_BLANK, ABILITY_FORMULA_HEAL_HP, ABILITY_FORM … } | An ability kind picks what the ability's power does to each target; ABILITY_FORMULA_BLANK, ABILITY_FORMULA_EFFECT_ONLY and ABILITY_FORMULA_NO_POWER apply none. |
enum | ABILITY_USE { ABILITY_USABLE_IN_FIELD, ABILITY_USABLE_IN_BATTLE } | ABILITY_DEFINITION.flags: where an ability can be used. |
enum | ABILITY_TARGET { ABILITY_TARGET_ONE, ABILITY_TARGET_FOES, ABILITY_TARGET_ALLI … } | ABILITY_DEFINITION.targetMode: whom an ability may target, from its user's view. |
enum | ABILITY_EFFECT { ABILITY_EFFECT_NONE, ABILITY_EFFECT_RESTORE_HP, ABILITY_EFFE … } | ABILITY_DEFINITION.effect: what an ability does besides its damage or healing, applied by btAbilityApplyToTarget unless noted. |
enum | CURSE_FLAG { CURSE_BOUND, CURSE_ITEM, CURSE_KEEP_BOUND, CURSE_REMOVABLE } | The curse bits of UNIT.curse (updated by gmUnitCalculate). |
Functions
| Name | Description | |
|---|---|---|
static __inline__ Sint32 | gmUnitClampGauge (Sint32 ratio) | Clamps a gauge ratio to 0..UNIT_GAUGE_FULL. |
Variables
| Name | Description | |
|---|---|---|
extern UNIT | CharacterUnits [PARTY_UNIT_COUNT] | The eight characters' units, ISAAC to PIERS, kept in the save. |
Description
UNIT, a party member's or an enemy's stats and statuses in battle, with the
elements, abilities and actions it uses.
Macros in detail
NAME_LETTER_ALPHABET
#define NAME_LETTER_ALPHABET 26
The letters A to Z, which the Japanese edition gives enemies as name suffixes.
Definition at line 13 of file battle_unit.h.
NAME_SUFFIX_COUNT
#define NAME_SUFFIX_COUNT JAPANESE_OR(NAME_LETTER_ALPHABET, 9)
The name suffixes that tell enemies of one kind apart, one more character
after the name (gmBattleUnitSet): the alphabet in Japanese, the digits 1 to 9
elsewhere, as btStringFindFirstDigit reads them back.
Referenced by btEnemyClaimNameLetter() and gmBattleUnitSet().
Definition at line 17 of file battle_unit.h.
ABILITY_RANGE_ALL
#define ABILITY_RANGE_ALL 255
ABILITY_DEFINITION.range of an ability that reaches every unit on the side,
each as if aimed at.
Referenced by AbilityDefinitions, btAbilityApplyToTarget(), btRun(), mnAbilityApplyToTargets(), mnBattleDjinnMenuShowChangePreview(), mnBattlePsynergyMenuRun(), mnBattleStatusScreenRun(), mnBattleTargetRunSelection(), mnItemClassifyUseMode(), mnPsynergyMenuClassifySelectedPsynergy() and mnStatusScreenDrawPsynergyPage().
Definition at line 70 of file battle_unit.h.
ABILITY_FORMULA_MASK
#define ABILITY_FORMULA_MASK 15
The low four bits of ABILITY_DEFINITION.flags: the ability kind (enum
ABILITY_FORMULA).
Referenced by btAbilityApplyToTarget(), btActionRunBuild(), btAIChooseTarget(), mnAbilityApplyToTargets(), mnAbilityPlayUseSound() and mnBattleClassifyEntryKind().
Definition at line 74 of file battle_unit.h.
CLASS_NONE
#define CLASS_NONE 0
UNIT.classId of an enemy, which has no class of its own.
Referenced by btActionRunBuild(), btAIChooseAction(), btEffectRunTwistingColumn(), btEnemyRecordDefeat(), btEnemyReleaseNameLetter(), btEnemySpriteLoadIntoSlots(), btObjectMake(), btStagingDispatchAction(), gmBattleAbilityIsWeakToEffect(), gmBattleRollEffectSuccess(), gmBattleUnitSet(), gmEquipmentRollUnleash(), gmUnitCalculate(), gmUnitCalculateBaseElements(), gmUnitGetAttackElement(), gmUnitGetExperienceForLevel() and gmUnitRebuildPsynergyList().
Definition at line 282 of file battle_unit.h.
ALLY_MAX
#define ALLY_MAX 7
The last party unit id: ids 0 to 7, one for each character, ISAAC to PIERS.
Referenced by btActionRunBuild(), btAIChooseAction(), btAIChooseTarget(), btAutoBattleApplyDamage(), btAutoBattleRunApproachAttack(), btAutoBattleRunAttackOrItem(), btAutoBattleRunPsynergy(), btDjinnCountStandby(), btDjinnRecoveryReconcile(), btEffectRunAttackSlash(), btEffectRunCriticalHit(), btEnemyRecordDefeat(), btFindUnitPlace(), btMotionCallBeast(), btMotionDestroyAllSlotObjects(), btObjectFindSlot(), btObjectGet(), btObjectIsValidId(), btObjectMake(), btObjectSpawnObjectsForList(), btPlacementContainsId(), btRun(), btStagingDispatchAction(), btStagingPlanAuroraField(), btStagingPlanDaedalus(), btStagingPlanHighImpact(), btStagingRunAttack(), btStagingRunFlee(), btStagingRunFullScreen(), btStagingRunItem(), btStagingRunPsynergyCast(), btUnitDrainDjinn(), btUnitFindStrongestAlly(), btUnitIsListed(), btUnitProcessActionEnd(), fdPartyCheckShortcut(), fdUsePsynergy(), gmPartyInitCharacters(), mnBattleDjinnMenuRun(), mnBattleStatusScreenRun(), mnBattleTargetRunSelection() and scLinkLobbySendPartyRecords().
Definition at line 285 of file battle_unit.h.
PARTY_UNIT_COUNT
#define PARTY_UNIT_COUNT (ALLY_MAX + 1)
How many party units there are, one for each character.
Referenced by btMotionDestroyAllSlotObjects(), btObjectFindSlot(), btObjectGet(), btObjectSpawnObjectsForList(), btPlacementContainsId(), CharacterUnits, dbShopTestEditPartyNames(), scInit(), scLinkLobbyExplainPartyOrder() and scLinkLobbySendPartyRecords().
Definition at line 288 of file battle_unit.h.
PARTY_BATTLE_SIZE
#define PARTY_BATTLE_SIZE 4
The party fights four at a time, three in a link battle; six enemies at most, three in a link battle.
Referenced by btAutoBattleBuildActions(), btPartyPrepareMembers(), btPartyPrepareReserveOwners(), fdPartyIsInFrontRow() and scLinkLobbyPartyContains().
Definition at line 292 of file battle_unit.h.
ENEMY_BATTLE_SIZE
#define ENEMY_BATTLE_SIZE 6
Referenced by btAbilityApplyToTarget(), btEnemyGetFreeUnitId(), btEnemyLetterFirstOfKind(), btEnemyList(), btEnemyRecordDefeat(), btFormationBuildEnemyList(), btObjectIsValidId(), btPlacementRelayoutEnemies(), btUnitListLiving(), btUnitListLivingWithReserve(), btUnitRefreshPlacement(), gmUnitGet() and scLinkLobbyEnterBattle().
Definition at line 293 of file battle_unit.h.
UNIT_MAX
#define UNIT_MAX (PARTY_UNIT_COUNT + ENEMY_BATTLE_SIZE)
The most units in a battle, every party unit and the most enemies: the length
of a unit list such as btUnitListIds fills.
Referenced by btAbilityReplaceDefeated(), btAutoBattleBuildActions(), btAutoBattleRunPsynergy(), btBuildEnemyActions(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCoatlicue(), btEffectRunDaedalus(), btEffectRunEclipse(), btEffectRunMegiddo(), btEffectRunOdyssey(), btEffectShowLivingTargets(), btFleeCheckSuccess(), btFleePlayRun(), btFormationBuildEnemyList(), btHighlightClearAllSpriteModes(), btHighlightSetModes(), btHighlightSetOtherSpriteModes(), btIrisChangeBackdrop(), btMotionCallBeast(), btMotionDestroyAllSlotObjects(), btMotionDismissBeast(), btObjectPut(), btObjectPutKeepingPoses(), btObjectSpawnObjectsForList(), btObjectUpdateSpritePriorities(), btPartyReturnAllToSpots(), btPlacementContainsId(), btPlacementRelayoutEnemies(), btStagingRunFlee(), btStagingRunFullScreen(), btTransitionRun(), btUnitCollect(), btUnitRefreshPlacement(), btUnitResetGuardLevels() and mnBattleTargetRunSelection().
Definition at line 297 of file battle_unit.h.
POISON_NORMAL
#define POISON_NORMAL 1
UNIT.poison: poisoned, or deadly poisoned.
Referenced by btAbilityApplyToTarget(), btUnitBuildStatusFlags(), dbPsynergyTestDamageAndAfflictParty(), dbShopTestDamageAndAfflictParty(), fdPartyApplyPoisonDamage(), mnBattleStatusScreenRun() and mnShopOpenDebugShop().
Definition at line 300 of file battle_unit.h.
POISON_VENOM
#define POISON_VENOM 2
Referenced by btAbilityApplyToTarget(), btUnitBuildStatusFlags(), dbPsynergyTestDamageAndAfflictParty(), dbShopTestDamageAndAfflictParty(), fdPartyApplyPoisonDamage() and mnBattleStatusScreenRun().
Definition at line 301 of file battle_unit.h.
DEFEND_NORMAL
#define DEFEND_NORMAL 1
UNIT.defendLevel, 0 for no guard: each guard effect raises it to its own
level and no lower (btAbilityApplyToTarget). Defend and Granite halve the
damage, Shade cuts it to two fifths, Total Defense, Flash and Guard Aura to a
tenth (REDUCE_BY_GUARD), and Haze leaves the unit untouched.
Referenced by btAbilityApplyToTarget(), btActionRunBuild() and btGatherActions().
Definition at line 307 of file battle_unit.h.
DEFEND_SHIELD
#define DEFEND_SHIELD 2
Referenced by btAbilityApplyToTarget().
Definition at line 308 of file battle_unit.h.
DEFEND_TOTAL
#define DEFEND_TOTAL 3
Referenced by btAbilityApplyToTarget() and btGatherActions().
Definition at line 309 of file battle_unit.h.
DEFEND_VANISHED
#define DEFEND_VANISHED 4
Referenced by btAbilityApplyToTarget() and btObjectUpdateSpritePriorities().
Definition at line 310 of file battle_unit.h.
FIRST_ENEMY_UNIT
#define FIRST_ENEMY_UNIT 128
Unit ids from 128 are the enemies'.
Referenced by btAbilityReplaceDefeated(), btAIChooseAction(), btAutoBattleBuildActions(), btAutoBattleRunAttackOrItem(), btAutoBattleRunPsynergy(), btChangeEnemyForm(), btEffectReadKeysForEnemyTarget(), btEffectRunFlare(), btEnemyGetFreeUnitId(), btEnemyLetterFirstOfKind(), btEnemyList(), btFormationBuildEnemyList(), btLinkBattleReceiveParty(), btLinkBattleSendParty(), btMotionDestroyAllSlotObjects(), btObjectFindSlot(), btObjectGet(), btObjectIsValidId(), btObjectSpawnObjectsForList(), btPartyAssignOpponentSlots(), btPartyInsertUnitCentered(), btPlacementContainsId(), btPlayFormChange(), btRun(), btUnitListLiving(), btUnitListLivingWithReserve(), gmBattleUnitSet(), gmDjinnGetRecoveryTable(), gmUnitGet(), scLinkLobbyReceivePartyRecords(), scLinkLobbySendPartyRecords() and ScriptedBattleUnits.
Definition at line 313 of file battle_unit.h.
UNIT_ID_ENEMY_BIT
#define UNIT_ID_ENEMY_BIT FIRST_ENEMY_UNIT
The bit set in every enemy's unit id (FIRST_ENEMY_UNIT and up), and so the
side a unit fights on.
Referenced by btMotionCallBeast() and btStagingRunAttack().
Definition at line 316 of file battle_unit.h.
PSYNERGY_SLOTS
#define PSYNERGY_SLOTS 32
How many actions a unit's list holds (UNIT.psynergy).
Referenced by btAwardSpoils(), btDebugParamSetLoad(), gmUnitKnowsPsynergy(), gmUnitLearnPsynergy(), gmUnitRebuildPsynergyList(), mnBattleCollectPartyCommands(), mnBattleDjinnMenuListChangedPsynergy(), mnBattleStatusScreenRun(), mnPsynergyListDifference(), mnPsynergyMenuCollectActions(), mnPsynergyMenuDrawPsynergyIcons() and mnStatusPanelDraw().
Definition at line 319 of file battle_unit.h.
UNIT_GAUGE_SHIFT
#define UNIT_GAUGE_SHIFT 14
A full HP or PP gauge (UNIT.hpGauge, UNIT.ppGauge): the gauge is the current
value over the maximum in 2.14 fixed point, and the cap gmUnitClampGauge puts
on hp / hpMax shifted up UNIT_GAUGE_SHIFT bits.
Referenced by scJupiterLighthouseKarstAndAgatioRetreat().
Definition at line 335 of file battle_unit.h.
UNIT_GAUGE_FULL
#define UNIT_GAUGE_FULL (1 << UNIT_GAUGE_SHIFT)
Referenced by gmBattleUnitSet(), gmPartyInitCharacters(), gmUnitCalculate() and gmUnitClampGauge().
Definition at line 336 of file battle_unit.h.
UNIT_ACTION_COUNT_MASK
#define UNIT_ACTION_COUNT_MASK 0xf
The bits of UNIT.baseActionCount that count the unit's actions a turn.
Referenced by gmUnitCalculate().
Definition at line 339 of file battle_unit.h.
UNIT_NAME_SIZE
#define UNIT_NAME_SIZE 15
A unit's name buffer: 14 characters and the 0 that ends them.
Referenced by btEnemyLetterFirstOfKind(), btEnemyReleaseNameLetter(), btStringFindFirstDigit(), gmBattleUnitSet(), gmPartyInitCharacters(), mnBattleTargetRunSelection(), mnMessageDecode(), mnNameEntryEditMemberName(), scGabombaStatueGetPuzzleSeed(), scLinkLobbyReceivePartyRecords() and scPrepareMap().
Definition at line 342 of file battle_unit.h.
RESISTANCE_PER_STAGE
#define RESISTANCE_PER_STAGE 20
The Resistance each of a unit's battle Resistance stages
(UNIT.resistanceStage) adds to every element's.
Referenced by btAbilityApplyToTarget(), gmUnitCalculate() and mnBattleStatusScreenRun().
Definition at line 345 of file battle_unit.h.
PSY_SEAL_BIND_MASK
#define PSY_SEAL_BIND_MASK 7
UNIT.psySeal's layout: its low three bits Bind's turns left, the seal Bind
casts (seven turns, which may end sooner); above them Luff's, cast as
PSY_SEAL_LUFF and losing PSY_SEAL_LUFF_TURN a turn, so it lasts two and never
ends early.
Referenced by btUnitCountDownPsynergySeal().
Definition at line 351 of file battle_unit.h.
PSY_SEAL_BIND
#define PSY_SEAL_BIND 7
Referenced by btAbilityApplyToTarget().
Definition at line 352 of file battle_unit.h.
PSY_SEAL_LUFF
#define PSY_SEAL_LUFF 16
Referenced by btAbilityApplyToTarget().
Definition at line 353 of file battle_unit.h.
PSY_SEAL_LUFF_TURN
#define PSY_SEAL_LUFF_TURN 8
Referenced by btUnitCountDownPsynergySeal().
Definition at line 354 of file battle_unit.h.
UNIT_UPDATE_GAUGES
#define UNIT_UPDATE_GAUGES(unit)
Recalculates HP and PP gauges, keeping at least one when any points remain.
Referenced by fdEngineRun(), fdPartyRemoveMemberRestored(), gmPartyRestoreHpPp(), gmPartyRestorePpInLighthouse(), gmReturnFromEngine(), gmUnitRecalculateGauges() and scKibomboInitCeremony().
Definition at line 565 of file battle_unit.h.
Enumerations in detail
anonymous enum
enum { BATTLE_UNIT_SIZE }
Bytes in a UNIT, which the code clears and copies whole: the size the
STATIC_ASSERTs below hold it to.
| Enumerator | Value | Description |
|---|---|---|
BATTLE_UNIT_SIZE | 332 |
Definition at line 21 of file battle_unit.h.
anonymous enum
enum { PSYNERGY_ABILITY_MASK, PSYNERGY_FROM_ITEM, PSYNERGY_FROM_CLASS, PSYNERGY_FROM_CLASS_SHIFT }
The action id's bits in an action list entry.
| Enumerator | Value | Description |
|---|---|---|
PSYNERGY_ABILITY_MASK | 0x3fff | PSYNERGY_ENTRY.encodedAction's action id |
PSYNERGY_FROM_ITEM | 0x4000 | PSYNERGY_ENTRY.encodedAction's marks: the action comes from an equipped item, or from the class (its top bit, PSYNERGY_FROM_CLASS_SHIFT). |
PSYNERGY_FROM_CLASS | 0x8000 | |
PSYNERGY_FROM_CLASS_SHIFT | 15 |
Definition at line 27 of file battle_unit.h.
ELEMENT
enum ELEMENT
The elements, in the order of every table kept per element: a unit's element
stats, the Djinn and the summons. ELEMENT_NONE marks an ability or a weapon
that has no element.
| Enumerator | Value | Description |
|---|---|---|
ELEMENT_VENUS | ||
ELEMENT_MERCURY | ||
ELEMENT_MARS | ||
ELEMENT_JUPITER | ||
ELEMENT_NONE | ||
ELEMENT_COUNT | ELEMENT_NONE |
Definition at line 58 of file battle_unit.h.
ABILITY_FORMULA
enum ABILITY_FORMULA
An ability kind picks what the ability's power does to each target;
ABILITY_FORMULA_BLANK, ABILITY_FORMULA_EFFECT_ONLY and
ABILITY_FORMULA_NO_POWER apply none.
| Enumerator | Value | Description |
|---|---|---|
ABILITY_FORMULA_BLANK | 0 | no ability |
ABILITY_FORMULA_HEAL_HP | 1 | Cure, Fizz, healing items |
ABILITY_FORMULA_EFFECT | 2 | damage only if the effect lands |
ABILITY_FORMULA_ATTACK | 3 | Attack vs Defense, plus the power |
ABILITY_FORMULA_ATTACK_MULTIPLIED | 4 | that attack times power / 10 |
ABILITY_FORMULA_DAMAGE | 5 | HP damage from the power (Psynergy) |
ABILITY_FORMULA_ENEMY_DAMAGE | 6 | enemy HP damage (<unit> unleashes <ability>!) |
ABILITY_FORMULA_EFFECT_ONLY | 7 | Granite, Flash and Kite (effect |
ABILITY_FORMULA_SUMMON | 8 | only) |
ABILITY_FORMULA_NO_POWER | 9 | field Psynergy, Defend, Flee, |
ABILITY_FORMULA_PP_DAMAGE | 10 | enemies' commands |
ABILITY_FORMULA_HEAL_PP | 11 |
Definition at line 79 of file battle_unit.h.
ABILITY_USE
enum ABILITY_USE
ABILITY_DEFINITION.flags: where an ability can be used.
| Enumerator | Value | Description |
|---|---|---|
ABILITY_USABLE_IN_FIELD | 0x40 | can be used outside battle |
ABILITY_USABLE_IN_BATTLE | 0x80 | can be used in battle; else greyed there |
Definition at line 100 of file battle_unit.h.
ABILITY_TARGET
enum ABILITY_TARGET
ABILITY_DEFINITION.targetMode: whom an ability may target, from its user's
view.
| Enumerator | Value | Description |
|---|---|---|
ABILITY_TARGET_ONE | 0 | the aimed unit alone, whatever its range |
ABILITY_TARGET_FOES | 1 | the other side |
ABILITY_TARGET_ALLIES | 2 | the user's side, the user included |
ABILITY_TARGET_UNUSED | 3 | Unused: no ability has it. An enemy that draws it aims at itself and picks again (btAIChooseAction). |
ABILITY_TARGET_SELF | 4 | the user alone, whatever the range |
Definition at line 108 of file battle_unit.h.
ABILITY_EFFECT
enum ABILITY_EFFECT
ABILITY_DEFINITION.effect: what an ability does besides its damage or
healing, applied by btAbilityApplyToTarget unless noted. Each is named for
the abilities that have it (ability_table.c). Sidestep (48), Crazy Voice (52)
and Vengeance (89) have effects no code here reads.
| Enumerator | Value | Description |
|---|---|---|
ABILITY_EFFECT_NONE | 0 | |
ABILITY_EFFECT_RESTORE_HP | 1 | Restores HP (the item menu's use). |
ABILITY_EFFECT_RESTORE_PP | 2 | Restores PP (the item menu's use). |
ABILITY_EFFECT_CURE_POISON | 3 | Cure Poison, Antidote. |
ABILITY_EFFECT_RESTORE | 4 | Restore, Elixir. |
ABILITY_EFFECT_REVIVE | 5 | Revive, Water of Life: full HP. |
ABILITY_EFFECT_ATTACK_UP_SHARPLY | 6 | Impact: two stages. |
ABILITY_EFFECT_ATTACK_UP | 7 | High Impact: one stage. |
ABILITY_EFFECT_ATTACK_DOWN_SHARPLY | 8 | Dull. |
ABILITY_EFFECT_ATTACK_DOWN | 9 | Blunt. |
ABILITY_EFFECT_DEFENSE_UP_SHARPLY | 10 | Guard. |
ABILITY_EFFECT_DEFENSE_UP | 11 | Protect. |
ABILITY_EFFECT_DEFENSE_DOWN_SHARPLY | 12 | Impair. |
ABILITY_EFFECT_DEFENSE_DOWN | 13 | Debilitate. |
ABILITY_EFFECT_RESISTANCE_UP_SHARPLY | 14 | Ward. |
ABILITY_EFFECT_RESISTANCE_UP | 15 | Resist. |
ABILITY_EFFECT_RESISTANCE_DOWN_SHARPLY | 16 | Weaken. |
ABILITY_EFFECT_RESISTANCE_DOWN | 17 | Enfeeble. |
ABILITY_EFFECT_POISON | 18 | Taint. |
ABILITY_EFFECT_VENOM | 19 | Poison. |
ABILITY_EFFECT_DELUSION | 20 | Delude. |
ABILITY_EFFECT_CONFUSION | 21 | Confuse. |
ABILITY_EFFECT_CHARM | 22 | Charm. |
ABILITY_EFFECT_STUN | 23 | Paralyze. |
ABILITY_EFFECT_SLEEP | 24 | Sleep. |
ABILITY_EFFECT_SEAL | 25 | Bind: Psynergy sealed. |
ABILITY_EFFECT_HAUNT | 26 | Haunt. |
ABILITY_EFFECT_INSTANT_DEATH | 27 | Condemn. |
ABILITY_EFFECT_CURSE | 28 | Curse: the Grim Reaper's countdown. |
ABILITY_EFFECT_REGENERATE | 29 | Regenerate. |
ABILITY_EFFECT_REFLECT | 30 | Reflect. |
ABILITY_EFFECT_DRAIN_HP | 31 | Drain. |
ABILITY_EFFECT_DRAIN_PP | 32 | Psy Drain. |
ABILITY_EFFECT_BREAK | 33 | Break: raised stats undone. |
ABILITY_EFFECT_LEAVE_ONE_HP | 34 | Severe Blow, Thrash. |
ABILITY_EFFECT_HALVE_DEFENSE | 35 | Torch. |
ABILITY_EFFECT_CRITICAL_1_IN_64 | 36 | A chance of an ability's critical hit on every target, rolled by btActionRunBuild. |
ABILITY_EFFECT_CRITICAL_1_IN_32 | 37 | |
ABILITY_EFFECT_CRITICAL_1_IN_16 | 38 | |
ABILITY_EFFECT_CRITICAL_1_IN_8 | 39 | |
ABILITY_EFFECT_CRITICAL_1_IN_4 | 40 | |
ABILITY_EFFECT_DOUBLE_BLOW_RARE | 41 | A chance of a double or triple blow, rolled by btActionRunBuild. |
ABILITY_EFFECT_DOUBLE_BLOW | 42 | Double Fang, Twin Beaks. |
ABILITY_EFFECT_TRIPLE_BLOW_RARE | 43 | |
ABILITY_EFFECT_TRIPLE_BLOW | 44 | Swift Strike. |
ABILITY_EFFECT_THREATEN | 45 | Contain, Threaten, Tremble. |
ABILITY_EFFECT_DEFEND | 46 | Defend, Granite. |
ABILITY_EFFECT_TOTAL_DEFENSE | 47 | Total Defense, Flash. |
ABILITY_EFFECT_SIDESTEP | 48 | Sidestep. |
ABILITY_EFFECT_FLEE | 49 | Flee. |
ABILITY_EFFECT_CALL_ALLY | 50 | Ally Search, Speed Surge. |
ABILITY_EFFECT_CALL_HELP | 51 | Search for Help. |
ABILITY_EFFECT_CRAZY_VOICE | 52 | Crazy Voice. |
ABILITY_EFFECT_GROUND | 53 | Ground: the target's turn lost. |
ABILITY_EFFECT_CHALLENGE | 54 | No ability has it. |
ABILITY_EFFECT_SELF_DESTRUCT | 55 | Dynamite, Mortal Blow. |
ABILITY_EFFECT_REVIVE_HALF | 56 | Quartz. |
ABILITY_EFFECT_DEW | 57 | Dew: 80% of max HP. |
ABILITY_EFFECT_AGILITY_DOWN | 58 | Vine. |
ABILITY_EFFECT_AGILITY_UP | 59 | Zephyr. |
ABILITY_EFFECT_DRAIN_HALF_HP | 60 | Sap. |
ABILITY_EFFECT_FIZZ | 61 | Fizz: 60% of max HP. |
ABILITY_EFFECT_SPRITZ | 62 | Spritz: 30%. |
ABILITY_EFFECT_EMBER | 63 | Ember: 7% of max PP. |
ABILITY_EFFECT_CURE_ALL | 64 | Tonic. |
ABILITY_EFFECT_DOUBLE_BLOW_LIKELY | 65 | Gust, Rapid Smash: 153 in 256. |
ABILITY_EFFECT_ACT_TWICE | 66 | Kite. |
ABILITY_EFFECT_SEAL_2_TURNS | 67 | Luff. |
ABILITY_EFFECT_TRIPLE_BLOW_LIKELY | 68 | Sonic Smash. |
ABILITY_EFFECT_PSY_LEECH | 69 | Psy Leech. |
ABILITY_EFFECT_CRYSTAL | 70 | Crystal: half of max HP. |
ABILITY_EFFECT_SPRING | 71 | Spring. |
ABILITY_EFFECT_SHIELD | 72 | Shade: DEFEND_SHIELD. |
ABILITY_EFFECT_BALM | 73 | Balm, Spark: 60% of max HP. |
ABILITY_EFFECT_COUNTER | 74 | Reflux, Counter-rush. |
ABILITY_EFFECT_DAZZLE | 75 | Shine: the first target takes the damage, the others are deluded. |
ABILITY_EFFECT_BREATH | 76 | Breath. |
ABILITY_EFFECT_AROMA | 77 | Aroma. |
ABILITY_EFFECT_ETHER | 78 | Ether. |
ABILITY_EFFECT_VANISH | 79 | Haze: DEFEND_VANISHED. |
ABILITY_EFFECT_CURSE_THREE_ROLLS | 80 | Gasp: Curse, rolled three times (gmBattleRollEffectSuccess). |
ABILITY_EFFECT_CEASE_FIRE | 81 | Lull: "Everybody is resting!" (BATTLE_STATE.ceaseFire). |
ABILITY_EFFECT_BLOW_AWAY | 82 | Gale: an enemy blown out of the battle, as one that flees. |
ABILITY_EFFECT_ULYSSES | 83 | Ulysses: as Ground. |
ABILITY_EFFECT_CATASTROPHE | 84 | Catastrophe: the target also loses a tenth of its max PP. |
ABILITY_EFFECT_STUN_THREE_ROLLS | 85 | Fire Puppet: Paralyze, rolled three times (gmBattleRollEffectSuccess). |
ABILITY_EFFECT_CALL_REINFORCEMENT | 86 | Clarion Cry, Mystic Call: a Sea Fighter called in, or a Star Magician's ball. |
ABILITY_EFFECT_CALL_QUEUED | 87 | Regen Dance: the next enemy of BATTLE_STATE.queuedSummons called in. |
ABILITY_EFFECT_GUARD_AURA | 88 | Guard Aura: as Total Defense. |
ABILITY_EFFECT_VENGEANCE | 89 | Vengeance. |
ABILITY_EFFECT_SLAY_DRAGON | 90 | Raiden's Wrath: lands only on a dragon (EnemyDragonIds), and ignores its Defense. |
ABILITY_EFFECT_SLAY_SEA_CREATURE | 91 | Trident: lands only on a sea creature (EnemySeaCreatureIds), and ignores its Defense. |
Definition at line 123 of file battle_unit.h.
CURSE_FLAG
enum CURSE_FLAG
The curse bits of UNIT.curse (updated by gmUnitCalculate).
| Enumerator | Value | Description |
|---|---|---|
CURSE_BOUND | 0x01 | the unit is bound: one action in four is lost |
CURSE_ITEM | 0x02 | a cursed item is equipped |
CURSE_KEEP_BOUND | 0x04 | keeps CURSE_BOUND through gmUnitCalculate |
CURSE_REMOVABLE | 0x08 | EQUIP_EFFECT_CURSE_REMOVABLE: cleared again with CURSE_BOUND |
Definition at line 272 of file battle_unit.h.
Functions in detail
gmUnitClampGauge
static __inline__ Sint32 gmUnitClampGauge(Sint32 ratio)
Clamps a gauge ratio to 0..UNIT_GAUGE_FULL.
References Sint32.
Referenced by scJupiterLighthouseKarstAndAgatioRetreat().
Definition at line 551 of file battle_unit.h.
Variables in detail
CharacterUnits
extern UNIT CharacterUnits[PARTY_UNIT_COUNT]
The eight characters' units, ISAAC to PIERS, kept in the save.
Referenced by gmMainRoutineStateInitDefaults(), gmUnitGet() and scClearReceiveByLink().
Definition at line 579 of file battle_unit.h.