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

#11
Posts: 2,548
Threads: 98
Thanks Received: 147
Thanks Given: 156
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
(04-28-2016, 09:29 AM)seibaby Wrote: @Gi Nattak, upon rereading your PM I must admit I'm a bit confused as to what you're asking for exactly. I thought you meant breaking Rods, as Throwing a Rod doesn't cast a spell. However, Throwing a Skean does cast a spell.

Do you want to modify the behaviour of Thrown weapons? Or spells cast by Throwing a Skean/Edge? And are you only interested in Ignore Clear specifically?

EDIT: because if so, what you suggested works fine, I just tested it.
Code:
C2/1895: 80 03   BRA $189A    ;Set Ignore Clear

First and foremost, thank you!

As for what I was requesting, just so that when you use a Rod as an item, or a piece of hacked equipment that can cast a spell when used as an item, it takes away Clear status like a normal magic spell. Skeans I believe already do this because they are spell and not item. So yeah I think this is what your code must change, but just to be sure I shall await your response. Confused
Quote  

#12
Posts: 281
Threads: 18
Thanks Received: 12
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)

#13
Posts: 81
Threads: 4
Thanks Received: 6
Thanks Given: 6
Joined: Nov 2009
Reputation: 14
Status
Weakness
(04-28-2016, 10:43 AM)seibaby Wrote:  Unfortunately, the two properties are intertwined in the damage modification code and not easily separated. Fixing this issue requires a bigger hack, preferably one that allows the damage modification code to accept a byte as input, check each bit individually, and turn off or on the 7 different properties of damage modification accordingly. Then we could have attacks that ignore row, but not defense, or any other combination. Some day I may tackle that kind of hack...
I've always thought that such an engine hack would be a worthwhile endeavor. Since there are 7 sub-steps in damage modification, I was envisioning using a byte; bit #$80 being a quick check to jump over all of it, but then each of the other bits corresponding to one of the sub-steps. It would be handy for future hackers to build from such a hack, but without the tools and/or application of its features, it's hard to get motivated to make such a function.


I appreciate the prayers and good wishes. Those who don't know, I was diagnosed with stage 4 melanoma in 2019, and I have done well with the treatment, but eventually treatments stop working and you change.  I recently had a seizure at work, now I am healing but not able to work or really do much at all. The focus is just to get better. Again, thanks for the support and if I can help you I will.  I've forgotten more about this game than most people should ever learn, lol.
  Find
Quote  

#14
Posts: 281
Threads: 18
Thanks Received: 12
Thanks Given: 8
Joined: Mar 2014
Reputation: 8
Status
None
Oh....I actually made a separation of damage modification bits a while back and then realized the only part I cared about was Ignore target row. And maybe ignore defense still honoring safe/shell. I can post it up when I'm at my computer.

EDIT: here it is:
https://www.ff6hacking.com/forums/showth...p?tid=3409
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite