Users browsing this thread: 1 Guest(s)
Normalised Item Magic

#12
Posts: 281
Threads: 18
Thanks Received: 13
Thanks Given: 8
Joined: Mar 2014
Reputation: 8
Status
None
Edit: I released an updated version of this hack with the different functionality I detailed in this post. I've edited the original post with a download link.

Yes, my code does that, and more. It specifically removes the "ignore Mblock" and "ignore Reflect" code to insert code that disables "ignore Clear" and re-enables damage modification (i.e. disables "ignore defense").

Specifically, before this hack, Item Magic (spells cast by using a piece of equipment as an item in battle) had the following properties:
* Unblockable
* Ignores Reflect
* Ignores Clear
* Ignores MDef (more accurately: bypasses damage modification, which includes MDef, Shell, Morph, Self-damage, and random variance)

After this hack, Rod magic will behave just like normal Magic:
* Spell Hit Rate and Target Mblock determines if spell hits
* Reflect will bounce the spell (if it is Reflectable)
* Clear will make the spell automatically hit, and the spell will remove Clear if it hits
* Damage is reduced by Mdef, Morph, and Shell, and is halved if hitting another character, and will randomly vary between 87%-100% of the spell's full damage potential.

If you ONLY care about Clear, and want to keep the other properties of Item Magic (unblockable, ignores defense and reflect, etc.) then it's slightly trickier because you can't get free space inline from removing the code to Ignore Mblock and Reflect. You need to replace some of that code with a call to some free space that clears Ignore Clear (and does whatever the code you overwrote did).

If you want to do it inline, you can replace either the Unblockable or Ignore Reflect properties with code to disable Ignore Clear.
For example, you could have it honor Reflect and Clear, while still being unblockable and defense-ignoring.

Edit: Found a way to preserve both Not Reflectable and Unblockable Item Magic behaviour and still disable Ignore Clear, if you're interested.

At C2/18F3, replace the first three bytes with a JSR $382D (sets Not Reflectable and Unblockable; part of the random spellcast code). Now you've freed up the following seven bytes, enough to insert a LDA #$80 followed by a TSB $B3 (clears Ignore Clear), with three bytes to spare (pad them out with NOP #3). Not sure if that's what you wanted but there you go. Smile

EDIT2: As for what Square's intention was, it was obviously intended to let Item Magic bypass Reflect and Mblock. What is possibly an unintended byproduct of it being part of the item code is that it ignores damage modification and Clear.
I believe Square wanted to make sure that, since you're sacrificing an item, the resulting spell definitely hits its target and isn't "wasted". I think it was unintended that the spell also bypasses defenses and doesn't remove Clear. Therefore I think the "correct" way is to disable Ignore Clear, and restore damage modification, while also preserving Ignore Reflect and Unblockable.

It might be possible to do just that by using those last three bytes to do a DEC $3414. Since $3414 is already 0, decreasing it should roll it over to FF. This would set the v flag but I'm not sure if that matters. Worth a shot.

For what it's worth, I still think the "best" way is to make Item Magic behave like normal spells, since Rods are horrendously overpowered and you can just buy unlimited amounts in Thamasa for cheaps. I always head straight out of Daryl's Tomb to the Thamasan Pearl Rod Emporium and go Doom Gaze hunting for quick Bahamut access.

(04-28-2016, 09:20 AM)Kugawattan Wrote: Interesting. I guess the developers felt that if you had to have your item break, the spell they would produce would be stronger.
I'm still deciding whether I should use this or not, because of what I just said. I'll see what I do.

You might be interested in what I just wrote in my last edit in the above post. Item Magic that works like normal magic, except with the added bonus of Ignoring Reflect and being Unblockable, ensuring that your sacrifice at least makes sure that the spell hits its intended target.

Edit3: It works! Edit4: Fixed the mistakes in the code. Smile
Code:
org $C2382D
set_unblockable:
org $C218F3
JSR set_unblockable     ;(Set Not reflectable and Unblockable)
LDA #$80
TSB $B3                 ;(clear ignore Clear)
DEC $3414               ;(clear Ignore damage modification)
  Find
Quote  
[-] The following 2 users say Thank You to seibaby for this post:
  • Gi Nattak (04-28-2016), SSJ Rick (02-07-2017)



Messages In This Thread
Normalised Item Magic - by seibaby - 04-28-2016, 09:14 AM
RE: Normalised Item Magic - by Kugawattan - 04-28-2016, 09:20 AM
RE: Normalised Item Magic - by seibaby - 04-28-2016, 09:41 AM
RE: Normalised Item Magic - by seibaby - 04-28-2016, 09:29 AM
RE: Normalised Item Magic - by Gi Nattak - 04-28-2016, 02:26 PM
RE: Normalised Item Magic - by Kugawattan - 04-28-2016, 09:32 AM
RE: Normalised Item Magic - by Kugawattan - 04-28-2016, 09:44 AM
RE: Normalised Item Magic - by seibaby - 04-28-2016, 10:43 AM
RE: Normalised Item Magic - by Imzogelmo - 02-04-2017, 08:54 PM
RE: Normalised Item Magic - by Kugawattan - 04-28-2016, 11:15 AM
RE: Normalised Item Magic - by Tenkarider - 04-28-2016, 11:34 AM
RE: Normalised Item Magic - by seibaby - 04-28-2016, 12:24 PM
RE: Normalised Item Magic - by seibaby - 04-28-2016, 04:06 PM
RE: Normalised Item Magic - by seibaby - 02-05-2017, 01:17 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite