Difference between revisions of "Set targets animation based on attack type"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Set targets animation based on attack type (wounded, recovery,etc.) 00083978: 27bdffd8 addiu r29,r29,0xffd8 0008397c: afb3001c sw r19,0x001c(r29) 00083980: 00809821 addu r...")
 
m
 
Line 128: Line 128:
 
  00083b44: 92220006 lbu r2,0x0006(r17) load spriteset ID
 
  00083b44: 92220006 lbu r2,0x0006(r17) load spriteset ID
 
  00083b48: 00000000 nop
 
  00083b48: 00000000 nop
  00083b4c: 2c42009b sltiu r2,r2,0x009b set if less than WEP 2
+
  00083b4c: 2c42009b sltiu r2,r2,0x009b set if not crystal/treasure
 
  00083b50: 14400003 bne r2,r0,0x00083b60 branch if so
 
  00083b50: 14400003 bne r2,r0,0x00083b60 branch if so
 
  00083b54: 34020019 ori r2,r0,0x0019
 
  00083b54: 34020019 ori r2,r0,0x0019
Line 144: Line 144:
 
  00083b7c: 02602021 addu r4,r19,r0
 
  00083b7c: 02602021 addu r4,r19,r0
 
   
 
   
  00083b80: 0c01b76b jal 0x0006ddac
+
  00083b80: 0c01b76b jal 0x0006ddac                     [[Transfer Target Coordinates (knockback)]]
 
  00083b84: 02202821 addu r5,r17,r0
 
  00083b84: 02202821 addu r5,r17,r0
 
  00083b88: 96420010 lhu r2,0x0010(r18) load special flags
 
  00083b88: 96420010 lhu r2,0x0010(r18) load special flags

Latest revision as of 02:47, 3 May 2024

Set targets animation based on attack type (wounded, recovery,etc.)
00083978: 27bdffd8 addiu r29,r29,0xffd8
0008397c: afb3001c sw r19,0x001c(r29)
00083980: 00809821 addu r19,r4,r0
00083984: afb10014 sw r17,0x0014(r29)
00083988: 00a08821 addu r17,r5,r0
0008398c: afbf0020 sw r31,0x0020(r29)
00083990: afb20018 sw r18,0x0018(r29)
00083994: 127100a8 beq r19,r17,0x00083c38		branch to end if equal
00083998: afb00010 sw r16,0x0010(r29)
0008399c: 962201dc lhu r2,0x01dc(r17)			load current animation?
000839a0: 00000000 nop
000839a4: 00021842 srl r3,r2,0x01
000839a8: 3402001a ori r2,r0,0x001a
000839ac: 106200a2 beq r3,r2,0x00083c38			branch if animation is 0x34?  dead animations?
000839b0: 34020034 ori r2,r0,0x0034
000839b4: 106200a0 beq r3,r2,0x00083c38			branch if animation is 0x68?
000839b8: 00000000 nop
000839bc: 0c0209e3 jal 0x0008278c				Movement validation - float/fly?
000839c0: 02202021 addu r4,r17,r0
000839c4: 304200ff andi r2,r2,0x00ff
000839c8: 2c420002 sltiu r2,r2,0x0002
000839cc: 10400097 beq r2,r0,0x00083c2c			branch if result > 2
000839d0: 34040009 ori r4,r0,0x0009
000839d4: 8e230134 lw r3,0x0134(r17)			load unit data
000839d8: 00000000 nop
000839dc: 10600092 beq r3,r0,0x00083c28
000839e0: 2472018c addiu r18,r3,0x018c			r18 = current action data
000839e4: 9062018e lbu r2,0x018e(r3)			load evade type
000839e8: 00000000 nop
000839ec: 2443ffff addiu r3,r2,0xffff
000839f0: 2c62000d sltiu r2,r3,0x000d
000839f4: 1040003a beq r2,r0,0x00083ae0			branch if hit or out of valid range
000839f8: 34040002 ori r4,r0,0x0002
000839fc: 00031080 sll r2,r3,0x02
00083a00: 3c018006 lui r1,0x8006
00083a04: 00220821 addu r1,r1,r2
00083a08: 8c227ee8 lw r2,0x7ee8(r1)				load return address based on evade type
00083a0c: 00000000 nop
00083a10: 00400008 jr r2

00083a14: 00000000 nop
00083a18: 02202021 addu r4,r17,r0
00083a1c: 0c01c9cf jal 0x0007273c				
00083a20: 02602821 addu r5,r19,r0
00083a24: 92440003 lbu r4,0x0003(r18)			r4 = item to use
00083a28: 0c020dd6 jal 0x00083758				set item graphic/palette
00083a2c: 02202821 addu r5,r17,r0				
00083a30: 92640004 lbu r4,0x0004(r19)			load unit misc ID
00083a34: 0c02371d jal 0x0008dc74				
00083a38: 00000000 nop
00083a3c: 000287c2 srl r16,r2,0x1f
00083a40: 02028021 addu r16,r16,r2
00083a44: 00108043 sra r16,r16,0x01
00083a48: 96620042 lhu r2,0x0042(r19)			load height mod
00083a4c: 92240004 lbu r4,0x0004(r17)			load unit misc ID
00083a50: 0c02371d jal 0x0008dc74
00083a54: 02028023 subu r16,r16,r2
00083a58: 00021fc2 srl r3,r2,0x1f
00083a5c: 00621821 addu r3,r3,r2
00083a60: 00031843 sra r3,r3,0x01
00083a64: 00108400 sll r16,r16,0x10
00083a68: 96220042 lhu r2,0x0042(r17)
00083a6c: 00108403 sra r16,r16,0x10
00083a70: 00621823 subu r3,r3,r2
00083a74: 00031c00 sll r3,r3,0x10
00083a78: 00031c03 sra r3,r3,0x10
00083a7c: 02038023 subu r16,r16,r3
00083a80: 2a02fff5 slti r2,r16,-0x000b
00083a84: 10400003 beq r2,r0,0x00083a94
00083a88: 2a02000c slti r2,r16,0x000c
00083a8c: 08020ecf j 0x00083b3c
00083a90: 3404005a ori r4,r0,0x005a				low weapon guard

00083a94: 14400029 bne r2,r0,0x00083b3c
00083a98: 34040059 ori r4,r0,0x0059				mid weapon guard
00083a9c: 08020ecf j 0x00083b3c
00083aa0: 34040058 ori r4,r0,0x0058				high weapon guard

00083aa4: 92420018 lbu r2,0x0018(r18)			load status change byte
00083aa8: 00000000 nop
00083aac: 30420080 andi r2,r2,0x0080
00083ab0: 10400022 beq r2,r0,0x00083b3c			branch if not animate on miss?
00083ab4: 00000000 nop

00083ab8: 02202021 addu r4,r17,r0
00083abc: 0c01c9cf jal 0x0007273c
00083ac0: 02602821 addu r5,r19,r0
00083ac4: 08020ecf j 0x00083b3c
00083ac8: 34040018 ori r4,r0,0x0018				sidestep evade

00083acc: 02202021 addu r4,r17,r0
00083ad0: 0c01c9cf jal 0x0007273c
00083ad4: 02602821 addu r5,r19,r0
00083ad8: 08020ecf j 0x00083b3c
00083adc: 3404001b ori r4,r0,0x001b				hands in air get recovered

if hit or out of range of above
00083ae0: 92420000 lbu r2,0x0000(r18)			load hit flag
00083ae4: 00000000 nop
00083ae8: 10400014 beq r2,r0,0x00083b3c			branch if missed
00083aec: 00000000 nop
00083af0: 86420004 lh r2,0x0004(r18)			load HP damage
00083af4: 00000000 nop
00083af8: 14400005 bne r2,r0,0x00083b10			branch if HP damage stored
00083afc: 00000000 nop
00083b00: 86420008 lh r2,0x0008(r18)			load MP damage
00083b04: 00000000 nop
00083b08: 10400003 beq r2,r0,0x00083b18			branch if MP damage not stored
00083b0c: 00000000 nop
00083b10: 08020ecf j 0x00083b3c
00083b14: 34040019 ori r4,r0,0x0019				get injured

if not getting damaged
00083b18: 86420006 lh r2,0x0006(r18)			load HP recovery
00083b1c: 00000000 nop
00083b20: 14400005 bne r2,r0,0x00083b38			branch if recovering HP
00083b24: 00000000 nop
00083b28: 8642000a lh r2,0x000a(r18)			load MP recovery
00083b2c: 00000000 nop
00083b30: 10400002 beq r2,r0,0x00083b3c			branch if not recovering MP
00083b34: 00000000 nop
00083b38: 3404001b ori r4,r0,0x001b				hands up get recovered
00083b3c: 1080000b beq r4,r0,0x00083b6c
00083b40: 00000000 nop

if not getting recovered
00083b44: 92220006 lbu r2,0x0006(r17)			load spriteset ID
00083b48: 00000000 nop
00083b4c: 2c42009b sltiu r2,r2,0x009b			set if not crystal/treasure
00083b50: 14400003 bne r2,r0,0x00083b60			branch if so
00083b54: 34020019 ori r2,r0,0x0019
00083b58: 14820004 bne r4,r2,0x00083b6c			branch if animation != get injured
00083b5c: 34040019 ori r4,r0,0x0019				animation = get injured

00083b60: 86250070 lh r5,0x0070(r17)
00083b64: 0c020662 jal 0x00081988
00083b68: 02203021 addu r6,r17,r0

00083b6c: 96420010 lhu r2,0x0010(r18)			load special flags
00083b70: 00000000 nop
00083b74: 30424000 andi r2,r2,0x4000
00083b78: 10400003 beq r2,r0,0x00083b88			branch if not performing knockback
00083b7c: 02602021 addu r4,r19,r0

00083b80: 0c01b76b jal 0x0006ddac                      Transfer Target Coordinates (knockback)
00083b84: 02202821 addu r5,r17,r0
00083b88: 96420010 lhu r2,0x0010(r18)			load special flags
00083b8c: 00000000 nop
00083b90: 30420020 andi r2,r2,0x0020
00083b94: 10400005 beq r2,r0,0x00083bac			branch if not poached
00083b98: 00000000 nop
00083b9c: 8e220144 lw r2,0x0144(r17)			load status flags
00083ba0: 00000000 nop
00083ba4: 34420080 ori r2,r2,0x0080
00083ba8: ae220144 sw r2,0x0144(r17)			store poach flag
00083bac: 96420010 lhu r2,0x0010(r18)
00083bb0: 00000000 nop
00083bb4: 30420002 andi r2,r2,0x0002
00083bb8: 10400005 beq r2,r0,0x00083bd0			branch if not marlboroed
00083bbc: 00000000 nop
00083bc0: 8e220144 lw r2,0x0144(r17)
00083bc4: 00000000 nop
00083bc8: 34420100 ori r2,r2,0x0100
00083bcc: ae220144 sw r2,0x0144(r17)			store marlboro flag
00083bd0: 96420010 lhu r2,0x0010(r18)
00083bd4: 00000000 nop
00083bd8: 30420004 andi r2,r2,0x0004
00083bdc: 10400006 beq r2,r0,0x00083bf8			branch if not getting item broken
00083be0: 00000000 nop
00083be4: 8e220134 lw r2,0x0134(r17)
00083be8: 00000000 nop
00083bec: 9044018a lbu r4,0x018a(r2)			load ID
00083bf0: 0c0667b2 jal 0x00199ec8
00083bf4: 00000000 nop
00083bf8: 96420010 lhu r2,0x0010(r18)
00083bfc: 00000000 nop
00083c00: 30420010 andi r2,r2,0x0010
00083c04: 1040000c beq r2,r0,0x00083c38			branch if not getting item stolen
00083c08: 00000000 nop
00083c0c: 8e220134 lw r2,0x0134(r17)
00083c10: 00000000 nop
00083c14: 9044018a lbu r4,0x018a(r2)			load ID
00083c18: 0c0667b2 jal 0x00199ec8
00083c1c: 00000000 nop
00083c20: 08020f0e j 0x00083c38
00083c24: 00000000 nop
00083c28: 34040019 ori r4,r0,0x0019				get wounded
00083c2c: 86250070 lh r5,0x0070(r17)			store facing
00083c30: 0c02065e jal 0x00081978
00083c34: 02203021 addu r6,r17,r0
00083c38: 8fbf0020 lw r31,0x0020(r29)
00083c3c: 8fb3001c lw r19,0x001c(r29)
00083c40: 8fb20018 lw r18,0x0018(r29)
00083c44: 8fb10014 lw r17,0x0014(r29)
00083c48: 8fb00010 lw r16,0x0010(r29)
00083c4c: 27bd0028 addiu r29,r29,0x0028
00083c50: 03e00008 jr r31
00083c54: 00000000 nop