Difference between revisions of "Determine which stat will be reduced"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Determine which stat will be reduced (bunch of hardcoding) 00187860: 3c038019 lui r3,0x8019 00187864: 946338d6 lhu r3,0x38d6(r3) Used Ability ID 00187868: 34020090 ori ...")
 
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
  Determine which stat will be reduced (bunch of hardcoding)
+
  No Parameters - Returns nothing
  00187860: 3c038019 lui r3,0x8019
+
  00187864: 946338d6 lhu r3,0x38d6(r3) Used Ability ID
+
This routine determines which stats will be reduced (no bonus here) in a hard coded way [[#Hard coded mechanics|(See here))]]
  00187868: 34020090 ori r2,r0,0x0090
+
Chosen ability will decrease by Used Ability X amount.
  0018786c: 10620003 beq r3,r2,0x0018787c Branch if used ability is 'Power Break'
+
Enables Attack Type flag 0x01 (pseudo status), preserves other flags
  00187870: 340200c6 ori r2,r0,0x00c6
+
No cumulative mechanics, only one stat will be altered (PA > MA > Speed)
  00187874: 14620008 bne r3,r2,0x00187898 Branch if used ability is not  'Power Ruin'
+
----------------------------------------------------------------------------------------------
  00187878: 34020091 ori r2,r0,0x0091
+
  00187860: 3c038019 lui r3,0x8019           |
  0018787c: 3c028019 lui r2,0x8019
+
  00187864: 946338d6 lhu r3,0x38d6(r3)       |{{f/load|<nowiki>r3 = Current Ability used Ability ID</nowiki>}} {{f/std|          0x801938d6 / 801938d6}}
  00187880: 904238f9 lbu r2,0x38f9(r2) Load Ability X
+
  00187868: 34020090 ori r2,r0,0x0090         |{{f/std|<nowiki>r2 = 0x90 (Power Break ID)</nowiki>}}
  00187884: 3c038019 lui r3,0x8019
+
{{f/loc| --- PA Section ---}}
  00187888: 8c632d90 lw r3,0x2d90(r3) Current Action Data Pointer
+
  0018786c: 10620003 beq r3,r2,0x0018787c     {{f/Cond|If used Ability ID is not  0x90 (Power Break)}}
  0018788c: 3042007f andi r2,r2,0x007f
+
  00187870: 340200c6 ori r2,r0,0x00c6             |{{f/std|<nowiki>r2 = 0xc6 (Power Ruin ID)</nowiki>}}
  00187890: 08061e3b j 0x001878ec
+
  00187874: 14620008 bne r3,r2,0x00187898         {{f/Cond|If Used Ability ID is 0xc6 (Power ruin)}}
  00187894: a0620014 sb r2,0x0014(r3) Store X as a negative PA change
+
  00187878: 34020091 ori r2,r0,0x0091             |{{f/std|<nowiki>r2 = 0x91 (Mind Break ID)</nowiki>}}
  00187898: 10620003 beq r3,r2,0x001878a8 Branch if used ability is 'Mind Break'
+
  0018787c: 3c028019 lui r2,0x8019           {{f/Cond|E }}    |
  0018789c: 340200c7 ori r2,r0,0x00c7
+
  00187880: 904238f9 lbu r2,0x38f9(r2)               |{{f/load|<nowiki>r2 = Current Ability used Ability X</nowiki>}}
  001878a0: 14620008 bne r3,r2,0x001878c4 Branch if used ability is not 'Mind Ruin'
+
  00187884: 3c038019 lui r3,0x8019                   |
  001878a4: 3402008f ori r2,r0,0x008f
+
  00187888: 8c632d90 lw r3,0x2d90(r3)                 |{{f/adr|<nowiki>r2 = Target Current Action (TCA) data pointer</nowiki>}}
  001878a8: 3c028019 lui r2,0x8019
+
  0018788c: 3042007f andi r2,r2,0x007f               |{{f/std|<nowiki>r2 = Ability X without 0x80 flag (it is a malus)</nowiki>}}
  001878ac: 904238f9 lbu r2,0x38f9(r2) Load Ability X
+
  00187890: 08061e3b j 0x001878ec                     {{f/jump|Jump to set Attack type}}
  001878b0: 3c038019 lui r3,0x8019
+
  00187894: a0620014 sb r2,0x0014(r3)                 |{{f/store|Store Ability X as a negative PA change}}
  001878b4: 8c632d90 lw r3,0x2d90(r3) Current Action Data Pointer
+
{{f/loc| --- MA Section ---}}
  001878b8: 3042007f andi r2,r2,0x007f
+
  00187898: 10620003 beq r3,r2,0x001878a8     {{f/Cond|If used Ability ID is not  0x91 (Mind Break)}}
  001878bc: 08061e3b j 0x001878ec
+
  0018789c: 340200c7 ori r2,r0,0x00c7             |{{f/std|<nowiki>r2 = 0xc7 (Mind Ruin ID)</nowiki>}}
  001878c0: a0620015 sb r2,0x0015(r3) Store X as a negative MA change
+
  001878a0: 14620008 bne r3,r2,0x001878c4         {{f/Cond|If Used Ability ID is 0xc7 (Mind ruin)}}
  001878c4: 10620003 beq r3,r2,0x001878d4 Branch if used ability is 'Speed Break'
+
  001878a4: 3402008f ori r2,r0,0x008f             |{{f/std|<nowiki>r2 = 0x8f (Speed break ID)</nowiki>}}
  001878c8: 340200c5 ori r2,r0,0x00c5
+
  001878a8: 3c028019 lui r2,0x8019           {{f/Cond|E }}    |
  001878cc: 1462000e bne r3,r2,0x00187908 Branch if used ability not 'Speed Ruin'
+
  001878ac: 904238f9 lbu r2,0x38f9(r2)               |{{f/load|<nowiki>r2 = Current Ability used Ability X</nowiki>}}
  001878d0: 00000000 nop
+
  001878b0: 3c038019 lui r3,0x8019                   |
  001878d4: 3c028019 lui r2,0x8019
+
  001878b4: 8c632d90 lw r3,0x2d90(r3)                 |{{f/adr|<nowiki>r2 = Target Current Action (TCA) data pointer</nowiki>}}
  001878d8: 904238f9 lbu r2,0x38f9(r2) Load Ability X
+
  001878b8: 3042007f andi r2,r2,0x007f               |{{f/std|<nowiki>r2 = Ability X without 0x80 flag (it is a malus)</nowiki>}}
  001878dc: 3c038019 lui r3,0x8019
+
  001878bc: 08061e3b j 0x001878ec                     {{f/jump|Jump to set Attack type}}
  001878e0: 8c632d90 lw r3,0x2d90(r3) Current Action Data Pointer
+
  001878c0: a0620015 sb r2,0x0015(r3)                 |{{f/store|Store Ability X as a negative MA change}}
  001878e4: 3042007f andi r2,r2,0x007f
+
{{f/loc| --- Speed Section ---}}
  001878e8: a0620012 sb r2,0x0012(r3) Store X as a negative SP change
+
  001878c4: 10620003 beq r3,r2,0x001878d4     {{f/Cond|If used Ability ID is not  0x8c (Speed Break)}}
  001878ec: 3c038019 lui r3,0x8019
+
  001878c8: 340200c5 ori r2,r0,0x00c5             |{{f/std|<nowiki>r2 = 0xc5 (Speed Ruin ID)</nowiki>}}
  001878f0: 8c632d90 lw r3,0x2d90(r3) Current Action Data Pointer
+
  001878cc: 1462000e bne r3,r2,0x00187908         {{f/Cond|If Used Ability ID is 0xc5 (Speed ruin)}} /Else branch to END
  001878f4: 00000000 nop
+
  001878d0: 00000000 nop                             |
  001878f8: 90620025 lbu r2,0x0025(r3) Load Attack type flag
+
  001878d4: 3c028019 lui r2,0x8019           {{f/Cond|E }}    |
  001878fc: 00000000 nop
+
  001878d8: 904238f9 lbu r2,0x38f9(r2)               |{{f/load|<nowiki>r2 = Current Ability used Ability X</nowiki>}}
  00187900: 34420001 ori r2,r2,0x0001
+
  001878dc: 3c038019 lui r3,0x8019                   |
  00187904: a0620025 sb r2,0x0025(r3) Store Attack as a Psuedo-Status
+
  001878e0: 8c632d90 lw r3,0x2d90(r3)                 |{{f/adr|<nowiki>r2 = Target Current Action (TCA) data pointer</nowiki>}}
  00187908: 03e00008 jr r31
+
  001878e4: 3042007f andi r2,r2,0x007f               |{{f/std|<nowiki>r2 = Ability X without 0x80 flag (it is a malus)</nowiki>}}
  0018790c: 00000000 nop
+
  001878e8: a0620012 sb r2,0x0012(r3)                 |{{f/store|Store Ability X as a negative MA change}}
 +
{{f/loc| --- End Section ---}}
 +
  001878ec: 3c038019 lui r3,0x8019           |
 +
  001878f0: 8c632d90 lw r3,0x2d90(r3)         |{{f/adr|<nowiki>r3 = TCA data pointer</nowiki>}}
 +
  001878f4: 00000000 nop                     |
 +
  001878f8: 90620025 lbu r2,0x0025(r3)       |{{f/load|<nowiki>r2 = TCA Attack type</nowiki>}}
 +
  001878fc: 00000000 nop                     |
 +
  00187900: 34420001 ori r2,r2,0x0001         |{{f/std|<nowiki>r2 = TCA Attack type enhanced with pseudo status</nowiki>}}
 +
  00187904: a0620025 sb r2,0x0025(r3)         |{{f/store|Set Attack type with pseudo status enabled (preserves other flags)}}
 +
  00187908: 03e00008 jr r31                   |
 +
  0018790c: 00000000 nop                     |
 +
=== Hard coded mechanics ===
 +
The Altered stat is tied to Ability ID
 +
  - Ability 0x8f : Speed malus
 +
  - Ability 0x90 : PA malus
 +
  - Ability 0x91 : MA malus
 +
  - Ability 0xc5 : Speed malus
 +
  - Ability 0xc6 : PA malus
 +
  - Ability 0xc7 : MA malus
 +
 +
If the routine is called by another ability, stat will not be reduced
 +
=== Return locations ===
 +
'''Battle.bin'''
 +
0018932c: [[1A_Hit_F(MA%2BY)%25_//_-PA/MA/SP_(X)|Formula 1a : Hit F(MA+Y)% // -PA/MA/SP (X)]]
 +
00189ac8: [[2B_Hit_(PA%2BX)%25_//_-PA/MA/SP_(X)|Formula 2b : Hit (PA+X)% // -PA/MA/SP (X)]]

Latest revision as of 19:40, 17 April 2022

No Parameters - Returns nothing

This routine determines which stats will be reduced (no bonus here) in a hard coded way (See here))
Chosen ability will decrease by Used Ability X amount.
Enables Attack Type flag 0x01 (pseudo status), preserves other flags
No cumulative mechanics, only one stat will be altered (PA > MA > Speed)
----------------------------------------------------------------------------------------------
00187860: 3c038019 lui r3,0x8019            |
00187864: 946338d6 lhu r3,0x38d6(r3)        |r3 = Current Ability used Ability ID           0x801938d6 / 801938d6
00187868: 34020090 ori r2,r0,0x0090         |r2 = 0x90 (Power Break ID)
 --- PA Section ---
0018786c: 10620003 beq r3,r2,0x0018787c     #If used Ability ID is not  0x90 (Power Break)
00187870: 340200c6 ori r2,r0,0x00c6             |r2 = 0xc6 (Power Ruin ID)
00187874: 14620008 bne r3,r2,0x00187898         #If Used Ability ID is 0xc6 (Power ruin)
00187878: 34020091 ori r2,r0,0x0091             |r2 = 0x91 (Mind Break ID)
0018787c: 3c028019 lui r2,0x8019            #E      |
00187880: 904238f9 lbu r2,0x38f9(r2)                |r2 = Current Ability used Ability X
00187884: 3c038019 lui r3,0x8019                    |
00187888: 8c632d90 lw r3,0x2d90(r3)                 |r2 = Target Current Action (TCA) data pointer
0018788c: 3042007f andi r2,r2,0x007f                |r2 = Ability X without 0x80 flag (it is a malus)
00187890: 08061e3b j 0x001878ec                     >>Jump to set Attack type
00187894: a0620014 sb r2,0x0014(r3)                 |Store Ability X as a negative PA change
 --- MA Section ---
00187898: 10620003 beq r3,r2,0x001878a8     #If used Ability ID is not  0x91 (Mind Break)
0018789c: 340200c7 ori r2,r0,0x00c7             |r2 = 0xc7 (Mind Ruin ID)
001878a0: 14620008 bne r3,r2,0x001878c4         #If Used Ability ID is 0xc7 (Mind ruin)
001878a4: 3402008f ori r2,r0,0x008f             |r2 = 0x8f (Speed break ID)
001878a8: 3c028019 lui r2,0x8019            #E      |
001878ac: 904238f9 lbu r2,0x38f9(r2)                |r2 = Current Ability used Ability X
001878b0: 3c038019 lui r3,0x8019                    |
001878b4: 8c632d90 lw r3,0x2d90(r3)                 |r2 = Target Current Action (TCA) data pointer
001878b8: 3042007f andi r2,r2,0x007f                |r2 = Ability X without 0x80 flag (it is a malus)
001878bc: 08061e3b j 0x001878ec                     >>Jump to set Attack type
001878c0: a0620015 sb r2,0x0015(r3)                 |Store Ability X as a negative MA change
 --- Speed Section ---
001878c4: 10620003 beq r3,r2,0x001878d4     #If used Ability ID is not  0x8c (Speed Break)
001878c8: 340200c5 ori r2,r0,0x00c5             |r2 = 0xc5 (Speed Ruin ID)
001878cc: 1462000e bne r3,r2,0x00187908         #If Used Ability ID is 0xc5 (Speed ruin) /Else branch to END
001878d0: 00000000 nop                              |
001878d4: 3c028019 lui r2,0x8019            #E      |
001878d8: 904238f9 lbu r2,0x38f9(r2)                |r2 = Current Ability used Ability X
001878dc: 3c038019 lui r3,0x8019                    |
001878e0: 8c632d90 lw r3,0x2d90(r3)                 |r2 = Target Current Action (TCA) data pointer
001878e4: 3042007f andi r2,r2,0x007f                |r2 = Ability X without 0x80 flag (it is a malus)
001878e8: a0620012 sb r2,0x0012(r3)                 |Store Ability X as a negative MA change
 --- End Section ---
001878ec: 3c038019 lui r3,0x8019            |
001878f0: 8c632d90 lw r3,0x2d90(r3)         |r3 = TCA data pointer
001878f4: 00000000 nop                      |
001878f8: 90620025 lbu r2,0x0025(r3)        |r2 = TCA Attack type
001878fc: 00000000 nop                      |
00187900: 34420001 ori r2,r2,0x0001         |r2 = TCA Attack type enhanced with pseudo status
00187904: a0620025 sb r2,0x0025(r3)         |Set Attack type with pseudo status enabled (preserves other flags)
00187908: 03e00008 jr r31                   |
0018790c: 00000000 nop                      |

Hard coded mechanics

The Altered stat is tied to Ability ID
 - Ability 0x8f : Speed malus
 - Ability 0x90 : PA malus
 - Ability 0x91 : MA malus
 - Ability 0xc5 : Speed malus
 - Ability 0xc6 : PA malus
 - Ability 0xc7 : MA malus

If the routine is called by another ability, stat will not be reduced

Return locations

Battle.bin
0018932c: Formula 1a : Hit F(MA+Y)% // -PA/MA/SP (X)
00189ac8: Formula 2b : Hit (PA+X)% // -PA/MA/SP (X)