Difference between revisions of "Weather effects on Bows"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
  Weather effects on Bows/Crossbows
+
  No parameters - Returns Nothing
  00185738: 3c028019 lui r2,0x8019
+
  0018573c: 904238d8 lbu r2,0x38d8(r2) Load Used Weapon ID
+
If Ability Used Weapon (0x801938d8) Type is Bow or Crossbow
  00185740: 27bdffe8 addiu r29,r29,0xffe8
+
    - If Map State is Night : Base Hit becomes 75% of base Hit
  00185744: afbf0014 sw r31,0x0014(r29)
+
    - If Weather is Storm or Strong storm : Base Hit Becomes 75% of base hit (could be cumulative)
  00185748: afb00010 sw r16,0x0010(r29)
+
---------------------------------------------------------------------------------------------------------------------------------
  0018574c: 00021840 sll r3,r2,0x01 ID * 2
+
  00185738: 3c028019 lui r2,0x8019           |
  00185750: 00621821 addu r3,r3,r2 ID * 3
+
  0018573c: 904238d8 lbu r2,0x38d8(r2)       |{{f/load|<nowiki>r2 = Current Ability Used Weapon ID</nowiki>}} {{f/std| 0x801938d8}}
  00185754: 00031880 sll r3,r3,0x02 ID * 12
+
  00185740: 27bdffe8 addiu r29,r29,-0x0018    |
  00185758: 3c018006 lui r1,0x8006
+
  00185744: afbf0014 sw r31,0x0014(r29)       |
  0018575c: 00230821 addu r1,r1,r3
+
  00185748: afb00010 sw r16,0x0010(r29)       |
  00185760: 90222ebd lbu r2,0x2ebd(r1) Load Used Weapon Item Type
+
  0018574c: 00021840 sll r3,r2,0x01           |{{f/std|<nowiki>r3 = Weapon ID * 2</nowiki>}} {{f/std|ID * 2}}
  00185764: 00000000 nop
+
  00185750: 00621821 addu r3,r3,r2           |{{f/std|<nowiki>r3 = Weapon ID * 3</nowiki>}} {{f/std|ID * 3}}
  00185768: 2442fff5 addiu r2,r2,0xfff5 Type - 11 (0xfff6 and below 0x0003 for guns)
+
  00185754: 00031880 sll r3,r3,0x02           |{{f/std|<nowiki>r3 = Weapon ID * 12 (= 0x0c - Size of Item data in item data table)</nowiki>}} {{f/std|ID * 12}}
  0018576c: 2c420002 sltiu r2,r2,0x0002 Check for Crossbows/Bows
+
  00185758: 3c018006 lui r1,0x8006           |
  00185770: 10400023 beq r2,r0,0x00185800 Branch if weapon is not a Crossbow/Bow
+
  0018575c: 00230821 addu r1,r1,r3           |{{f/std|<nowiki>r1 = 0x80060000 + Weapon Offset</nowiki>}}
  00185774: 00000000 nop
+
  00185760: 90222ebd lbu r2,0x2ebd(r1)       |{{f/load|<nowiki>r2 = Current Ability Used Weapon Item Type</nowiki>}} {{f/std| 0x80062eb8 + 0x05 + Weapon Offset}}
  00185778: 0c04ed64 jal 0x0013b590 [[Get_Script_Variable]]
+
  00185764: 00000000 nop                     |
  0018577c: 34040023 ori r4,r0,0x0023 r4 = 0x23
+
  00185768: 2442fff5 addiu r2,r2,-0x000b      |{{f/std|<nowiki>r2 = Weapon Type - 0x0b</nowiki>}}
  00185780: 34040024 ori r4,r0,0x0024 r4 = 0x24
+
  0018576c: 2c420002 sltiu r2,r2,0x0002       |{{f/std|<nowiki>r2 = 0x01 If Weapon Type was 0x0b or 0x0c (Bow or Crossbow)</nowiki>}}
  00185784: 0c04ed64 jal 0x0013b590 [[Get_Script_Variable]]
+
  00185770: 10400023 beq r2,r0,0x00185800     {{f/Cond|If Used Weapon is a Bow or a Crossbow}} /Else Branch to {{f/loc|END}}
  00185788: 00408021 addu r16,r2,r0 Weather ID?
+
  00185774: 00000000 nop                         |{{f/std|}}
  0018578c: 34030001 ori r3,r0,0x0001
+
  00185778: 0c04ed64 jal 0x0013b590               |{{f/jal|Get_Script_Variable|Get_Script_Variable}} Returns r2 = Weather Variable Value
  00185790: 1443000d bne r2,r3,0x001857c8 Branch if not night time?
+
  0018577c: 34040023 ori r4,r0,0x0023             |{{f/std|<nowiki>r4 = 0x23 (Weather Variable ID)</nowiki>}}
  00185794: 2602fffd addiu r2,r16,0xfffd Weather ID? - 3
+
  00185780: 34040024 ori r4,r0,0x0024             |{{f/std|<nowiki>r4 = 0x24 (Map State Variable ID)</nowiki>}}
  00185798: 3c038019 lui r3,0x8019
+
  00185784: 0c04ed64 jal 0x0013b590               |{{f/jal|Get_Script_Variable|Get_Script_Variable}} Returns r2 = Map State Value
  0018579c: 906338dc lbu r3,0x38dc(r3) Load Base Hit
+
  00185788: 00408021 addu r16,r2,r0               |{{f/std|<nowiki>r16 = Weather Value</nowiki>}}
  001857a0: 00000000 nop
+
  0018578c: 34030001 ori r3,r0,0x0001             |{{f/std|<nowiki>r3 = 0x01</nowiki>}}
  001857a4: 00031040 sll r2,r3,0x01 Base hit * 2
+
  00185790: 1443000d bne r2,r3,0x001857c8         {{f/Cond|If Map State is Night Time}}
  001857a8: 00431021 addu r2,r2,r3 Base hit * 3
+
  00185794: 2602fffd addiu r2,r16,-0x0003        |{{f/std|<nowiki>r2 = Weather Value - 0x03</nowiki>}}
  001857ac: 04410002 bgez r2,0x001857b8 Branch if Hit % is positive
+
  00185798: 3c038019 lui r3,0x8019                   |{{f/std|}}
  001857b0: 00000000 nop
+
  0018579c: 906338dc lbu r3,0x38dc(r3)               |{{f/load|<nowiki>r3 = Current Ability Base Hit</nowiki>}}
  001857b4: 24420003 addiu r2,r2,0x0003 Hit % + 3
+
  001857a0: 00000000 nop                             |{{f/std|}}
  001857b8: 00021083 sra r2,r2,0x02 Base hit * 3 / 4
+
  001857a4: 00031040 sll r2,r3,0x01                   |{{f/std|<nowiki>r2 = Base hit * 2</nowiki>}}
  001857bc: 3c018019 lui r1,0x8019
+
  001857a8: 00431021 addu r2,r2,r3                   |{{f/std|<nowiki>r2 = Base hit * 3</nowiki>}}
  001857c0: a02238dc sb r2,0x38dc(r1) Store new hit %
+
  001857ac: 04410002 bgez r2,0x001857b8               {{f/Cond|If Base Hit < 0x00}}
  001857c4: 2602fffd addiu r2,r16,0xfffd Weather ID? - 3
+
  001857b0: 00000000 nop                                 |{{f/std|}}
  001857c8: 2c420002 sltiu r2,r2,0x0002
+
  001857b4: 24420003 addiu r2,r2,0x0003                   |{{f/std|<nowiki>r2 = Base Hit + 0x03 (??)</nowiki>}}
  001857cc: 1040000c beq r2,r0,0x00185800 Branch if Weather? is not a thunderstorm?
+
  001857b8: 00021083 sra r2,r2,0x02                   |{{f/std|<nowiki>r2 = Base Hit * 3 / 4</nowiki>}}
  001857d0: 00000000 nop
+
  001857bc: 3c018019 lui r1,0x8019                   |
  001857d4: 3c048019 lui r4,0x8019
+
  001857c0: a02238dc sb r2,0x38dc(r1)                 |{{f/store|Store 75% of initial Base Hit as new Base Hit at 0x801938dc}}
  001857d8: 248438dc addiu r4,r4,0x38dc
+
  001857c4: 2602fffd addiu r2,r16,-0x0003            |{{f/std|<nowiki>r2 = Weather Value - 0x03</nowiki>}}
  001857dc: 90830000 lbu r3,0x0000(r4) Load Base Hit
+
  001857c8: 2c420002 sltiu r2,r2,0x0002           |{{f/std|<nowiki>r2 = 0x01 if Weather was 0x03 or 0x04 (Storm or Strong Storm)</nowiki>}}
  001857e0: 00000000 nop
+
  001857cc: 1040000c beq r2,r0,0x00185800         {{f/Cond|If Weather is Storm or Strong Storm}}
  001857e4: 00031040 sll r2,r3,0x01 Hit * 2
+
  001857d0: 00000000 nop                             |{{f/std|}}
  001857e8: 00431021 addu r2,r2,r3 Hit * 3
+
  001857d4: 3c048019 lui r4,0x8019                   |{{f/std|}}
  001857ec: 04410002 bgez r2,0x001857f8 Branch if Hit% is positive
+
  001857d8: 248438dc addiu r4,r4,0x38dc               |{{f/adr|<nowiki>r4 = Ability Base Hit pointer</nowiki>}}
  001857f0: 00000000 nop
+
  001857dc: 90830000 lbu r3,0x0000(r4)               |{{f/load|<nowiki>r3 = Current Ability Base Hit</nowiki>}}
  001857f4: 24420003 addiu r2,r2,0x0003 Hit% + 3
+
  001857e0: 00000000 nop                             |
  001857f8: 00021083 sra r2,r2,0x02 Hit * 3 / 4
+
  001857e4: 00031040 sll r2,r3,0x01                   |{{f/std|<nowiki>r2 = Base hit * 2</nowiki>}}
  001857fc: a0820000 sb r2,0x0000(r4) Store new Hit%
+
  001857e8: 00431021 addu r2,r2,r3                   |{{f/std|<nowiki>r2 = Base hit * 3</nowiki>}}
  00185800: 8fbf0014 lw r31,0x0014(r29)
+
  001857ec: 04410002 bgez r2,0x001857f8               {{f/Cond|If Base Hit < 0x00}}
  00185804: 8fb00010 lw r16,0x0010(r29)
+
  001857f0: 00000000 nop                                 |{{f/std|}}
  00185808: 27bd0018 addiu r29,r29,0x0018
+
  001857f4: 24420003 addiu r2,r2,0x0003                   |{{f/std|<nowiki>r2 = Base Hit + 0x03 (??)</nowiki>}}
  0018580c: 03e00008 jr r31
+
  001857f8: 00021083 sra r2,r2,0x02                   |{{f/std|<nowiki>r2 = Base Hit * 3 / 4</nowiki>}}
  00185810: 00000000 nop
+
  001857fc: a0820000 sb r2,0x0000(r4)                 |{{f/store|Store 75% of previous Base Hit as new Base Hit at 0x801938dc}}
 +
  00185800: 8fbf0014 lw r31,0x0014(r29)       '''END'''
 +
  00185804: 8fb00010 lw r16,0x0010(r29)      
 +
  00185808: 27bd0018 addiu r29,r29,0x0018    
 +
  0018580c: 03e00008 jr r31                  
 +
  00185810: 00000000 nop                    
  
  
== Return Locations ==
+
=== Return Locations ===
 
+
'''Battle.bin'''
*Battle.bin
+
  00188548: [[Physical Evade Calculation]]
 
 
  00188540: [[Physical Evade Calculation]]
 

Latest revision as of 21:29, 22 March 2022

No parameters - Returns Nothing

If Ability Used Weapon (0x801938d8) Type is Bow or Crossbow 
   - If Map State is Night : Base Hit becomes 75% of base Hit
   - If Weather is Storm or Strong storm : Base Hit Becomes 75% of base hit (could be cumulative)
---------------------------------------------------------------------------------------------------------------------------------
00185738: 3c028019 lui r2,0x8019            |
0018573c: 904238d8 lbu r2,0x38d8(r2)        |r2 = Current Ability Used Weapon ID  0x801938d8
00185740: 27bdffe8 addiu r29,r29,-0x0018    |
00185744: afbf0014 sw r31,0x0014(r29)       |
00185748: afb00010 sw r16,0x0010(r29)       |
0018574c: 00021840 sll r3,r2,0x01           |r3 = Weapon ID * 2 ID * 2
00185750: 00621821 addu r3,r3,r2            |r3 = Weapon ID * 3 ID * 3
00185754: 00031880 sll r3,r3,0x02           |r3 = Weapon ID * 12 (= 0x0c - Size of Item data in item data table) ID * 12
00185758: 3c018006 lui r1,0x8006            |
0018575c: 00230821 addu r1,r1,r3            |r1 = 0x80060000 + Weapon Offset
00185760: 90222ebd lbu r2,0x2ebd(r1)        |r2 = Current Ability Used Weapon Item Type  0x80062eb8 + 0x05 + Weapon Offset
00185764: 00000000 nop                      |
00185768: 2442fff5 addiu r2,r2,-0x000b      |r2 = Weapon Type - 0x0b
0018576c: 2c420002 sltiu r2,r2,0x0002       |r2 = 0x01 If Weapon Type was 0x0b or 0x0c (Bow or Crossbow)
00185770: 10400023 beq r2,r0,0x00185800     #If Used Weapon is a Bow or a Crossbow /Else Branch to END
00185774: 00000000 nop                          |
00185778: 0c04ed64 jal 0x0013b590               |-->Get_Script_Variable Returns r2 = Weather Variable Value
0018577c: 34040023 ori r4,r0,0x0023             |r4 = 0x23 (Weather Variable ID)
00185780: 34040024 ori r4,r0,0x0024             |r4 = 0x24 (Map State Variable ID)
00185784: 0c04ed64 jal 0x0013b590               |-->Get_Script_Variable Returns r2 = Map State Value
00185788: 00408021 addu r16,r2,r0               |r16 = Weather Value
0018578c: 34030001 ori r3,r0,0x0001             |r3 = 0x01
00185790: 1443000d bne r2,r3,0x001857c8         #If Map State is Night Time
00185794: 2602fffd addiu r2,r16,-0x0003         |r2 = Weather Value - 0x03
00185798: 3c038019 lui r3,0x8019                    |
0018579c: 906338dc lbu r3,0x38dc(r3)                |r3 = Current Ability Base Hit
001857a0: 00000000 nop                              |
001857a4: 00031040 sll r2,r3,0x01                   |r2 = Base hit * 2
001857a8: 00431021 addu r2,r2,r3                    |r2 = Base hit * 3
001857ac: 04410002 bgez r2,0x001857b8               #If Base Hit < 0x00
001857b0: 00000000 nop                                  |
001857b4: 24420003 addiu r2,r2,0x0003                   |r2 = Base Hit + 0x03 (??)
001857b8: 00021083 sra r2,r2,0x02                   |r2 = Base Hit * 3 / 4
001857bc: 3c018019 lui r1,0x8019                    |
001857c0: a02238dc sb r2,0x38dc(r1)                 |Store 75% of initial Base Hit as new Base Hit at 0x801938dc
001857c4: 2602fffd addiu r2,r16,-0x0003             |r2 = Weather Value - 0x03
001857c8: 2c420002 sltiu r2,r2,0x0002           |r2 = 0x01 if Weather was 0x03 or 0x04 (Storm or Strong Storm)
001857cc: 1040000c beq r2,r0,0x00185800         #If Weather is Storm or Strong Storm
001857d0: 00000000 nop                              |
001857d4: 3c048019 lui r4,0x8019                    |
001857d8: 248438dc addiu r4,r4,0x38dc               |r4 = Ability Base Hit pointer
001857dc: 90830000 lbu r3,0x0000(r4)                |r3 = Current Ability Base Hit
001857e0: 00000000 nop                              |
001857e4: 00031040 sll r2,r3,0x01                   |r2 = Base hit * 2
001857e8: 00431021 addu r2,r2,r3                    |r2 = Base hit * 3
001857ec: 04410002 bgez r2,0x001857f8               #If Base Hit < 0x00
001857f0: 00000000 nop                                  |
001857f4: 24420003 addiu r2,r2,0x0003                   |r2 = Base Hit + 0x03 (??)
001857f8: 00021083 sra r2,r2,0x02                   |r2 = Base Hit * 3 / 4
001857fc: a0820000 sb r2,0x0000(r4)                 |Store 75% of previous Base Hit as new Base Hit at 0x801938dc
00185800: 8fbf0014 lw r31,0x0014(r29)       END
00185804: 8fb00010 lw r16,0x0010(r29)       
00185808: 27bd0018 addiu r29,r29,0x0018     
0018580c: 03e00008 jr r31                   
00185810: 00000000 nop                      


Return Locations

Battle.bin
00188548: Physical Evade Calculation