FF6 Hacking

Full Version: Stamina Questions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So, I've been looking into the Stamina is used in Evasion flag and I'm not understanding step 5b. Would someone please run it down for me?

Step 5. Check to hit for attacks that can be blocked by Stamina

   Most attacks use step 4 instead of this step. Only Break, Doom, Demi,
   Quartr, X-Zone, W Wind, Shoat, Odin, Raiden, Antlion, Snare, X-Fer, and
   Grav Bomb use this step.

   Step 5a. Chance to hit

     1. BlockValue = (255 - MBlock * 2) + 1

     2. If BlockValue > 255 then BlockValue = 255
        If BlockValue < 1 then BlockValue = 1

     3. If ((Hit Rate * BlockValue) / 256) > [0..99] then you hit, otherwise
     you miss.

   Step 5b. Check if Stamina blocks

     If target's stamina >= [0..127] then the attack misses (even if it hit in
     step 5a); otherwise, the attack hits as long as it hit in step 5a.


Does this mean that if the target has a stamina value greater than or equal to  a randomly generated number between 0 and 127 then the attack misses?
Stamina is basically a Stamina/128 chance of avoiding the attack that is run after a normal evasion check (i.e. 32 stamina is a 25% chance, 64 stamina is a 50% chance, and so on).
Logically if greater stamina means greater avoiding chance, for 32 stamina the attack will be avoid if random number is below 32. It should be a BMI instruction that branch if Accumulator compared to (CMP) #$32 < 0 (if A minus #$32 is below 0, Negative flag of CPU is set, which is what BMI look at). Anything after my first sentence is really extra info..

Edit: The call for the stamina check is at C2/22B0. Actually I was wrong, it does a BCC (branch if carry flag is not set) because A CMP value will set the carry flag if below 0. So the function check if stamina doesn't block the attack, if value > stamina. There are other things related to stamina in bank $C2, make a search for the word. Monster also have a max stamina of 40.
oh, finally i know what does that flag.
does it work even for damage dealing stuff?(no status dealing spells)
Thanks for the information. I was considering applying that flag to every spell. I plan on applying Seibaby's physical/magical equalization patch, the Evasion/Mblock bug fix. So, rebalancing character Stamina levels appropriately, would be necessary. However, this would either result in a huge chunk of secondary Evasion/Mblock or it would require characters to have very small Stamina scores and removing of all level up bonuses. 

Obviously, this is going to require an ASM hack and since that's the case, it would probably be better to so without co-opting the flag. Furthermore, I'm not sure if it would be better to cap Stamina at 128 and make it so that Stamina/4 = starting Evasion and Mblock, or if it would be better to take this discussion to the "Having the option to use Vigor in Spells" thread and discuss making Stamina add directly to Defense and Magic Defense the way that Vigor adds directly to Battle Power. Ultimately, the latter hack would really only be useful in conjunction with Seibaby's hack in that thread.

Finally, how and where do I start this hack? I've been trying to figure out how to add Stamina to Defense and Magic Defense for awhile and I'm getting nowhere.

(04-17-2017, 02:20 PM)Tenkarider Wrote: [ -> ]oh, finally i know what does that flag.
does it work even for damage dealing stuff?(no status dealing spells)

It should. As I understand it, it's just a random chance of blocking a spell.
(04-17-2017, 02:20 PM)Tenkarider Wrote: [ -> ]oh, finally i know what does that flag.
does it work even for damage dealing stuff?(no status dealing spells)

Anything with this flag set gets an extra evasion check through stamina, whether it deals damage or not.

Brave New World significantly overhauls this flag to only consider the status portion of an attack, so that attacks which also deal damage can have the status portion be checked separately. To avoid problems with double-dipping into magic evasion, attacks that only set statuses are set to 255% and thus use *only* stamina as the evasion check.