include/battle/battle_unit.h
Unit, a party member's or enemy's battle state, with the elements, abilities and actions it uses.
Included by battle_effect_internal.h, screen_tables.c, battle_action_run.h, debug_parameter_set.h, character.h, game.h and main_routine_state.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, ability 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. |
Macros
| Name | Description | |
|---|---|---|
#define | ABILITY_RANGE_ALL 255 | ABILITY_DEFINITION.range of an ability that reaches every unit on the side, each as if aimed at. |
#define | RANGE_ICON_ALL 11 | The range icon the Psynergy lists draw for ABILITY_RANGE_ALL, the last of the twelve; range n takes icon n - 1. |
#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 | FIRST_ENEMY_UNIT 128 | Unit ids from 128 are the enemies'. |
#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) | |
#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 | 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, as gmUnitCalculate multiplies a maximum by it and divides by this, 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 | RESISTANCE_PER_STAGE 20 | What a Resistance stage adds to the resistance to every element (gmUnitCalculate). |
#define | POISON_NORMAL 1 | UNIT.poison: the poison takes a tenth of the maximum HP at the end of each of the unit's actions, deadly poison a fifth. |
#define | POISON_VENOM 2 | |
#define | DEFEND_NORMAL 1 | UNIT.defendLevel, 0 for no Defend: Defend and Granite halve the damage, Total Defense and Flash cut it to a tenth (REDUCE_BY_GUARD, battle_ability.c). |
#define | DEFEND_TOTAL 2 | |
#define | UNIT_LEVEL_MAX 99 | The caps on a unit's level and stats. |
#define | UNIT_HP_MAX 9999 | Maximum HP and PP, an enemy's. |
#define | UNIT_CHARACTER_HP_MAX 1999 | Maximum HP and PP, a character's. |
#define | UNIT_STAT_MAX 999 | Attack, Defense and Agility. |
#define | UNIT_LUCK_MAX 99 | |
#define | UNIT_ELEMENT_MAX 200 | Elemental power and resistance. |
#define | UNIT_HP_REGEN_MAX 10000 | |
#define | UNIT_PP_REGEN_MAX 200 | |
#define | PSYNERGY_SLOTS 32 | How many actions a unit's list holds (UNIT.psynergy). |
#define | UNIT_NAME_SIZE 15 | A unit's name buffer: 14 characters and the 0 that ends them. |
#define | UNIT_UPDATE_GAUGES (unit) | Recalculates HP and PP gauges, keeping at least one when any points remain. |
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { ABILITY_DEFINITION_SIZE, BATTLE_UNIT_SIZE, PSYNERGY_ABILITY_ … } | The sizes the STATIC_ASSERTs below hold the structs to, and 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: the formula btAbilityApplyToTarget puts it through. |
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 | 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 | CURSE_FLAG { CURSE_BOUND, CURSE_ITEM, CURSE_KEEP_BOUND, CURSE_REMOVABLE } | UNIT.curse bits, the curse. |
enum | ABILITY_USE { ABILITY_USABLE_IN_FIELD, ABILITY_USABLE_IN_BATTLE } | ABILITY_DEFINITION.flags: where an ability, or the ability an item calls, can be used, as the Status screen's Psynergy list says ("Can be used in Towns/Dungeons", "Can be used in Battle"). |
Functions
| Name | Description | |
|---|---|---|
static __inline__ Sint32 | gmUnitClampGauge (Sint32 ratio) | Clamps a gauge ratio to 0..UNIT_GAUGE_FULL. |
Description
Unit, a party member's or enemy's battle state, with the elements, abilities and actions it uses.
Macros in detail
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(), mnAbilityApplyToTargets(), mnBattleDjinnMenuShowChangePreview(), mnBattlePsynergyMenuRun(), mnBattleTargetRunSelection(), mnItemClassifyUseMode(), mnPsynergyMenuClassifySelectedPsynergy() and mnStatusScreenDrawPsynergyPage().
Definition at line 53 of file battle_unit.h.
RANGE_ICON_ALL
#define RANGE_ICON_ALL 11
The range icon the Psynergy lists draw for ABILITY_RANGE_ALL, the last of the
twelve; range n takes icon n - 1.
Referenced by mnBattleDjinnMenuShowChangePreview(), mnBattlePsynergyMenuRun() and mnStatusScreenDrawPsynergyPage().
Definition at line 56 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 60 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(), btEnemyRecordDefeat(), btEnemyReleaseNameLetter(), btEnemySpriteLoadIntoSlots(), btObjectMake(), btStagingDispatchAction(), gmBattleAbilityIsWeakToEffect(), gmBattleUnitSet(), gmClassDetermine(), gmEquipmentRollUnleash(), gmUnitCalculate(), gmUnitCalculateBaseElements(), gmUnitGetAttackElement(), gmUnitGetExperienceForLevel() and gmUnitRefreshPsynergy().
Definition at line 288 of file battle_unit.h.
FIRST_ENEMY_UNIT
#define FIRST_ENEMY_UNIT 128
Unit ids from 128 are the enemies'.
Referenced by btAbilityReplaceDefeated(), btAppendLinkedActions(), btAutoBattleBuildActions(), btAutoBattleRunAttackOrItem(), btAutoBattleRunPsynergy(), btEffectReadKeysForEnemyTarget(), btEffectRunFlare(), btEffectShowLivingTargets(), btEnemyGetFreeUnitId(), btEnemyLetterFirstOfKind(), btEnemyList(), btFormationBuildEnemyList(), btLinkBattleReceiveParty(), btLinkBattleSendParty(), btObjectDestroyAll(), btObjectGet(), btObjectIsValidId(), btObjectSpawnObjectsForList(), btPartyAssignOpponentSlots(), btPlacementContainsId(), btRun(), btTransitionRun(), btUnitListLiving(), gmBattleUnitSet(), gmUnitGet(), scBattleArenaReceivePartyRecords() and scBattleArenaSendPartyRecords().
Definition at line 291 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(), btEnemyRecordDefeat(), btFindUnitPlace(), btObjectDestroyAll(), btObjectGet(), btObjectIsValidId(), btObjectMake(), btObjectSpawnObjectsForList(), btPlacementContainsId(), btRun(), btStagingRunAttack(), btStagingRunFlee(), btStagingRunFullScreen(), btStagingRunItem(), btStagingRunPlainAttack(), btStagingRunPsynergyCast(), btTransitionRun(), btUnitIsListed(), btUnitProcessActionEnd(), fdExamineMetatile(), fdPartyCheckShortcut(), fdUsePsynergy(), gmPartyInitCharacters(), mnBattleDjinnMenuRun() and mnBattleTargetRunSelection().
Definition at line 294 of file battle_unit.h.
PARTY_UNIT_COUNT
#define PARTY_UNIT_COUNT (ALLY_MAX + 1)
Referenced by btEffectShowLivingTargets(), btLinkBattleSendParty(), btObjectDestroyAll(), btObjectGet(), btObjectSpawnObjectsForList(), btPlacementContainsId(), btTransitionRun() and gmItemCanUnitEquip().
Definition at line 295 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() and btPartyPrepareMembers().
Definition at line 299 of file battle_unit.h.
ENEMY_BATTLE_SIZE
#define ENEMY_BATTLE_SIZE 6
Referenced by btAbilityApplyToTarget(), btEffectRunAtalanta(), btEffectShowLivingTargets(), btEnemyGetFreeUnitId(), btEnemyLetterFirstOfKind(), btEnemyList(), btEnemyRecordDefeat(), btFormationBuildEnemyList(), btObjectIsValidId(), btPlacementRelayoutEnemies(), btUnitListLiving(), btUnitRefreshPlacement(), gmBattleUnitSet() and gmUnitGet().
Definition at line 300 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(), btEffectShowLivingTargets(), btFleeCheckSuccess(), btFleePlayRun(), btFormationBuildEnemyList(), btHighlightClearAllSpriteModes(), btHighlightSetModes(), btHighlightSetOtherSpriteModes(), btObjectDestroyAll(), btObjectPut(), btObjectPutKeepingPoses(), btObjectSpawnObjectsForList(), btObjectUpdateSpritePriorities(), btPlacementContainsId(), btPlacementRelayoutEnemies(), btProcessTurnEnd(), btStagingDispatchAction(), btStagingRunFlee(), btStagingRunFullScreen(), btTransitionRun(), btUnitCollect(), btUnitRefreshPlacement(), btUnitResetGuardLevels(), fdActorUpdateAllMotion() and mnBattleTargetRunSelection().
Definition at line 304 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, as gmUnitCalculate multiplies a
maximum by it and divides by this, and the cap gmUnitClampGauge puts on hp /
hpMax shifted up UNIT_GAUGE_SHIFT bits.
Definition at line 310 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 311 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 314 of file battle_unit.h.
RESISTANCE_PER_STAGE
#define RESISTANCE_PER_STAGE 20
What a Resistance stage adds to the resistance to every element
(gmUnitCalculate).
Referenced by btAbilityApplyToTarget(), gmUnitCalculate() and mnBattleStatusScreenRun().
Definition at line 318 of file battle_unit.h.
POISON_NORMAL
#define POISON_NORMAL 1
UNIT.poison: the poison takes a tenth of the maximum HP at the end of each of
the unit's actions, deadly poison a fifth.
Referenced by btAbilityApplyToTarget(), btUnitBuildStatusFlags(), dbMenuTestDamageAndAfflictParty(), fdPartyApplyPoisonDamage() and mnShopOpenDebugShop().
Definition at line 322 of file battle_unit.h.
POISON_VENOM
#define POISON_VENOM 2
Referenced by btAbilityApplyToTarget(), btUnitBuildStatusFlags(), dbMenuTestDamageAndAfflictParty() and fdPartyApplyPoisonDamage().
Definition at line 323 of file battle_unit.h.
DEFEND_NORMAL
#define DEFEND_NORMAL 1
UNIT.defendLevel, 0 for no Defend: Defend and Granite halve the damage, Total
Defense and Flash cut it to a tenth (REDUCE_BY_GUARD, battle_ability.c). It
lasts the turn: btUnitResetGuardLevels clears it as the next one's commands
are gathered.
Referenced by btAbilityApplyToTarget(), btActionRunBuild() and btGatherActions().
Definition at line 329 of file battle_unit.h.
DEFEND_TOTAL
#define DEFEND_TOTAL 2
Referenced by btAbilityApplyToTarget() and btGatherActions().
Definition at line 330 of file battle_unit.h.
UNIT_LEVEL_MAX
#define UNIT_LEVEL_MAX 99
The caps on a unit's level and stats.
Referenced by btFormationSelectLevelMatchedCandidate(), gmUnitGetExperienceForLevel(), gmUnitLevelUp(), mnBattleStatusScreenRun(), mnStatusScreenShowMemberProgressMessage() and scFileScreenPackPasswordData().
Definition at line 333 of file battle_unit.h.
UNIT_HP_MAX
#define UNIT_HP_MAX 9999
Maximum HP and PP, an enemy's.
Referenced by btEnemyAdjustLevel() and gmUnitCalculate().
Definition at line 335 of file battle_unit.h.
UNIT_CHARACTER_HP_MAX
#define UNIT_CHARACTER_HP_MAX 1999
Maximum HP and PP, a character's.
Referenced by gmUnitCalculate() and scFileScreenPackPasswordData().
Definition at line 337 of file battle_unit.h.
UNIT_STAT_MAX
#define UNIT_STAT_MAX 999
Attack, Defense and Agility.
Referenced by btEnemyAdjustLevel(), gmUnitCalculate() and scFileScreenPackPasswordData().
Definition at line 339 of file battle_unit.h.
UNIT_LUCK_MAX
#define UNIT_LUCK_MAX 99
Referenced by gmUnitCalculate() and scFileScreenPackPasswordData().
Definition at line 340 of file battle_unit.h.
UNIT_ELEMENT_MAX
#define UNIT_ELEMENT_MAX 200
Elemental power and resistance.
Referenced by btEnemyAdjustLevel() and gmUnitCalculate().
Definition at line 342 of file battle_unit.h.
UNIT_HP_REGEN_MAX
#define UNIT_HP_REGEN_MAX 10000
Referenced by gmUnitCalculate().
Definition at line 343 of file battle_unit.h.
UNIT_PP_REGEN_MAX
#define UNIT_PP_REGEN_MAX 200
Referenced by gmUnitCalculate().
Definition at line 344 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(), gmUnitRefreshPsynergy(), mnBattleCollectPartyCommands(), mnBattleDjinnMenuListChangedAbilities(), mnPsynergyListDifference(), mnPsynergyMenuCollectActions(), mnPsynergyMenuDrawPsynergyIcons() and mnStatusPanelDraw().
Definition at line 347 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(), gmBattleUnitSet(), gmPartyInitCharacters(), mnBattleTargetRunSelection() and scBattleArenaReceivePartyRecords().
Definition at line 359 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(), gmPartyEndChildhood(), gmPartyRestoreHpPp(), gmPartyRestorePpInLighthouse(), gmReturnFromEngine(), gmUnitRecalculateGauges() and scColossoControlCharacterAlone().
Definition at line 615 of file battle_unit.h.
Enumerations in detail
anonymous enum
enum { ABILITY_DEFINITION_SIZE, BATTLE_UNIT_SIZE, PSYNERGY_ABILITY_MASK }
The sizes the STATIC_ASSERTs below hold the structs to, and the action id's
bits in an action list entry.
| Enumerator | Value | Description |
|---|---|---|
ABILITY_DEFINITION_SIZE | 16 | bytes in an ABILITY_DEFINITION |
BATTLE_UNIT_SIZE | 332 | Bytes in a UNIT, which the code clears and copies whole |
PSYNERGY_ABILITY_MASK | 0x3fff | PSYNERGY_ENTRY.encodedAction's action id |
Definition at line 13 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 41 of file battle_unit.h.
ABILITY_FORMULA
enum ABILITY_FORMULA
An ability kind picks what the ability's power does to each target: the
formula btAbilityApplyToTarget puts it through. ABILITY_FORMULA_BLANK,
ABILITY_FORMULA_EFFECT_ONLY and ABILITY_FORMULA_NO_POWER apply no power. No
row has a kind above ABILITY_FORMULA_HEAL_PP, which would apply none either.
| Enumerator | Value | Description |
|---|---|---|
ABILITY_FORMULA_BLANK | 0 | Only the blank rows no table uses. |
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 | HP damage from enemies' moves such as Fire Blessing and Deadly Gas, falling off faster than Psynergy's (RangeFalloffEnemyDamage). Unless the move has wording of its own, it's announced as <unit> unleashes <ability>!. A weapon's unleash is something else: ABILITY_FORMULA_ATTACK, or for Rapid Smash ABILITY_FORMULA_ATTACK_MULTIPLIED. |
ABILITY_FORMULA_EFFECT_ONLY | 7 | Granite, Flash and Kite, whose effect is all they do. |
ABILITY_FORMULA_SUMMON | 8 | Summon damage falls off faster than Psynergy's (RangeFalloffSummonDamage). Called with the Summon command, a summon also adds 3% of the target's maximum HP to its power for each Djinni it spends; the Fusion Dragon's Outer Space and Dragon Driver go without that bonus. |
ABILITY_FORMULA_NO_POWER | 9 | The field Psynergy (Move, Catch...), the field-only stat items (Apple, Power Bread...), Defend, Flee and the enemies' commands (Threaten, Ally Search...). The enemies' targeting check (CHECK_EFFECT_TARGET) treats it as a summon: worth it on a living unit only when the power is nonzero. |
ABILITY_FORMULA_PP_DAMAGE | 10 | Crazy Voice, and Psy Drain when it lands. |
ABILITY_FORMULA_HEAL_PP | 11 | Ember, Psy Crystal, Adept Ring. |
Definition at line 66 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, with their English names and
descriptions). ABILITY_EFFECT_SIDESTEP and ABILITY_EFFECT_CRAZY_VOICE are
read by no code here, and no row has ABILITY_EFFECT_RESTORE_HP or
ABILITY_EFFECT_RESTORE_PP. A stat change whose name ends in _SHARPLY moves
its stat two stages, one without moves it one.
ABILITY_EFFECT_CRITICAL_1_IN_* are chances of an ability's critical hit,
rolled by btActionRunBuild at the odds each name gives. Only an attack
(ABILITY_FORMULA_ATTACK or ABILITY_FORMULA_ATTACK_MULTIPLIED) applies it, and
no ability has one.
ABILITY_EFFECT_DOUBLE_BLOW_* and ABILITY_EFFECT_TRIPLE_BLOW_* are chances of
a double or triple blow, rolled by btActionRunBuild: the plain one 1 in 4,
the rare one (which no ability has) 1 in 8, and the likely one 153 in 256.
| 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 |
ABILITY_EFFECT_ATTACK_UP | 7 | High Impact |
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 | |
ABILITY_EFFECT_STUN | 23 | Paralyze |
ABILITY_EFFECT_SLEEP | 24 | |
ABILITY_EFFECT_SEAL | 25 | Bind: Psynergy sealed |
ABILITY_EFFECT_HAUNT | 26 | |
ABILITY_EFFECT_INSTANT_DEATH | 27 | Condemn |
ABILITY_EFFECT_CURSE | 28 | Curse: the Grim Reaper's |
ABILITY_EFFECT_REGENERATE | 29 | countdown |
ABILITY_EFFECT_REFLECT | 30 | |
ABILITY_EFFECT_DRAIN_HP | 31 | |
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 | |
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 | |
ABILITY_EFFECT_DOUBLE_BLOW | 42 | Double Fang, Twin Beaks, |
ABILITY_EFFECT_TRIPLE_BLOW_RARE | 43 | Flying Attack |
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 | |
ABILITY_EFFECT_FLEE | 49 | Flee: an enemy's becomes COMMAND_FLEE |
ABILITY_EFFECT_CALL_ALLY | 50 | Ally Search, Speed Surge |
ABILITY_EFFECT_CALL_HELP | 51 | Search for Help |
ABILITY_EFFECT_CRAZY_VOICE | 52 | |
ABILITY_EFFECT_GROUND | 53 | Ground, War Cry, Wicked Howl |
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: revives with 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% of max HP |
ABILITY_EFFECT_EMBER | 63 | Ember: 7% of max PP |
ABILITY_EFFECT_CURE_ALL | 64 | Tonic |
ABILITY_EFFECT_DOUBLE_BLOW_LIKELY | 65 | Gust, Rapid Smash, Slice |
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 |
Definition at line 129 of file battle_unit.h.
ABILITY_TARGET
enum ABILITY_TARGET
ABILITY_DEFINITION.targetMode: whom an ability may target, from its user's
view. The party's cursor (mnBattleTargetRunSelection) shows the enemies for
every mode but ABILITY_TARGET_ALLIES and ABILITY_TARGET_SELF. No row of
ability_table.c has a mode above ABILITY_TARGET_SELF; btActionRunSetTargets
would walk such a mode's range as it does ABILITY_TARGET_FOES'.
| Enumerator | Value | Description |
|---|---|---|
ABILITY_TARGET_ONE | 0 | The ability takes one target, the aimed unit, |
ABILITY_TARGET_FOES | 1 | whatever its range (btActionRunSetTargets), and an enemy aims it at itself. The field Psynergy and enemies' commands such as Threaten, Ally Search and Flee have it. |
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); the party's cursor and btActionRunSetTargets take it as ABILITY_TARGET_FOES. |
ABILITY_TARGET_SELF | 4 | The user alone, whatever the range. |
Definition at line 215 of file battle_unit.h.
CURSE_FLAG
enum CURSE_FLAG
UNIT.curse bits, the curse.
| Enumerator | Value | Description |
|---|---|---|
CURSE_BOUND | 0x01 | The unit is bound. |
CURSE_ITEM | 0x02 | A cursed item is equipped. |
CURSE_KEEP_BOUND | 0x04 | Keeps CURSE_BOUND through gmUnitCalculate. |
CURSE_REMOVABLE | 0x08 | EQUIP_EFFECT_CURSE_REMOVABLE: gmUnitCalculate clears it again with CURSE_BOUND. |
Definition at line 234 of file battle_unit.h.
ABILITY_USE
enum ABILITY_USE
ABILITY_DEFINITION.flags: where an ability, or the ability an item calls, can
be used, as the Status screen's Psynergy list says ("Can be used in
Towns/Dungeons", "Can be used in Battle").
| 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 281 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.
Definition at line 601 of file battle_unit.h.