Blocking and Damage

Any information you would like to share or ask in regards to the hacking of Legend of Legaia
User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Blocking and Damage

Post by meth962 » 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.
まさかつあがつ

User avatar
Nightshade
Level 60
Posts: 1797
Joined: Tue Jul 26, 2011 9:07 pm
Location: the the the the

Re: Blocking and Damage

Post by Nightshade » Wed Jul 09, 2014 10:02 am

Could the "Cut Damage by 1/4 or 1/3" and "Cut Defense by 1/4 or 1/3" flags you mention in there be related to Venom Status / Toxic Status?
Do not question yourself with the why or the how. I simply am, and that is all you need to know.

GoldenPower89
Level 57
Posts: 1638
Joined: Mon Sep 09, 2013 3:12 am
Location: Indiana

Re: Blocking and Damage

Post by GoldenPower89 » Wed Jul 09, 2014 10:18 am

That sounds reasonable, Night. Does the Defender Chain double the defense value like the Target Chain doubles attack value?
Image

User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Re: Blocking and Damage

Post by meth962 » Wed Jul 09, 2014 11:13 am

GoldenPower89 wrote:Does the Defender Chain double the defense value like the Target Chain doubles attack value?
Whoops! Don't know how I missed that. Guess 'cause I was following my notes from Gala attacking a Gobu Gobu instead of vice versa...

Defender Chain actually multiplies it by 1.5.

I bet you are right, Night. That should be easy enough to test.
まさかつあがつ

User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Re: Blocking and Damage

Post by meth962 » Tue Jul 22, 2014 11:48 pm

One thing to note is that Arts use your full ATK power, not just your base. So all of your attack from boots, weapons, ra-seru (and even armor and helm) are added up. Only normal attacks use your base ATK plus the used weapon only (arms, boots for high/low, and ra-seru).
まさかつあがつ

User avatar
Nightshade
Level 60
Posts: 1797
Joined: Tue Jul 26, 2011 9:07 pm
Location: the the the the

Re: Blocking and Damage

Post by Nightshade » Tue Jul 22, 2014 11:51 pm

Did you manage to test whether Venom / Toxic caused the -25% / -33% flags to trip?

How does the Unholy Icon factor in? Does it do anything other than force through 25% damage if the enemy would otherwise block the attack?
Do not question yourself with the why or the how. I simply am, and that is all you need to know.

User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Re: Blocking and Damage

Post by meth962 » Wed Jul 23, 2014 4:22 pm

No it looks like it is what is used when you do like a Gimard Lv 9 attack and it has the added effect of 25% ATK down.

The Unholy Icon acts like the enemy has 25% less defense.
まさかつあがつ

User avatar
Nightshade
Level 60
Posts: 1797
Joined: Tue Jul 26, 2011 9:07 pm
Location: the the the the

Re: Blocking and Damage

Post by Nightshade » Wed Jul 23, 2014 5:55 pm

I know there's an item that makes the enemy take 25% of normal damage when they successfully block an attack; I thought that was the Unholy Icon, but now I'm not so sure.

What is "Critical Block" exactly?
Do not question yourself with the why or the how. I simply am, and that is all you need to know.

User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Re: Blocking and Damage

Post by meth962 » Wed Jul 23, 2014 9:03 pm

Found out it is a state that the enemies can enter and it sets their defense = to your offense. Meaning they are very likely to block your attack.
まさかつあがつ

User avatar
Nightshade
Level 60
Posts: 1797
Joined: Tue Jul 26, 2011 9:07 pm
Location: the the the the

Re: Blocking and Damage

Post by Nightshade » Wed Jul 23, 2014 10:27 pm

Can they just trigger it on demand?

Also, another interesting fact is that when enemies block one attack, they become a lot more likely to block the following attack, particularly if the attacks are not separated by enough in-game animation time. Why is that?
Do not question yourself with the why or the how. I simply am, and that is all you need to know.

Post Reply