Transfer Last Ability Used CT

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Parameters : r4 = Acting unit data pointer

Transfer Last Ability Used (Acting unit 0x170) CT (Ability data2 0x0c) in Attacker 0x18b (Ability CT)
-----------------------------------------------------------------------------------------------------
0005e778: 84830170 lh r3,0x0170(r4)         |r3 = Acting Unit's Last Attack Used ID
0005e77c: 00000000 nop                      |
0005e780: 000310c0 sll r2,r3,0x03           |r2 = Last Attack Used ID *8
0005e784: 00431023 subu r2,r2,r3            |r2 = Last Attack Used ID *7
0005e788: 00021040 sll r2,r2,0x01           |r2 = Last Attack Used ID *14 (= Ability offset in ability data 2)
0005e78c: 3c018006 lui r1,0x8006            |
0005e790: 00220821 addu r1,r1,r2            |
0005e794: 9022fbfc lbu r2,-0x0404(r1)       |r2 = Acting unit's last used Ability's CT 8005fbf0 + 0x0c
0005e798: 00000000 nop                      |
0005e79c: 3042007f andi r2,r2,0x007f        |r2 = last used ability CT (limited to 128)
0005e7a0: 03e00008 jr r31                   |
0005e7a4: a082018b sb r2,0x018b(r4)         |Store Acting unit's last used Ability's CT in Unit's ability CT (Unit data 0x18b)

Return Locations

SCUS_942.21

0005e840: Status_infliction/removal?

BATTLE.BIN

00182c54: In_between_turn_control_routine
001838a4: Calculate AT List