Non-Specific AI AutoBattle (Enemies)

From Final Fantasy Hacktics Wiki
(Redirected from 0019619c - 0019629c)
Jump to navigation Jump to search
Non-Specific AI AutoBattle (Enemies)
*Note: 0x1f1 is the same as 0xe2d
0019619c: 3c02801a lui r2,0x801a
001961a0: 90420d7b lbu r2,0x0d7b(r2)				load skillset/usage byte
001961a4: 27bdffe8 addiu r29,r29,0xffe8	
001961a8: afb00010 sw r16,0x0010(r29)	
001961ac: 3c10801a lui r16,0x801a	
001961b0: 2610f3c4 addiu r16,r16,0xf3c4	
001961b4: 1040000a beq r2,r0,0x001961e0				branch if none set
001961b8: afbf0014 sw r31,0x0014(r29)	
001961bc: 3c03801a lui r3,0x801a	
001961c0: 90630299 lbu r3,0x0299(r3)				load Ability Use Ruling
001961c4: 34020004 ori r2,r0,0x0004
001961c8: 10620008 beq r3,r2,0x001961ec				<Movement> if 4
001961cc: 34020002 ori r2,r0,0x0002
001961d0: 1062000f beq r3,r2,0x00196210				<Charging> if 2
001961d4: 00000000 nop
001961d8: 08065894 j 0x00196250						Else <Choose Current Ability>
001961dc: 00000000 nop
no skillset usage set
001961e0: 34020001 ori r2,r0,0x0001
001961e4: 3c01801a lui r1,0x801a
001961e8: a02201f1 sb r2,0x01f1(r1)					Ability Decided = True (0x1f1 = 0xe2d)
001961ec: 0c0658e3 jal 0x0019638c					Map movement decision/data setting
001961f0: 00000000 nop		
001961f4: 2403ffff addiu r3,r0,0xffff		
001961f8: 1043001a beq r2,r3,0x00196264				Branch to Ability Ruling if needed position cannot be reached
001961fc: 34020004 ori r2,r0,0x0004					Can't move into position
00196200: 0c0658c3 jal 0x0019630c					Find and Invert Target Priority?
00196204: a2000e2d sb r0,0x0e2d(r16)				Ability Decided = False		
00196208: 34020001 ori r2,r0,0x0001		
0019620c: a2020e2d sb r2,0x0e2d(r16)				Ability Decided = True
		
00196210: 0c0657e3 jal 0x00195f8c					Set/Remove Charging
00196214: 00000000 nop
00196218: 00401821 addu r3,r2,r0
0019621c: 2402ffff addiu r2,r0,0xffff
00196220: 10620010 beq r3,r2,0x00196264				Ability Ruling because RNG said so
00196224: 34020002 ori r2,r0,0x0002					RNG said no (taking too long to decide?)
00196228: 34020001 ori r2,r0,0x0001
0019622c: 10620017 beq r3,r2,0x0019628c				Exit if lower than the current Highest Priority
00196230: 00001021 addu r2,r0,r0
00196234: 34020001 ori r2,r0,0x0001
00196238: a2020e2d sb r2,0x0e2d(r16)				Ability Decided = True?
0019623c: 00002021 addu r4,r0,r0					Set Look for any unit
00196240: 0c065f43 jal 0x00197d0c					Find which units are active
00196244: 00002821 addu r5,r0,r0					Set Look for self
00196248: 10400009 beq r2,r0,0x00196270				Branch if no units are active
0019624c: 00000000 nop
<Choose Current Ability>		
00196250: 0c065f98 jal 0x00197e60					Decide if AI will choose Ability(Chose move from movelist)
00196254: 00000000 nop		
00196258: 2403ffff addiu r3,r0,0xffff		
0019625c: 14430004 bne r2,r3,0x00196270				<Transfer Data Randomly> if AI choose to use this ability
00196260: 34020007 ori r2,r0,0x0007					Chose not to use ability
<Ability Ruling>
00196264: a2020ed5 sb r2,0x0ed5(r16)				Save Ability Ruling (Denied by Frame Data, Can't move into position, Chose not to use ability)
00196268: 080658a3 j 0x0019628c						Exit and return -1
0019626c: 2402ffff addiu r2,r0,0xffff
<Transfer Data Randomly>
00196270: 0c065c2f jal 0x001970bc					Transfer Data based on RNG
00196274: 00000000 nop		
00196278: 14400004 bne r2,r0,0x0019628c				Exit and return 0 if successfully transfered data
0019627c: 00001021 addu r2,r0,r0		
00196280: 0c066526 jal 0x00199498					Reset Ability Choice Data? (Target Flags?)
00196284: a2000e2d sb r0,0x0e2d(r16)				Ability Decided = False
00196288: 00001021 addu r2,r0,r0
0019628c: 8fbf0014 lw r31,0x0014(r29)
00196290: 8fb00010 lw r16,0x0010(r29)
00196294: 27bd0018 addiu r29,r29,0x0018
00196298: 03e00008 jr r31
0019629c: 00000000 nop