A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments. More...
#include <battle/battle_unit.h>
Data Fields | |
| u8 | name [0x0f] |
| The name, one byte a character, ending in 0. | |
| u8 | level |
| 1 to 99 for a character | |
| s16 | baseHp |
| before equipment, Djinn and class (UnitCalc) | |
| s16 | basePp |
| before equipment, Djinn and class (UnitCalc) | |
| s16 | hpGauge |
| hp / maxHp in 0..0x4000; 1 while any HP remains | |
| s16 | ppGauge |
| pp / maxPp in 0..0x4000; 1 while any PP remains | |
| u16 | baseAttack |
| before equipment, Djinn, class and stages | |
| u16 | baseDefense |
| before equipment, Djinn, class and stages | |
| u16 | baseAgility |
| before equipment, Djinn, class and stages | |
| u8 | baseLuck |
| before equipment, Djinn and class | |
| u8 | baseActionCount |
| Actions a round before equipment: the low four bits are read. | |
| u8 | baseHpRegen |
| HP regained each turn before equipment; 0 for a character. | |
| u8 | basePpRegen |
| PP regained each turn before equipment and lighthouses. | |
| u8 | unk022 [2] |
| Not named by any TBS code. | |
| struct BattleElementStats | baseElement [4] |
| Power and resistance before equipment and stages: an enemy's from its element preset, a character's from its element levels (Unit_CalcBaseElements). | |
| s16 | maxHp |
| 0 to 1999 for a character, 9999 for an enemy (UnitCalc) | |
| s16 | maxPp |
| 0 to 1999 for a character, 9999 for an enemy (UnitCalc) | |
| s16 | hp |
| current HP, 0 when downed | |
| s16 | pp |
| current PP | |
| u16 | atk |
| Attack, 0 to 999 (UnitCalc). | |
| u16 | def |
| Defense, 0 to 999 (UnitCalc). | |
| u16 | agi |
| Agility, 0 to 999: the order of the round's actions. | |
| u8 | luck |
| 0 to 99 (UnitCalc) | |
| u8 | actionEntryCount |
| Actions each round, 0 to 2: baseActionCount, one more while ready, and the equipment's extra turns (UnitCalc). | |
| u8 | hpRegen |
| HP regained at each turn's end (UnitCalc). | |
| u8 | ppRegen |
| PP regained at each turn's end, 0 to 200 (UnitCalc): 4 more once the lighthouse of the character's element is lit. | |
| u8 | unk046 [2] |
| Not named by any TBS code. | |
| struct BattleElementStats | element [4] |
| Power and resistance in each element, 0 to 200, after equipment, element levels and Resistance stages (UnitCalc). | |
| struct OwnerActionSlot | actionSlots [32] |
| The action list: Psynergy taught for good, then the class's and the equipment's (Unit_RefreshPsynergy). | |
| u16 | inventory [15] |
| Items held, one entry each: bits 15..11 quantity | 10 broken | 9 equipped | 8..0 item id (INVENTORY_*). | |
| u8 | unk0f6 [2] |
| Not named by any TBS code. | |
| u32 | djinnAvailable [4] |
| The Djinn held, one bit per Djinni (by its index) in each element's word. | |
| u32 | djinnActive [4] |
| The Djinn set, one bit per Djinni; only these add their stat bonuses. | |
| u8 | djinnOwnedCounts [4] |
| the Djinn held in each element, at most 10 | |
| u8 | djinnActiveCounts [4] |
| the Djinn set in each element; the class's element levels are read from these | |
| u32 | rewards |
| Copied from the enemy's definition, where it is 0 in every row. | |
| u32 | experience |
| a character's experience points | |
| u8 | classId |
| Who the unit is: a character's id (ISAAC to JENNA, below 8) or an enemy's id (BattleUnitSet). | |
| u8 | classIndex |
| The character's class, worked out from its Djinn (Unit_UpdateClass); 0 marks an enemy, and code throughout tests it to tell the two apart. | |
| u8 | side |
| BATTLE_UNIT_ABSENT (0), BATTLE_UNIT_ENEMY (1) or BATTLE_UNIT_PARTY (2). | |
| s8 | guardLevel |
| 0, GUARD_DEFEND (1, half the damage) or GUARD_TOTAL_DEFENSE (2, a tenth); set by Defend and Granite, cleared each round. | |
| s8 | elementLevels [4] |
| A summon's boost to each element: the Djinn of that element the summon spent, adding (n * n + n) * 5 power (UnitCalc). | |
| s8 | restraint |
| The curse. | |
| s8 | poison |
| 1 poisoned, 2 deadly poison | |
| u8 | psySeal |
| bits: 7..3 Luff (16 when cast, minus 8 a turn) | 2..0 Bind's turns (7 when cast). | |
| u8 | refrain |
| Regenerate's turns left, 7 when cast. | |
| s8 | reflect |
| Reflect's turns left, 7 when cast. | |
| u8 | haunt |
| set while an evil spirit grips the unit | |
| u8 | grimReaper |
| The Grim Reaper's countdown: 7 when cursed, down one at each turn's end; at 0 the unit falls. | |
| u8 | equipBonus [2] |
| The totals of equipment effects 23 (unleash chance) and 24 that UnitCalc sums; TBS never reads them back. | |
| u8 | ready |
| Kite's extra action: 2 when cast, down one at each turn's end; while nonzero UnitCalc gives the unit one more action a round. | |
| u8 | immobile |
| set by Ground: the next action is lost | |
| u8 | agilityTurns |
| the Agility change's turns left, 5 when cast | |
| s8 | agilityStage |
| The Agility stage: -4 (Vine) to 8 (Zephyr, twice the Agility). | |
| s8 | challenge |
| Set by the challenge effect: an enemy with it never chooses to flee. | |
| u8 | unk149 |
| Not named by any TBS code. | |
| u16 | enemyId |
| Not named by any TBS code; TLA reads it as the unit's id. | |
| u8 | attackTurns |
| Each stat change: the turns it has left, and its stage (UnitCalc: an eighth of Attack, Defense or Agility, or 20 Resistance, a stage). | |
| s8 | attackStage |
| u8 | defenseTurns |
| s8 | defenseStage |
| u8 | resistanceTurns |
| s8 | resistanceStage |
| u8 | delusion |
| Delusion to sleep: the turns each status has left, 7 when it lands; each may end sooner at the end of a turn. | |
| s8 | confusion |
| u8 | charm |
| u8 | stun |
| u8 | sleep |
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
Definition at line 178 of file battle_unit.h.
| u8 BattleUnit::name[0x0f] |
The name, one byte a character, ending in 0.
An enemy's is its message name cut to 14 characters, with the suffix letter BattleUnitSet is given (a digit in Japanese); name[14] is always 0.
Definition at line 182 of file battle_unit.h.
Referenced by BattleEnemy_LetterFirstOfClass(), BattleEnemy_ReleaseNameLetter(), BattleTarget_RunSelection(), BattleUnitSet(), DebugBattle_ViewMessages(), DjinnMenu_DrawStatPreview(), DjinnMenu_SelectDjinn(), ItemLevel_RunLevelEditor(), ItemMenu_DrawItemHead(), ItemMenu_DrawOwnerStatus(), ItemMenu_SelectGiveQuantity(), LinkBattle_ReceiveParty(), Menu_DrawOwnerStatusPanel(), NameEntry_EditOwnerName(), Party_InitCharacters(), PartyStatusDraw(), PsynergyMenu_DrawListPage(), PsynergyMenu_DrawShortcuts(), SaveState_BuildSummaryHeader(), Shop_DrawItemPage(), Ui_RunOwnerStatusScreen(), and UiText_BuildRenderEntries().
| u8 BattleUnit::level |
1 to 99 for a character
Definition at line 183 of file battle_unit.h.
Referenced by Battle_AwardSpoils(), BattleEnemy_AdjustLevel(), BattleEnemy_CalculateCoinReward(), BattleEnemy_CalculateExperienceReward(), BattleEscape_CheckSuccess(), BattleFormation_SelectLevelMatchedCandidate(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), BattleUnitSet(), DebugParty_LoadPreset(), DjinnMenu_DrawStatPreview(), DjinnMenu_SelectDjinn(), ItemLevel_AdjustOwnerLevel(), ItemLevel_RunLevelEditor(), ItemMenu_DrawOwnerStatus(), Menu_DrawOwnerStatusPanel(), Owner_LevelUp(), Party_GetAverageLevel(), PsynergyMenu_DrawListPage(), SaveState_BuildSummaryHeader(), Shop_ServicePrice(), StatusMenu_ShowOwnerProgressMessage(), Ui_RunOwnerStatusScreen(), Unit_GetExperienceForLevel(), Unit_LevelUpTo(), Unit_RefreshPsynergy(), and Unit_TryLevelUp().
| s16 BattleUnit::baseHp |
before equipment, Djinn and class (UnitCalc)
Definition at line 184 of file battle_unit.h.
Referenced by BattleEffect_ApplyToTargets(), BattleEnemy_AdjustLevel(), BattleUnitSet(), Owner_LevelUp(), and UnitCalc().
| s16 BattleUnit::basePp |
before equipment, Djinn and class (UnitCalc)
Definition at line 185 of file battle_unit.h.
Referenced by BattleEffect_ApplyToTargets(), BattleEnemy_AdjustLevel(), BattleUnitSet(), Owner_LevelUp(), and UnitCalc().
| s16 BattleUnit::hpGauge |
hp / maxHp in 0..0x4000; 1 while any HP remains
Definition at line 186 of file battle_unit.h.
Referenced by BattleUnitSet(), Colosso_ControlCharacterAlone(), Party_InitCharacters(), and UnitCalc().
| s16 BattleUnit::ppGauge |
pp / maxPp in 0..0x4000; 1 while any PP remains
Definition at line 187 of file battle_unit.h.
Referenced by BattleUnitSet(), Colosso_ControlCharacterAlone(), Party_InitCharacters(), and UnitCalc().
| u16 BattleUnit::baseAttack |
before equipment, Djinn, class and stages
Definition at line 188 of file battle_unit.h.
Referenced by BattleEffect_ApplyToTargets(), BattleEnemy_AdjustLevel(), BattleUnitSet(), Owner_LevelUp(), and UnitCalc().
| u16 BattleUnit::baseDefense |
before equipment, Djinn, class and stages
Definition at line 189 of file battle_unit.h.
Referenced by BattleEffect_ApplyToTargets(), BattleEnemy_AdjustLevel(), BattleUnitSet(), Owner_LevelUp(), and UnitCalc().
| u16 BattleUnit::baseAgility |
before equipment, Djinn, class and stages
Definition at line 190 of file battle_unit.h.
Referenced by BattleEffect_ApplyToTargets(), BattleEnemy_AdjustLevel(), BattleUnitSet(), Owner_LevelUp(), and UnitCalc().
| u8 BattleUnit::baseLuck |
before equipment, Djinn and class
Definition at line 191 of file battle_unit.h.
Referenced by BattleEffect_ApplyToTargets(), BattleUnitSet(), Owner_LevelUp(), and UnitCalc().
| u8 BattleUnit::baseActionCount |
Actions a round before equipment: the low four bits are read.
An enemy's comes from its definition's turns; a level up sets a character's to 1.
Definition at line 194 of file battle_unit.h.
Referenced by BattleUnitSet(), Owner_LevelUp(), and UnitCalc().
| u8 BattleUnit::baseHpRegen |
HP regained each turn before equipment; 0 for a character.
Definition at line 195 of file battle_unit.h.
Referenced by BattleUnitSet(), Owner_LevelUp(), and UnitCalc().
| u8 BattleUnit::basePpRegen |
PP regained each turn before equipment and lighthouses.
Definition at line 196 of file battle_unit.h.
Referenced by BattleUnitSet(), Owner_LevelUp(), and UnitCalc().
| u8 BattleUnit::unk022[2] |
Not named by any TBS code.
Definition at line 197 of file battle_unit.h.
| struct BattleElementStats BattleUnit::baseElement[4] |
Power and resistance before equipment and stages: an enemy's from its element preset, a character's from its element levels (Unit_CalcBaseElements).
Definition at line 201 of file battle_unit.h.
Referenced by BattleEnemy_AdjustLevel(), BattleTargetExec(), BattleUnitSet(), Unit_UpdateClass(), and UnitCalc().
| s16 BattleUnit::maxHp |
0 to 1999 for a character, 9999 for an enemy (UnitCalc)
Definition at line 202 of file battle_unit.h.
Referenced by BabiPalace_RestorePartyAndInventory(), Battle_ProcessRoundEnd(), BattleEffect_ApplyToTargets(), BattleParty_ApplyHealthDelta(), BattleParty_ApplyStatusDamage(), BattleTarget_RunSelection(), BattleTarget_SelectForAction(), BattleTargetExec(), BattleUnit_ProcessTurnEnd(), BattleUnit_ResetStateByMode(), BattleUnitSet(), Colosso_ControlCharacterAlone(), DjinnMenu_DrawStatPreview(), Inn_PlaySleep(), ItemMenu_DrawOwnerStatus(), Party_EndChildhood(), Party_RemoveOwnerRestored(), Party_RestoreHpPp(), PartyStatusDraw(), Scene_ReturnFromBattle(), Ui_DrawValuePairRows(), Ui_RunOwnerStatusScreen(), Unit_AddHp(), Unit_SetHp(), and UnitCalc().
| s16 BattleUnit::maxPp |
0 to 1999 for a character, 9999 for an enemy (UnitCalc)
Definition at line 203 of file battle_unit.h.
Referenced by BabiPalace_RestorePartyAndInventory(), Battle_ProcessRoundEnd(), BattleCommand_BuildPlan(), BattleEffect_ApplyToTargets(), BattleTarget_RunSelection(), BattleTargetExec(), BattleUnitSet(), Colosso_ControlCharacterAlone(), DjinnMenu_DrawStatPreview(), Inn_PlaySleep(), ItemMenu_DrawOwnerStatus(), Party_EndChildhood(), Party_RemoveOwnerRestored(), Party_RestoreHpPp(), Party_RestorePpOfLitElements(), PartyStatusDraw(), Scene_ReturnFromBattle(), Ui_DrawValuePairRows(), Ui_RunOwnerStatusScreen(), Unit_AddPp(), Unit_SetPp(), and UnitCalc().
| s16 BattleUnit::hp |
current HP, 0 when downed
Definition at line 204 of file battle_unit.h.
Referenced by BabiPalace_RestorePartyAndInventory(), Battle_ProcessRoundEnd(), BattleCommand_BuildPlan(), BattleEffect_ApplyToTargets(), BattleFx_RollSuccess(), BattleParty_ListLivingUnits(), BattlePres_BuildTargetList(), BattlePres_RunAction(), BattlePres_SetActorModeAndAction(), BattlePres_ShowDefendMessage(), BattlePresentation_ApplyUnitDamage(), BattlePresentation_DispatchAction(), BattleTarget_RunSelection(), BattleTarget_SelectForAction(), BattleTargetExec(), BattleUnit_ResetStateByMode(), BattleUnitSet(), CharacterMenu_BuildAvailability(), Colosso_ControlCharacterAlone(), DjinnMenu_DrawStatPreview(), DjinnMenu_ShowChangePreview(), DjinnRecovery_Tick(), Field_ProcessStep(), Field_RunScene(), FieldObject_UpdatePlayerControl(), Inn_PlaySleep(), Inn_RoomPrice(), ItemMenu_DrawOwnerStatus(), Party_EndChildhood(), Party_RemoveOwnerRestored(), Party_RestoreHpPp(), PartyStatusDraw(), Scene_ReturnFromBattle(), Shop_CanServe(), Ui_DrawValuePairRows(), Ui_RunOwnerStatusScreen(), Unit_AddHp(), Unit_SetHp(), and UnitCalc().
| s16 BattleUnit::pp |
current PP
Definition at line 205 of file battle_unit.h.
Referenced by BabiPalace_RestorePartyAndInventory(), Battle_CollectPartyCommands(), Battle_ProcessRoundEnd(), BattleCommand_BuildPlan(), BattleCommand_SelectAutomatic(), BattleEffect_ApplyToTargets(), BattleMenu_RunActionSelection(), BattleTarget_RunSelection(), BattleTargetExec(), BattleUnitSet(), Colosso_ControlCharacterAlone(), DjinnMenu_DrawStatPreview(), DjinnMenu_ShowChangePreview(), Inn_PlaySleep(), ItemMenu_DrawOwnerStatus(), Party_EndChildhood(), Party_RemoveOwnerRestored(), Party_RestoreHpPp(), Party_RestorePpOfLitElements(), PartyStatusDraw(), PsynergyMenu_DrawActionPage(), PsynergyMenu_RunList(), Scene_ReturnFromBattle(), Ui_DrawValuePairRows(), Ui_RunOwnerStatusScreen(), Unit_AddPp(), Unit_SetPp(), and UnitCalc().
| u16 BattleUnit::atk |
Attack, 0 to 999 (UnitCalc).
Definition at line 206 of file battle_unit.h.
Referenced by BattleTargetExec(), DjinnMenu_DrawStatPreview(), DjinnMenu_ShowChangePreview(), ItemMenu_DrawOwnerStatus(), Menu_DrawOwnerStatusPanel(), Shop_DrawEquipComparison(), Shop_DrawItemPage(), Ui_RunOwnerStatusScreen(), UiText_DrawStatComparison(), and UnitCalc().
| u16 BattleUnit::def |
Defense, 0 to 999 (UnitCalc).
Definition at line 207 of file battle_unit.h.
Referenced by BattleTargetExec(), DjinnMenu_DrawStatPreview(), DjinnMenu_ShowChangePreview(), ItemMenu_DrawOwnerStatus(), Menu_DrawOwnerStatusPanel(), Shop_DrawEquipComparison(), Shop_DrawItemPage(), Ui_RunOwnerStatusScreen(), UiText_DrawStatComparison(), and UnitCalc().
| u16 BattleUnit::agi |
Agility, 0 to 999: the order of the round's actions.
Definition at line 208 of file battle_unit.h.
Referenced by Battle_CollectPartyCommands(), BattlePres_BuildOpponentEntries(), BattlePres_BuildUnitEntries(), BattlePresentation_BuildSortedUnitEntries(), BattleTargetExec(), DjinnMenu_DrawStatPreview(), DjinnMenu_ShowChangePreview(), ItemMenu_DrawOwnerStatus(), Menu_DrawOwnerStatusPanel(), Shop_DrawEquipComparison(), Ui_RunOwnerStatusScreen(), UiText_DrawStatComparison(), and UnitCalc().
| u8 BattleUnit::luck |
0 to 99 (UnitCalc)
Definition at line 209 of file battle_unit.h.
Referenced by BattleFx_RollSuccess(), BattleUnit_RollCounterEarlyEnd(), DjinnMenu_DrawStatPreview(), DjinnMenu_ShowChangePreview(), ItemMenu_DrawOwnerStatus(), Menu_DrawOwnerStatusPanel(), Shop_DrawEquipComparison(), Ui_RunOwnerStatusScreen(), and UnitCalc().
| u8 BattleUnit::actionEntryCount |
Actions each round, 0 to 2: baseActionCount, one more while ready, and the equipment's extra turns (UnitCalc).
Each gives the unit a place in the round's queue.
Definition at line 213 of file battle_unit.h.
Referenced by BattlePres_BuildOpponentEntries(), BattlePres_BuildUnitEntries(), and UnitCalc().
| u8 BattleUnit::hpRegen |
HP regained at each turn's end (UnitCalc).
Definition at line 214 of file battle_unit.h.
Referenced by Battle_ProcessRoundEnd(), and UnitCalc().
| u8 BattleUnit::ppRegen |
PP regained at each turn's end, 0 to 200 (UnitCalc): 4 more once the lighthouse of the character's element is lit.
Definition at line 217 of file battle_unit.h.
Referenced by Battle_ProcessRoundEnd(), and UnitCalc().
| u8 BattleUnit::unk046[2] |
Not named by any TBS code.
Definition at line 218 of file battle_unit.h.
| struct BattleElementStats BattleUnit::element[4] |
Power and resistance in each element, 0 to 200, after equipment, element levels and Resistance stages (UnitCalc).
Definition at line 221 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleEffect_ApplyToTargets(), BattleEnemy_AdjustLevel(), BattleParty_ReconcileDjinnRecovery(), BattleSummon_UpdateAvailability(), BattleTargetExec(), BattleUnit_ProcessTurnEnd(), CharacterMenu_DrawStatusAilments(), Djinn_Activate(), Djinn_AddToLeastLoadedOwner(), Djinn_AddToOwner(), Djinn_CountTurns(), Djinn_Deactivate(), Djinn_ListOwnerEntries(), Djinn_Transfer(), Party_SumDjinnCounts(), Ui_RunOwnerStatusScreen(), Unit_GetElementLevel(), and UnitCalc().
| struct OwnerActionSlot BattleUnit::actionSlots[32] |
The action list: Psynergy taught for good, then the class's and the equipment's (Unit_RefreshPsynergy).
An empty entry is 0.
Definition at line 224 of file battle_unit.h.
Referenced by Battle_AwardSpoils(), Battle_CollectPartyCommands(), DebugParty_LoadPreset(), DjinnMenu_DrawStatPreview(), DjinnMenu_ShowChangePreview(), DjinnMenu_ShowOwnerStatus(), Menu_DrawOwnerStatusPanel(), OwnerAction_RunCompareLoop(), Party_ListPsynergy(), PsynergyMenu_CollectActions(), Unit_KnowsAction(), Unit_LearnPsynergy(), and Unit_RefreshPsynergy().
| u16 BattleUnit::inventory[15] |
Items held, one entry each: bits 15..11 quantity | 10 broken | 9 equipped | 8..0 item id (INVENTORY_*).
An empty entry is 0.
Definition at line 227 of file battle_unit.h.
Referenced by Battle_CollectPartyCommands(), BattleCommand_BuildPlan(), BattleCommand_SelectAutomatic(), BattlePres_RunItem(), BattleUnit_LookupWeaponValueByClass(), BattleUnit_ResetStateByMode(), BattleUnitSet(), Equipment_GetUnleashRateBonus(), Field_UseItem(), GameFlag_RefreshLureCap(), GomaCaveEntrance_GiveShamansRod(), Inventory_AddAndEquip(), Inventory_AddItem(), Inventory_Break(), Inventory_CheckDiscard(), Inventory_Count(), Inventory_CountItem(), Inventory_Discard(), Inventory_Equip(), Inventory_Find(), Inventory_FindEquipped(), Inventory_GetEquippedDefinition(), Inventory_GetEquippedItem(), Inventory_GetQuantity(), Inventory_Remove(), Inventory_RemoveFirstUnflagged(), Inventory_Repair(), InventoryMenu_GetItemQuantity(), InventorySnapshot_Restore(), InventorySnapshot_Save(), Item_Use(), ItemMenu_CollectItems(), ItemMenu_CountItems(), ItemMenu_DrawEquipPreview(), ItemMenu_RunCommands(), ItemMenu_RunList(), ItemMenu_RunOwnerSelection(), ItemMenu_SelectItem(), KolimaForestTree_ReplaceInventoryItem(), Menu_DrawOwnerStatusPanel(), MercuryLighthouse_ReplaceInventoryItem(), Party_EndChildhood(), Party_InitCharacters(), Scene_GiveAndEquipItem(), Shop_ConfirmEquip(), Shop_DrawEquipComparison(), Shop_DrawUnitGrid(), Shop_DrawUseItem(), Shop_RepairItem(), Shop_SelectBuyNum(), Shop_SelectRepair(), Shop_SelectSell(), Shop_SelectSellNum(), Shop_SelectUse(), Shop_SellItem(), Shop_SellOld(), SolSanctumElementalStarRoom_UnmaskFelix(), Unit_RefreshPsynergy(), and UnitCalc().
| u8 BattleUnit::unk0f6[2] |
Not named by any TBS code.
Definition at line 228 of file battle_unit.h.
| u32 BattleUnit::djinnAvailable[4] |
The Djinn held, one bit per Djinni (by its index) in each element's word.
Definition at line 230 of file battle_unit.h.
Referenced by Battle_SelectAbility(), DebugParty_LoadPreset(), Djinn_Activate(), Djinn_AddToOwner(), Djinn_CountTurns(), Djinn_IsReady(), Djinn_ListOwnerEntries(), Djinn_Transfer(), Unit_CalcBaseElements(), Unit_GetElementLevel(), and Unit_UpdateClass().
| u32 BattleUnit::djinnActive[4] |
The Djinn set, one bit per Djinni; only these add their stat bonuses.
Definition at line 232 of file battle_unit.h.
Referenced by Battle_SelectAbility(), DebugParty_LoadPreset(), Djinn_Activate(), Djinn_CountTurns(), Djinn_Deactivate(), Djinn_IsActive(), Djinn_IsReady(), Djinn_ListOwnerEntries(), and UnitCalc().
| u8 BattleUnit::djinnOwnedCounts[4] |
the Djinn held in each element, at most 10
Definition at line 233 of file battle_unit.h.
Referenced by BattleSummon_UpdateAvailability(), CharacterMenu_DrawStatusAilments(), DebugParty_LoadPreset(), Djinn_AddToLeastLoadedOwner(), Djinn_AddToOwner(), Djinn_IsReady(), Djinn_Transfer(), Party_SumDjinnCounts(), Ui_RunOwnerStatusScreen(), Vault_GetIvanVenusDjinnCount(), and VaultInteriors_GetIvanVenusDjinnCount().
| u8 BattleUnit::djinnActiveCounts[4] |
the Djinn set in each element; the class's element levels are read from these
Definition at line 234 of file battle_unit.h.
Referenced by CharacterMenu_DrawStatusAilments(), DebugParty_LoadPreset(), Djinn_Activate(), Djinn_Deactivate(), Djinn_IsReady(), DjinnMenu_DrawStatPreview(), and Ui_RunOwnerStatusScreen().
| u32 BattleUnit::rewards |
Copied from the enemy's definition, where it is 0 in every row.
During a battle the enemy's action choice keeps its place in its action list here (BattleCommand_SelectAutomatic).
Definition at line 239 of file battle_unit.h.
Referenced by BattleCommand_SelectAutomatic(), and BattleUnitSet().
| u32 BattleUnit::experience |
a character's experience points
Definition at line 240 of file battle_unit.h.
Referenced by Battle_AwardSpoils(), Encounter_SelectEnemyGroup(), ItemMenu_DrawOwnerStatus(), Menu_DrawOwnerStatusPanel(), Owner_LevelUp(), StatusMenu_ShowOwnerProgressMessage(), Ui_RunOwnerStatusScreen(), and Unit_TryLevelUp().
| u8 BattleUnit::classId |
Who the unit is: a character's id (ISAAC to JENNA, below 8) or an enemy's id (BattleUnitSet).
The class tables are indexed by classIndex.
Definition at line 243 of file battle_unit.h.
Referenced by Battle_CollectPartyCommands(), BattleCommand_BuildPlan(), BattleCommand_SelectAutomatic(), BattleEnemy_LetterFirstOfClass(), BattleEnemy_RecordDefeat(), BattleEnemy_ReleaseNameLetter(), BattleEvent_Playback(), BattleFx_RunBeamSequence(), BattleObjMake(), BattlePres_RunAttack(), BattleTarget_IsWeakToEffect(), BattleTarget_RunSelection(), BattleTarget_SelectForAction(), BattleTargetExec(), BattleUnit_BuildStatusFlags(), BattleUnit_GetEffectHeight(), BattleUnit_LookupWeaponValueByClass(), BattleUnitSet(), Enemy_GetAttackElement(), Item_CanOwnerEquipDirect(), Party_InitCharacters(), Summon_LayoutPositions(), SummonSlot_RegisterActorSprites(), Unit_CalcBaseElements(), Unit_GetElementLevel(), Unit_GetExperienceForLevel(), Unit_UpdateClass(), and UnitCalc().
| u8 BattleUnit::classIndex |
The character's class, worked out from its Djinn (Unit_UpdateClass); 0 marks an enemy, and code throughout tests it to tell the two apart.
Definition at line 246 of file battle_unit.h.
Referenced by Battle_AwardSpoils(), BattleCommand_BuildPlan(), BattleCommand_SelectAutomatic(), BattleEnemy_RecordDefeat(), BattleEnemy_ReleaseNameLetter(), BattleObjMake(), BattlePresentation_DispatchAction(), BattleTarget_IsWeakToEffect(), BattleUnitSet(), DjinnMenu_DrawStatPreview(), DjinnMenu_SelectDjinn(), DjinnMenu_ShowChangePreview(), Item_GetEquippedElement(), ItemMenu_DrawOwnerStatus(), Menu_DrawOwnerStatusPanel(), Owner_LevelUp(), PsynergyMenu_DrawListPage(), RollWeaponUnleash(), SaveState_BuildSummaryHeader(), SummonSlot_RegisterActorSprites(), Ui_RunOwnerStatusScreen(), Unit_CalcBaseElements(), Unit_GetExperienceForLevel(), Unit_RefreshPsynergy(), Unit_UpdateClass(), and UnitCalc().
| u8 BattleUnit::side |
BATTLE_UNIT_ABSENT (0), BATTLE_UNIT_ENEMY (1) or BATTLE_UNIT_PARTY (2).
Enemies 158 to 171 are put on side 2 (BattleUnitSet).
Definition at line 249 of file battle_unit.h.
Referenced by BattleActor_DestroyTemporaryObject(), BattleActor_RemoveFromLists(), BattleEnemy_LetterFirstOfClass(), BattleEvent_Playback(), BattleMotion_ShowDowned(), BattleParty_ListLivingUnits(), BattleParty_PrepareActiveOwners(), BattlePres_SetActorModeAndAction(), BattleTargetExec(), BattleUnitSet(), EnemySlotGet(), LinkBattle_ReceiveParty(), and LinkBattle_SendParty().
| s8 BattleUnit::guardLevel |
0, GUARD_DEFEND (1, half the damage) or GUARD_TOTAL_DEFENSE (2, a tenth); set by Defend and Granite, cleared each round.
Definition at line 252 of file battle_unit.h.
Referenced by BattleCommand_BuildPlan(), BattlePresentation_BuildActions(), BattleTargetExec(), and BattleUnit_ResetGuardLevels().
| s8 BattleUnit::elementLevels[4] |
A summon's boost to each element: the Djinn of that element the summon spent, adding (n * n + n) * 5 power (UnitCalc).
Cleared at the battle's start and by Break.
Definition at line 256 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), BattleUnit_ProcessTurnEnd(), Unit_GetElementLevel(), and UnitCalc().
| s8 BattleUnit::restraint |
The curse.
bits: 3 item effect 25 (UnitCalc clears it again with bit 0) | 2 keeps bit 0 | 1 cursed item equipped | 0 bound. UnitCalc rebuilds bits 1 and 0 from the equipment. A bound unit loses one action in four, except Defend (BattleCommand_BuildPlan); any bit set shows the curse in the status screens and lets the sanctum remove it.
Definition at line 262 of file battle_unit.h.
Referenced by BattleCommand_BuildPlan(), CharacterMenu_BuildAvailability(), Shop_CanServe(), Ui_RunOwnerStatusScreen(), and UnitCalc().
| s8 BattleUnit::poison |
1 poisoned, 2 deadly poison
Definition at line 263 of file battle_unit.h.
Referenced by Battle_ApplyPresetItemsAndFlags(), BattleActor_ResetRuntimeFields(), BattleEffect_ApplyToTargets(), BattleFx_RollSuccess(), BattleParty_ApplyStatusDamage(), BattleTarget_RunSelection(), BattleTargetExec(), BattleUnit_BuildStatusFlags(), BattleUnit_ProcessTurnEnd(), BattleUnit_ResetStateByMode(), CharacterMenu_BuildAvailability(), Colosso_ControlCharacterAlone(), Field_ProcessStep(), Party_RemoveOwnerRestored(), Party_RestoreHpPp(), Shop_CanServe(), and Ui_RunOwnerStatusScreen().
| u8 BattleUnit::attackTurns |
Each stat change: the turns it has left, and its stage (UnitCalc: an eighth of Attack, Defense or Agility, or 20 Resistance, a stage).
Stages run -4 to 4 and last 7 turns.
Definition at line 268 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), BattleUnit_TickAttackModifier(), and Ui_RunOwnerStatusScreen().
| s8 BattleUnit::attackStage |
Definition at line 269 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), BattleUnit_TickAttackModifier(), Ui_RunOwnerStatusScreen(), and UnitCalc().
| u8 BattleUnit::defenseTurns |
Definition at line 270 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), and Ui_RunOwnerStatusScreen().
| s8 BattleUnit::defenseStage |
Definition at line 271 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), Ui_RunOwnerStatusScreen(), and UnitCalc().
| u8 BattleUnit::resistanceTurns |
Definition at line 272 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), and Ui_RunOwnerStatusScreen().
| s8 BattleUnit::resistanceStage |
Definition at line 273 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), Ui_RunOwnerStatusScreen(), and UnitCalc().
| u8 BattleUnit::delusion |
Delusion to sleep: the turns each status has left, 7 when it lands; each may end sooner at the end of a turn.
Sleep, confusion, charm and stun cost the unit its actions.
Definition at line 279 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleCommand_BuildPlan(), BattleFx_RollSuccess(), BattleParty_ResetActiveRuntimeFields(), BattleTarget_RunSelection(), BattleTargetExec(), BattleUnit_BuildStatusFlags(), and Ui_RunOwnerStatusScreen().
| s8 BattleUnit::confusion |
Definition at line 280 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleFx_RollSuccess(), BattleParty_ResetActiveRuntimeFields(), BattlePres_BuildUnitEntries(), BattleTargetExec(), and BattleUnit_TickConfusion().
| u8 BattleUnit::charm |
Definition at line 281 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleCommand_BuildPlan(), BattleFx_RollSuccess(), BattleParty_ResetActiveRuntimeFields(), BattlePres_BuildUnitEntries(), and BattleTargetExec().
| u8 BattleUnit::stun |
Definition at line 282 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleCommand_BuildPlan(), BattleFx_RollSuccess(), BattleParty_ResetActiveRuntimeFields(), BattlePres_BuildOpponentEntries(), BattlePres_BuildUnitEntries(), BattlePres_RunEscape(), BattlePres_SetActorModeAndAction(), BattleTarget_RunSelection(), BattleTargetExec(), BattleUnit_BuildStatusFlags(), and Ui_RunOwnerStatusScreen().
| u8 BattleUnit::sleep |
Definition at line 283 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleCommand_BuildPlan(), BattleFx_RollSuccess(), BattleParty_ResetActiveRuntimeFields(), BattlePres_BuildOpponentEntries(), BattlePres_BuildUnitEntries(), BattlePres_RunEscape(), BattlePres_SetActorModeAndAction(), BattleTarget_RunSelection(), BattleTargetExec(), BattleUnit_BuildStatusFlags(), and Ui_RunOwnerStatusScreen().
| u8 BattleUnit::psySeal |
bits: 7..3 Luff (16 when cast, minus 8 a turn) | 2..0 Bind's turns (7 when cast).
Psynergy is sealed while any bit is set.
Definition at line 287 of file battle_unit.h.
Referenced by Battle_AdvanceCounterAndCheckChance(), Battle_CollectPartyCommands(), BattleActor_ResetRuntimeFields(), BattleCommand_BuildPlan(), BattleCommand_SelectAutomatic(), BattleFx_RollSuccess(), BattleMenu_RunActionSelection(), BattleParty_ResetActiveRuntimeFields(), BattleTarget_RunSelection(), BattleTargetExec(), BattleUnit_BuildStatusFlags(), and Ui_RunOwnerStatusScreen().
| u8 BattleUnit::refrain |
Regenerate's turns left, 7 when cast.
Definition at line 288 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), and BattleUnit_TickRefrain().
| s8 BattleUnit::reflect |
Reflect's turns left, 7 when cast.
Definition at line 289 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), and BattleUnit_TickReflect().
| u8 BattleUnit::haunt |
set while an evil spirit grips the unit
Definition at line 290 of file battle_unit.h.
Referenced by Battle_ApplyPresetItemsAndFlags(), BattleActor_ResetRuntimeFields(), BattleTarget_RunSelection(), BattleTargetExec(), BattleUnit_BuildStatusFlags(), BattleUnit_ResetStateByMode(), CharacterMenu_BuildAvailability(), Party_RestoreHpPp(), Shop_CanServe(), and Ui_RunOwnerStatusScreen().
| u8 BattleUnit::grimReaper |
The Grim Reaper's countdown: 7 when cursed, down one at each turn's end; at 0 the unit falls.
Definition at line 293 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleFx_RollSuccess(), BattleParty_ResetActiveRuntimeFields(), BattleTarget_RunSelection(), BattleTargetExec(), BattleUnit_BuildStatusFlags(), BattleUnit_ProcessTurnEnd(), and Ui_RunOwnerStatusScreen().
| u8 BattleUnit::equipBonus[2] |
The totals of equipment effects 23 (unleash chance) and 24 that UnitCalc sums; TBS never reads them back.
Definition at line 296 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), and UnitCalc().
| u8 BattleUnit::ready |
Kite's extra action: 2 when cast, down one at each turn's end; while nonzero UnitCalc gives the unit one more action a round.
Definition at line 299 of file battle_unit.h.
Referenced by Battle_ProcessRoundEnd(), BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), and UnitCalc().
| u8 BattleUnit::immobile |
set by Ground: the next action is lost
Definition at line 300 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleCommand_BuildPlan(), BattleParty_ResetActiveRuntimeFields(), BattlePres_SetActorModeAndAction(), and BattleTargetExec().
| u8 BattleUnit::agilityTurns |
the Agility change's turns left, 5 when cast
Definition at line 301 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), and BattleUnit_TickAgilityModifier().
| s8 BattleUnit::agilityStage |
The Agility stage: -4 (Vine) to 8 (Zephyr, twice the Agility).
Definition at line 303 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleParty_ResetActiveRuntimeFields(), BattleTargetExec(), BattleUnit_TickAgilityModifier(), Ui_RunOwnerStatusScreen(), and UnitCalc().
| s8 BattleUnit::challenge |
Set by the challenge effect: an enemy with it never chooses to flee.
Definition at line 305 of file battle_unit.h.
Referenced by BattleActor_ResetRuntimeFields(), BattleCommand_SelectAutomatic(), BattleParty_ResetActiveRuntimeFields(), and BattleTargetExec().
| u8 BattleUnit::unk149 |
Not named by any TBS code.
Definition at line 306 of file battle_unit.h.
| u16 BattleUnit::enemyId |
Not named by any TBS code; TLA reads it as the unit's id.
Definition at line 307 of file battle_unit.h.