• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
October 31, 2024, 08:11:51 pm

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed! Find out how you can help in the Recruitment section or our Discord!


ASM Collective BATTLE.BIN Map

Started by formerdeathcorps, January 06, 2011, 05:09:33 am


Celdia

@Raven & FDC - Can you point out for me in the code where the (XA2 * 3/2) for Martial Arts is, or am I misunderstanding how its applying the multiplier and it doesn't do that? Preferably with a HEX address? Because I thought I was seeing what I wanted but the notations here leave me wondering if they're wrong or if I'm just not getting it.

beq r4, r0, (A-UP) If Martial Arts isn't used, GOTO (A-UP)
srl r6, r5, 0x01
addu r6, r5, r6
sh r6, 0x38D0 (r1) If 2H is used and XA2 is PA or SP, XA2 = XA2 + [XA2/2].

Is that supposed to be 2H again or is that for Martial Arts and just mis-commented? If it IS for Martial Arts, what do I change to make the following: If Martial Arts is used and XA2 is PA or SP, XA2 = XA2 + [XA2/ 4 ] ?
  • Modding version: PSX
  • Discord username: Celdia#0

formerdeathcorps

February 21, 2011, 01:28:12 pm #42 Last Edit: February 26, 2011, 05:27:05 pm by formerdeathcorps
Sorry, that's a typo on my part.  The bolded section should be "If Martial Arts is used".
If you want 1/4, change srl r6, r5, 0x01 to 0x02.


lhu r4, 0x38D6 (r1) r4 = Used Ability ID
lui r5, 0x8006
sll r4, r4, 0x03 r4 = r4 * 8
addu r5, r5, r4
lbu r6, -0x1F0D (r5) r6 = AI Byte 1
lbu r7, -0x1F0A (r5) r7 = AI Byte 4
lbu r5, -0x1F0B (r5) r5 = AI Byte 3
andi r6, r6, 0x0010
bne r6, r0, (Un) If AI flag under Learn on Hit is flagged, GOTO (Un)
(Check) andi r7, r7, 0x0080
bne r7, r0, (Br) If the blank AI flag above Direct Attack is flagged, GOTO (Br)
andi r5, r5, 0x0004
bne r5, r0, (Fa) If the Unknown AI flag under Random Hits is flagged, GOTO (Fa)
nop
jr 31 ELSE, GOTO Main Routine
nop

(Un) addiu r6, r0, 0x0064
j (Check) r6 = 100, r4 = Yes, GOTO (Check)
addiu r4, r0, 0x0001

(Br) bne r4, r0, (UnBr) If UnBrave/UnFaith is flagged, GOTO (UnBr)
lbu r7, 0x0024 (r2) r7 = Attacker Brave
j (Mult) ELSE, GOTO (Mult)
(UnBr) lbu r4, 0x0024 (r3) r4 = Defender Brave
subu r7, r6, r7 r7 = 100 - Attacker Brave if UnBrave/UnFaith is flagged
subu r4, r6, r4 r4 = 100 - Defender Brave if UnBrave/UnFaith is flagged
(Mult) lhu r6, 0x38D0 (r1) r6 = XA2
nop
mult r6, r7
mflo r6 r6 = XA2 * (CaBr/Fa or 100 - CaBr/Fa)
nop
nop
mult r6, r4
mflo r6 r6 = XA2 * (CaBr/Fa or 100 - CaBr/Fa) * (TaBr/Fa or 100 - TaBr/Fa)
lui r4, 0x0006
addu r4, r4, 0x8DB8
mult r6, r4
mfhi r6 XA2 = [XA2 * (CaBr/Fa or 100 - CaBr/Fa) * (TaBr/Fa or 100 - TaBr/Fa) / 10000]
jr 31 GOTO Main Routine
sh r6, 0x38D0 (r1) Stores new XA2
(Fa) lbu r5, 0x005C (r2) r5 = Attacker Status Byte 5
lbu r7, 0x005C (r3) r7 = Defender Status Byte 5
andi r5, r5, 0x00C0
beq r5, r0, (Load-AFa) If attacker does not have innocent or faith, GOTO (Load-AFa)
andi r7, r7, 0x00C0
sltiu r5, r5, 0x0080
beq r5, r0, (A-Inn) If attacker has Innocent, GOTO (A-Inn)
nop
j (CheckTar) If attacker has Faith, r5 = 100 and GOTO (CheckTar)
addiu r5, r0, 0x0064
(A-Inn) j (CheckTar) If attacker has Innocent, r5 = 0 and GOTO (CheckTar)
addiu r5, r0, 0x0000
(Load-AFa) lbu r5, 0x0026 (r2) If attacker has neither, r5 = Attacker Faith
(CheckTar) beq r7, r0, (Load-DFa) If defender does not have innocent or faith, GOTO (Load-DFa)
nop
sltiu r7, r7, 0x0080
beq r7, r0, (D-Inn) If defender has Innocent, GOTO (D-Inn)
nop
j (CheckUn) If defender has Faith, r7 = 100 and GOTO (CheckUn)
addiu r7, r0, 0x0064
(D-Inn) j (CheckUn) If defender has Innocent, r7 = 0 and GOTO (CheckUn)
addiu r7, r0, 0x0000
(Load-DFa) lbu r7, 0x0026 (r3) If defender has neither, r7 = Defender Faith
(CheckUn) beq r4, r0, (Normal) If UnBrave/UnFaith isn't flagged, GOTO (Normal)
nop
subu r5, r6, r5 r5 = 100 - Attacker Faith if UnBrave/UnFaith is flagged
subu r7, r6, r7 r7 = 100 - Defender Faith if UnBrave/UnFaith is flagged
(Normal) addu r4, r7, r0 r4 = r7 = Defender Faith
j (Mult) GOTO (Mult)
addu r7, r5, r0 r7 = r5 = Attacker Faith


Note, if you want the above hack to work like Xif's fury hack and add YY to brave and ZZ to faith, here's a slightly modified version (with the differences underlined).


lhu r4, 0x38D6 (r1) r4 = Used Ability ID
lui r5, 0x8006
sll r4, r4, 0x03 r4 = r4 * 8
addu r5, r5, r4
lbu r6, -0x1F0D (r5) r6 = AI Byte 1
lbu r7, -0x1F0A (r5) r7 = AI Byte 4
lbu r5, -0x1F0B (r5) r5 = AI Byte 3
andi r6, r6, 0x0010
bne r6, r0, (Un) If AI flag under Learn on Hit is flagged, GOTO (Un)
(Check) andi r7, r7, 0x0080
bne r7, r0, (Br) If the blank AI flag above Direct Attack is flagged, GOTO (Br)
andi r5, r5, 0x0004
bne r5, r0, (Fa) If the Unknown AI flag under Random Hits is flagged, GOTO (Fa)
nop
jr 31 ELSE, GOTO Main Routine
nop

(Un) addiu r6, r0, 0x0064
j (Check) r6 = 100, r4 = Yes, GOTO (Check)
addiu r4, r0, 0x0001

(Br) bne r4, r0, (UnBr) If UnBrave/UnFaith is flagged, GOTO (UnBr)
lbu r7, 0x0024 (r2) r7 = Attacker Brave
j (AddBr) ELSE, GOTO (AddBr)
(UnBr) lbu r4, 0x0024 (r3) r4 = Defender Brave
subu r7, r6, r7 r7 = 100 - Attacker Brave if UnBrave/UnFaith is flagged
subu r4, r6, r4 r4 = 100 - Defender Brave if UnBrave/UnFaith is flagged
(AddBr) addiu r7, r7, 0x00YY r7 = Attacker Brave + 0xYY
j (Mult) GOTO (Mult)
addiu r4, r4, 0x00YY r4 = Defender Brave + 0xYY
(AddFa) addiu r7, r7, 0x00ZZ r7 = Attacker Faith + 0xZZ
addiu r4, r4, 0x00ZZ r4 = Defender Faith + 0xZZ

(Mult) lhu r6, 0x38D0 (r1) r6 = XA2
nop
mult r6, r7
mflo r6 r6 = XA2 * (CaBr/Fa or 100 - CaBr/Fa)
nop
nop
mult r6, r4
mflo r6 r6 = XA2 * (CaBr/Fa or 100 - CaBr/Fa) * (TaBr/Fa or 100 - TaBr/Fa)
lui r4, 0x0006
addu r4, r4, 0x8DB8
mult r6, r4
mfhi r6 XA2 = [XA2 * (CaBr/Fa or 100 - CaBr/Fa) * (TaBr/Fa or 100 - TaBr/Fa) / 10000]
jr 31 GOTO Main Routine
sh r6, 0x38D0 (r1) Stores new XA2
(Fa) lbu r5, 0x005C (r2) r5 = Attacker Status Byte 5
lbu r7, 0x005C (r3) r7 = Defender Status Byte 5
andi r5, r5, 0x00C0
beq r5, r0, (Load-AFa) If attacker does not have innocent or faith, GOTO (Load-AFa)
andi r7, r7, 0x00C0
sltiu r5, r5, 0x0080
beq r5, r0, (A-Inn) If attacker has Innocent, GOTO (A-Inn)
nop
j (CheckTar) If attacker has Faith, r5 = 100 and GOTO (CheckTar)
addiu r5, r0, 0x0064
(A-Inn) j (CheckTar) If attacker has Innocent, r5 = 0 and GOTO (CheckTar)
addiu r5, r0, 0x0000
(Load-AFa) lbu r5, 0x0026 (r2) If attacker has neither, r5 = Attacker Faith
(CheckTar) beq r7, r0, (Load-DFa) If defender does not have innocent or faith, GOTO (Load-DFa)
nop
sltiu r7, r7, 0x0080
beq r7, r0, (D-Inn) If defender has Innocent, GOTO (D-Inn)
nop
j (CheckUn) If defender has Faith, r7 = 100 and GOTO (CheckUn)
addiu r7, r0, 0x0064
(D-Inn) j (CheckUn) If defender has Innocent, r7 = 0 and GOTO (CheckUn)
addiu r7, r0, 0x0000
(Load-DFa) lbu r7, 0x0026 (r3) If defender has neither, r7 = Defender Faith
(CheckUn) beq r4, r0, (Normal) If UnBrave/UnFaith isn't flagged, GOTO (Normal)
nop
subu r5, r6, r5 r5 = 100 - Attacker Faith if UnBrave/UnFaith is flagged
subu r7, r6, r7 r7 = 100 - Defender Faith if UnBrave/UnFaith is flagged
(Normal) addu r4, r7, r0 r4 = r7 = Defender Faith
j (AddFa) GOTO (AddFa)
addu r7, r5, r0 r7 = r5 = Attacker Faith
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.


formerdeathcorps

February 22, 2011, 03:44:18 am #44 Last Edit: February 22, 2011, 04:18:58 am by formerdeathcorps
Quote
This routine starts by checking 3 flags.  The first is the Un- flag, checking to see whether the ability is trying to connocate a typical C(Br or Fa) * T(Br or Fa) / 10000 or a Malak-inspired (100-C[Br or Fa]) * (100-T[Br or Fa]) / 10000.  It then checks to see which is actually flagged between Br or Fa, and makes the jump to the proper section of the routine and calculating the Br and Fa (normal or inverted) that will actually be inserted into the routines.  It then adds constants (if using the latter version) to this end-value Br and Fa, avoiding errors in the inverted conversion.  It then "builds" the calculation of (end TBrFa * CBrFa / 10000).  Finally, it checks for Innocent or Faith, setting the TFa or CFa values to their proper setting if true.  In then performs a secondary "Un-" check for if either of these status are found, setting "Faith" to 100 if Innocent is found (meaning you cause maximum damage with an UnFaith skill) or 0 if Faith is found (meaning you cause no damage with an UnFaith skill).


No, that's not right.  It should be more like this.

This routine starts by checking 3 flags.  The first is the Un- flag, checking to see whether the ability is trying to connocate a typical C(Br or Fa) * T(Br or Fa) / 10000 or a Malak-inspired (100-C[Br or Fa]) * (100-T[Br or Fa]) / 10000.  It then checks to see which is actually flagged between Br or Fa, and makes the jump to the proper section of the routine and calculating the Br and Fa (normal) that will actually be inserted into the routines.  Innocent and Faith is then calculated for the faith routine. It then calculates the inverted Brave or Faith (if flagged) and adds constants (if using the latter version) to this end-value Br and Fa.  It finally then "builds" the calculation of (end TBrFa * CBrFa / 10000).


I suspect the non-linear nature of that routine confused you, Raven, on top of typing while tired.

I made a slight error.  The following routine comes before Faith/Fury on damage formulas.


lhu r4, 0x38D0 (r1) Loads r4 as XA2
lhu r5, 0x38CE (r1) Loads r5 as XA1
beq r4, r0 (Set1) If XA2 is 0, GOTO (Set1)
nop
(Mult) mult r4, r5
mflo r4 XA2 = XA1 * XA2
jr 31 Return to Main Routine
sh r4, 0x38D0 (r1) Stores new XA2

(Set1) j (Mult) GOTO (Mult)
addiu r4, r0, 0x0001 If XA2 = 0, XA2 is now 1.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

RavenOfRazgriz

February 22, 2011, 04:11:18 am #45 Last Edit: February 27, 2011, 11:02:33 am by RavenOfRazgriz
Mostly the latter, considering all you had to do was condense/change the order of my sentences and edit maybe four words.

EDIT: Update to include the Base Damage Routine, which is properly located before the Brave/Faith Routine Knockback and Critical Hit routine.

Loads the attacker's stats and reads the X variable as input in FFTPatcher.  When looking for both XA1 and XA2, there are 16 combinations:

PA and PA
PA and MA
PA and SP
PA and WP
MA and PA
MA and MA
MA and SP
MA and WP
SP and PA
SP and MA
SP and SP
SP and WP
WP and PA
WP and MA
WP and SP
WP and WP

Basically, this allows you to take a formula and "load" it with values based on X.  So, the same formula that tells a skill to be PA * WP would also be MA * WP, SP * MA, WP * SP, and a host of other combinations based on your input for X.  Some of the values on the above table (PA and WP vs WP and PA) may seem redundant, but they certainly aren't, because all boosts and decrements are based on the XA2 value, meaning PA*MA and MA*PA and very different Formula.


Loads whatever value is defined as XA2, checks to see if attack's Element is the same as an Element that the unit as "Strengthen:" enabled for, and increases XA2 by 25% for the duration of this attack, resulting in a 25% damage boost.


If target is afflicted with any combination of Charge/Sleep/Frog/Chicken, XA2 is boosted by 50%, resulting in a 50% damage boost.


Checks XA2 value.  If XA2 is WP, unit is using Two Hands, weapon is compatible with Two Hands Support, XA2 is multiplied by 2, resulting in double damage.  If XA2 is PA or SP, unit is using Martial Arts, and unit does not have a weapon equipped in either hand, XA2 is multiplied by 1.5, resulting in a 50% damage boost.  If XA2 is PA, SP, or WP, unit is using Attack UP, XA2 is multiplied by 1.34x, resulting in a ~34% damage boost.  If XA2 is MA , unit is using Magic Attack UP, XA2 is multiplied by 1.34x, resulting in a ~34% damage boost.


Loads Ability ID, then checks Ability Flags for Defense UP.  If Defense UP is found as checked, the target unit is checked for having the Defense UP Support Ability and/or the status Protect, and the proper routines are run based on which are found, if any.  Then, the Ability Flags are checked for Magic Defense UP.  If Magic Defense UP is found as checked, the target unit is checked for having the Magic Defense UP Support Ability and/or the status Shell, and the proper routines are run based on which are found, if any.  Yes, this means by flagging both, you can create skills that are blocked by all of Defense UP, Protect, Magic Defense UP, and Shell.


Loads Ability's Element, checks it against the target unit's enabled "Half:" elements, then divides XA2 by 2 for the duration of the ability if true, resulting in a 50% damage reduction.


As they share the XA1 and XA2 code, this begins by checking whether you are using Formula 08, Formula 09, Formula 0A, Formula 0B, or Formula 0C, and branches to the proper code to "complete" the Formula.

If Formula = 08, the Formula is "completed" as (Rdm(1...XA1)+Y)*XA2.  If you remember our XA1 and XA2 tables, this means this formula can be anything from (Rdm(1...PA)+Y)*WP, which you should remember as the "Axe" Formula, all the way to (Rdm(1...MA)+Y)*MA or other crazy fun combinations based on X.

If Formula = 09, the Formula is "completed" as (XA1*YA3+Y/16)*XA2.  Now you'll notice a new value, YA3, and that Y is being divided.  This is because this is a three-entry Formula, where Y determines the third entry on a loop where each time through, the Y-boost for the formula is incremented by 1.  If you load this up with (PA*Br/100+Y)*WP, you may recognize this as the Katana or Knight Sword Formula, but as usual, this is much more than that.  In this case, YA3 controls the input that is essentially (0...1), and it can be anything as follows:

Caster's Br/100
Caster's Fa/100
Caster's (100-Br)/100
Caster's (100-Fa)/100
Caster's CurHP/MaxHP
Caster's CurMP/MaxMP
Caster's (MaxHP-CurHP)/MaxHP
Caster's (MaxMP-CurMP)/MaxMP
Target's Br/100
Target's Fa/100
Target's (100-Br)/100
Target's (100-Fa)/100
Target's CurHP/MaxHP
Target's CurMP/MaxMP
Target's (MaxHP-CurHP)/MaxHP
Target's (MaxMP-CurMP)/MaxMP

If Formula = 0A, the Formula is "completed" as ((XA1+YA3)/2+Y/8)*XA2.  You may recognize this Formula to be ((PA+SP)/2+Y)*WP or ((PA+MA)/2+Y)*WP, the Longbow and Book Formula. Again, not only does this act as much more than those, but this also substitutes as PA*WP and similar formula by being able to be loaded as ((PA+PA)/2+Y)*WP, etc.  Again, YA3 is a third value determined by the Y input, this time with 8 potential options:

PA
MA
SP
WP
W-Ev/2
S-Ev P/3
S-Ev M/2
LVL/4

(Note - the divisors on these values can easily be modified or removed for those using lower evasion values.)

If Formula = 0B, the Formula is "completed" as (XA1+Y)/2*XA2.  You may know this Formula to be (PA+Y)/2*PA, (PA+Y)/2*MA, or (MA+Y)/2*MA, the Formula for Punch Art, Geomancy, and Truth, respectively.  Obviously, though, because this runs off XA1 and XA2, it can now be much more than that based on X input.

If Formula = 0C, the Formula is "completed" as XA1+Y+XA2.  You may know this Formula to be PA+Y+WP, the Formula used by the Knight's Break techniques, though now it can support far more than just PA and WP obviously.  There is no special operation performed by Y here.


This checks if the "Zodiac Enabled" Flag has been checked, checks to see neither is Serpentarius, checks alignment, checks Gender for Best/Worst, and modifies XA2 based on the results of those checks.


Load XA2, XA1. Check for XA2=0, if true, set XA2 to 1, else multiply XA2 by XA1 and store the new XA2.


This routine starts by checking 3 flags.  The first is the Un- flag, checking to see whether the ability is trying to connocate a typical C(Br or Fa) * T(Br or Fa) / 10000 or a Malak-inspired (100-C[Br or Fa]) * (100-T[Br or Fa]) / 10000.  It then checks to see which is actually flagged between Br or Fa, and makes the jump to the proper section of the routine and calculating the Br and Fa (normal) that will actually be inserted into the routines.  Innocent and Faith is then calculated for the faith routine. It then calculates the inverted Brave or Faith (if flagged) and adds constants (if using the latter version) to this end-value Br and Fa.  It finally then "builds" the calculation of (end TBrFa * CBrFa / 10000).


This routine starts by checking your Ability ID and whether the Critical Hit flag is toggled.  If yes, this gives your skill a percent chance to land a Critical Hit as defined by the user. (The rate can be modified by editing the code.)  If a Critical Hit lands, an extra value from 1 to the original damage score is added to the attack's damage.  It then checks to see whether the Knockback flag is toggled.  If so, it rolls for Knockback (the percent chance can again be changed my modifying the code) then checks whether user is targeting self, a Chocobo, a mounted unit, then... this routine does a whole load or horseshit you don't need to know about unless you intend to modify it.  Just know it checks for various map bounds, illegal panels to be knocked into, etc., along with the attacker's direction, and sends the unit in the correct direction based on all these factors.  If the unit performing the Knockback is at a diagonal, there is a semi-random element involved as to whether the unit being Knocked will go one direction or the other.  It then checks for the height drop and any damage that should be inflicted, including a random +/- modifier to compensate for the removed acknowledgement of .5h tiles.

formerdeathcorps

February 23, 2011, 04:20:47 am #46 Last Edit: March 03, 2011, 05:54:32 am by formerdeathcorps
Finally, my knockback routine is done.

There are some small differences with FFT:
1) Sloped height is no longer calculated.
2) Frogged units can be knocked back.  Units with float (status and movement ability), fly, or ignore height do not take damage.
3) Critical attacks now no longer default to knockback.
4) WE no longer consider halves of elevation.  This means a unit from 7h can technically be knocked to a tile of 7.5h, which previously was not allowed.
5) COMING SOON: There will be a 5% of HPMax Variance on fall damage to compensate for not considering halves of elevation.


lhu r4, 0x38D6 (r1) r4 = Used Ability ID
lui r5, 0x8006
sll r4, r4, 0x03 r4 = r4 * 8
addu r4, r5, r4
lbu r9, -0x1409 (r4) r9 = AI Byte 8
addu r8, r31, r0 Sends r31 into r8 because r31 will be modified by jal commands below.
andi r4, r9, 0x0010
beq r4, r0, (KB Check) If the first blank flag under the Third Unknown in the "Learn on Hit" box is unflagged, GOTO (KB Check)
sb r0, 0x38CC (r1) Reset Higher Tile Flag
jal (RNG) ELSE, GOTO (RNG)
addiu r7, r0, 0x0064
addiu r4, r0, 0x0004
sub r4, r4, r7 r4 = 4 - RN from 0 to 99
bltz r4 (KB check) If RN > 4, GOTO (KB check)
addiu r5, r0, 0x0001
sb r5, 0x018D (r2) Flag attack as critical.
jal (RNG) GOTO (RNG)
lhu r7, 0x38D0 (r1) r7 = Base Damage
lhu r6, 0x38D0 (r1) r6 = Base Damage
addiu r7, r7, 0x0001 r7 = {1...Base Damage}
addu r6, r6, r7 New Damage = Base Damage + {1...Base Damage}
sh r6, 0x38D0 (r1) Store New Damage
(KB check) andi r4, r9, 0x0008
beq r4, r0, (E) If the second blank flag under the Third Unknown in the "Learn on Hit" box is unflagged, GOTO (E)
sb r0, 0x38EE (r1) Reset Knockback Height
jal (RNG) GOTO (RNG)
addiu r7, r0, 0x0064
addiu r4, r0, 0x0031
sub r4, r4, r7 r4 = 49 - RN from 0 to 99
bltz r4 (E) If RN > 49, GOTO (E)
(KB) lbu r5, 0x0182 (r3)
beq r2, r3, (E) If you are targeting yourself with knockback, GOTO (E)
lbu r4, 0x0005 (r3)
lbu r6, 0x0047 (r2) r6 = Attacker X Coordinate
andi r4, r4, 0x0004
bne r4, r0, (E) If target is immortal, GOTO (E)
lbu r7, 0x0047 (r3) r7 = Defender X Coordinate
bne r5, r0, (E) If target is riding a chocobo or in 2h+ water, GOTO (E)
lui r4, 0x800E
lbu r5, 0x4E9C (r4) r5 = Map Maximum X
beq r7, r0 (CheckEdge1) If Defender X Coordinate = 0, GOTO (CheckEdge1)
sb r0, 0x38EC (r1) Reset Knockback Flag
beq r7, r5 (CheckEdge2) If Defender X Coordinate = Map Maximum X, GOTO (CheckEdge2)
nop
sub r5, r6, r7 XA1 Byte 1 = Attacker X - Defender X
j (YChecks) Store Byte 1 of XA1 and GOTO (YChecks)
sb r5, 0x38CE (r1)
(CheckEdge1) beq r6, r0 (YChecks) If Defender and Attacker X Coordinate = 0, GOTO (YChecks)
sb r0, 0x38CE (r1) Store Byte 1 of XA1 as 0.
(E) jr r8 ELSE, unflag knockback and return to Main Routine
sb r0, 0x38EC (r1)
(CheckEdge2) beq r6, r5 (YChecks) If Defender and Attacker X Coordinate = Maximum, GOTO (YChecks)
sb r0, 0x38CE (r1) Store Byte 1 of XA1 as 0.
jr r8 If Defender X Coordinate = Maximum, but Attacker X coordinate is not maximal, unflag knockback and return to Main Routine
sb r0, 0x38EC (r1)
(YChecks) lbu r6, 0x0048 (r2) r6 = Attacker Y Coordinate
lbu r7, 0x0048 (r3) r7 = Defender Y Coordinate
lbu r5, 0x4EA0 (r4) r5 = Map Maximum Y
beq r7, r0, (CheckEdge3) If Defender Y Coordinate = 0, GOTO (CheckEdge3)
nop
beq r7, r5, (CheckEdge4) If Defender Y Coordinate = Maximum Y, GOTO (CheckEdge4)
nop
sub r5, r6, r7 XA1 Byte 1 = Attacker Y - Defender Y
j (NewXY) Store Byte 2 of XA1 and GOTO (NewXY)
sb r5, 0x38CF (r1)
(CheckEdge3) beq r6, r0 (NewXY) If Defender and Attacker Y Coordinate = 0, GOTO (NewXY)
sb r0, 0x38CF (r1) Store Byte 2 of XA1 as 0.
jr r8 If Defender Y Coordinate = 0, while Attacker Y Coordinate isn't, unflag knockback and return to Main Routine
sb r0, 0x38EC (r1)
(CheckEdge4) beq r6, r5 (NewXY) If Defender and Attacker Y Coordinate = Maximum, GOTO (NewXY)
sb r0, 0x38CF (r1) Store Byte 2 of XA1 as 0.
jr r8 If Defender Y Coordinate = Maximum, but Attacker Y coordinate is not maximal, unflag knockback and return to Main Routine
sb r0, 0x38EC (r1)
(NewXY) lb r4, 0x38CE (r1) r4 = Attacker X - Defender X
lb r5, 0x38CF (r1) r5 = Attacker Y - Defender Y
bgez r4 (+X) If r4 is greater than or equal to 0, GOTO (+X)
addiu r7, r0, 0x0100
addiu r6, r0, 0x0001 If r4 < 0, r6 = 1
j (YDiff) Make r4 positive and GOTO (YDiff)
subu r4, r7, r4 If r4 < 0, r4 = 0x100 - r4 (as unsigned byte), essentially the equivalent of multiplying a signed byte by -1.
(+X) bne r4, r0 (YDiff) If r4 > 0, r6 = 2 and GOTO (YDiff)
addiu r6, r0, 0x0002
addiu r6, r0, 0x0000 ELSE, r6 = 0
(YDiff) bgez r5 (+Y) If r5 is greater than or equal to 0, GOTO (+Y)
addiu r7, r0, 0x0100
ori r6, r6, 0x0004 If r5 < 0, r6 = r6 OR 0x4 = r6 + 4 (because r6 = 0, 1, or 2)
j (CoordChange) Make r5 positive and GOTO (CoordChange)
subu r5, r7, r5 If r5 < 0, r5 = 0x100 - r5 (as unsigned byte), essentially the equivalent of multiplying a signed byte by -1.
(+Y) beq r5, r0 (CoordChange) If r5 = 0, r6 = r6 and GOTO (CoordChange)
ori r6, r6, 0x0000
ori r6, r6, 0x0008 ELSE, r6 = r6 OR 0x8 = r6 + 8 (because r6 = 0, 1, or 2)
(CoordChange) jal (RNG) r7 = r4 + r5 = Distance Attacker is from Defender and GOTO (RNG)
addu r7, r4, r5
sub r7, r4, r7 r7 = |Attacker X - Defender X| - {0...|Attacker X - Defender X| + |Attacker Y - Defender Y| - 1}
bgtz r7 (ChangeX) If r7 > 0, GOTO (Change X)
lbu r5, 0x0048 (r3) r5 = Defender Y
andi r6, r6, 0x0008
beq r6, r0, (+1Y) If Attacker Y < Defender Y, GOTO (+1Y)
nop
j (NewCoord) If Attacker Y > Defender Y, Defender Y = Defender Y - 1 and GOTO (NewCoord)
addi r5, r5, -0x0001
(+1Y) j (NewCoord) If Attacker Y < Defender Y, Defender Y = Defender Y + 1 and GOTO (NewCoord)
addiu r5, r5, 0x0001
(ChangeX) lbu r4, 0x0047 (r3) r4 = Defender X
andi r6, r6, 0x0002
beq r6, r0, (+1X) If Attacker X < Defender X, GOTO (+1X)
nop
j (NewCoord) If Attacker X > Defender X, Defender X = Defender X - 1 and GOTO (NewCoord)
addi r4, r4, -0x0001
(+1X) addiu r4, r4, 0x0001 If Attacker X < Defender X, Defender X = Defender X + 1
(NewCoord) lui r6, 0x800E
lbu r6, 0x4E9C (r6) r6 = Map Maximum X
sb r4, 0x38CE (r1) Store Defender X as XA1 Byte 1
sb r5, 0x38CF (r1) Store Defender Y as XA1 Byte 2
lhu r5, 0x0048 (r3) r5 = Pre-Attack Defender Y + Unit Facing
lbu r4, 0x0047 (r3) r4 = Pre-Attack Defender X
andi r7, r5, 0x8000
jal (TileOffset) GOTO (TileOffset)
andi r5, r5, 0x00FF r5 = Pre-Attack Defender Y
bne r7, r0, (HigherTile) If the defender stood on a higher tile, GOTO (HigherTile)
nop
j (NewHeight) ELSE, r7 = Height of Lower Tile and GOTO (NewHeight)
lbu r7, -0x0732 (r4)
(HigherTile) lbu r7, 0x00CE (r4) r7 = Height of Higher Tile
(NewHeight) lbu r5, 0x38CF (r1) r5 = Defender Y (current)
jal (TileOffset) GOTO (TileOffset)
lbu r4, 0x38CE (r1) r4 = Defender X (current)
lbu r9, 0x005A (r3) r9 = Current Status Byte 3
lbu r5, 0x0093 (r3) r5 = Movement Status Byte 1
andi r9, r9. 0x0040
bne r9, r0, (SCheckFail) If target has float status, GOTO (SCheckFail)
lbu r2, 0x0095 (r3) r2 = Movement Status Byte 3
andi r5, r5, 0x0002
bne r5, r0, (SCheckFail) If target has ignore height, GOTO (SCheckFail)
andi r2, r2, 0x000C
beq r2, r0, (SCheckGood) If target doesn't have float/fly, GOTO (SCheckGood)
addu r9, r0, r0 If target doesn't have float/fly/ignore height, r9 = 0
(SCheckFail) addiu r9, r0, 0x0001 ELSE, r9 = 1
(SCheckGood) lbu r5, -0x0732 (r4) r5 = Height of Current Lower Tile
lbu r2, -0x072E (r4) r2 = Byte 7 of Current Lower Tile Data
sltu r4, r7, r5
bne r4, r0 (E) IF r7 < r5, GOTO (E)
andi r2, r2, 0x0001
bne r2, r0, (HigherTile) ELSE IF lower tile is impassable, GOTO (HigherTile)
sub r4, r7, r5 r4 = r7 - r5
bne, r9, r0, (NoFallDamageL) ELSE If target has float/fly/ignore height, GOTO (NoFallDamageL)
nop
sb r4, 0x38EE (r1) ELSE, Store r4 as knockback height
(NoFallDamageL) ori r4, r0, 0x0001 r4 = 1
sb r4, 0x38EC (r1) Flag Knockback
(HigherTile) lbu r5, 0x38CF (r1) r5 = Defender Y (current)
jal (TileOffset) GOTO (TileOffset)
lbu r4, 0x38CE (r1) r4 = Defender X (current)
lbu r5, 0x00CE (r4) r5 = Height of Current Higher Tile
lbu r2, 0x00D2 (r4) r2 = Byte 7 of Current Higher Tile Data
beq r5, r0 (E2) IF r5 = 0, GOTO (E2)
sltu r4, r7, r5
bne r4, r0 (E2) ELSE IF r7 < r5, GOTO (E2)
andi r2, r2, 0x0001
bne r2, r0, (E) ELSE IF higher tile is impassable, GOTO (E)
sub r4, r7, r5 r4 = r7 - r5
bne, r9, r0, (NoFallDamageH) ELSE If target has float/fly/ignore height, GOTO (NoFallDamageH)
addu r6, r0, r0 r6 = 0
sb r4, 0x38EE (r1) ELSE, store r4 as Knockback Height.
(NoFallDamageH) ori r4, r0, 0x0001 r4 = 1
sb r4, 0x38EC (r1) Flag Knockback
(E2) lbu r4, 0x38EC (r1) r4 = Knockback flag.
nop
beq r4, r0, (E) If Knockback is not flagged, GOTO (E)
nop
bne r6, r0, (LowerFlag) ELSE If r6 = Map Maximum X (and not 0), GOTO (LowerFlag)
addiu r7, r0, 0x0001 r7 = 1
sb r7, 0x38CC (r1) ELSE, flag Higher Tile
(LowerFlag) lbu r5, 0x38C1 (r1) r5 = The Xth unit on map (target)
lbu r4, 0x38CE (r1) r4 = Target X (current)
sb r5, 0x38EF (r1) Store r5.
lbu r5, 0x38CF (r1) r5 = Target Y (current)
sb r4, 0x38CA (r1) Store r4.
lbu r4, 0x019D (r3) r4 = Attack Elemental Modifier Flags vs. Target
sb r5, 0x38CB (r1) Store r5.
ori r4, r4, 0x0040 r4 = r4 OR 0x40
jr r8 GOTO Main Routine
sb r4, 0x019D (r3) Store r4, which now has a knockback on attack flag

(TileOffset) mult r5, r6
mflo r5 r5 = Map Maximum X * Defender Y (pre-attack or current)
addiu r5, r5, r4 r5 = Map Maximum X * Defender Y + Defender X (pre-attack or current)
sll r5, r5, 0x03 r5 = r5 * 8
lui r4, 0x8019
jr 31  Return to Critical/Knockback Routine
addu r4, r4, r5

(RNG) lui r4, 0xA001
lw r5, -0x6FF0 (r4) Load random word.
lui r6, 0x41C6
addiu r6, r6, 0x4E6D
multu r5, r6
mflo r5
addiu r5, r5, 0x3039
sw r5, -0x6FF0 (r4) Store new Random Word.
mult r7, r5
jr 31 Return to Critical/Knockback Routine
mfhi r7 r7 = {0...value(r7)-1}

BATTLE.BIN
0x123EB0
00000000

BATTLE.BIN
0x11408C
00000000
00000000

BATTLE.BIN
0x1140FC
00000000
00000000

BATTLE.BIN
0x115FD8
EC

BATTLE.BIN
0x115FE0
01

BATTLE.BIN
0x124420
EC

BATTLE.BIN
0x124428
01

BATTLE.BIN
0x116250
EC

BATTLE.BIN
0x1162AC
EC

BATTLE.BIN
0x1162B4
01

BATTLE.BIN
0x1162C4
EC

BATTLE.BIN
0x123E50
EC

BATTLE.BIN
0x119EB8
lui r18, 0x8019 or 1980123C
0x119EC4
lbu r18, 0x38CC (r18) or CC385292

The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Vanya

That sounds like a huge improvement over the original. Huzzah!
  • Modding version: Other/Unknown
¯\(°_0)/¯

RavenOfRazgriz

February 26, 2011, 07:37:12 pm #48 Last Edit: February 27, 2011, 11:03:08 am by RavenOfRazgriz
5) Is the unit just not Knocked back, or is the option to pick it up given?  If the option is given, what happens if the unit chooses No?  You don't want there to be a Knight standing inside of a Treasure Box or something equally stupid occurring.

I'll trace through that retarded monster of a routine that's still maybe a third of what Square originally had coded and do my retarded-people-friendly writeup tonight.  I mostly know how it works but I'm having a bad headache so I'd rather not mess this one up like I did the last one.

EDIT: added KB/CHit routine description to my previous post.  Don't feel like moving it around to this one.

formerdeathcorps

Quote from: RavenOfRazgriz on February 26, 2011, 07:37:12 pm
5) Is the unit just not Knocked back, or is the option to pick it up given?  If the option is given, what happens if the unit chooses No?  You don't want there to be a Knight standing inside of a Treasure Box or something equally stupid occurring.


My code actually does not address that issue.  I checked the code again.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

formerdeathcorps

March 02, 2011, 11:56:15 pm #50 Last Edit: April 14, 2011, 01:28:02 pm by formerdeathcorps
All right, next routine.

DONE!


lw r2, 0x2D94 (r1) r2 = Attacker Offset
lhu r4, 0x38D6 (r1) r4 = Ability ID
lbu r8, 0x3904 (r1) r8 = Weapon Elemental
lbu r5, 0x38F3 (r1) r5 = Ability Flags Byte 1
lbu r7, 0x38F7 (r1) r7 = Ability Elemental
andi r9, r5, 0x0020
beq r9, r0 (CheckWS) If Ranged Weapon is not flagged, GOTO (CheckWS)
lui r6, 0x8006
addu r7, r8, r0 ELSE, Ability Elemental = Weapon Elemental
(CheckWS) andi r9, r5, 0x0004
beq r9, r0 (CheckNull) If Weapon Strike is not flagged, GOTO (CheckNull)
nop
or r7, r7, r8 ELSE, Ability Elemental = Weapon Elemental + Ability Elemental
(CheckNull) sll r4, r4, 0x03 r4 = Ability ID * 8
addu r6, r6, r4 r6 = r6 + Ability ID * 8
lbu r8, 0x006E (r3) r8 = Target Elemental Nullification Byte
lhu r4, 0x0058 (r3) r4 = Target Status Bytes 1 and 2
andi r8, r8, r7
bne r8, r0, (ENull) If element is Nulled, GOTO (ENull)
lbu r6, -0x140B (r6) r6 = AI Flags Byte 5
lbu r8, 0x0070 (r3) ELSE, r8 = Target Elemental Weakness Byte
andi r4, r4, 0x0410
beq r4, r0, (CheckOil) If target is not undead or vampire (has blood suck), GOTO (CheckOil)
addiu r9, r0, 0x0001
ori r8, r8, 0x0002 ELSE, Target is now weak against holy
(CheckOil) lbu r4, 0x005A (r3) r4 = Target Status Bytes 3
sb r9, 0x018C (r3) Flag attack as hit.
andi r4, r4, 0x0080
beq r4, r0 (NoStatusWeak) If target does not have oil, GOTO (NoStatusWeak)
nop
ori r8, r8, 0x0080 ELSE, Target is now weak against fire
(NoStatusWeak) lhu r4, 0x38D0 (r1) r4 = Base Damage
andi r6, r6, 0x0020
beq r6, r0, (EWeak) If AI Undead Reverse Flag is not flagged, r9 = 1 and GOTO (EWeak)
addiu r9, r0, 0x0001
andi r9, r5, 0x0080 ELSE r9 = 0, if the first blank flag under Player Abilities isn't flagged (healing), or 80 if it is (drain)
(EWeak) lbu r5, 0x38D6 (r1) r5 = Ability ID
lui r6, 0x8006
sll r5, r5, 0x03 r5 = Ability ID * 8
addu r6, r6, r5 r6 = r6 + Ability ID * 8
lbu r5, -0x140C (r6) r5 = AI Flags Byte 4
and r8, r8, r7
beq r8, r0, (SetupDMG) If the target is not weak against the spell's element, GOTO (SetupDMG)
addi r9, r9, -0x0001
sll r4, r4, 0x01 ELSE, r4 = r4 * 2
(SetupDMG) andi r5, r5, 0x00A0
beq r5, r0, (EAbsorb) If the AI HP and MP flags are unflagged, GOTO (EAbsorb)
addu r6, r4, r0 r6 = r4
andi r6, r5, 0x0080
beq r6, r0 (-MP) ELSE, r6 = 0 or 0x80 and if AI flag HP is not flagged (r6 = 0), GOTO (-MP)
nop
andi r6, r5, 0x0040
beq r6, r0 (-HP) ELSE, If AI flag MP is not flagged, GOTO (-HP)
sh r4, 0x0190 (r3) Stores HP Damage as 2x Base Damage
srl r4, r4, 0x01
(-MP) sh r4, 0x0194 (r3) Stores r4 as MP Damage
(-HP) lbu r4, 0x019D (r3) r4 = Elemental Resistance Byte
beq r8, r0, (EAbsorb) If the target is not weak against the spell's element, GOTO (EAbsorb)
lbu r6, 0x01B1 (r3) r6 = Attack Type Byte
ori r4, r4, 0x0008 ELSE, r4 includes damage is elemental weakness
ori r6, r6, 0x00A0 r6 includes HP/MP Damage
sb r4, 0x019D (r3) Store r4 as elemental resistance byte
bgtz r9, (DrainFlags) If attack is supposed to drain, GOTO (DrainFlags)
sb r6, 0x01B1 (r3) Store r6 as attack type byte
j (EAbsorb) ELSE, GOTO (EAbsorb)
nop
(DrainFlags) lhu r4, 0x0194 (r3) r4 = MP Damage Dealt
lhu r5, 0x002C (r3) r5 = Target MP
lhu r6, 0x002C (r3) r6 = Target MP
sub r5, r5, r4
bltz r5, (ExcessMPDMG) If target MP < MP Damage Dealt, GOTO (ExcessMPDMG)
nop
j (HPDrain) GOTO (HPDrain)
sh r4, 0x0196 (r2) ELSE, Set MP restored to MP Damage Dealt.
(ExcessMPDMG) sh r6, 0x0196 (r2) If target MP < MP Damage Dealt, set MP restored as target MP.
(HPDrain) lhu r4, 0x0190 (r3) r4 = HP Damage Dealt
lhu r5, 0x0028 (r3) r5 = Target HP
lhu r6, 0x0028 (r3) r6 = Target HP
sub r5, r5, r4
bltz r5, (ExcessHPDMG) If target HP < HP Damage Dealt, GOTO (ExcessMPDMG)
nop
j (SelfFlags) GOTO (SelfFlags)
sh r4, 0x0192 (r2) ELSE, Set HP restored to HP Damage Dealt.
(ExcessHPDMG) sh r6, 0x0192 (r2) If target HP < HP Damage Dealt, set HP restored as target HP.
(SelfFlags) ori r4, r0, 0x0001
lbu r5, 0x01B1 (r2) r5 = Attack Type Byte of caster.
sb r4, 0x018C (r2) Drain will affect caster.
ori r5, r5, 0x0050 r5 includes HP/MP Healing
sb r5, 0x01B1 (r2) r5 is stored as the caster attack type byte.
ori r6, r0, 0x0100 r6 = 0x100
beq r9, r6, (E) If r9 = 0x100 (only possible if drain attack has no elemental modifiers), GOTO (E)
(EAbsorb) lbu r4, 0x0058 (r3) r4 = Target Status Bytes 1
lbu r8, 0x006D (r3) r8 = Target Elemental Absorption Byte
andi r4, r4, 0x0010
beq r4, r0, (NoUndead) If the target isn't undead, GOTO (NoUndead)
nop
ori r8, r8, 0x0001 ELSE, the target absorbs dark attacks.
(NoUndead) and r8, r8, r7
beq r8, r0, (Normal) If the target does not absorb the spell's element, GOTO (Normal)
lhu r4, 0x0190 (r3) r4 = HP Damage
bne r5, r0 (NotStatus) If the attack deals damage, drain, or healing, GOTO (NotStatus)
sll r6, r6, 0x01 Double hit chance of non-damage attack if target absorbs element.
j (E) ELSE, GOTO (E)
sh r6, 0x01B6 (r2) r6 = Attacker Hit Chance
(NotStatus) lhu r5, 0x0194 (r3) r5 = MP Damage
(HealSetup) sh r0, 0x0190 (r3) HP Damage is 0
bgtz r9, (DrainReversalFlags) If attack is supposed to drain, GOTO (DrainReversalFlags)
sh r0, 0x0194 (r3) MP Damage is 0
sh r4, 0x0192 (r3) r4 = HP Healing
sh r5, 0x0196 (r3) r5 = MP Healing
(EAbsorbFlags) lbu r5, 0x019D (r3) r5 = Elemental Resistance Byte
lbu r6, 0x01B1 (r3) r6 = Attack Type Byte
ori r5, r5, 0x0004 r5 includes healing is elemental absorption
andi r6, r6, 0x005F r6 no longer includes HP/MP damage.
ori r6, r6, 0x0050 r6 includes HP/MP Healing
sb r5, 0x019D (r3) Store r5 as elemental resistance byte
jr 31 Return to Main Formula Routine
sb r6, 0x01B1 (r3) Store r6 as attack type byte
(DrainReversalFlags) sh r4, 0x0190 (r2) r4 = HP Damage on Caster
lbu r6, 0x002C (r2) r6 = Caster MP
sh r5, 0x0194 (r2) r5 = MP Damage on Caster
sub r6, r6, r5
bltz r6, (ExcessMPHeal) If caster MP < MP Damage Dealt, GOTO (ExcessMPHeal)
sh r0, 0x0196 (r2) MP Healing on Caster is 0
j (HPReversal) GOTO (HPReversal)
sh r5, 0x0196 (r3) ELSE, Target MP Healing = Caster MP Damage
(ExcessMPHeal) add r6, r6, r5
sh r6, 0x0196 (r3) If Caster MP < MP Damage Dealt, Target MP Healing = Caster MP
(HPReversal) lbu r6, 0x0028 (r2) r6 = Caster HP
nop
sub r6, r6, r4
bltz r6, (ExcessHPHeal) If caster HP < HP Damage Dealt, GOTO (ExcessHPHeal)
sh r0, 0x0192 (r2) HP Healing on Caster is 0
j (SelfReverseFlags) GOTO (SelfReverseFlags)
sh r4, 0x0192 (r3) ELSE, Target HP Healing = Caster HP Damage
(ExcessMPHeal) add r6, r6, r4
sh r6, 0x0192 (r3) If Caster HP < HP Damage Dealt, Target MP Healing = Caster MP
(SelfReverseFlags) lbu r6, 0x01B1 (r2) r6 = Caster Attack Type Byte
ori r5, r0, 0x0001
andi r6, r6, 0x00AF r6 no longer includes HP/MP healing.
ori r6, r6, 0x00A0 r6 includes HP/MP Damage
sb r5, 0x018C (r2) Caster is affected by drain reversal.
j (EAbsorbFlags) GOTO (EAbsorbFlags)
sb r6, 0x01B1 (r2) Store r6 as attack type byte
(Normal) bne r5, r0 (NotStatus2) If the attack deals damage, drain, or healing, GOTO (NotStatus2)
nop
j (E) ELSE, GOTO (E)
sh r6, 0x01B6 (r2) r6 = Attacker Hit Chance
(NotStatus2) bltz r9, (Healing) If r9 < 0 (if the AI flags are set as healing), GOTO (Healing)
lhu r5, 0x0194 (r3) r5 = MP Damage
lbu r6, 0x01B1 (r3) ELSE, r6 = Attack Type Byte
nop
ori r6, r6, 0x00A0 r6 includes HP/MP Damage
bgtz r9, (Drain) If r9 > 0 (if the AI flags are set as drain), GOTO (Drain)
sb r6, 0x01B1 (r3) Store r6 as Attack Type Byte
jr 31 ELSE (if attack is not drain/healing), return to Main Formula Routine
nop
(Healing) addu, r7, r31, r0 r7 = Return address
jal (HealSetup) Save offset into r31 and GOTO (HealSetup)
nop
andi r5, r5, 0x00FB r5 no longer includes healing as elemental absorption
jr r7 Return to Main Formula Routine
sb r5, 0x019D (r3) Store r5 as elemental resistance byte
(Drain) j (DrainFlags) GOTO (DrainFlags)
addiu r9, r0, 0x0100 r9 = 0x100 (for comparison purposes above)
(E) jr r31 Return to Main Formula Routine
nop

(ENull) sb r0, 0x018C (r3) Attack will miss.
sh r0, 0x0190 (r3) HP Damage is 0.
sh r0, 0x0192 (r3) MP Damage is 0.
sh r0, 0x0194 (r3) HP Healing is 0.
sh r0, 0x0196 (r3) MP Healing is 0.
sh r0, 0x019C (r3) Set the elemental resistance byte to 0
sb r0, 0x01B1 (r3) Set the attack type byte to 0
sh r0, 0x01B6 (r3) Set the accuracy to 0
lhu r5, 0x38C8 (r1) r5 = Halfword
ori r4, r0, 0x0005
sb r4, r0, 0x018E (r3) Display on missed attack is "Nullified"
lbu r4, 0x38ED (r1) r4 = Byte
beq r5, r0, (NextCheck) If Halfword is 0, GOTO (NextCheck)
sh r0, 0x38C8 (r1) r5's halfword = 0
sh r0, 0x38C6 (r1) ELSE, previous halfword = 0
(NextCheck) andi r4, r4, 0x0080 r4 = r4 AND 0x80
beq r4, r0 (E2) If Byte is 0, GOTO (E2)
nop
sb r0, 0x38ED (r1) ELSE, r4's byte = 0
(E2) jr r31 Return to Main Formula Routine
nop

The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

RandMuadDib

Since you plan on using the boolean in FFTPatcher between "Hit Allies" and "Follow Target," does that mean you are going to build in Xif's Weapon Strike Fix into the elemental calculations, so weapon elementals can be taken into consideration as well? I know you said that the elemental routine you posted isnt finished, but i didnt see anything that mentioned weapon elements (i am also very poor at reading asm and am relying on your purple text). Thanks!
I will show you the power of SARDIIIIINES!!!!

RavenOfRazgriz

March 03, 2011, 03:49:57 am #52 Last Edit: March 03, 2011, 03:50:20 am by RavenOfRazgriz
^ Yes, Xifanie's Weapon Strike Fix will have been made irrelevant once the Formula Hack is done... in addition to a rather huge as hell pile of other things.  

RandMuadDib

Excellent you're my hero and i eagerly await any and all process. Super excited :)
I will show you the power of SARDIIIIINES!!!!

RandMuadDib

There's also the blank AI flag just above Direct Attack. No abilities have it flagged, and so should be completely usable if you had a desire to do so.
I will show you the power of SARDIIIIINES!!!!

RavenOfRazgriz

It's already in use.  We've already mapped out all the blank flags and put them to use, and the V2 release will put far more... unexpected things to use as well.  All the flags are also getting rearranged for optimal customization, since not all abilities support the Abilities box (the one on the bottom, see stuff like Charge and Throw for people who want to still use those), nor do R/S/M for whatever functionality we can force out of flags for those.  We spend tons of time mapping things out in advance to maximize features, to the point where I think almost everything is pretty well mapped, the coding for some areas (mostly shit like Knockback/Critical) just means coding some areas takes far longer than planning them does.  That, and I can't code in assembly worth shit and FDC's only human, so getting it from design phase to product phase takes time since he's essentially recoding nearly every section he comes across.

RandMuadDib

Sure, i was just prepping resources.zip from a post back on page 2,

Quote from: formerdeathcorps on February 05, 2011, 04:31:44 am
After weeks of discussion on iRC with Raven, I think I have the final structure hammered out.  Everything I've already posted on this matter will be completely rewritten.

Plans:


And I didnt see any mention of that particular flag, so i figured i'd say something, just on the extremely off chance that you guys missed it.
I will show you the power of SARDIIIIINES!!!!

RavenOfRazgriz

Quote from: RandMuadDib on March 06, 2011, 07:03:00 pm
Sure, i was just prepping resources.zip from a post back on page 2,

And I didnt see any mention of that particular flag, so i figured i'd say something, just on the extremely off chance that you guys missed it.


It's cool.

Those plans are horrifically out of date, that's all. The flag-hijacking has become a lot more elaborate since he made that post. It's just easier to code and then retard-friendly-document each piece instead of trying to constantly revise a Plans notes since we're still not 100% on which features will be in V1 and which in V2 until he sees how hard each is to code and if that feature is going to need some of the space we're freeing up from recoding the thing, since a few things being added will actually take more space than before in order to add a pile of extra features, and you can't use more space until you know how much space is actually free.

RandMuadDib

I was wondering if you were planning on adding a way to check for the job of the target, to do extra damage or have a better chance o hit. I know a few people have asked for that in other threads and having a beast-hunter option open would be cool.
I will show you the power of SARDIIIIINES!!!!

RavenOfRazgriz

Quote from: RandMuadDib on March 13, 2011, 10:52:54 am
I was wondering if you were planning on adding a way to check for the job of the target, to do extra damage or have a better chance o hit. I know a few people have asked for that in other threads and having a beast-hunter option open would be cool.


V2 is slated to have checks for Status and Gender, meaning you can make proper Beast Tamers and Necromancers by checking for "Monster" Gender, the "Undead" Status, etc.  Same effect, but it's far more efficient to check for Gender and Status instead of Job IDs and other stupid crap... and easier for a user to modify the checks that way.