Repository navigation
Battle System
What the matched code tells about battle: the character pool, Kizuna, the Blade-change cooldown, arts and recast, specials, chain attacks, elemental combos, hate, reactions and defence, buffs, and the battle AI script plumbing. Namespace btl, folder src/application/BF2/battle/ (shortened B/ below), with some rules in gf.
How much is known. Of about 1,500 btl:: functions about 1,070 are matched, but the core runtime logic is mostly not decompiled yet: damage calculation, hate selection, the chain attack's turn flow, the Blade-change and special-attack procedures, and the balance table loader. What exists is accessors, data structures, small formulas, BDAT readers and some state machines. Sections end with a "not decompiled" list where it matters, with addresses and sizes. Snapshot: main at commit a313ecb66. Reading guide: Home. Member names in the source are unknownXX with inferred roles; wherever this page leans on one, it says "inferred".
- Battle logic lives in a handful of singletons, not in
BattleManageritself (it is only 0x18 bytes):BattleGlobal,DataManager,CharacterManager,ChainAttackManager,SpAttackManager,BladeArtsManager,BladeChangeManager,HateRingManager, UI, talk and effect managers (B/battle_manager.h). - Every frame
BattleManager::Updateruns only when battle is enabled (set by the map-jump event), checks game over, plays the "player dead" sequence once when allowed, accumulates battle time in 1/15 s ticks, then checks battle state and target mode (B/battle_manager.cpp).postUpdatecallsDataManager,BattleGlobalandCharacterManagerin that order. - Much of the tuning is read from BDAT tables with prefix
BTL_(see BDAT-Data) and from a "system balance" table (BtlSystemBalanceAccess) whose loader is not decompiled yet. That table is indexed by number in the matched code (BtlSystemBalance[0xea], ...), so its individual meanings are mostly unknown. - A frame is 1/30 s (
FRAME_TO_SECOND,B/utility_battle.cpp): time values in the tables are in frames.
-
Slots. 90 battle character slots (
CHARACTER_COUNT): 0 to 19 are the player side (CHARACTER_PLAYER_COUNT= 20), 20 to 89 the enemy side (CharacterManager,B/character/character_manager_battle.h). Player-side slots hold both drivers and Blades;IsExistAlivePlayerskips Blades.DataManagerholds 18 player and 70 enemy parameter objects. -
Parties. 3 party groups (
PARTY_COUNT), each with 5 Blade slots (GROUP_DATA,B/group_data.h). Indices 0 to 2 are the driver's equipped Blades; indices 3 and 4 are the two forms of the special Blade pair that shares a gauge (the repository's constantsBLADE_HOMURAandBLADE_HIKARI). -
Ids. Battle AI ids are a separate space: players 0 to 2, enemies
100 + n(Utility::AI_ConversionID_AItoBtl). Enemy groups: 35 slots, handed out asindex + 3(DataManager::RegisterEnemyGroup). -
Attributes. Attribute ids 1 to 8, 0 = none, 9 = "no attribute" in attack data. The opposite-attribute table is
{1:2, 2:1, 3:6, 4:5, 5:4, 6:3, 7:8, 8:7}(Utility::GetAntiAttribute). Together with the idea mapping in Blade-Creation (idea 0 covers attributes 1 and 2, idea 1 covers 3 and 6, ...), this shows that attribute pairs are opposites. An enemy's weak-attribute bit is1 << opposite(attribute)(CharacterParameter::GetWeakAttributeFlag). The element names for the ids are the repository's inference (fire, water, wind, earth, electric, ice, light, dark); the names are not in the code. -
Map revision of driver stats (
BattleGlobal::UpdateMapRev,B/battle_global.cpp): wheneverGfGameUtil::getAntiBladeAreaBdatId()changes, the game rebuilds a per-driver override from theBTL_MapRevtable. Area 0 resets every driver to defaults: Kizuna cap 1000, special level max 4, support enabled, attack and defence 100%. Otherwise, for 9 drivers (BDAT ids 1 to 9), a driver whose bit in the area'sFlagcolumn is set getsKizunaCap,ArtSp(maximum special level),PC%02dAtkandPC%02dDef(percent), and support is enabled unless thenbaflag is set; a driver whose bit is clear gets the defaults. [INFERENCE] The area id name ("anti-blade area") and thenbaflag suggest areas where Blade-related power is restricted.
KIZUNA_GAUGE_DATA in B/group_data.h / group_data.cpp.
-
Range. The gauge runs 0 to 1000 (
KIZUNA_GAUGE_MAX), and a "gauge rate"value * 0.001is kept next to it. There are 7 stages (0 to 6; 7 means "recompute"). -
Setting the gauge (
SetGauge): a lock flag stops it from increasing; the value is clamped to the cap; a value<= 0sets everything to 0 and raises a "reached zero" flag when the gauge was above 0; a value>= 1000stops at 999 (rate 0.999) unless the "permit max" flag (inferred role) is set, in which case it becomes exactly 1000 and raises "reached max" once. So the full gauge is only reachable when that flag is on. -
Cap.
SetKizunaMax(n)clamps the cap to 0 to 1000 and re-clamps the gauge. The cap at setup is the map revision'sKizunaCap(default 1000). -
Initial value.
GROUP_BLADE_DATA::Initializetakes the Blade's personality (1 if 0), readsKizunaBasefromBTL_Bl_Personalityfor it, thenResetGaugesets the gauge toKizunaDefofBTL_Bl_KizunaBase[KizunaBase]plus the pouch-buff Kizuna parameter of that party slot (for driver indices below 3). -
Stage ranges.
Misc::GetKizunaMinMax(stage)reads row7 - stageofBTL_Kizuna(columnsKizunaMin,KizunaMax): stage 6 is row 1 and stage 0 is row 7. The function that maps a gauge value to a stage,Misc::GetKizunaStage(0x7100084430), is not decompiled, so the thresholds are not in the code read here. -
Effects of the stage. The special attack needs the active Blade's Kizuna stage to be 6 (
IsEnableRecastSpAttack,B/character/battle_character.cpp); a chain attack start raises every initialised Blade's gauge to at least 300 (ChainAttackManager::RecoveryKizuna). -
Link set.
GfGameUtil::getKizunaLink(blade)(gf_game_util.cpp) reads theBTL_Bl_KizunaLinkSetcolumnsLinkChType,LinkChNum,KizunaLink1,KizunaLink2: type 0 always gives link 1, type 1 gives link 2 when the Blade's trust rank is at leastLinkChNum(else 1), type 2 gives link 2 when the game conditionLinkChNumholds (else 1), any other type gives 0. - Not decompiled:
AddGauge(0x7100080118), the buddy and reserve update functions,Misc::GetKizunaStage.
-
Trust points and ranks (
GfGameUtil::addTrustPoint,getTrustRank,gf_game_util.cpp; data in Drivers-Blades-Party): points cap at 65535; the stored rank goes up to 16; the displayed rank clamps stored ranks above 6 (and below 16) to 6 and subtracts 1 from a rank above 1 when the Blade is used by a driver who is not its creator. Between 6 and 15 the rank rises whileFLD_IdeaTable.TrustPoint[rank]is at most the total points, but only if the Blade's achievements are complete. -
In battle,
BattleCharacter::FluctuateTrust(type, level)readsBTL_Bl_TrustUp.Point[type]; type 1 applies to every living friendly non-Blade character, any other type to the character alone.AddTrustonly applies to Blade ids 1001 to 1999 and only iflevel >= playerLevel - BtlSystemBalance[0xea]. -
Blade-change cooldown (
Utility::GetBladeCoolTime,B/utility_battle.cpp):- start from the Blade's
CoolTime(frames); - if the stored trust rank is non-zero, add the signed
FLD_IdeaTable.BladeChangeRev[rank](the raw stored rank, not the displayed one); - multiply by 1/30 to get seconds;
- gather enhance entries from the Blade's equipped orbs and from the enhance of each of its three skills at skill level minus 1; for every entry whose effect type is
0x100, addparam * 0.01to a reduction; - if the reduction is not 0, multiply the time by
max(1 - reduction, 0). So cooldown-reduction enhances add up and the result bottoms out at 0. Only driver Blades (index below 3) get a cooldown; the special pair gets 0 (GROUP_BLADE_DATA::InitializeCoolTime). The counter advances throughGROUP_DATA::ProgressCoolTime, which skips the active Blade and uninitialised slots, and only while in battle and not in a chain attack (CharacterParameter::IsProgressCoolTime). The ratiocounter / cooltimeis clamped to 0 to 1.
- start from the Blade's
-
BladeChangeManager(B/blade_change_manager.cpp) tracks up to 10 simultaneous changes (driver, Blade, target Blade, effect, progress, step, timer, type, cancel state). Types 0 = normal and 3 to 5 = the special pair's types (inferred). The procedures that run a change (BladeChangeProc,HomuraChangeProc,ForceHikariProc,StartBladeChange) are not decompiled (0x710001212c,0x7100012b98,0x710001370c,0x7100014168).
-
Slots (
ARTS_SLOT_DATA,B/arts_data.h): arts id, data type (driver, Blade, enemy, Blade special), slot, level 1 to 6, a recast ratio 0 to 1, a lock flag and six per-level recast frame counts.AddRecast(amount, isRate)converts the amount to frames (frames * amountfor a rate), clamps the current recast to[0, frames]; a slot with 0 recast frames is ready at once; a locked or empty slot adds nothing. Becoming ready for the controlled character raises tutorials (driver arts ready, Blade arts ready, special level 3). -
Start recast.
ResetRecast(isStart)sets the ratio to 0, or topercent * 0.01when the arts has a start-recast percent (7 bits). -
Palette (
ARTS_PALETTE_DATA): 19 arts slots (0 to 15 normal, 16 to 18 "talent"), a separate level-4 special slot reached by slot id 15 (SP_ATTACK_LEVEL_4_SLOT) and 3 support slots. One mode ofAddArtsRecastfills slots in order and carries the remainder over; otherwise every slot but one excluded slot receives the amount. -
Chain recast bonus (
BattleCharacter::AddBladeArtsRecast(chain, rate)): applied to the Blade (the driver redirects to its Blade), skipped during a chain attack; the amount isBTL_SpArtsRecast.Param[chain](orParam2for a non-controlled player Blade with enhance 0x146 above 0); recast added to all slots is(rate + 1) * param, an absolute value.SuccessChain(chain)addsSatisfyEnhanceCondition(0xb0)asrate. -
Hit weighting.
ARTS_DATA::GetHitWeightRate(hit)(up to 16 hits):min(hitRate / totalRate, 1), divided by the loop count if above 1, by the bullet count if above 1, and, if a bullet id is set, multiplied by1 / (BTL_Bullet.AddAtkNum + 1). The damage rate of an arts level isLEVEL_DATA.damage_margin * 0.01. -
Registering Blade arts (
BladeArtsManager::RegisterBladeArts, up to 10 procs) fails unless battle is enabled (or forced), the three objects exist, neither the driver nor the Blade is already registered, neither is in a Blade change (unless a flag allows), neither is in a special attack, the arts is usable, and fewer than 10 procs run. -
Normal attack damage (gf side,
DataObjBlade::getNorAtkDmgMin/Max,src/application/BF2/gf/data/gf_data_obj.cpp): base =weaponDamage * FLD_IdeaTable.WpnRatio[storedTrustRank] * 0.01; minimumbase * (1 - stability * 0.01), maximumbase * (1 + stability * 0.01)(weapon fields of the equipped weapon); the driver adds its Strength to both. -
Driver stat caps (same file): HP 9999; Strength, Ether, Dexterity, Agility, Luck 999; level 99. Stat steps: flat enhance effects add first, then percent enhances, then the stat's own
Revpercent, then the cap. - Not decompiled:
BladeArtsProc(0x7100010fdc),StartButtonChallenge,ActionBladeArts(0x710003a34c, 10,716 bytes).
SpAttackManager (B/sp_attack_manager.cpp): up to 5 procs; slot 15 = none; movie steps NONE, WAIT_ANIMATION, CREATE, LOAD, PLAY, END. The special level is slot + 1, or 4 for slot 15. BattleCharacter::IsEnableRecastSpAttack requires, for a Blade: the special slot holds an arts and is not locked; if a player, it belongs to the controlled group; not in a Blade change; no chain attack; and for the ordinary Blades the group's Kizuna stage equal to 6 (two specific Blades have their own conditions: one needs a global flag, the other needs game condition 15); and a group flag (role unknown). A "request permit" mechanism (DataManager::RequestPermit) stores the next elemental combo id and stage for a target, and the arts attack is only allowed if the group flags carry the permit bits. Not decompiled: UpdateProc, RegisterSpAttack (0x7100088354), ActionSpAttack (0x710003db38, 11,508 bytes).
ChainAttackManager (B/chain_attack_manager.cpp). Matched: states and queries, damage multiplier, bonus, party-gauge links. The turn selection, results and the whole flow are not decompiled (UpdateProc, 0x7100018838, 10,496 bytes).
-
States:
NONE0,START_WAIT1 (range 1 to 3),SELECT_ACTION9 (also the time-stop state),RESULT51 (and above). -
Damage multiplier. An integer
unknown19ccis clamped to[1783, 11782]and the multiplier isNextFloat((value - 1783 + 100) * 0.01)(DAMAGE_RATE_MIN,DAMAGE_RATE_MAX,GetDamageRate): ×1.00 at the floor, ≈ ×100.99 at the ceiling, +0.01 per step; 1.0 when no chain runs.AddDamageRateonly counts while the state is between 1 and 50. -
Bonus rate.
GetBonusRate() = NextFloat(BtlSystemBalance[0x76] * 0.01), 0 when no chain runs or when the state is in the result range and the bonus timer is at least 0.2. -
Chain time.
BattleCharacter::GetChainSec() = BtlSystemBalance[0x68] / 30, plus that value times a rate ifSatisfyEnhanceCondition(0x147) > 0. -
Participants. Up to 3 groups with a current-turn index; per group 3 Blade slots with recast and a special level;
RecoveryRecastAll(r)addsrto each slot, clamped to 0 to 1. A required attribute order of up to 9 entries is read in sequence (GetAttrOrder). -
Resist break.
GetResistantAttrBreakDamage(attr)(only in a chain): 0 for an invalid attribute, 1 when there is no opposite, otherwise 2 when the enemy's resist bit mask contains the opposite attribute, else 1. During a chain the involved characters take no damage (IsNoDamage). -
Party gauge.
GfGameParty::getPartyGauge/setPartyGaugestore a u16 with maximum 300 (PARTY_UNKNOWN_300). Elemental-combo stage 1 fires party-gauge event 10 and stage 2 fires event 11. Enemies flaggedPGMaxin their arrangement set the gauge to its maximum when battle starts; the controlled character dying outside battle sets it to 0.
ElementalComboManager (B/character/elemental_combo_manager.cpp) per character; combo flow data in BattleGlobal::InitializeElementalComboFlowData (B/battle_global.cpp).
-
Flow table.
BTL_ElementalComboprovides, per combo,PreCombo(the combo that must come before),ComboStageandAtr(attribute).NeedAtrNumgives, for each following combo, how many elemental orbs of the attribute are needed. At load,InitializeElementalComboFlowDatabuilds for each combo the list of the next combos per attribute (next comboandneeded count). There areELEMENTAL_COMBO_NUMentries. -
Orbs. Each character has an orb value per attribute (0 to 8): value, ratio
value / max, timer, state, 20 recorded attack ids and damages. Orb capacity for a player isBtlSystemBalance[0x34](u8); enemies get 0. An orb is full at ratio at least 1. -
Starting a combo (
IsEnableElementalCombo,Burst): needs a full orb of the attribute; fewer than 3 combos running (ELEMENTAL_COMBO_COUNT= 3); the start-wait timer not above 0;GetNextElementalComboIDnon-zero; and a stage not above the allowed stage.Burstuses the requested combo id if the data manager holds a permit for this target, otherwise the next combo id; it uses the orb of the combo'sAtr, which must be full, and records the attack. -
Effects. The combo's
Effectstrings (BTL_ElementalCombo,BTL_ElementalEffect) go to the effect caster; the SE index iscombo + 79. A burst during a chain spawns effect packcmn_012_NNNwithattribute - 1. -
Enemy attributes.
EnemyParameter::GetAttribute: an overwrite attribute (at most 8) wins, otherwise the angry attribute applies while angry, otherwise the base attribute. A change notifies all player-side characters when the old attribute was below 9. - Not decompiled:
GetNextElementalComboID(0x710006e21c),AddElement,UpdateElement(0x710006f4e4, 2,920 bytes),ElementalComboDamage,ApplyElementalComboBonus.
HateRingManager (B/hate_ring_manager.cpp): a ring for each of 90 characters and 3 targets. SetData(enemyId, handle, targetParty) clears the ring on a negative target; on a target change the old target's driver and Blade get NotifyLostHateTarget and the new target's get NotifyGetHateTarget; a controlled character who gains hate hears a system sound. Enemy side (EnemyParameter::HATE_DATA): three entries (one per party member) with two hate floats (types 0 and 1), a rate and an empty flag; Set clamps to 0 or more and is ignored while a global flag (inferred "kakusei") is on; AddHate and MulHate apply to types 0 and 1. GetHateTarget returns the stored target only in battle. The rule that picks a target is not visible: EnemyParameter::HateProc (0x710006b008, 2,624 bytes), ResetHate and BattleCharacter::HateFluctuate are not decompiled. Angry spread: AngryInfection(range) makes every non-angry allied character within range + radius angry (permanent).
-
Reaction power (
BattleCharacter::GetReactionBlowParam): the target's size class (clamped, mapped toS, M, L, LL) and the reaction level pick the columnPowLv<level>_<size>ofBTL_Reactionin the row of the reaction id; a value of 0 gives rate 1.0, otherwisepercent * 0.01. Base blow vectors (horizontal, vertical) by reaction id: 1: (0.3, 0.6), 2: (0.1, 4.5), 4: (0, 1.05), 5: (0, 6.0), 6: (0, -9.0); other ids return false. Reaction names are not in the code; a negative vertical for id 6 suggests a downward slam [INFERENCE]. -
Priority.
IsPriorityReaction(a, b)comparesBTL_Reaction.Priority;awins at equal or higher priority; for the same reactionawins only for reactions 1 and 2. -
Blow (
SetBlow): default blow time 0.38 s; the vertical component is scaled by a ground-distance factor: 1.0 belowground + 2.7, 0.1 fromground + 10, and((10 - dh) * 0.11986301 + 0.125) * 0.9between; apex height is the landing height plusBtlSystemBalance[0xa6] * 0.01. -
Guard rate (
GetGuardRate):guard% * 0.01plus the sum of enhance effects0x79up to a last id that is0x79at full HP and0x82 - floor(hpRate * 10)below, so one more enhance tier opens per 10% HP lost. For a driver the result is 0 unless its Blade is on the field and in battle, the driver is not ignoring its buddy and buff0xeis inactive; then the rate is halved unless a group flag is set, with +0.5 during the Blade's attack. -
Critical damage.
GetCriticalDamageRate(flag) = NextFloat(balance[0x20] (or [0x24] whenflag) + enhance 0x2e). The base values live inBtlSystemBalanceAccess(loader not decompiled). -
Attack position (
CheckAttackPosition): angle between the target's facing and the vector to the attacker: 0 front, 3 behind (angle at least π minus half the arc), 1 or 2 sides. Position 3 raises the "back attack" achievement. -
No damage / super armour.
IsNoDamageis true for a no-damage timer, perfect-avoid states 10 and 15, invalid targets, and for players during a unite combo, elemental combo direction, special-attack camera or chain attack.IsSuperArmor(level)is true while a no-damage, super-armour, special attack, chain attack or awakening effect is on, otherwise it compares the armour level withlevel. -
Damage armour pools. Pouch damage armour
NextFloat(pouchPct * 0.01 * maxHP)computed once per battle per player is consumed first (SetupPouchDamageArmor,CalcDamageArmorEx); buff 5 is then a second absorb pool and is cleared when empty. -
Revive heal (
ReviveHeal): rate =BtlSystemBalance[0xe7] * 0.01 + enhance 0xa8 (self) + enhance 0xa9 (reviver), capped at 1.0 of max HP. Heal enhances use ids 0xac (healer) and 0xad or 0x108 (target) plus pouch bonuses. -
Stats (
CharacterParameter::GetSTR,GetDEX,GetAGI,GetLUK,GetEtherPower,GetPArmor,GetEArmor, ...):final = base + trunc(base * rate) + flat, where rate and flat come from the additional enhance effects; there are 20 enhance types (10 rate types then 10 flat types).GetMaxHPadds only the flat enhance. -
Valid dead enhances.
DataManager::IsValidDeadEnhanceaccepts exactly{0xa8, 0xc1, 0xc4, 0xf5, 0x14f, 0x173}. -
The damage path is not decompiled:
CalcDamage(0x710004e428, 7,376 bytes),NotifyDamage(0x7100050988, 8,896),GetDamageEnhanceRate,GetCriticalRate,GetHitEnhanceRate,GetAvoidEnhanceRate,DecideDamage,CheckResistReaction,SetReaction,SatisfyEnhanceCondition(0x7100020c88, 3,516),AttackProc(0x7100047088, 10,256). So no damage formula can be given yet.
- A parameter holds buff entries (id, remaining frames, effect value) and a bitset; a negative remaining count means infinite.
ClearAllBuffloops buff ids 1 to 22. A debuff mask inBattleGlobalmakesCheckDebuffflag the character if any flagged buff is active. -
BTL_Buffcolumns read:Effect(effect pack name) and flag bitsSEandBuff(picks the sound for a buff or a debuff). - Effect slots by buff id for drivers: ids 1 to 9 and 0x11 use slot 7, 0xb slot 8, 0xc slot 9, 0xd slot 10, 0xf slot 11, 0x10 slot 12; for Blades only 0xe uses slot 10 (
GetBuffEffectIndex). - "Power charge" (the function's own name, buff id 3): when active on a driver with a Blade, the attack's damage rate is multiplied by
1 + effect * 0.01; an infinite buff is cleared after use (CheckPowerCharge). - Pouch buffs (
DataManager::UpdatePouchBuff) use a 30.0 counter and are active while buff type 4 or 9 is positive for the member; types seen: 0 damage armour, 1 heal target bonus (inferred), 6 Kizuna, 12 timing counter. - Blade timers: modes 1, 2, 3 set the timer to 5.0,
BtlSystemBalance[0xaf],BtlSystemBalance[0xb0]; a higher mode overrides a lower one (StartBladeTimer).
ButtonChallenge (B/button_challenge.cpp): types DRIVER 0, BLADE 1, ENEMY 2, NONE 3; id 223 opens the "sequence" variant of the screen, any other id the normal one. A new request is rejected when it has lower priority than the open one; an open driver challenge is resolved with result 3 and cancelled first; the id counter wraps from -1 to 1. Enemy challenges set a battle pause bit that is cleared with the slow motion at the end. Enemy scripts raise one through Utility::AI_RegisterButtonChallenge(challenge, isSuccess) (refused unless in battle with no chain attack, arts, special or running challenge; id 0xdf if isSuccess, else 0xde), and read the result through AI_GetButtonChallengeResult (0 running, 1 success, 2 otherwise). The table BTL_BtnChallenge exists but no matched code reads it. A related "lever" minigame (BattleGlobal::InputLeverGachaButton): four button gauges; pressing a button sets its gauge to 1/3 and the others drop by 1/9; a button whose gauge is still above 0 is rejected, so the player must alternate buttons.
-
AiScriptDataManager::_initreads theBTL_AItable (BDAT id 0), columnScript, for up to 512 rows and keeps the non-empty names (B/ai/ai_script_data_manager.cpp).AiManager::regist(handle, id)starts the named script for an object (at most 128AiData);AiScriptManagerhas 32 script slots driven by a state machine (0 free, 1 start, 2 load, 3 running, 4 end, 5 reload;reloadis accepted only from 2 or 3) and passes the scripts toGfScriptManager. - Script-visible state (
AiData): 16 integer parameters and a frame counter that drops by one per update except during an arts action.isValid()is false when the AI sleeps, the character is the party leader, not in battle, or in arts, dead, Blade change, Blade arts, rescue or chain attack. - Script commands are
Utility::AI_*functions (B/utility_battle.cpp): queries (HP percent, level, attribute, combo ids, reaction, Kizuna stage, special level, counts of enemies and players, who targets me, kill count ...),AI_CheckState(handle, state)with states 0 to 15 (in battle, arts, reaction, dead, Blade change, Blade arts, special attack, rescue, chain attack, ..., in water, timer, can act, scouting), and actions (arts by slot or id, attack, Blade change, special attack, rescue, escape, turn, angry on/off, scout, super armour for a time, add Kizuna, add Blade-arts recast, play voice, many move variants). - The generic
aiLib(behaviour tree with Selector, Sequence, Parallel, Task, Decorator and Root nodes, andFsm/Hfsmstate machines insrc/libs/aiLib) is matched, but whether battle scripts use it is not shown. The title screen does useai::State(see Engine-Overview).
BattleManager::QuestTaskProc reads FLD_QuestBattle (ReduceEnemyHP, EnemyID, EnemyGroupID, ReducePCHP) to evaluate "reduce an enemy's HP below a value" and "reduce the player's HP" tasks (B/battle_manager.cpp).
Engine-Overview, Drivers-Blades-Party, BDAT-Data, Blade-Creation