Difference between revisions of "Prep Current Action Data"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
Line 39: Line 39:
 
  0017ca48: 02002021 addu r4,r16,r0
 
  0017ca48: 02002021 addu r4,r16,r0
 
  0017ca4c: 00408821 addu r17,r2,r0
 
  0017ca4c: 00408821 addu r17,r2,r0
  0017ca50: 12200005 beq r17,r0,0x0017ca68
+
  0017ca50: 12200005 beq r17,r0,0x0017ca68 branch if ability can be used (MP cost is sufficient, unit is not silenced, attempting to cast frog as frog, etc.)
 
  0017ca54: 00002021 addu r4,r0,r0
 
  0017ca54: 00002021 addu r4,r0,r0
 
  0017ca58: 0c05f6f2 jal 0x0017dbc8 store target data
 
  0017ca58: 0c05f6f2 jal 0x0017dbc8 store target data
Line 45: Line 45:
 
  0017ca60: 0805f2ab j 0x0017caac jump to end  
 
  0017ca60: 0805f2ab j 0x0017caac jump to end  
 
  0017ca64: 02201021 addu r2,r17,r0 return usage checks
 
  0017ca64: 02201021 addu r2,r17,r0 return usage checks
  not attacking
+
   
 +
Ability can be used:
 
  0017ca68: 96020170 lhu r2,0x0170(r16) Load attacker's ability
 
  0017ca68: 96020170 lhu r2,0x0170(r16) Load attacker's ability
  0017ca6c: 02601821 addu r3,r19,r0
+
  0017ca6c: 02601821 addu r3,r19,r0 Start of battle data
 
  0017ca70: 3c018019 lui r1,0x8019
 
  0017ca70: 3c018019 lui r1,0x8019
 
  0017ca74: ac32f8c8 sw r18,-0x0738(r1) store acting unit id
 
  0017ca74: ac32f8c8 sw r18,-0x0738(r1) store acting unit id
Line 53: Line 54:
 
  0017ca7c: a4223d44 sh r2,0x3d44(r1) store attack used
 
  0017ca7c: a4223d44 sh r2,0x3d44(r1) store attack used
 
  0017ca80: a460019a sh r0,0x019a(r3) clear reaction ID
 
  0017ca80: a460019a sh r0,0x019a(r3) clear reaction ID
  0017ca84: a0600189 sb r0,0x0189(r3) clear turn?
+
  0017ca84: a0600189 sb r0,0x0189(r3) clear mid turn actions (reacting, learning abilities, being hit by ability?)
 
  0017ca88: 24840001 addiu r4,r4,0x0001
 
  0017ca88: 24840001 addiu r4,r4,0x0001
 
  0017ca8c: 28820015 slti r2,r4,0x0015
 
  0017ca8c: 28820015 slti r2,r4,0x0015
  0017ca90: 1440fffb bne r2,r0,0x0017ca80 cycle through each unit?
+
  0017ca90: 1440fffb bne r2,r0,0x0017ca80 cycle through each unit
  0017ca94: 246301c0 addiu r3,r3,0x01c0
+
  0017ca94: 246301c0 addiu r3,r3,0x01c0 next unit's battle data table
 
  0017ca98: 0c05f528 jal 0x0017d4a0 [[Current Action Ability Data Setting / Multi Hit Formulas]]
 
  0017ca98: 0c05f528 jal 0x0017d4a0 [[Current Action Ability Data Setting / Multi Hit Formulas]]
 
  0017ca9c: 02002021 addu r4,r16,r0
 
  0017ca9c: 02002021 addu r4,r16,r0

Revision as of 00:12, 20 February 2022

0017c9b8: 27bdffd8 addiu r29,r29,0xffd8
0017c9bc: afb20018 sw r18,0x0018(r29)
0017c9c0: 00809021 addu r18,r4,r0
0017c9c4: 2402ffff addiu r2,r0,0xffff
0017c9c8: 3c018019 lui r1,0x8019
0017c9cc: ac22f8c8 sw r2,-0x0738(r1)		clear acting unit ID
0017c9d0: 2a420015 slti r2,r18,0x0015		
0017c9d4: afbf0020 sw r31,0x0020(r29)
0017c9d8: afb3001c sw r19,0x001c(r29)
0017c9dc: afb10014 sw r17,0x0014(r29)
0017c9e0: afb00010 sw r16,0x0010(r29)
0017c9e4: 3c018019 lui r1,0x8019
0017c9e8: ac20f5f0 sw r0,-0x0a10(r1)		type of action = pre attack/initial attack
0017c9ec: 1040000a beq r2,r0,0x0017ca18		branch if unit not in party?
0017c9f0: 001210c0 sll r2,r18,0x03
0017c9f4: 00521023 subu r2,r2,r18
0017c9f8: 00021180 sll r2,r2,0x06
0017c9fc: 3c138019 lui r19,0x8019
0017ca00: 267308cc addiu r19,r19,0x08cc
0017ca04: 00538021 addu r16,r2,r19			r16 = unit data
0017ca08: 92030001 lbu r3,0x0001(r16)		
0017ca0c: 340200ff ori r2,r0,0x00ff
0017ca10: 14620003 bne r3,r2,0x0017ca20		unit exists check
0017ca14: 00000000 nop
0017ca18: 0805f2ab j 0x0017caac				jump to end, return r2 = FF, fail
0017ca1c: 2402ffff addiu r2,r0,0xffff
0017ca20: 3c028019 lui r2,0x8019
0017ca24: 8c4238bc lw r2,0x38bc(r2)			load unknown byte (reacting?)
0017ca28: 00000000 nop
0017ca2c: 10400005 beq r2,r0,0x0017ca44		jump to ability usage checks
0017ca30: 00000000 nop
0017ca34: 0c05f6f2 jal 0x0017dbc8			Store target data for reaction (acting unit data)
0017ca38: 02002021 addu r4,r16,r0
0017ca3c: 0805f2ab j 0x0017caac				Jump to end, return r2 = 6	
0017ca40: 34020006 ori r2,r0,0x0006
0017ca44: 0c05f688 jal 0x0017da20			Ability Usage Checks and MP Reduction
0017ca48: 02002021 addu r4,r16,r0
0017ca4c: 00408821 addu r17,r2,r0
0017ca50: 12200005 beq r17,r0,0x0017ca68			branch if ability can be used (MP cost is sufficient, unit is not silenced, attempting to cast frog as frog, etc.)
0017ca54: 00002021 addu r4,r0,r0
0017ca58: 0c05f6f2 jal 0x0017dbc8			store target data
0017ca5c: 02002021 addu r4,r16,r0
0017ca60: 0805f2ab j 0x0017caac				jump to end 
0017ca64: 02201021 addu r2,r17,r0			return usage checks

Ability can be used:
0017ca68: 96020170 lhu r2,0x0170(r16)		Load attacker's ability
0017ca6c: 02601821 addu r3,r19,r0		Start of battle data
0017ca70: 3c018019 lui r1,0x8019
0017ca74: ac32f8c8 sw r18,-0x0738(r1)		store acting unit id
0017ca78: 3c018019 lui r1,0x8019
0017ca7c: a4223d44 sh r2,0x3d44(r1)			store attack used
0017ca80: a460019a sh r0,0x019a(r3)			clear reaction ID
0017ca84: a0600189 sb r0,0x0189(r3)			clear mid turn actions (reacting, learning abilities, being hit by ability?)
0017ca88: 24840001 addiu r4,r4,0x0001
0017ca8c: 28820015 slti r2,r4,0x0015
0017ca90: 1440fffb bne r2,r0,0x0017ca80		cycle through each unit
0017ca94: 246301c0 addiu r3,r3,0x01c0		next unit's battle data table
0017ca98: 0c05f528 jal 0x0017d4a0			Current Action Ability Data Setting / Multi Hit Formulas
0017ca9c: 02002021 addu r4,r16,r0
0017caa0: 0c063bcd jal 0x0018ef34			Current Action Attacker Data Setting
0017caa4: 02002021 addu r4,r16,r0			r4 = units action pointer
0017caa8: 00001021 addu r2,r0,r0
0017caac: 8fbf0020 lw r31,0x0020(r29)
0017cab0: 8fb3001c lw r19,0x001c(r29)
0017cab4: 8fb20018 lw r18,0x0018(r29)
0017cab8: 8fb10014 lw r17,0x0014(r29)
0017cabc: 8fb00010 lw r16,0x0010(r29)
0017cac0: 27bd0028 addiu r29,r29,0x0028
0017cac4: 03e00008 jr r31
0017cac8: 00000000 nop