Count number of targets hit by ability

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Parameters : r4 = misc attacker data 0x18e

Returns: r2 = Target/Hit counter

Store : List of Targets ID at Attacker misc data 0x18e to 0x19d (from list at 0x80193868 )
--------------------------------------------------------------------------------------------------
0018ee24: 00002821 addu r5,r0,r0            |r5 = 0x00
0018ee28: 00001821 addu r3,r0,r0            |r3 = 0x00
0018ee2c: 340600ff ori r6,r0,0x00ff         |r6 = 0x00ff
0018ee30: 3c018019 lui r1,0x8019            @LOOP
0018ee34: 00230821 addu r1,r1,r3                 |r1 = 0x8019 0000 + loop counter
0018ee38: 90223868 lbu r2,0x3868(r1)             |r2 = this iteration Targeted unit ( 0x80193868 + loop offset)
0018ee3c: 00000000 nop                           |
0018ee40: a0820000 sb r2,0x0000(r4)              |Store targeted unit ID in Attacker misc data 0x18e (+loop offset)
0018ee44: 10460002 beq r2,r6,0x0018ee50          #if This iteration target ID = 0xff
0018ee48: 24840001 addiu r4,r4,0x0001            |r4 = Attacker misc data offset counter (+0x01 each iteration)
0018ee4c: 24a50001 addiu r5,r5,0x0001                |r5 = Target counter
0018ee50: 24630001 addiu r3,r3,0x0001            |r3 = Loop counter + 1
0018ee54: 28620010 slti r2,r3,0x0010             |r2 = 0x01 while counter < 0x10
0018ee58: 1440fff5 bne r2,r0,0x0018ee30     Λ Loop 0x10 times (size of list on 0x80193868 )  contains only 0x10 units (0x14 targets available)
0018ee5c: 00000000 nop                           |
0018ee60: 03e00008 jr r31                   >>END
0018ee64: 00a01021 addu r2,r5,r0            |return r2 = Target/Hit counter

Return location

 0017d0e0: Main_ability_loading_routine?