Difference between revisions of "Save Fading Life - Auto Battle (00198df0)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
 +
Description:
 +
The default AI routine, and thus the most simplistic of the Auto Battle Routine.
 +
If one of it's own units are not in peril, then it hands control over to the Non-Specific AI Auto Battle Routine, which is the catch all AI routine.
 +
If it does find a unit in peril, it exits and hands over control to the Protect Allies routine.
 +
 +
Referenced In:
 +
[[Auto Battle Handling]]
 +
 +
Routines Used:
 +
[[Find Peril Most Unit (00198b04)]]
 +
[[Non-Specific AI AutoBattle (Enemies)]]
 +
 
  00198df0: 3c02801a lui r2,0x801a
 
  00198df0: 3c02801a lui r2,0x801a
 
  00198df4: 90420d7b lbu r2,0x0d7b(r2) load skillset/usage byte
 
  00198df4: 90420d7b lbu r2,0x0d7b(r2) load skillset/usage byte

Latest revision as of 23:09, 8 March 2017

Description:
The default AI routine, and thus the most simplistic of the Auto Battle Routine.
If one of it's own units are not in peril, then it hands control over to the Non-Specific AI Auto Battle Routine, which is the catch all AI routine.
If it does find a unit in peril, it exits and hands over control to the Protect Allies routine.
Referenced In:
Auto Battle Handling
Routines Used:
Find Peril Most Unit (00198b04)
Non-Specific AI AutoBattle (Enemies)
00198df0: 3c02801a lui r2,0x801a
00198df4: 90420d7b lbu r2,0x0d7b(r2)				load skillset/usage byte
00198df8: 27bdffe8 addiu r29,r29,0xffe8
00198dfc: 1440000f bne r2,r0,0x00198e3c				Branch if usage has been set
00198e00: afbf0010 sw r31,0x0010(r29)
00198e04: 0c0662c1 jal 0x00198b04					Find Unit in Highest Peril
00198e08: 00000000 nop
00198e0c: 10400005 beq r2,r0,0x00198e24				Branch if no unit is in enough peril
00198e10: 3402000e ori r2,r0,0x000e
00198e14: 3c01801a lui r1,0x801a
00198e18: a0220d7a sb r2,0x0d7a(r1)					0x0e = Unit is saving another unit
00198e1c: 08066394 j 0x00198e50
00198e20: 2402fffe addiu r2,r0,0xfffe				Return -2
00198e24: 3c02801a lui r2,0x801a
00198e28: 8c420bbc lw r2,0x0bbc(r2)					Acting unit data
00198e2c: 00000000 nop
00198e30: 904401b9 lbu r4,0x01b9(r2)				Targeted Unit
00198e34: 0c065243 jal 0x0019490c					Store main target ID and focus on target flag
00198e38: 00000000 nop
00198e3c: 0c065867 jal 0x0019619c					Non-Specific AI AutoBattle (Enemies)
00198e40: 00000000 nop
00198e44: 00021027 nor r2,r0,r2						
00198e48: 2c420001 sltiu r2,r2,0x0001
00198e4c: 00021023 subu r2,r0,r2					Return -1 or 0
00198e50: 8fbf0010 lw r31,0x0010(r29)
00198e54: 27bd0018 addiu r29,r29,0x0018
00198e58: 03e00008 jr r31
00198e5c: 00000000 nop