Difference between revisions of "Target's Status Affecting XA (Magical)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
m (typo (3rd -> 4rd))
Line 25: Line 25:
 
  001864ac: 8c422d98 lw r2,0x2d98(r2)        |{{f/adr|<nowiki>r2 = Target data pointer</nowiki>}}
 
  001864ac: 8c422d98 lw r2,0x2d98(r2)        |{{f/adr|<nowiki>r2 = Target data pointer</nowiki>}}
 
  001864b0: 00000000 nop                      |
 
  001864b0: 00000000 nop                      |
  001864b4: 9042005a lbu r2,0x005a(r2)        |{{f/load|<nowiki>r2 = Target 4rd set of Current statuses</nowiki>}}
+
  001864b4: 9042005a lbu r2,0x005a(r2)        |{{f/load|<nowiki>r2 = Target 3rd set of Current statuses</nowiki>}}
 
  001864b8: 00000000 nop                      |
 
  001864b8: 00000000 nop                      |
 
  001864bc: 30420006 andi r2,r2,0x0006        |{{f/std|r2 <> 0x00 if Target has frog or chicken}}
 
  001864bc: 30420006 andi r2,r2,0x0006        |{{f/std|r2 <> 0x00 if Target has frog or chicken}}

Revision as of 17:01, 21 June 2023

No Parameters - Returns Nothing

Decreases Ability XA (-33%) if Target has Shell
Increases Ability XA (+50%) if Target has Frog or Chicken
---------------------------------------------------------------------------------
00186460: 3c028019 lui r2,0x8019            |
00186464: 8c422d98 lw r2,0x2d98(r2)         |r2 = Target data pointer
00186468: 00000000 nop                      |
0018646c: 9042005b lbu r2,0x005b(r2)        |r2 = Target 4th set of Current statuses
00186470: 00000000 nop                      |
00186474: 30420010 andi r2,r2,0x0010        |r2 = 0x10 if Target has Shell
00186478: 1040000b beq r2,r0,0x001864a8     #If Target has Shell
0018647c: 3c025555 lui r2,0x5555                |
00186480: 3c048019 lui r4,0x8019                |
00186484: 248438ce addiu r4,r4,0x38ce           |r4 = Current Ability XA pointer
00186488: 84830000 lh r3,0x0000(r4)             |r3 = Ability XA
0018648c: 34425556 ori r2,r2,0x5556             |r2 = 0x55555556 (0,33 * 2^32)
00186490: 00031840 sll r3,r3,0x01               |XA * 2
00186494: 00620018 mult r3,r2                   |XA * 2 / 3 * 2^32
00186498: 00031fc3 sra r3,r3,0x1f               |r3 = highest bit of r3 (should be 0x00 else 0x01)
0018649c: 00001010 mfhi r2                      |r2 = XA *2/3
001864a0: 00431023 subu r2,r2,r3                |XA eventually down rounded
001864a4: a4820000 sh r2,0x0000(r4)             |Store New XA (66% of initial XA)
001864a8: 3c028019 lui r2,0x8019            |
001864ac: 8c422d98 lw r2,0x2d98(r2)         |r2 = Target data pointer
001864b0: 00000000 nop                      |
001864b4: 9042005a lbu r2,0x005a(r2)        |r2 = Target 3rd set of Current statuses
001864b8: 00000000 nop                      |
001864bc: 30420006 andi r2,r2,0x0006        |r2 <> 0x00 if Target has frog or chicken
001864c0: 1040000b beq r2,r0,0x001864f0     #If the Target has Frog or Chicken 
001864c4: 00000000 nop                          |
001864c8: 3c048019 lui r4,0x8019                |
001864cc: 248438ce addiu r4,r4,0x38ce           |r4 = Current Ability XA pointer
001864d0: 84830000 lh r3,0x0000(r4)             |r3 = Ability XA
001864d4: 00000000 nop                          |
001864d8: 00031040 sll r2,r3,0x01               |XA * 2
001864dc: 00431021 addu r2,r2,r3                |XA * 3
001864e0: 00021fc2 srl r3,r2,0x1f               |r3 = highest bit of r3 (should be 0x00 else 0x01)
001864e4: 00431021 addu r2,r2,r3                |XA eventually high rounded
001864e8: 00021043 sra r2,r2,0x01               |XA * 3 / 2
001864ec: a4820000 sh r2,0x0000(r4)             |Store new XA (150% of initial XA)
001864f0: 03e00008 jr r31                   END
001864f4: 00000000 nop

Warning : this routine don't save r31 (and don't set his stack pointer) do not jal from here without resolving it    

Return Locations

Battle.bin
00188764: Magical Support/Status/Compat
00189018: Formula 0E - Dmg (Y)% Hit F(MA+X)% 100% Status Hide Status