Float/Float/Fly movements

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Parameters : r4 = unit data pointer
Return r2 = holding various flags
            0x01 - 
            0x02 - Unit uses silent walk movement skill
            0x04 -
            0x08 - Unit uses Teleport*Teleport 2 (never with 0x80)
            0x10 - Unit uses move in water (never with 0x20, 0x40)
            0x20 - Unit uses move on water (never with 0x10, 0x40)
            0x40 - Unit is floating (never with 0x10,0x20)
            0x80 - Unit is flying (never with 0x08)
---------------------------------------------------------------------------- 
0017f020: 9086005a lbu r6,0x005a(r4)        |r6 = Unit's 3rd set of Current Status
0017f024: 90850095 lbu r5,0x0095(r4)        |r5 = Unit's 3rd set of Movements
0017f028: 90840094 lbu r4,0x0094(r4)        |r4 = Unit's 2nd set of Movements
0017f02c: 30c20040 andi r2,r6,0x0040        |r2 = 0x40 if unit have float
0017f030: 10400002 beq r2,r0,0x0017f03c     #If unit have float Else branch to frog-chicken check
0017f034: 00001821 addu r3,r0,r0            |r3 = 0x00
0017f038: 34a50008 ori r5,r5,0x0008              |r5 = Unit's 3rd set of movements updated with float movement
0017f03c: 30c20006 andi r2,r6,0x0006        |r2 = 0x06 if unit have frog or chicken
0017f040: 10400003 beq r2,r0,0x0017f050     #If unit is a frog or a chicken  Else branch to movement skill scheck
0017f044: 30a20080 andi r2,r5,0x0080        |r2 = 0x80 if unit use walk on water
0017f048: 30a500fb andi r5,r5,0x00fb             |r5 = Unit's 3rd set of movements updated without fly
0017f04c: 30a20080 andi r2,r5,0x0080             |r2 = 0x80 if unit use walk on water
0017f050: 10400003 beq r2,r0,0x0017f060     #If unit use walk on water
0017f054: 30a20040 andi r2,r5,0x0040        |r2 = 0x40 if unit use move in water
0017f058: 0805fc1b j 0x0017f06c                  >>jump avoiding move in water check
0017f05c: 34030020 ori r3,r0,0x0020              |r3 = 0x20
0017f060: 10400003 beq r2,r0,0x0017f070     # Else If unit use move in water  (and not using move on water)
0017f064: 30a20002 andi r2,r5,0x0002        |r2 = 0x02 if unit uses silent walk
0017f068: 34030010 ori r3,r0,0x0010              |r3 = 0x10 
0017f06c: 30a20002 andi r2,r5,0x0002             |r2 = 0x02 if unit uses silent walk > Walk on water jump landing site
0017f070: 10400002 beq r2,r0,0x0017f07c     #If unit uses silent walk /Else branch to fly check
0017f074: 30a20004 andi r2,r5,0x0004        |r2 = 0x04 if unit uses fly (and is not a frog)
0017f078: 34630002 ori r3,r3,0x0002              |r3 = r3 updated with 0x02
0017f07c: 10400003 beq r2,r0,0x0017f08c     #If unit is flying /Else branch to teleport check
0017f080: 3082000c andi r2,r4,0x000c        |r2 <>0x00 if unit uses teleport or teleport 2
0017f084: 0805fc25 j 0x0017f094                  >>jump further (avoid teleport check and flag if flying)
0017f088: 34640080 ori r4,r3,0x0080              |r4 = r3 updated with 0x80
0017f08c: 10400007 beq r2,r0,0x0017f0ac     #If unit uses teleport /Else branch to float check
0017f090: 34640008 ori r4,r3,0x0008              |r4 = r3 updated + 0x08
0017f094: 30a20008 andi r2,r5,0x0008             |r2 = 0x08 if unit have float movement  Flying jump landing here
0017f098: 10400012 beq r2,r0,0x0017f0e4          #If unit uses float (and is teleporting or flying) /Else branch to end (avoid float check)
0017f09c: 00801821 addu r3,r4,r0                 |r3 = r3 with fly or teleport enabled
0017f0a0: 3082008e andi r2,r4,0x008e                 |r2 = r4  without walk on/in water flags
0017f0a4: 0805fc39 j 0x0017f0e4                      >>jump to end (r3 updated with 0x40, without 0x10 and 0x20)
0017f0a8: 34430040 ori r3,r2,0x0040                  |r3 = r2 updated with 0x40 flag
0017f0ac: 30a20008 andi r2,r5,0x0008        #Else (unit doesn't uses teleport) r2 = 0x08 if unit's uses/have float
0017f0b0: 10400003 beq r2,r0,0x0017f0c0     #If unit is floating /Else branch to move on water check
0017f0b4: 30620006 andi r2,r3,0x0006             |r2 = 0x02 if unit uses silent walk
0017f0b8: 0805fc39 j 0x0017f0e4                  >>jump to end (r3 = 0x42)
0017f0bc: 34430040 ori r3,r2,0x0040              |r3 = 0x42
0017f0c0: 30a20080 andi r2,r5,0x0080        |Else (not floating) r2 = 0x80 if unit uses walk on water
0017f0c4: 10400003 beq r2,r0,0x0017f0d4     #If unit Walks on water (second check ? Wtf ?)
0017f0c8: 00000000 nop                           | 
0017f0cc: 0805fc39 j 0x0017f0e4                  >>jump to end
0017f0d0: 34630020 ori r3,r3,0x0020              |r3 is updated with 0x20
0017f0d4: 30a20040 andi r2,r5,0x0040        |r2 = 0x40 if unit uses walk in water
0017f0d8: 10400002 beq r2,r0,0x0017f0e4     #If unit uses walk in water #branch to end

Return Locations

0006dcb0: - Knockback_with_bows?
0007d01c: - 0007cff8_-_0007d09c
0007d1ec: - Complex_Height_Data_from_unit_misc_data_and_coordinates
00082820: - Movement_validation_-_float/fly?
0008402c: - Update_Sprite_display_data
00086d04: - 00086b44_-_00086dc0
00177164: - 00176c90_-_0017717c
00184584: - Knockback Calculation