src/battle/battle_action.c
An action announced and built for its targets, btActionRunBuild, with whether a unit is in its side's list and how many Djinn a side has on standby. More…
Included by battle.c.
Macros
| Name | Description | |
|---|---|---|
#define | RANGE_WHOLE_SIDE 11 | A range that reaches every place of a side from any of them: Dazzle's. |
#define | EFFECT_CHANCE_FULL 100 | gmBattleRollEffectSuccess's successScale at full strength, in percent. |
Enumerations
| Name | Description | |
|---|---|---|
enum | ACTION_CHANCE { CHANCE_DELUDED_MISS, CHANCE_BLOW_LIKELY, CHANCE_BLOW_RARE, C … } | The chances, out of 256, an action rolls against the battle's random byte. |
Functions
| Name | Description | |
|---|---|---|
Uint32 | btUnitIsListed (Uint32 unitId) | Returns 1 when the unit is in its side's list of units in the battle (btUnitListIds), 0 otherwise. |
Sint32 | btDjinnCountStandby (Uint32 unitId, Uint8 *counts) | Counts the standby Djinn on unitId's side, and each element's count into counts when it is not null. |
Sint32 | btActionRunBuild (BATTLE_ACTION_RECORD *request, BATTLE_PLAN *plan) | Announces the action and builds it for its targets, paying its PP or Djinn. |
Description
An action announced and built for its targets, btActionRunBuild, with whether
a unit is in its side's list and how many Djinn a side has on standby. Part
of battle.c.
Macros in detail
RANGE_WHOLE_SIDE
#define RANGE_WHOLE_SIDE 11
A range that reaches every place of a side from any of them: Dazzle's.
Referenced by btActionRunBuild().
Definition at line 72 of file battle_action.c.
EFFECT_CHANCE_FULL
#define EFFECT_CHANCE_FULL 100
gmBattleRollEffectSuccess's successScale at full strength, in percent.
Referenced by btActionRunBuild().
Definition at line 86 of file battle_action.c.
Enumerations in detail
ACTION_CHANCE
enum ACTION_CHANCE
The chances, out of 256, an action rolls against the battle's random byte.
| Enumerator | Value | Description |
|---|---|---|
CHANCE_DELUDED_MISS | 153 | a deluded attacker misses |
CHANCE_BLOW_LIKELY | 153 | a likely double or triple blow lands |
CHANCE_BLOW_RARE | 32 | a rare one |
CHANCE_BLOW | 64 | any other |
CHANCE_VENGEANCE_EXTRA | 179 | Vengeance strikes one more time or two |
CHANCE_VENGEANCE_TWICE | 128 | of those, two more |
Definition at line 75 of file battle_action.c.
Functions in detail
btUnitIsListed
Uint32 btUnitIsListed(Uint32 unitId)
Returns 1 when the unit is in its side's list of units in the battle
(btUnitListIds), 0 otherwise.
References btUnitListIds() and Sint32.
Referenced by btActionRunBuild(), btDjinnRecoveryCountDownSide(), btProcessTurnEnd(), btScriptedBattleRestoreUnits(), btScriptedBattleSaveUnits() and btStagingBuildTargetList().
Definition at line 7 of file battle_action.c.
btDjinnCountStandby
Sint32 btDjinnCountStandby(Uint32 unitId, Uint8 *counts)
Counts the standby Djinn on unitId's side, and each element's count into counts when it is not null.
References btUnitListIds(), gmDjinnGetRecoveryTableStub() and Sint32.
Referenced by btActionRunBuild() and btAIChooseAction().
Definition at line 30 of file battle_action.c.
btActionRunBuild
Sint32 btActionRunBuild(BATTLE_ACTION_RECORD *request, BATTLE_PLAN *plan)
Announces the action and builds it for its targets, paying its PP or Djinn.
Returns 0 to stage it, ACTION_REPORTED when it failed with its message shown,
or ACTION_NOTHING_TO_SHOW.
References AbilityBattleEffects, AbilityStaging, ActionRunEffectChance, btAbilityIsPsynergy(), btAIChooseRandomTarget(), btDjinnCountStandby(), btElementGlowPlay(), btGetUnitAtPlace(), btHighlightSetModes(), btMessageWaitForAdvance(), btMessageWaitForTyping(), btObjectGet(), btPlaybackPush(), btPlaybackReset(), btPlaybackRunAll(), btPlaybackSchedulePhase(), btPlaybackWaitForReady(), btSpriteGetAttackEffect(), btUnitFindStrongestAlly(), btUnitGetPartyAttackEffect(), btUnitIsListed(), DebugMode, fdActorSelectAnimationStub(), fdActorSetAnimationSpeedStub(), gmAbilityGetDefinitionStub(), gmBattleIsReviveEffectStub(), gmBattleRandomStub(), gmBattleRollEffectSuccessStub(), gmDjinnCanSetStub(), gmDjinnGetAbilityIdStub(), gmDjinnGetRecoveryTableStub(), gmDjinnIsSetStub(), gmDjinnRecoveryAddStandbyStub(), gmDjinnRecoveryRemoveStub(), gmDjinnSetStub(), gmEquipmentGetUnleashRateBonusStub(), gmEquipmentRollUnleashStub(), gmInventoryGetEquippedItemStub(), gmItemGetDefinitionStub(), gmSummonDefinitionGetNearStub(), gmUnitAddHpStub(), gmUnitCalculateStub(), gmUnitGet(), gmUnitGetAttackElementStub(), gmUnitRecalculateGaugesStub(), mnBattleMessageShowAndWaitStub(), mnMessageArgumentClearAllStub(), mnMessageArgumentPushStub(), PerWork, Sint32 and 3 more.
Referenced by btStagingDispatchAction().
Definition at line 91 of file battle_action.c.