øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=463.msg22418e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf5d8.htmldelayedslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=463.60e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf5d8.html.zxç1g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ@>¾ŸOKtext/htmlISO-8859-1gzip@øÕ¾ŸÿÿÿÿÿÿÿÿÑHTue, 10 Mar 2020 06:37:51 GMT0ó°° ®0®P®€§²ð®ç1g^ÿ¾Ÿ Enemy Special/Magic Attacks

Author Topic: Enemy Special/Magic Attacks  (Read 16022 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #60 on: February 06, 2015, 09:30:08 AM »
Heh, the topic is rather large and I was updating it at a feverish pace at the time, knocking out all of the documentation of routines as I could, so it's little surprise you missed it.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #61 on: February 07, 2015, 07:08:53 AM »
I tried Grimoire's solution and it didn't work. I tried avalanche's and it did work.

Any chance I can bug you guys for one more thing: How to change "recover 1/3 target's current HP" to "recover 1/(spell power) caster's current HP"?
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #62 on: February 07, 2015, 08:07:45 AM »
It... didn't work? I tested it at the time and I just tested it now (to reassure I actually did test it back then), the objective was to make it so that 1/10 of HP recovered becomes 1/X'th of HP recovered, wasn't it? What happened when you tried it, out of curiosity? That sort of shakes my confidence a little to have it work for me, but not for others.

A fix for 1/3 current HP is the same case as my original formula posted above... changing This...

$03/DD6E   A2 03 00   LDX #$0003   A:0000   X:0001   Y:0000   P:envMxdiZc - Load 03 into X (/3. How much % of HP to heal.)
$03/DD71   8E 47 39   STX $3947  [$7E:3947]   A:0000   X:0003   Y:0000   P:envMxdizc - Store X in 7E3947.

To this...

$03/DD6E   AD 9D 28   LDA $289D  [$7E:289D]   A:000B   X:0058   Y:FFFF   P:envMxdizc
$03/DD71   8D 47 39   STA $3947  [$7E:3947]   A:0002   X:0058   Y:FFFF   P:envMxdizc


Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #63 on: February 07, 2015, 09:09:00 AM »
It... didn't work? I tested it at the time and I just tested it now (to reassure I actually did test it back then), the objective was to make it so that 1/10 of HP recovered becomes 1/X'th of HP recovered, wasn't it? What happened when you tried it, out of curiosity? That sort of shakes my confidence a little to have it work for me, but not for others.

Hm, could have simply been a typo on my part or something... though I was sure I checked carefully... anyway the result was that it always healed 1/10 target's max even after making the spell power 1.

 :edit: Definitely was a typo on my part; I just tried it again and it worked no problem. Sorry if I gave you a fright!

A fix for 1/3 current HP is the same case as my original formula posted above... changing This...

$03/DD6E   A2 03 00   LDX #$0003   A:0000   X:0001   Y:0000   P:envMxdiZc - Load 03 into X (/3. How much % of HP to heal.)
$03/DD71   8E 47 39   STX $3947  [$7E:3947]   A:0000   X:0003   Y:0000   P:envMxdizc - Store X in 7E3947.

To this...

$03/DD6E   AD 9D 28   LDA $289D  [$7E:289D]   A:000B   X:0058   Y:FFFF   P:envMxdizc
$03/DD71   8D 47 39   STA $3947  [$7E:3947]   A:0002   X:0058   Y:FFFF   P:envMxdizc

This worked, for target's current HP. I managed to figure out how to change it over to caster's current HP without any difficulty.

Thank you all so much for your help!
« Last Edit: February 07, 2015, 09:17:01 AM by Pinkpuff »
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #64 on: February 07, 2015, 09:42:31 AM »
It... didn't work? I tested it at the time and I just tested it now (to reassure I actually did test it back then), the objective was to make it so that 1/10 of HP recovered becomes 1/X'th of HP recovered, wasn't it? What happened when you tried it, out of curiosity? That sort of shakes my confidence a little to have it work for me, but not for others.

Hm, could have simply been a typo on my part or something... though I was sure I checked carefully... anyway the result was that it always healed 1/10 target's max even after making the spell power 1.

 :edit: Definitely was a typo on my part; I just tried it again and it worked no problem. Sorry if I gave you a fright!

A fix for 1/3 current HP is the same case as my original formula posted above... changing This...

$03/DD6E   A2 03 00   LDX #$0003   A:0000   X:0001   Y:0000   P:envMxdiZc - Load 03 into X (/3. How much % of HP to heal.)
$03/DD71   8E 47 39   STX $3947  [$7E:3947]   A:0000   X:0003   Y:0000   P:envMxdizc - Store X in 7E3947.

To this...

$03/DD6E   AD 9D 28   LDA $289D  [$7E:289D]   A:000B   X:0058   Y:FFFF   P:envMxdizc
$03/DD71   8D 47 39   STA $3947  [$7E:3947]   A:0002   X:0058   Y:FFFF   P:envMxdizc

This worked, for target's current HP. I managed to figure out how to change it over to caster's current HP without any difficulty.

Thank you all so much for your help!

I misread that part, that makes a lot of sense and is a neat idea! It wouldn't quite work for Combat Boost because of Kain's already beefy HP, but on a Mage character it does encourage the use of Apples on them, very nice thinking!

Heh, just good to know I'm not completely losing my touch.

avalanche

  • Mom Bomb
  • *
  • Posts: 122
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #65 on: February 07, 2015, 02:13:35 PM »
One quick thing to point out about the math routines.  I believe the division routine at 03:8407 takes two 16-bit parameters.  So if you are not explicitly writing to the second byte, I don't think you can be sure it's a zero which you need it to be.  I'd be worried that you might occasionally get an incorrect result because of whatever value happened to be there from the previous call to the routine.