Blocking and Damage
Posted: Wed Jul 09, 2014 9:43 am
So blocking and damage stem from the same calculations. The game totals up a few stats from attacker and defender to determine if they block. Also, the steps here are organized by me since the game code is HORRIBLY organized. The game will load an enemy UDF value and not use it until 120 lines of code later for instance. For that reason I organized this so it makes sense to read (because it's hard enough already!)
Your ATK and SPD determine your damage/block.
It is compared to the enemy's ATK and SPD, plus a random strength generated from the enemy. The game adds these numbers together into an "attack value" and "defend value". You _could_ view them as damage but the game first sees them as a block check, then later manipulates it as damage. So I'll just call them "attack value" and "defend value" hereon. If yours is less than the enemy's after all is said and done, it is blocked.
This is the first check if your attack value is less than their defend value. If it is, move on.
Add a random number up to your current attack value. So up to 100% added.
And do the same for the enemy's defense value, now both have RNG added.
Check if attacker has flag 4 and make the defend value less, this seems like targetchain, but I think that comes later, have to find out.
Check if attacker has flag 1000, and make your attack number about 1/4 less.
Check if defender has flag 1000, and make your attack number about 1/4 less.
(I'm wondering if this is a rage status or a status ailment)
Now the game has to check if the attacker is your party for accessories.
Checks target chain, and doubles your attack value if equipped (remember this is not dmg yet)
Checks guardian chain, and sets the attack and defend numbers equal (this means they cannot block)
Next check defender flags.
Flag 0400 - Critical Block! If this flag is set, sets the attack and defend numbers equal
Check the numbers again if attack value is less than defend value, attack is blocked, otherwise do damage.
DAMAGE TIME
Get character ATK, and then the input of the hit (High, Low, Arms, Ra-Seru)
Based on your input, different equipment attack values are loaded.
Arms - Grabs the attack power of your weapon (same number you see in game)
High/Low - Grabs the attack power of your boots.
Ra-Seru - The Ra-seru attack value
Next a value is added based on being a normal attack or an art, arts are more obviously.
Add a random amount based on attack, up to about 1/8th of your attack.
This part is weird, the game loads a damage multiplier from the enemy you are attacking. It's usually 1 but I wonder if someone has a 2 or 3 in the game.
Your current HP is looked at and adds damage. Basically every 256 health will add one, so up to 27 for 9999.
Now your ingredients are gathered, and the game does a final manipulation of the number to turn it into damage.
Now grab the UDF or LDF of the defender based on your attack (I think all but Low kicks are UDF but I'll have to look).
Add some RNG based off the defend number.
Next it checks the attacker flags which lower the attack number, this might be elemental.
1 = Cut damage by 1/4
2 = Cut damage by 1/3
And then checks another attacker flag which lowers the defend number.
1 = Cut defense by 1/4
2 = Cut defense by 1/3
The enemy damage multiplier is figured in again here for damage this time (not block).
Damage is now forced to be no more than 9999 after defense is subtracted.
Final damage is attack value minus defend value.
The game now figures in how much AP you gain from being hit (even monsters even though they always have 100 AP). The more the damage is compared to your HP, the more AP you get.
Your ATK and SPD determine your damage/block.
It is compared to the enemy's ATK and SPD, plus a random strength generated from the enemy. The game adds these numbers together into an "attack value" and "defend value". You _could_ view them as damage but the game first sees them as a block check, then later manipulates it as damage. So I'll just call them "attack value" and "defend value" hereon. If yours is less than the enemy's after all is said and done, it is blocked.
This is the first check if your attack value is less than their defend value. If it is, move on.
Add a random number up to your current attack value. So up to 100% added.
And do the same for the enemy's defense value, now both have RNG added.
Check if attacker has flag 4 and make the defend value less, this seems like targetchain, but I think that comes later, have to find out.
Check if attacker has flag 1000, and make your attack number about 1/4 less.
Check if defender has flag 1000, and make your attack number about 1/4 less.
(I'm wondering if this is a rage status or a status ailment)
Now the game has to check if the attacker is your party for accessories.
Checks target chain, and doubles your attack value if equipped (remember this is not dmg yet)
Checks guardian chain, and sets the attack and defend numbers equal (this means they cannot block)
Next check defender flags.
Flag 0400 - Critical Block! If this flag is set, sets the attack and defend numbers equal
Check the numbers again if attack value is less than defend value, attack is blocked, otherwise do damage.
DAMAGE TIME
Get character ATK, and then the input of the hit (High, Low, Arms, Ra-Seru)
Based on your input, different equipment attack values are loaded.
Arms - Grabs the attack power of your weapon (same number you see in game)
High/Low - Grabs the attack power of your boots.
Ra-Seru - The Ra-seru attack value
Next a value is added based on being a normal attack or an art, arts are more obviously.
Add a random amount based on attack, up to about 1/8th of your attack.
This part is weird, the game loads a damage multiplier from the enemy you are attacking. It's usually 1 but I wonder if someone has a 2 or 3 in the game.
Your current HP is looked at and adds damage. Basically every 256 health will add one, so up to 27 for 9999.
Now your ingredients are gathered, and the game does a final manipulation of the number to turn it into damage.
Now grab the UDF or LDF of the defender based on your attack (I think all but Low kicks are UDF but I'll have to look).
Add some RNG based off the defend number.
Next it checks the attacker flags which lower the attack number, this might be elemental.
1 = Cut damage by 1/4
2 = Cut damage by 1/3
And then checks another attacker flag which lowers the defend number.
1 = Cut defense by 1/4
2 = Cut defense by 1/3
The enemy damage multiplier is figured in again here for damage this time (not block).
Damage is now forced to be no more than 9999 after defense is subtracted.
Final damage is attack value minus defend value.
The game now figures in how much AP you gain from being hit (even monsters even though they always have 100 AP). The more the damage is compared to your HP, the more AP you get.