I read through the wiki pages & the "gears" pdf, but it seemed pretty general and high level. I haven't had a chance to do a whole lot of tinkering with the executable yet (because I'm taking an OS class and we have to implement a kernel which is eating up exorbitant amounts of time) but I was hoping that there existed a more technical description of the function of the battle module (i.e, a memory addresses for all the subroutines (specifically those checking elemental/status weaknesses) and information about how these functions are placed on the call stack (so what talks to the kernel to tell it push a specific subroutine onto the call stack?) (I see that someone must know that because the order of checks seems to be well-understood (In the enemy mechanics FAQ)-- but where in the executable is the logic that's handling that?). I see where the damage formula's are located from the addresses in the wiki, but I don't see any info about the subroutines which control elemental checking (though how it works is described in the FAQ in high level terms). And I don't see any information about where the logic that governs that is
In particular, while AI scripting I noticed that modifying elemental weaknesses in battle by reassigning the enemies self mask and changing values doesn't work (so I suspect that whether or not specific items are being worn is being checked directly somewhere in the battle module) and I want to have a look at the subroutines that check elemental weaknesses to see if this is actually the case (so I can rewrite them and make it possible for a boss or enemy ability to overwrite elemental defenses)
EDIT: So, it seems like elemental checking is taking place at 0x5DEC52? It doesn't seem to be checking items explicitly though, so it seems like I should just be able to have an enemy directly modify another characters weaknesses by swapping the self-mask and changing the battle addresses... but that definitely doesn't work, which is very confusing to me. The battle addresses which store absorbs/weaknesses seem to work fine for enemies, too. Does anyone know how the game sets elemental absorbs/weaknesses when entering a battle based on items/materia combinations? Does it just check and then write the value to that actors element def/absorb flags in their particular instance? (or what hex address I can find that logic at)?