It would be nice if I understood more of this code. I feel so close to the answers I'm looking for, but I just don't understand Assembly what so ever.
When using cheat editors I've been able to find the address for the first monster in a battle's defense. Using different cheat editors I've found the addresses 0015df and 7e15df. The two addresses end the same, but start differently but seem to net me the same results. I don't really understand why they both work.
But anyways if I use the defense address in my cheat editor I can see a monster's actual defense stat. But when I use the defense address in my debugger I can't seem to find the values I'm looking for. Instead I've found that when I set 0015df or 7e15df as a breakpoint the game will pause after choosing an attack target, as the player character slashes their sword into the enemy. My debugger has a "X Field" which displays certain values. During this moment, which is the same as the image posted down below, the X field expresses a value of 6. This isn't exactly the monster's defense as Slime enemies have a defense stat of 12. But without a doubt this value is used in damage calculations.
In my tests I've noticed the player character dealing different damage depending on the value expressed in this X field.
0 will equate to 15 damage.
2 to 14.
4 to 12.
6 to 11.
8 to 10.
I've only seen the X field spit out those 5 values during my tests, but there could possibly be more. For a moment it might seem like a 0 value expressed in the X Field means the player character deals their full damage, but that isn't the case. The player character's attack stat with default equipment is indeed 15, but I tried fighting other enemies as well. The Gloom enemy has a 22 defense stat. When the player character attacks this enemy and the X field expresses a 0 value the damage comes out to 8. So there's a difference of 10 defense between the two enemies, but a damage difference of 7. The Gloom also doesn't have the same differences in reduced damage for a higher value expressed in the X field. I'm pretty certain this value expressed in the X field is either a random number meant to add some variance in damage dealt to enemies. That or it is the end result of a defense stat that has gone through some calculation with a random number. Regardless it is clear that this number is important.
I've also noticed that when the player character gets a "Slam", the critical hit in this game, damage seems to double. I assume that critical hits double the damage dealt at or near the end of damage calculation as it seems to me that the double damage takes into account the x field variable.
Everything I've deduced so far has been simply from playing the game, looking at the listed stats, seeing the number that pops up in the x field when the breakpoint triggers for the 0015df or 7e15df addresses, and the damage number displayed in game. I haven't really read any of the assembly code because I don't understand it. As far as I can tell all these lines of code are loading memory or something for literally hundreds of steps. I was hoping I could go from line to line and eventually find a line of code that showed some sort of calculation. Maybe adding or subtracting something, but I can't find anything like that or know how to look for it.
Any advice or insight would be greatly appreciated!https://i.imgur.com/hU4ZwrW.png