Difference between revisions of "Get Positive Priority (00196908)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Uploaded the correct routine)
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  Get Positive Priority
+
  '''BATTLE.BIN''' :  - Get Positive Priority
 
+
2 Attemps to find a Tile to move on
  00196908: 27bdffe8 addiu r29,r29,0xffe8
+
- if 0xe2d = 1 the two attempts try to get closer to Target the first One has a distance check (based on closest ability range) the second only check priority score.
  0019690c: afbf0010 sw r31,0x0010(r29)
+
------------------------------------------------------------------------------------------
  00196910: 0c065a4f jal 0x0019693c Find Closest Highest Priority
+
Parameter : r4 = Shortest Ability (0x8019f36c)
  00196914: 00002821 addu r5,r0,r0 Prioritize Distance over Priority
+
------------------------------------------------------------------------------------------
  00196918: 14400004 bne r2,r0,0x0019692c Exit if Priority was positive
+
  00196908: 27bdffe8 addiu r29,r29,0xffe8     |
  0019691c: 3c047fff lui r4,0x7fff
+
  0019690c: afbf0010 sw r31,0x0010(r29)       |
  00196920: 3484ffff ori r4,r4,0xffff
+
  00196910: 0c065a4f jal 0x0019693c           |{{f/jal|AI_Post_Action_Movement_Decision_Routine_(0019693c)|AI_Post_Action_Movement_Decision_Routine_(0019693c)}} {{f/std|Find better closer tile beating r4}}
  00196924: 0c065a4f jal 0x0019693c Find Closest Highest Priority
+
  00196914: 00002821 addu r5,r0,r0             |{{f/std|Prioritize Distance over Priority}}
  00196928: 34050001 ori r5,r0,0x0001 Prioritize Priority over Distance
+
  00196918: 14400004 bne r2,r0,0x0019692c     {{f/Cond|If a Tile was found}} {{f/loc|Exit routine}}
 +
  0019691c: 3c047fff lui r4,0x7fff                 |
 +
  00196920: 3484ffff ori r4,r4,0xffff             |
 +
  00196924: 0c065a4f jal 0x0019693c           |{{f/jal|AI_Post_Action_Movement_Decision_Routine_(0019693c)|AI_Post_Action_Movement_Decision_Routine_(0019693c)}} {{f/std|Find better priority }}
 +
  00196928: 34050001 ori r5,r0,0x0001         |{{f/std|Prioritize Priority over Distance}}
 
  0019692c: 8fbf0010 lw r31,0x0010(r29)
 
  0019692c: 8fbf0010 lw r31,0x0010(r29)
 
  00196930: 27bd0018 addiu r29,r29,0x0018
 
  00196930: 27bd0018 addiu r29,r29,0x0018
 
  00196934: 03e00008 jr r31
 
  00196934: 03e00008 jr r31
 
  00196938: 00000000 nop
 
  00196938: 00000000 nop
 +
===Return locations===
 +
'''BATTLE.BIN'''
 +
  00196754: [[Map_movement_decision/data_setting]]                        r4 = Shortest Ability range (8019f36c)
 +
  001968f8: [[Find_Positive_Priority_Target_within_3_Range_(0019689c)]]  r4 = Distance from Target -1 (If Target is enemy and arcing ability range is at least 0x3 (??))
 +
  00198408: [[001982d8_-_001984e8]]

Latest revision as of 13:24, 20 June 2024

BATTLE.BIN :  - Get Positive Priority
2 Attemps to find a Tile to move on
- if 0xe2d = 1 the two attempts try to get closer to Target the first One has a distance check (based on closest ability range) the second only check priority score.
------------------------------------------------------------------------------------------
Parameter : r4 = Shortest Ability (0x8019f36c)
------------------------------------------------------------------------------------------
00196908: 27bdffe8 addiu r29,r29,0xffe8      |
0019690c: afbf0010 sw r31,0x0010(r29)        |
00196910: 0c065a4f jal 0x0019693c            |-->AI_Post_Action_Movement_Decision_Routine_(0019693c) Find better closer tile beating r4
00196914: 00002821 addu r5,r0,r0             |Prioritize Distance over Priority
00196918: 14400004 bne r2,r0,0x0019692c      #If a Tile was found Exit routine
0019691c: 3c047fff lui r4,0x7fff                 |
00196920: 3484ffff ori r4,r4,0xffff              |
00196924: 0c065a4f jal 0x0019693c            |-->AI_Post_Action_Movement_Decision_Routine_(0019693c) Find better priority 
00196928: 34050001 ori r5,r0,0x0001          |Prioritize Priority over Distance
0019692c: 8fbf0010 lw r31,0x0010(r29)
00196930: 27bd0018 addiu r29,r29,0x0018
00196934: 03e00008 jr r31
00196938: 00000000 nop

Return locations

BATTLE.BIN
 00196754: Map_movement_decision/data_setting                        r4 = Shortest Ability range (8019f36c)
 001968f8: Find_Positive_Priority_Target_within_3_Range_(0019689c)   r4 = Distance from Target -1 (If Target is enemy and arcing ability range is at least 0x3 (??))
 00198408: 001982d8_-_001984e8