Hello, this is my first post and the first time I touch assembly code in years, so please bear with me.
While collecting ASM hacks for a personal mod, I stumbled upon Xifanie's "Brave becomes Fury". It didn't quite fit my needs, but with a few tweaks I thought I could get it to do something that'd be useful to me.
The original formula was: (40 + Caster_Fury) * (40 + Target_Fury) * Total_Damage / 10000
The new formula is essentially: ((200 + Caster_Br) / (200 + Target_Br)) * Total_Damage
What it does is basically increase your damage if your Brave is higher than your opponent's, and decrease your damage if it's lower than your opponent's, both proportionally of course.
An attacker with 100 Bravery attacking a target with 0 Brave would have their damage increased to 1.5x the original value.
An attacker with 0 Bravery attacking a target with 100 Brave would have their damage decreased to 2/3rds of the original value.
The final damage range is 66%~150% of the original.
My main reason for using this formula is wanting to use Brave as a "fighting ability" sort of stat, and creating buffs and debuffs around Brave manipulation.
So anyway here's it:
You can change the value from 200 (C8) to something else to change the minimum and maximum damage modifiers. Don't change it to zero.
Multiplying the Attacker's Bravery by 1024 before dividing it by the Defender's was my implementation choice to soften the issue of loss of precision after division. With these values, the final result should be within "1" (one) of the expected value.
It also should have no load delays.
UPDATE: So my original modification was completely borked because I didn't really understand Xifanie's code. Spells were giving off really odd numbers. It should be fixed now.
I also made another xml to edit the Faith routine and apply the same formula to Faith calculation. So basically every spell damage/accuracy will use this same 66%~150% formula.
Using both the Brave and the Faith ASMs attached should basically rework the Brave/Faith system into something completely different. I'm aware many people prefer the old "high risk high reward" mechanics, and this requires a lot of extra work to - well, work... since all spells which accuracy is based on Faith will have to have their values changed to adapt to the new system. But it's nice to always have more options, I guess.
Again, I haven't tested them extensively yet. But now they do seem to work. Better.
While collecting ASM hacks for a personal mod, I stumbled upon Xifanie's "Brave becomes Fury". It didn't quite fit my needs, but with a few tweaks I thought I could get it to do something that'd be useful to me.
The original formula was: (40 + Caster_Fury) * (40 + Target_Fury) * Total_Damage / 10000
The new formula is essentially: ((200 + Caster_Br) / (200 + Target_Br)) * Total_Damage
What it does is basically increase your damage if your Brave is higher than your opponent's, and decrease your damage if it's lower than your opponent's, both proportionally of course.
An attacker with 100 Bravery attacking a target with 0 Brave would have their damage increased to 1.5x the original value.
An attacker with 0 Bravery attacking a target with 100 Brave would have their damage decreased to 2/3rds of the original value.
The final damage range is 66%~150% of the original.
My main reason for using this formula is wanting to use Brave as a "fighting ability" sort of stat, and creating buffs and debuffs around Brave manipulation.
So anyway here's it:
<Patch name="Brave Rework (a modification of Xif's Fury)">
<Description>
Changes Xif's Fury formula so that damage becomes directly proportional to the attacker's Brave and inversely proportional to the target's Brave.
In other words, you do more physical damage if your Brave is higher than your target's, and less damage if their Brave is higher than yours.
New formula is: Final_Damage = (((((200 + Caster_Br) * 1024) / (200 + Target_Br)) * Original_Damage) / 1024)
This gives the new damage a range of 66%~150% of the original.
</Description>
<Location file="BATTLE_BIN" offset="E930C">
00040000
1980033C
942D628C
982D638C
24004290
24006390
C8004224
C8006324
80120200
1A004300
12100000
1500043C
0C0382AC
97180608
942D218C
12100000
1500043C
0C03848C
00000000
18004400
1500023C
00040434
0C0344AC
12100000
82120200
65190608
00000000
</Location>
<Location file="BATTLE_BIN" offset="11F254">
C4400508
1980013C
00000000
5A002290
</Location>
<Location file="BATTLE_BIN" offset="11F58C">
D2400508
250062A0
</Location>
</Patch>
<Description>
Changes Xif's Fury formula so that damage becomes directly proportional to the attacker's Brave and inversely proportional to the target's Brave.
In other words, you do more physical damage if your Brave is higher than your target's, and less damage if their Brave is higher than yours.
New formula is: Final_Damage = (((((200 + Caster_Br) * 1024) / (200 + Target_Br)) * Original_Damage) / 1024)
This gives the new damage a range of 66%~150% of the original.
</Description>
<Location file="BATTLE_BIN" offset="E930C">
00040000
1980033C
942D628C
982D638C
24004290
24006390
C8004224
C8006324
80120200
1A004300
12100000
1500043C
0C0382AC
97180608
942D218C
12100000
1500043C
0C03848C
00000000
18004400
1500023C
00040434
0C0344AC
12100000
82120200
65190608
00000000
</Location>
<Location file="BATTLE_BIN" offset="11F254">
C4400508
1980013C
00000000
5A002290
</Location>
<Location file="BATTLE_BIN" offset="11F58C">
D2400508
250062A0
</Location>
</Patch>
You can change the value from 200 (C8) to something else to change the minimum and maximum damage modifiers. Don't change it to zero.
Multiplying the Attacker's Bravery by 1024 before dividing it by the Defender's was my implementation choice to soften the issue of loss of precision after division. With these values, the final result should be within "1" (one) of the expected value.
It also should have no load delays.
UPDATE: So my original modification was completely borked because I didn't really understand Xifanie's code. Spells were giving off really odd numbers. It should be fixed now.
I also made another xml to edit the Faith routine and apply the same formula to Faith calculation. So basically every spell damage/accuracy will use this same 66%~150% formula.
Using both the Brave and the Faith ASMs attached should basically rework the Brave/Faith system into something completely different. I'm aware many people prefer the old "high risk high reward" mechanics, and this requires a lot of extra work to - well, work... since all spells which accuracy is based on Faith will have to have their values changed to adapt to the new system. But it's nice to always have more options, I guess.
<Patch name="Faith Rework">
<Description>
Changes the Faith routine so that magic damage and accuracy becomes directly proportional to the attacker's Faith and inversely proportional to the target's Faith.
In other words, your spells do more damage and are more accurate if your Faith is higher than your target's, and less damage/less accurate if their Faith is higher than yours.
New formula is: Final_Damage/Accuracy = (((((200 + Caster_Br) * 1024) / (200 + Target_Br)) * Original_Damage/Accuracy) / 1024)
This gives the new damage/accuracy a range of 66%~150% of the original.
*Note that this requires rebalancing of all Faith abilities. Oracles for example have base spell accuracy values in the 100-200 range, which makes sense with the old Faith system.
A spell with 50+MA chance to hit in this new system cast by a mage with 10 MA could have its accuracy range from 39% to 90%, not counting zodiacs.
</Description>
<Location file="BATTLE_BIN" offset="1201FC">
D3384290
04008384
C8004224
80120200
1980043C
D2388490
00000000
C8008424
1A004400
12100000
1980043C
902D848C
18004300
12100000
C31F0300
82120200
</Location>
</Patch>
<Description>
Changes the Faith routine so that magic damage and accuracy becomes directly proportional to the attacker's Faith and inversely proportional to the target's Faith.
In other words, your spells do more damage and are more accurate if your Faith is higher than your target's, and less damage/less accurate if their Faith is higher than yours.
New formula is: Final_Damage/Accuracy = (((((200 + Caster_Br) * 1024) / (200 + Target_Br)) * Original_Damage/Accuracy) / 1024)
This gives the new damage/accuracy a range of 66%~150% of the original.
*Note that this requires rebalancing of all Faith abilities. Oracles for example have base spell accuracy values in the 100-200 range, which makes sense with the old Faith system.
A spell with 50+MA chance to hit in this new system cast by a mage with 10 MA could have its accuracy range from 39% to 90%, not counting zodiacs.
</Description>
<Location file="BATTLE_BIN" offset="1201FC">
D3384290
04008384
C8004224
80120200
1980043C
D2388490
00000000
C8008424
1A004400
12100000
1980043C
902D848C
18004300
12100000
C31F0300
82120200
</Location>
</Patch>
Again, I haven't tested them extensively yet. But now they do seem to work. Better.