øAslickproductions.org/forum/index.php?PHPSESSID=9thj53uia1o3n6jfuqo73fcls6&action=printpage;topic=1850.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexdd29-2.htmlslickproductions.org/forum/index.php?topic=1850.45e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexdd29-2.html.zxR½h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈÀKIÔOKtext/htmlISO-8859-1gzip0|ÖIÔÿÿÿÿÿÿÿÿWed, 11 Mar 2020 10:44:58 GMT0ó°° ®0®P®€§²ð®Q½h^ÿÿÿÿÿÿÿÿ“VIÔ Print Page - Changing details of Dark Wave

Board of Slick

Library of the Ancients => Final Fantasy IV Research & Development => Topic started by: Pinkpuff on August 16, 2013, 11:15:19 AM

Title: Changing details of Dark Wave
Post by: Pinkpuff on August 16, 2013, 11:15:19 AM
This command seems like it should have some straightforward parameters that would be great to be able to edit.

I believe it is known where to go to change the amount of HP the caster loses but I can't find off hand. Also I seem to recall it only allowing for 1/8, 1/4 or 1/2 of Max HP. Does anyone know what I'm talking about and where that address is? Is there a way we could jury rig it to be able to subtract different fractions, or maybe even have it "damage" a different stat or something?

Also I don't think anything was ever discovered with regards to how to change the damage dealt. On that note, is it possible to, say, make it dark elemental? Remove the check for undead, or make it check for different monster types? (Maybe you could make it into "Light Wave" or "Harm" that only affects undeads! Or maybe some kind of "Dragon Wave" or something for Kain for example.)
Title: Re: Changing details of Dark Wave
Post by: Dragonsbrethren on August 16, 2013, 11:35:15 AM
Here's the HP damaging code, commented from a trace Grimoire LD did:

Code: [Select]
$03/E9EF   A6 A6    LDX $A6
$03/E9F1   BD 09 20 LDA $2009,x ; load Cecil's max HP, A = 272
$03/E9F4   20 85 84 JSR $8485
$03/8485   4A LSR A ; A = 136
$03/8486   4A LSR A ; A = 68
$03/8487   4A LSR A ; A = 34
$03/8488   60 RTS
$03/E9F7   85 A9 STA $A9 ; $00A9 = 34
$03/E9F9   38 SEC
$03/E9FA   BD 07 20 LDA $2007,x ; load Cecil's current HP, A = 168
$03/E9FD   E5 A9 SBC $A9 ; subtract value at $00A9 (34) from A (168)
$03/E9FF   9D 07 20 STA $2007,x ; store result as Cecil's current HP, A = 134

To quote myself from the original posts (http://slickproductions.org/forum/index.php?topic=1754.msg18070#msg18070), "I'd be cautious changing that bitshift subroutine, since it's probably used for other things." But you can certainly change it to bitshift more, replace it with a fixed value, modify other stats, etc. I don't think anyone ever dug into the special condition for undead or anything else related to it.
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on August 16, 2013, 12:14:16 PM
That's actually very interesting Pinkpuff, yes. By just that old piece of code, there is a way to make it change another stat all together. At the time I wasn't very well acquainted with the character stats, but now I am quite a bit more proficient in the character's data so what you're asking is very simple.

Code: [Select]
00 -Character Identifier - 81
01 - Class - 09
02 - Level - 01
03 - ??? - 00
04 - ??? - 00
05 - ??? - 00
06 - ??? - 00
07 - HP (1) - 55
08 - HP (2) - 00
09 - Max HP (1) - 55
0A - Max HP (2) - 00
0B - MP (1) - 19
0C - MP (2) - 00
0D - Max MP (1) - 19
0E - Max MP (2) - 00
0F - Strength - 03
10 - Agility - 07
11 - Vitality - 02
12 - Wisdom - 08
13 - Will - 03
14 - Modified Strength - 03
15 - Modified Agility - 07
16 - Modified Vitality - 02
17 - Modified Wisdom - 08
18 - Modified Will - 03
19 - ???- 00
1A - ??? - 00
1B - X's to hit - 01
1C - Accuracy - 28
1D - Attack Power - 03
1E - ???- 00
1F - ??? - 00
20 - ??? - 00
21 - ??? - 00
22 - ??? - 00
23 - Magic Evasion - 06
24 - ??? - 00
25 - ??? - 00
26 - ??? - 00
27 - ??? - 00
28 - ??? - 00
29 - Physical Evasion - 1E
2A - Physical Defense - 03
2B - ??? - 00
2C - ??? - 00
2D - ??? - 04
2E - ??? - 15
2F - ??? - 0A

Say you wanted Dark Wave to reduce MP instead of HP, you would change

$03/E9F1   BD 09 20   LDA $2009,x   ; load Cecil's max HP, A = 272

to...

$03/E9F1   BD 0D 20   LDA $200D,x   ; load Cecil's max MP, A
-----------------------
and...

$03/E9FA   BD 07 20   LDA $2007,x   ; load Cecil's current HP, A = 168

to...

$03/E9FA   BD 0B 20   LDA $200B,x   ; load Cecil's current MP, A

-----------------
Finally...

$03/E9FF   9D 07 20   STA $2007,x   ; store result as Cecil's current HP, A = 134

to...

$03/E9FF   9D 0B 20   STA $200B,x   ; store result as Cecil's current MP, A =

Now the obvious problem with this is that nothing prevents the player from not using it when they have 0 MP left.

I did not know about the Undead = 1 Damage effect for Dark Wave, I was under the impression until recently that it was just resistance to the Dark Element. I'll try to take a look for it and see what I can come up with.
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on August 16, 2013, 10:45:07 PM
Oh ho? Looks like I was wrong! I was going through our available information and recalled that Phoenix said there was a Death check to activate when Cecil has less than 1/8 HP. That not only applies to HP. If you tie the command to Cecil's MP he will Die if he uses it with less than 1/8 of his MP, meaning that the original intent of "reliance = death" is kept fully intact and the consequence of using Dark Wave too much can be severe.
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on August 16, 2013, 11:34:54 PM
Hmm... would it be possible to have Dark Wave deplete the party's GP instead of the caster's HP, thus making it a Coin Toss?
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on August 16, 2013, 11:47:13 PM
Changing it to 7E16A0 Might be able to make that happen, granted if it is loaded in battle, but that's a lot of money lost! We still have no idea the formula for this thing, and I have scoured as far as I can in that regard.

I'm at a loss to look on how to make Dark Wave better, damage wise. Obviously it's based on Weapon/Str but to what accord is still unknown.
Title: Re: Changing details of Dark Wave
Post by: Dragonsbrethren on August 17, 2013, 12:15:36 AM
The formula for the amount subtracted? That's in that disassembly I commented above. Nothing says you have to use 1/8th, could easily use a smaller amount or a fixed value.
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on August 17, 2013, 12:22:27 AM
Didn't you say not to touch that 1/8 Subroutine though lest it be used by another part of the game? But yes, on second look you could easily make it a static value.
Title: Re: Changing details of Dark Wave
Post by: Dragonsbrethren on August 17, 2013, 12:48:05 AM
Yeah, but you could easily write your own subroutine to do different values (regardless of whether or not that one's used, you'd need to do any expansion elsewhere anyway).
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on August 17, 2013, 01:03:53 AM
Coin Toss in FFV was really the only worthwhile version, imo. it was a huge amount of nonelemental damage for a huge amount of GP. Made for a great desperation move to beat particularly tough bosses. If Dark Wave has a unique damage subroutine (which is plausible, since it apparently has a unique undead check) we could reproduce this technique. Think I'll look into that tomorrow.
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on August 17, 2013, 01:45:26 PM
Meh - forgot how bad I am at tracing stuff with snes9x debugger. I can't find Dark Wave's damage subroutine. I'm abandoning this ship for now.
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on September 02, 2013, 12:16:25 PM
Finally after All of This time I have Located the building blocks of Dark Wave's formula!

I found this in a stupidly simple manner, I breakpointed on the Command Used in the character information in battle and followed it until I came across the answer. It turned out to be not very complicated at all. Let's hope Jump and Focus are as simple...


The two stats that are taken into account are the Physical Attack Multiplier - 001B and Physical Attack Base -

The formula appears to be Physical Attack Multiplier x Physical Attack Base - 25%/50%/75% = Dark Wave's Damage

From the Bab-il Docs here's how to change the formula of Dark Wave to use what you please...

(http://i112.photobucket.com/albums/n198/LastingDawn/DarkWavebasedonHeldWeapon_zpse98f4243.png) (http://s112.photobucket.com/user/LastingDawn/media/DarkWavebasedonHeldWeapon_zpse98f4243.png.html)

I feared at first that I was just changing the ordinary damage calculation formula, but as this picture would attest the damage formula stayed put.

(http://i112.photobucket.com/albums/n198/LastingDawn/Normalweaponattackcomparison_zps8556ff68.png) (http://s112.photobucket.com/user/LastingDawn/media/Normalweaponattackcomparison_zps8556ff68.png.html)


Code: [Select]

An asterisk (*) before a description for the data indicates that only records
for characters have or use that type of data (equipment is a good example of
this). Two asterisks (**) before a description for the data indicate that only
monsters have or use that type of data (creature type data, for example).
Three asterisks (***) after a description of the data indicates that the
reader is requested to refer to the monster data document for a more complete
description (again, the creature type data is a good example).

Offset Meaning
------ -------
00     *character id/handedness
           bits 0-4: character id
           bit 5: unknown
           bit 6: left hand equippable
           bit 7: right hand equippable
01     *sprite/class
           bits 0-3: sprite/class id
           bits 4-6: unknown
           bit 7: in back row
02     level
03-06  current status anomalies
07-08  current hp
09-0A  maximum hp
0B-0C  current mp
0D-0E  maximum mp
0F     *base strength
10     *base agility
11     *base vitality
12     *base wisdom
13     *base willpower
14     *modified strength
15     modified agility
16     *modified vitality
17     black magic power/modified wisdom
18     white magic power/modified willpower
19     attack elemental
1A     *attack strong vs. creature types***
1B     physical attack multiplier
1C     physical attack percent
1D     physical attack base
1E     attack status 1***
1F     attack status 2***
20     elements weak vs***
21     elements very weak vs***
22     magical defense multiplier
23     magical defense percent
24     magical defense base
25     elemental defense (if immunity bit wasn't set)***
26     elemental defense (if immunity bit was set)***
27     *defense strong vs. creature types***
28     physical defense multiplier
29     physical defense percent
2A     physical defense base
2B     status immunity 1***
2C     status immunity 2***
2D-2F  unknown
30     *helmet
31     *armor
32     *gauntlet
33     *right hand-item
34     *right hand-quantity
35     *left hand-item
36     *left hand-quantity
37-39  *experience
3A     unknown
3B     speed modifier. lower = faster. for autobattles, starts at 01;
       otherwise starts at 10. slow adds +08, (upper bound 20) haste adds -3
       (lower bound 0C)
3C     unknown
3D-3F  *experience to level up
40     **creature types***
41-50  unknown
51     next command # (from 00 to 1D)
52     next sub-action (item or spell number)
53     next action monster target(s)
54     next action party target(s)
55-5F  unknown
60-61  relative speed. equal to (Cecil's agi * 32) / (our agi * 0A). if Cecil
       isn't in the batle, an arbitrary character is picked instead. lower
       number = faster speed.
62-6F  unknown
70     **level and boss bit***
71-72  unknown
73     **item byte***
74-7F  unknown

In RAM (LoRom/HiRom) at...

0x03E71B - BD 1B 20 - (LDA 7E201B) - Looks at the value in 201B - Physical Attack Multiplier
0x03E730 - BD 1D 20 - (LDA 7E201D) - Looks at the value in 201D - Physical Attack Base

In ROM at...

0x1E91B - BD 1B 20 - (LDA 7E201B) - Looks at the value in 201B - Physical Attack Multiplier
0x1E930 - BD 1D 20 - (LDA 7E201D) - Looks at the value in 201D - Physical Attack Base


For instance say I wanted to change the Dark Wave into an attack that looked not purely at Physical attributes but instead looked at Wisdom and the Physical Attack Base to deal damage, that way it would remain useful as the Dark Knight continues to increase in level and should they wish for the Paladin to keep it they could allow him to use some Wisdom boosting equipment to keep the attack relevant.

So Chillyfeez looks like you can get your Gil Toss after all! To change and alter the power of Dark Wave is just a matter of knowing the stats and equipment pools of your Dark Wave recipient!

 :edit:Fixed a Glaring issue with my addressing (I left the 7 from the initial LoRom/HiRom location)
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 02, 2013, 04:44:09 PM
Sweet - nice going, Grimoire. And good idea breakpointing the command slot.
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on September 02, 2013, 05:13:20 PM
Well I have a bit of bad news... Kick uses the same exact formula as Dark Wave (except without the Zombie = 1 damage deal). Therefore they're shared. So if you change Dark Wave's formula you are also changing Kick. Bah.
Title: Re: Changing details of Dark Wave
Post by: Pinkpuff on September 02, 2013, 05:57:03 PM
(except without the Zombie = 1 damage deal)

Speaking of that, do we know how to change that "Zombie" part to some other race or combination thereof?
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on September 02, 2013, 06:04:11 PM
I haven't taken a good look, but in theory it should be around the Dark Wave specialty sections of RAM, likely close to the HP decrease routine. I'm not sure what the data looks like in pure hex, but seeing it on a monster should give me some idea.
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on September 02, 2013, 08:42:30 PM
Alright, I think I found what we're looking for, but it's another unfortunate piece of news...

In RAM....

0x03848E - A9 80 - LDA 80 - This appears to be the "Creature Type check" byte. It's not actually a 1, but a low number from 1-9 it appears. It seems to be separated into bits. 8X = HP Damage (Changing that gets Really weird, really fast), 0 = Undead byte apparently, since it seems to be bit 0 according to Yousei's old notes. Now the problem is that changing this byte to other things may not cause the desired result. It's a very good possibility that this 80 is used for other things and possibly many other things as seeing when its changed in specific manners attacking monsters will die on the spot.

In this case the smart thing to do would be to take the JMP to 038489 (JSR 8489) and somehow reroute it to another LDA 80 (or what have you) that will return using the same measures. But I somewhat doubt that could be done without writing custom code unfortunately and finding spare space for it because  I believe this 80 is just matching it against the monster's type and deciding damage from there.
Title: Re: Changing details of Dark Wave
Post by: Dragonsbrethren on September 02, 2013, 09:36:20 PM
More code would be helpful for figuring out what it's actually doing with that value. (and you're still calling SNES addressing RAM :tongue:)
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on September 02, 2013, 10:07:07 PM
Heh, old habits die hard I suppose...

Now the around that area is pretty messy, but I'll grab it and see if you can't figure something out... starting from what I think is the relevant portion... though a warning, it is very long.

Code: [Select]
$03/E76F 85 CA STA $CA    [$00:00CA] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/E771 A5 C7 LDA $C7    [$00:00C7] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/E773 AA TAX A:0006 X:0000 Y:0000 P:envMxdizc
$03/E774 BD 40 35 LDA $3540,x[$7E:3546] A:0006 X:0006 Y:0000 P:envMxdizc
$03/E777 D0 68 BNE $68    [$E7E1] A:0000 X:0006 Y:0000 P:envMxdiZc
$03/E779 A5 C7 LDA $C7    [$00:00C7] A:0000 X:0006 Y:0000 P:envMxdiZc
$03/E77B 20 89 84 JSR $8489  [$03:8489] A:0006 X:0006 Y:0000 P:envMxdizc

$03/8489 8D 2F 35 STA $352F  [$7E:352F] A:0006 X:0006 Y:0000 P:envMxdizc
$03/848C 85 DF STA $DF    [$00:00DF] A:0006 X:0006 Y:0000 P:envMxdizc
$03/848E A9 80 LDA #$80 A:0006 X:0006 Y:0000 P:envMxdizc - (Looks to be where the game grabs the 80 for Dark Wave)
$03/8490 85 E1 STA $E1    [$00:00E1] A:0080 X:0006 Y:0000 P:eNvMxdizc
$03/8492 20 E0 83 JSR $83E0  [$03:83E0] A:0080 X:0006 Y:0000 P:eNvMxdizc

$03/83E0 64 E0 STZ $E0    [$00:00E0] A:0080 X:0006 Y:0000 P:eNvMxdizc
$03/83E2 64 E2 STZ $E2    [$00:00E2] A:0080 X:0006 Y:0000 P:eNvMxdizc
$03/83E4 C2 20 REP #$20 A:0080 X:0006 Y:0000 P:eNvMxdizc
$03/83E6 A2 10 00 LDX #$0010 A:0080 X:0006 Y:0000 P:eNvmxdizc
$03/83E9 64 E3 STZ $E3    [$00:00E3] A:0080 X:0010 Y:0000 P:envmxdizc
$03/83EB 9C 4D 39 STZ $394D  [$7E:394D] A:0080 X:0010 Y:0000 P:envmxdizc
$03/83EE 66 E1 ROR $E1    [$00:00E1] A:0080 X:0010 Y:0000 P:envmxdizc
$03/83F0 90 09 BCC $09    [$83FB] A:0080 X:0010 Y:0000 P:envmxdizc
$03/83FB 6E 4D 39 ROR $394D  [$7E:394D] A:0080 X:0010 Y:0000 P:envmxdizc
$03/83FE 66 E3 ROR $E3    [$00:00E3] A:0080 X:0010 Y:0000 P:envmxdiZc
$03/8400 CA DEX A:0080 X:0010 Y:0000 P:envmxdiZc
$03/8401 D0 EB BNE $EB    [$83EE] A:0080 X:000F Y:0000 P:envmxdizc
$03/83EE 66 E1 ROR $E1    [$00:00E1] A:0080 X:000F Y:0000 P:envmxdizc
$03/83F0 90 09 BCC $09    [$83FB] A:0080 X:000F Y:0000 P:envmxdizc
(Data decrementing, skipping...)

$03/8403 7B TDC A:0006 X:0000 Y:0000 P:envmxdiZc
$03/8404 E2 20 SEP #$20 A:0000 X:0000 Y:0000 P:envmxdiZc
$03/8406 60 RTS A:0000 X:0000 Y:0000 P:envMxdiZc
-------------------
$03/8495 A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/8497 86 A6 STX $A6    [$00:00A6] A:0000 X:0300 Y:0000 P:envMxdizc
$03/8499 AD 2F 35 LDA $352F  [$7E:352F] A:0000 X:0300 Y:0000 P:envMxdizc
$03/849C 85 DF STA $DF    [$00:00DF] A:0006 X:0300 Y:0000 P:envMxdizc
$03/849E A9 15 LDA #$15 A:0006 X:0300 Y:0000 P:envMxdizc
$03/84A0 85 E1 STA $E1    [$00:00E1] A:0015 X:0300 Y:0000 P:envMxdizc
$03/84A2 20 E0 83 JSR $83E0  [$03:83E0] A:0015 X:0300 Y:0000 P:envMxdizc

$03/83E0 64 E0 STZ $E0    [$00:00E0] A:0015 X:0300 Y:0000 P:envMxdizc
$03/83E2 64 E2 STZ $E2    [$00:00E2] A:0015 X:0300 Y:0000 P:envMxdizc
$03/83E4 C2 20 REP #$20 A:0015 X:0300 Y:0000 P:envMxdizc
$03/83E6 A2 10 00 LDX #$0010 A:0015 X:0300 Y:0000 P:envmxdizc
$03/83E9 64 E3 STZ $E3    [$00:00E3] A:0015 X:0010 Y:0000 P:envmxdizc
$03/83EB 9C 4D 39 STZ $394D  [$7E:394D] A:0015 X:0010 Y:0000 P:envmxdizc
$03/83EE 66 E1 ROR $E1    [$00:00E1] A:0015 X:0010 Y:0000 P:envmxdizc
$03/83F0 90 09 BCC $09    [$83FB] A:0015 X:0010 Y:0000 P:envmxdizC
$03/83F2 18 CLC A:0015 X:0010 Y:0000 P:envmxdizC
$03/83F3 A5 DF LDA $DF    [$00:00DF] A:0015 X:0010 Y:0000 P:envmxdizc
$03/83F5 6D 4D 39 ADC $394D  [$7E:394D] A:0006 X:0010 Y:0000 P:envmxdizc
(As above, it loops a timer or something... skipping)
---------------------

$03/8401 D0 EB BNE $EB    [$83EE] A:0007 X:0000 Y:0000 P:envmxdiZc
$03/8403 7B TDC A:0007 X:0000 Y:0000 P:envmxdiZc
$03/8404 E2 20 SEP #$20 A:0000 X:0000 Y:0000 P:envmxdiZc
$03/8406 60 RTS A:0000 X:0000 Y:0000 P:envMxdiZc
$03/84A5 A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/84A7 8E 30 35 STX $3530  [$7E:3530] A:0000 X:007E Y:0000 P:envMxdizc
$03/84AA AD 2F 35 LDA $352F  [$7E:352F] A:0000 X:007E Y:0000 P:envMxdizc
$03/84AD 85 DF STA $DF    [$00:00DF] A:0006 X:007E Y:0000 P:envMxdizc
$03/84AF A9 37 LDA #$37 A:0006 X:007E Y:0000 P:envMxdizc
$03/84B1 85 E1 STA $E1    [$00:00E1] A:0037 X:007E Y:0000 P:envMxdizc
$03/84B3 20 E0 83 JSR $83E0  [$03:83E0] A:0037 X:007E Y:0000 P:envMxdizc

(Repeat of Data we've seen before it's jumping to the exact same place)

$03/84B6 A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/84B8 8E 32 35 STX $3532  [$7E:3532] A:0000 X:014A Y:0000 P:envMxdizc
$03/84BB AD 2F 35 LDA $352F  [$7E:352F] A:0000 X:014A Y:0000 P:envMxdizc
$03/84BE 85 DF STA $DF    [$00:00DF] A:0006 X:014A Y:0000 P:envMxdizc
$03/84C0 A9 1C LDA #$1C A:0006 X:014A Y:0000 P:envMxdizc
$03/84C2 85 E1 STA $E1    [$00:00E1] A:001C X:014A Y:0000 P:envMxdizc
$03/84C4 20 E0 83 JSR $83E0  [$03:83E0] A:001C X:014A Y:0000 P:envMxdizc

(As above)

$03/84C7 A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/84C9 8E 34 35 STX $3534  [$7E:3534] A:0000 X:00A8 Y:0000 P:envMxdizc
$03/84CC AD 2F 35 LDA $352F  [$7E:352F] A:0000 X:00A8 Y:0000 P:envMxdizc
$03/84CF AA TAX A:0006 X:00A8 Y:0000 P:envMxdizc
$03/84D0 8E 3D 39 STX $393D  [$7E:393D] A:0006 X:0006 Y:0000 P:envMxdizc
$03/84D3 A2 20 01 LDX #$0120 A:0006 X:0006 Y:0000 P:envMxdizc
$03/84D6 8E 3F 39 STX $393F  [$7E:393F] A:0006 X:0120 Y:0000 P:envMxdizc
$03/84D9 20 B9 83 JSR $83B9  [$03:83B9] A:0006 X:0120 Y:0000 P:envMxdizc

$03/83B9 C2 20 REP #$20 A:0006 X:0120 Y:0000 P:envMxdizc
$03/83BB A2 10 00 LDX #$0010 A:0006 X:0120 Y:0000 P:envmxdizc
$03/83BE 9C 41 39 STZ $3941  [$7E:3941] A:0006 X:0010 Y:0000 P:envmxdizc
$03/83C1 9C 43 39 STZ $3943  [$7E:3943] A:0006 X:0010 Y:0000 P:envmxdizc
$03/83C4 6E 3F 39 ROR $393F  [$7E:393F] A:0006 X:0010 Y:0000 P:envmxdizc
$03/83C7 90 0A BCC $0A    [$83D3] A:0006 X:0010 Y:0000 P:envmxdizc
$03/83D3 6E 43 39 ROR $3943  [$7E:3943] A:0006 X:0010 Y:0000 P:envmxdizc
$03/83D6 6E 41 39 ROR $3941  [$7E:3941] A:0006 X:0010 Y:0000 P:envmxdiZc
$03/83D9 CA DEX A:0006 X:0010 Y:0000 P:envmxdiZc
$03/83DA D0 E8 BNE $E8    [$83C4] A:0006 X:000F Y:0000 P:envmxdizc
$03/83C4 6E 3F 39 ROR $393F  [$7E:393F] A:0006 X:000F Y:0000 P:envmxdizc
$03/83C7 90 0A BCC $0A    [$83D3] A:0006 X:000F Y:0000 P:envmxdizc
(Repeated data, ignored...)

$03/83DC 7B TDC A:0006 X:0000 Y:0000 P:envmxdiZc
$03/83DD E2 20 SEP #$20 A:0000 X:0000 Y:0000 P:envmxdiZc
$03/83DF 60 RTS A:0000 X:0000 Y:0000 P:envMxdiZc

$03/84DC AE 41 39 LDX $3941  [$7E:3941] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/84DF 8E 36 35 STX $3536  [$7E:3536] A:0000 X:06C0 Y:0000 P:envMxdizc
$03/84E2 60 RTS A:0000 X:06C0 Y:0000 P:envMxdizc

$03/E77E A6 A6 LDX $A6    [$00:00A6] A:0000 X:06C0 Y:0000 P:envMxdizc - (Back into the main subroutine)

$03/E780 BD 03 20 LDA $2003,x[$7E:2303] A:0000 X:0300 Y:0000 P:envMxdizc
$03/E783 29 C0 AND #$C0 A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E785 D0 5A BNE $5A    [$E7E1] A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E787 BD 05 20 LDA $2005,x[$7E:2305] A:0000 X:0300 Y:0000 P:envMxdiZc - (Looking at Monster's status?)

$03/E78A 29 02 AND #$02 A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E78C D0 53 BNE $53    [$E7E1] A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E78E BD 06 20 LDA $2006,x[$7E:2306] A:0000 X:0300 Y:0000 P:envMxdiZc - (Looking at third byte of Monster status?)

$03/E791 30 4E BMI $4E    [$E7E1] A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E793 BD 40 20 LDA $2040,x[$7E:2340] A:0000 X:0300 Y:0000 P:envMxdiZc - (Look at Monster's Creature Type)

$03/E796 29 48 AND #$48 A:0080 X:0300 Y:0000 P:eNvMxdizc
$03/E798 D0 47 BNE $47    [$E7E1] A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E79A A5 C1 LDA $C1    [$00:00C1] A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E79C F0 0D BEQ $0D    [$E7AB] A:0001 X:0300 Y:0000 P:envMxdizc
$03/E79E BD 40 20 LDA $2040,x[$7E:2340] A:0001 X:0300 Y:0000 P:envMxdizc
$03/E7A1 10 08 BPL $08    [$E7AB] A:0080 X:0300 Y:0000 P:eNvMxdizc
$03/E7A3 46 CA LSR $CA    [$00:00CA] A:0080 X:0300 Y:0000 P:eNvMxdizc
$03/E7A5 66 C9 ROR $C9    [$00:00C9] A:0080 X:0300 Y:0000 P:envMxdiZc
$03/E7A7 46 CA LSR $CA    [$00:00CA] A:0080 X:0300 Y:0000 P:envMxdizC
$03/E7AB A5 C1 LDA $C1    [$00:00C1] A:0080 X:0300 Y:0000 P:envMxdizc
$03/E7AD D0 20 BNE $20    [$E7CF] A:0001 X:0300 Y:0000 P:envMxdizc
$03/E7CF A6 C9 LDX $C9    [$00:00C9] A:0001 X:0300 Y:0000 P:envMxdizc
$03/E7D1 F0 F7 BEQ $F7    [$E7CA] A:0001 X:0006 Y:0000 P:envMxdizc
$03/E7D3 A5 C7 LDA $C7    [$00:00C7] A:0001 X:0006 Y:0000 P:envMxdizc
$03/E7D5 0A ASL A A:0006 X:0006 Y:0000 P:envMxdizc
$03/E7D6 AA TAX A:000C X:0006 Y:0000 P:envMxdizc
$03/E7D7 A5 C9 LDA $C9    [$00:00C9] A:000C X:000C Y:0000 P:envMxdizc
$03/E7D9 9D D4 34 STA $34D4,x[$7E:34E0] A:0006 X:000C Y:0000 P:envMxdizc

$03/E7DC A5 CA LDA $CA    [$00:00CA] A:0006 X:000C Y:0000 P:envMxdizc
$03/E7DE 9D D5 34 STA $34D5,x[$7E:34E1] A:0000 X:000C Y:0000 P:envMxdiZc
$03/E7E1 E6 C7 INC $C7    [$00:00C7] A:0000 X:000C Y:0000 P:envMxdiZc
$03/E7E3 A5 C7 LDA $C7    [$00:00C7] A:0000 X:000C Y:0000 P:envMxdizc
$03/E7E5 C5 C3 CMP $C3    [$00:00C3] A:0007 X:000C Y:0000 P:envMxdizc
$03/E7E7 F0 03 BEQ $03    [$E7EC] A:0007 X:000C Y:0000 P:eNvMxdizc
$03/E7E9 4C 5B E7 JMP $E75B  [$03:E75B] A:0007 X:000C Y:0000 P:eNvMxdizc
$03/E75B 7B TDC A:0007 X:000C Y:0000 P:eNvMxdizc
$03/E75C AA TAX A:0000 X:000C Y:0000 P:envMxdiZc
$03/E75D A5 C5 LDA $C5    [$00:00C5] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/E75F 20 79 83 JSR $8379  [$03:8379] A:000F X:0000 Y:0000 P:envMxdizc

And I think by this point we have left the proper subroutine... I could be wrong though.

I saw only one addition of 80 throughout that entire thing and it's in a spot that seems to be accessed by a lot of battle matters. 80 looks to be the Undead byte if the Zombie's Monster data is anything to go off of.

And here's the thing that really gets me... if I try to change the Creature Look up type as shown above nothing appears to happen, but if I change the 80 to something else (that doesn't make the game go strange) then Dark Wave's Zombie resistance is gone. I am really quite confused by this. I found this by placing a breakpoint on the Monster's creature type and to see what accessed it.
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on September 06, 2013, 02:26:34 AM
Alright, so by replacing both instance of 7E2040 to say... 7E1400 that should disable the Zombie Check... (I embarrassingly can still not find a way to change the type it resists)

In HiRom/LoRom at...

03E793 - BD 40 20 - LDA from 2040 - Creature Type Byte
03E79E - BD 40 20 - LDA from 2040 - Creature Type Byte

In ROM at...

01E993 - BD 40 20 - LDA from 2040 - Creature Type Byte
01E99E - BD 40 20 - LDA from 2040 - Creature Type Byte

Change these both to BD 00 14 and the Zombie check should be disabled.
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on September 08, 2013, 08:40:20 PM
Looking at my previous code I've decided to test things in a more empirical fashion and stumbled, completely by accident, upon the damage reduction routine for Zombie Types, but this two byte null also had the unexpected effect of making Zombies Weak to Dark Wave. As in they were dealt full weapon damage as if each one had been hit by Cecil's normal attack.

In LoRom/HiRom...

03E7A3 - 46 CA (LSR 0xCA) - Logical Shift Right the Value in CA. (Appears to be Zombie's damage reduction formula, unique to the normal Dark Wave damage formula.)

Nor curiously two bytes away there is another 46 CA which I thought was used for the general enemy being hit by Dark Wave but it doesn't appear to do anything.

03E7A1 is skipped by normal monsters and jumps t 03E7AB

Oh! Now I understand...

03E7A1 is a Branch if Plus to E7AB! 0080 (Zombie) is the Only Creature type that falls into a Negative Counter at 80. (-127)! And that's how the game looks at it. Though I cannot think of any easy way to change that now that I Truly understand how the game looks at the 80 and compares it. I'll take a look at my available instructions to use.

Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 08, 2013, 09:39:37 PM
Could you just change the BCS to E7AB (or is it a BCC) to a non-conditional JMP to E7AB (which would, essentially, just logically make the check for Zombie type irrelevant)?
Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on September 08, 2013, 09:48:14 PM
Yes, you could Very easily do that. It might be a little safer actually since I'm not really sure what 1400 uses.

However I would love to switch the type it resists (or is super effective) against. Something like a straight CMP 04 to make Reptiles (in The After Years the creature type is referred to as Demon, I can see either being applicable in some respects, they're definitely not Insects as FF4A tries to claim) resistant or weak to Dark Wave (or if we can ever find the graphic and palette for it, "Light Wave" if someone wants to make it super effective against Zombie/Demon types)

But that BPL 08 (Branch-if-plus to E7AB) is a very small command doesn't lend itself to changing the stuff around it very well. I would ideally have it CMP and Break if otherwise...

But your idea to use a BCS should work fine. A BCC might allow a success to get through somehow.

 :edit:
Alright! I figured it out completely now! With this new bit of coding you can have any enemy type weak to Dark Wave!

I must Note though it is Only making them weak to Dark Wave. The reasoning is because one of the new instructions erased the main "resist" check that divides the damage, therefore delivering normal damage, so while it will still only have Zombies resist it you can say, have Dragons or Demon/Reptiles weak to it. But because it is looking for a specific value in a byte you cannot have multi-type foes (like D. Bone Dragon/Zombie) be weak to it.

Dark Wave - Make Enemy Type XX weak to it in LoRom/HiRom

Creature Types in Hex -

00 - None
01 - Dragon
02 - Robot
04 - Reptile
08 - Spirit
10 - Giant
20 - Sime
40 - Mage
80 - Zombie

Code: [Select]
0x03E793 - BD  40 20 (LDA 2040) - Unsure of what it does, but change this if you are changing the value below.

0x03E79E - BD 40 20 (LDA 2040) - Loads Creature Type. The more ambitious hacker might want to change this to have it look at another value. Say that you want it to instead Load an Elemental Weakness check you would change it to BD2020 for Weakness.

0x03E7A1 - C9 XX  (CMP XX) - Compare Creature Type
0x03E7A3 - D0 06 (BNE 06) - If it is not the same value as above, Jump 9 Bytes (6+3?) to skip this routine.

ROM at...

Code: [Select]
0x1E993 - BD  40 20 (LDA 2040) - Unsure of what it does, but change this if you are changing the value below.

0x1E99E - BD 40 20 (LDA 2040) - Loads Creature Type. The more ambitious hacker might want to change this to have it look at another value. Say that you want it to instead Load an Elemental Weakness check you would change it to BD2020 for Weakness, or if you want it to look at a specific Status Ailment, (a use for Poison maybe?) then you would change it to BD0420 and have C9 look for 01.

0x1E9A1 - C9 XX  (CMP XX) - Compare Creature Type
0x1E9A3 - D0 06 (BNE 06) - If it is not the same value as above, Jump 9 Bytes (6+3?) to skip this routine.

What this does is get rid of the LSR CA which was decrementing the damage and allows the chosen type to play out as full weapon damage.




Title: Re: Changing details of Dark Wave
Post by: Grimoire LD on October 07, 2013, 10:50:56 AM
You wanted information on Dark Wave? You got it! (Repost from my main thread as it is pertinent to what was requested)

Dark Wave Routine -
Code: [Select]
$03/E9E9 A5 CD LDA $CD    [$00:00CD] A:0003 X:000A Y:0000 P:envMxdizc - Load User's ID.
$03/E9EB 30 26 BMI $26    [$EA13] A:0000 X:000A Y:0000 P:envMxdiZc - Is it Minus? (Enemy Cecil) If so, branch to 03EA13.
$03/E9ED C2 20 REP #$20 A:0000 X:000A Y:0000 P:envMxdiZc - Reset Processor Status
$03/E9EF A6 A6 LDX $A6    [$00:00A6] A:0000 X:000A Y:0000 P:envmxdiZc - Load User's Slot.
$03/E9F1 BD 09 20 LDA $2009,x[$7E:2009] A:0000 X:0000 Y:0000 P:envmxdiZc - Load User's Max HP.
$03/E9F4 20 85 84 JSR $8485  [$03:8485] A:00C8 X:0000 Y:0000 P:envmxdizc - Jump to Subroutine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
$03/8485 4A LSR A A:00C8 X:0000 Y:0000 P:envmxdizc - /2 A.
$03/8486 4A LSR A A:0064 X:0000 Y:0000 P:envmxdizc - /2 A.
$03/8487 4A LSR A A:0032 X:0000 Y:0000 P:envmxdizc - /2 A.
$03/8488 60 RTS A:0019 X:0000 Y:0000 P:envmxdizc - Return
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/E9F7 85 A9 STA $A9    [$00:00A9] A:0019 X:0000 Y:0000 P:envmxdizc - Store A in A9. (Amount of HP to subtract)
$03/E9F9 38 SEC A:0019 X:0000 Y:0000 P:envmxdizc - Set Carry Flag.
$03/E9FA BD 07 20 LDA $2007,x[$7E:2007] A:0019 X:0000 Y:0000 P:envmxdizC - Load User's Current HP.
$03/E9FD E5 A9 SBC $A9    [$00:00A9] A:002C X:0000 Y:0000 P:envmxdizC - Reduce A by the value in A9 (1/8th of Max HP)
$03/E9FF 9D 07 20 STA $2007,x[$7E:2007] A:0013 X:0000 Y:0000 P:envmxdizC - Store A in User's Current HP.
$03/EA02 B0 0C BCS $0C    [$EA10] A:0013 X:0000 Y:0000 P:envmxdizC - If greater than 00 branch to 03EA10.
---------------------------------------------------------------------------------------------------------------------------------------
$03/EA04 A9 00 00 LDA #$0000 A:FFFA X:0000 Y:0000 P:eNvmxdizc - Load 0000 into A.
$03/EA07 9D 07 20 STA $2007,x[$7E:2007] A:0000 X:0000 Y:0000 P:envmxdiZc - Store A in User's Current HP.
$03/EA0A A9 80 00 LDA #$0080 A:0000 X:0000 Y:0000 P:envmxdiZc - Load 0080 into A. (Death)
$03/EA0D 9D 03 20 STA $2003,x[$7E:2003] A:0080 X:0000 Y:0000 P:envmxdizc - Store A in 7E2003.
------------------------------------------------------------------------------------------------------------------------------------------
$03/EA10 7B TDC A:0013 X:0000 Y:0000 P:envmxdizC - Transfer Direct Page
$03/EA11 E2 20 SEP #$20 A:0000 X:0000 Y:0000 P:envmxdiZC - Set Processor Status.
$03/EA13 A9 01 LDA #$01 A:0000 X:0000 Y:0000 P:envMxdiZC - Load 01 into A.
$03/EA15 85 C1 STA $C1    [$00:00C1] A:0001 X:0000 Y:0000 P:envMxdizC - Store A in C1 (Used in the Kick Routine)
$03/EA17 4C B9 E6 JMP $E6B9  [$03:E6B9] A:0001 X:0000 Y:0000 P:envMxdizC - Jump to Routine (Most of Kick Routine)

Well that was quite a bit simpler this time around, everything was easily deciphered.

First, I've decided to make Dark Wave's death penalty more substantial...


$03/EA04   A9 00 00   LDA #$0000   A:FFF8   X:0000   Y:0000   P:eNvmxdizc - Load 0000 into A.
$03/EA07   9D 07 20   STA $2007,x[$7E:2007]   A:0000   X:0000   Y:0000   P:envmxdiZc - Store A in User's HP.
$03/EA0A   A9 80 00   LDA #$0080   A:0000   X:0000   Y:0000   P:envmxdiZc - Load 0080 into A.
$03/EA0D   9D 40 20   STA $2040,x[$7E:2040]   A:0080   X:0000   Y:0000   P:envmxdizc - Store A in User's Creature Type (Undead)


I'm going to go out on a limb and say this is what it May have originally been, or at least planned. Because setting the HP to 0 automatically will kill the user regardless, making the Death Application superfluous. This will prevent the player from being able to revive Cecil if he killed himself with Dark Wave, as it applied the Undead-type to him.

Furthermore the jump to Kick is basically reading the entirely of the Kick Routine, meaning that you could Easily set it to the Fight Routine and have Dark Wave hit only a single target, now unfortunately, it would then only act like a normal attack without modifying the Fight Routine or Dark Wave Routine itself to compensate the new addition to it.

For instance, say you want to make Dark Wave more like Darkness in FFIV:DS, an attack that hits one enemy for Double Damage, but takes HP.

You would change...

$03/EA10   7B    TDC   A:0013   X:0000   Y:0000   P:envmxdizC - Transfer Direct Page
$03/EA11   E2 20   SEP #$20   A:0000   X:0000   Y:0000   P:envmxdiZC - Set Processor Status.
$03/EA13   A9 01   LDA #$01   A:0000   X:0000   Y:0000   P:envMxdiZC - Load 01 into A.
$03/EA15   85 C1   STA $C1    [$00:00C1]   A:0001   X:0000   Y:0000   P:envMxdizC - Store A in C1 (Used in the Kick Routine)
$03/EA17   4C B9 E6   JMP $E6B9  [$03:E6B9]   A:0001   X:0000   Y:0000   P:envMxdizC - Jump to Routine (Most of Kick Routine)

To this...

$03/EA10   E2 20   SEP #$20   A:0039   X:0000   Y:0000   P:envmxdizC - Set Processor Status (in order to have it read only one byte rather than two)
$03/EA12   A9 04   LDA #$04   A:0039   X:0000   Y:0000   P:envMxdizC - Load 04 into A. (x2 Power)
$03/EA14   8D FE 38   STA $38FE  [$7E:38FE]   A:0004   X:0000   Y:0000   P:envMxdizC - Store A in Damage Altering Field.
$03/EA17   4C 99 C4   JMP $C499  [$03:C499]   A:0004   X:0000   Y:0000   P:envMxdizC - Jump to Fight Routine.

As long as the enemy itself has no weakness or resistance to the Elemental or Creature Type Attack, then Dark Wave will carry through as a normal attack at x2 Damage. Otherwise those variables will nullify it and replace it with an ordinary one.

Or if you want to make Dark Wave cast a Spell at 1/8th of your HP you would instead...

$03/EA10   E2 20   SEP #$20   A:0039   X:0000   Y:0000   P:envmxdizC - Set Processor Status (in order to have it read only one byte rather than two)
$03/EA12   A9 A2   LDA #$A2   A:0039   X:0000   Y:0000   P:envMxdizC - Load A2 into A. (Emission)
$03/EA14   8D D2 26   STA $26D2  [$7E:26D2]   A:00A2   X:0000   Y:0000   P:envMxdizC - Store A in Next Action to take.
$03/EA17   4C 3E CD   JMP $CD3E  [$03:CD3E]   A:00A2   X:0000   Y:0000   P:envMxdizC - Jump to Spell Routine.

But it is not that simple. The Magic Call seems to put the Caster stats above all else and will put that in initial stats at the end of the routine, meaning that if you want Dark Wave to cast a spell that hurts Cecil 1/8 HP you would also bear this in mind and change an earlier part of the routine...

Change this...

$03/E9FA   BD 07 20   LDA $2007,x[$7E:2007]   A:0019   X:0000   Y:0000   P:envmxdizC - Load User's Current HP.
$03/E9FD   E5 A9   SBC $A9    [$00:00A9]   A:002C   X:0000   Y:0000   P:envmxdizC - Reduce A by the value in A9 (1/8th of Max HP)
$03/E9FF   9D 07 20   STA $2007,x[$7E:2007]   A:0013   X:0000   Y:0000   P:envmxdizC - Store A in User's Current HP.
$03/EA02   B0 0C   BCS $0C    [$EA10]   A:0013   X:0000   Y:0000   P:envmxdizC - If greater than 00 branch to 03EA10.
---------------------------------------------------------------------------------------------------------------------------------------
$03/EA04   A9 00 00   LDA #$0000   A:FFFA   X:0000   Y:0000   P:eNvmxdizc - Load 0000 into A.
$03/EA07   9D 07 20   STA $2007,x[$7E:2007]   A:0000   X:0000   Y:0000   P:envmxdiZc - Store A in User's Current HP.
$03/EA0A   A9 80 00   LDA #$0080   A:0000   X:0000   Y:0000   P:envmxdiZc - Load 0080 into A. (Death)
$03/EA0D   9D 03 20   STA $2003,x[$7E:2003]   A:0080   X:0000   Y:0000   P:envmxdizc - Store A in 7E2003.

To this...

$03/E9FA   BD 87 26   LDA $2687,x[$7E:2687]   A:0019   X:0000   Y:0000   P:envmxdizC - Load Caster's Current HP.
$03/E9FD   E5 A9   SBC $A9    [$00:00A9]   A:0079   X:0000   Y:0000   P:envmxdizC - Subtract it by the value in A9.
$03/E9FF   8D 87 26   STA $2687,[$7E:2687]   A:0060   X:0000   Y:0000   P:envmxdizC - Store A in Caster's Current HP.
$03/EA02   B0 0C   BCS $0C    [$EA10]   A:0060   X:0000   Y:0000   P:envmxdizC - If more than 00 branch to 03EA02.
----------------------------------------------------------------------------------------------------------------------
$03/EA04   A9 00 00   LDA #$0000   A:FFFA   X:0000   Y:0000   P:eNvmxdizc - Load 0000 into A. - Load 0000 into A.
$03/EA07   8D 87 26   STA $2687, [$7E:2687]   A:0000   X:0000   Y:0000   P:envmxdiZc - Store A in User's Current HP. - Store A in Caster
$03/EA0A   A9 80 00   LDA #$0080   A:0000   X:0000   Y:0000   P:envmxdiZc - Load 0080 into A. (Death)
$03/EA0D   8D 03 20   STA $2003, [$7E:2003]   A:0080   X:0000   Y:0000   P:envmxdizc - Store A in 7E2003.

And there you have it. Two different ways to modify Dark Wave, one is to simulate Darkness from FFIV:DS and the other is to allow it to cast a spell, if one actually wanted to use something more complex than Kick's routine or normal attack modification.

Title: Re: Changing details of Dark Wave
Post by: fedorajoe on September 07, 2016, 11:35:45 AM
Forgive me for thread necromancy, but did anyone ever get around to making a Gil Toss command out of Dark?

I'd like to have Gil Toss for my next project and thought Dark was the logical choice.  This thread had a great breakdown of how the command works but I'm not sure, for example, what value you'd use to swap HP for gil.

Thanks!
:cookie:
Title: Re: Changing details of Dark Wave
Post by: Bahamut ZERO on September 07, 2016, 12:14:07 PM
Hmm from looking at a post before your's the HP portion of the code is this chunk:

Quote
$03/E9FA   BD 07 20   LDA $2007,x[$7E:2007]   A:0019   X:0000   Y:0000   P:envmxdizC - Load User's Current HP.
$03/E9FD   E5 A9   SBC $A9    [$00:00A9]   A:002C   X:0000   Y:0000   P:envmxdizC - Reduce A by the value in A9 (1/8th of Max HP)
$03/E9FF   9D 07 20   STA $2007,x[$7E:2007]   A:0013   X:0000   Y:0000   P:envmxdizC - Store A in User's Current HP.
$03/EA02   B0 0C   BCS $0C    [$EA10]   A:0013   X:0000   Y:0000   P:envmxdizC - If greater than 00 branch to 03EA10.


Granted, I have no knowledge in ASM to help change it from HP Loss to Gil loss, but this looks like a nice spot to start off with.  :banonsmash:
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 07, 2016, 11:23:05 PM
BZ's mostly right about what would need to be changed, except he left out the part where the amount of HP (GP) to subtract is determined.
The problem you'd face in making it all work is that GP is a three-byte value, versus HP which is only two bytes. SNES can only calculate two-byte values. So the way the amount is calculated - as well as possibly the way it's subtracted - would have to be adjusted. I guess. I mean, you could just ignore the lowest byte of GP, I suppose. You'd also want to up the damage done by the attack, right? When I was theorizing about this, I was thinking that it'd be like the gil toss in FFV, which deals a very large amount of damage.
I mean, I can help with this, probably, but I'd need specifics about what you'd want the command to do.
Title: Re: Changing details of Dark Wave
Post by: fedorajoe on September 08, 2016, 12:00:40 AM
Wow, thank you!

The ideal situation, for my project, would be a similar system to The After Years:  damage and gil spent = level x 30 per enemy.

This is an ability you'd have right near the beginning so I wouldn't want it to be too overpowered.  With that said, if you'd already posted a way to do it FFV or FFVI style I would have simply used your code with no complaints! :)
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 08, 2016, 03:00:14 PM
No, I haven't made any gil toss command yet. Anything I said here or anywhere else about it was just theoretical musing. But it's definitely something I can do.
So, what you're looking for...
If I understand correctly, the damage formula would look like:

D = 30 x L x T

where
D is the damage output (as well as amount of gil spent)
L is the caster (attacker)'s level
T is the number of living targets in the target party
and D is divided evenly among all living targets, such that a level 30 character deals 900 damage to all targets, regardless of how many targets are on the field, but spends 900 gil for one target, 1800 gil for two targets, 2700 gil for three targets, etc.

Did I get that right?

Also, I'm assuming we want different results if the player doesn't have enough gil. I'm not sure which of the following would be easiest to do, but tell me your preference:
A) When the player has some - but not enough - gil, the command deals the "right" amount of damage, but entirely wipes out the last of the player's gil (e.g., a level 30 player with 1800 gil attacking three targets deals 900 damage to all three targets and ends up with zero gil)
B) When the player has some - but not enough - gil, the command fails outright and the player retains that small amount of gil
C) When the player has some - but not enough - gil, the command deals a prorated amount of damage and entirely wipes out the last of the player's gil (e.g., a level 30 player with 1800 gil attacking three targets deals 600 damage to all three targets - instead of 900 - and ends up with zero gil)
note: regardless of which method above is used, I assume the command should fail outright if the player has zero gil to begin with

I'll have to write in a custom damage calculation in order to make this all possible, so I'll need to know the following as well:
1) Does your ROM have a header?
2) Has any custom assembly been written into your ROM (this does not include any edits made with FF4kster or most other editors, but does most likely include augmentation patches, such as my User Options or Break Damage Limit patches)
3) If you open your ROM in a hex editor and jump to offset 1F410 (with a header, or 1F210 without), are there seven lines of FFs there?
Title: Re: Changing details of Dark Wave
Post by: Squall on September 08, 2016, 03:56:43 PM
Since this is a  custom project you may implement whatever you need, but if I was you I would implement as its in other installments of FF. Besides 30* Level will mean you will never reach 9999dmg.

In FFV Gil Toss:
Code: [Select]
Gil cost = 50 * Level * (# of targets attacked)
Damage = (Attack - Defense) * M
  Attack = Level + 10
  M = 150
  Defense = Enemy Defense

Personally I find it a neat formula, because you cant abuse it vs bosses (supposedly they have high def) and it doesnt do a constant damage as in FFVI (as far as I remember)
Title: Re: Changing details of Dark Wave
Post by: fedorajoe on September 08, 2016, 06:00:35 PM
Hi!

No header and no patches applied, but I do make a lot of adjustments in my hex editor.  Yes, I've got the big block of FF's at 1F210.  :)

Edited to add:  I forgot to answer your other question.  I'd go with Option A:  command executes, uses up all gil, and deals damage corresponding to the amount spent.
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 08, 2016, 06:38:54 PM
Um, isn't that option C?
Title: Re: Changing details of Dark Wave
Post by: fedorajoe on September 08, 2016, 11:17:44 PM
Yes.  ;)

My reading comprehension skills were apparently not quite up to snuff today.
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 09, 2016, 11:39:59 AM
OK. Think I have everything I need to know.
Just to confirm, because I hadn't thought of it until Squall brought it up, you'll never be able to deal 9999 with this formula. You're at peace with that?
Title: Re: Changing details of Dark Wave
Post by: fedorajoe on September 09, 2016, 12:36:47 PM
Hee hee, I'm fine with that!

Scholars doing max damage sounds wrong anyway. (Looks for scholar emoji, fails.)
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 11, 2016, 01:05:33 AM
So.... This was a much bigger project than I anticipated. Because the damage calculation was originally part of Kick, I couldn't just make some quick edits. I had to write the whole darn thing from the ground up.

Anyway, I've got it working, but there's one (hopefully insignificant) problem. I never realized this before, but apparently the process by which the bouncy numbers are set to appear on the party is entirely different than setting the bouncy numbers to appear on the enemies. It's quick and painless for monsters, but it's like fifty bytes and always slightly different depending on the command for the party.

So as it stands now, the command works great, as long as the player uses it. If a monster uses it, the damage doesn't appear on the screen. The target's HP is reduced, but no bouncy numbers (it may be worth mentioning here that I was able to make it so the party's gold total isn't affected when a monster uses the command).

So the question is, should I spend the time and ROM space on making it work properly for monsters? Or will this command never be used by monsters anyway so I shouldn't worry about it?
Title: Re: Changing details of Dark Wave
Post by: Swordmaster on September 11, 2016, 04:11:39 PM
If you really wanted a monster to use Coin Toss, couldn't you just make an attack and call it "Coin Toss"?  I'm far from an expert, but it seems to me more practical and takes less code.

 :edit: It just occurred to me that it might be interesting to have that monster give 0 gil/GP if it used this (hypothetical) skill.  Maybe even base the damage on how much gil/GP the monster gives.
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 11, 2016, 05:27:35 PM
If you really wanted a monster to use Coin Toss, couldn't you just make an attack and call it "Coin Toss"?  I'm far from an expert, but it seems to me more practical and takes less code.

 :edit: It just occurred to me that it might be interesting to have that monster give 0 gil/GP if it used this (hypothetical) skill.  Maybe even base the damage on how much gil/GP the monster gives.
That wouldn't necessarily be easier or use less code, especially if the attack's strength was based on the attacker's dropped gil and/or made the enemy not drop gil.
Enemy attacks are just spells, so making one that was a coin toss would require cannibalizing one of the spell routines, unless you just used a straight damage routine, but even still, have fun getting the spell animation to look like something like coins being tossed...
I mean, my thinking is that monsters shouldn't have to use this skill. I can't think of a single monster in any FF game that uses a coin toss attack.
Title: Re: Changing details of Dark Wave
Post by: fedorajoe on September 11, 2016, 06:22:05 PM
Just speaking for myself, I  didn't intend for an enemy to ever use this ability.
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 11, 2016, 10:25:25 PM
OK, great. I'll make the patch for you tomorrow. I'm at work this evening until 4:30 AM (ET), so it'll probably be sometime in the afternoon.
Title: Re: Changing details of Dark Wave
Post by: Swordmaster on September 12, 2016, 08:17:16 AM
At first (before the edit) I was sort of half-joking about just taking a pre-existing skill and only change the name.  Say, for instance, change "Emission" to "Coin Toss" and remove fire graphics.  "What is Emission?  I just threw money at you.  Use your imagination.  Maybe it was invisible money, I don't know!"  I have an odd sense of humor....
Title: Re: Changing details of Dark Wave
Post by: Squall on September 12, 2016, 08:48:16 AM
If its real money, toss them my way  :laugh:
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 12, 2016, 10:09:33 AM
If its real money, toss them my way  :laugh:
OK, Squall, but I'll toss invisible money.
 :wink:
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 12, 2016, 01:17:22 PM
OK, here it is.

Sorry it took so long, but I got a little fancy, as I tend to do.
I got into investigating the sound effects, which I hadn't planned to do because it was sort of uncharted territory.
Anyway, now instead of the "shink!" sound it usually makes when Cecil draws his weapon to do the attack, it makes the "obtained item" noise; and instead of the dark wave sound effect, it makes the "cha-ching" noise you hear when buying stuff at a shop. These seemed more consistent with a money-throwing attack.
 :cycle:

Anyway, the command is called "Coin." I couldn't think of anything better to call it that was 5 letters or less, but you can change that to whatever you want with FF4kster.
As discussed, it will attack all foes for an amount equaling 30 x the user's level.
The total damage done to all foes combined is the amount of GP expended.
If GP < Lv x 30 x Total # Monsters, then instead the damage will be Total GP / Total # Monsters (and the user ends up with zero GP).
If the player has zero GP, the character will simply walk forward, fist bump the air, then return to ranks.

Apply this patch to an unheadered copy of Final Fantasy II (U) (v1.1) [!]

Enjoy!
Title: Re: Changing details of Dark Wave
Post by: fedorajoe on September 12, 2016, 05:38:07 PM
Holy crap, you're amazing.  And did you just apologize for "taking so long?"  Like, seriously?

You should get a Patreon so I can, you know, patronize you for your work!

I'll download and test and report how it goes!  Thank you so much!!!  I'm planning something very ambitious and this command ability was one of my biggest question marks.

EDITED TO ADD:  So, I just tested it, and it works perfectly.  In all seriousness, your work on this is so impressive.  Major attention to detail with the sound effects and all.  Thank you so much for making this!
Title: Re: Changing details of Dark Wave
Post by: Swordmaster on September 12, 2016, 06:33:23 PM
You should get a Patreon so I can, you know, patronize you for your work!

...and we can throw visible money at you.  I mean, the option would be there at any rate.  Minus the cool sound effects, of course.  Ok, I'll shut up.
Title: Re: Changing details of Dark Wave
Post by: Bahamut ZERO on September 13, 2016, 03:59:18 PM
Oh man, I am so trying this out to see it in action.  :omg:


EDIT:Nice touch with the sound effects! I'll sprite out some "Gil" graphics to replace the Dark Wave ones if no one minds. I'm 99.9% sure those graphics aren't used for anything else, anyway.

(noticed an oddity where the standard "Fight" attacks characters/enemies use  in battle become useless (no damage or number popups) but given the amount of mods I'm already using, not to mention the fact it wasn't meant for my project to begin with, I'm just gonna assume it was something on my end.)
Title: Re: Changing details of Dark Wave
Post by: Bahamut ZERO on September 13, 2016, 05:48:22 PM
First rough draft of a GP Coin graphic. Uh, don't mind the flying asses or other graphics, or the fact that it still has Dark Wave's palette and back end graphic. I just copy/pasted the graphic to my project to test it faster.

Any comments/criticism/suggestions are welcome. Not exactly sure what I ought to do with the back end graphic (the "trail" behind the coins). I may just look at the graphic for FF5's Cointoss graphic and try recreating it the best I can later on tonight or early tomorrow.

After the coin's done, and the fate of the Trail graphic's decided ( I might just blank that one out entirely if that's preferred) Then I'll figure how the hell to make it yellow instead of blue!  :yabin:
Title: Re: Changing details of Dark Wave
Post by: fedorajoe on September 13, 2016, 05:50:58 PM
That's what I did!  I kept the Darkness color scheme but swapped in the coin graphic from FFVI.  It looks amazing IMO!

(http://i135.photobucket.com/albums/q155/fedorajoe/harleyHack000_zpsg72l3xma.png)

I kept the trailing graphic and made it a darker color.  It gives the impression of the shit just flying at you at top speed.
Title: Re: Changing details of Dark Wave
Post by: Swordmaster on September 13, 2016, 07:19:54 PM
Whatever you're working on, fedorajoe-san, it looks very interesting!
Title: Re: Changing details of Dark Wave
Post by: fedorajoe on September 13, 2016, 07:29:06 PM
Oh thank you!  I normally don't share much because people hate when you over-share and then don't produce, no matter the arena.  But I'm so excited about this coin toss thing that I kinda couldn't help it.
Title: Re: Changing details of Dark Wave
Post by: chillyfeez on September 13, 2016, 07:57:28 PM
Hey, if you guys want to change the palette of the waves/coins/flying fartblasters: the byte in ROM that specifically determines which palette is used for Dark Wave is 1480C in ROM (2C80C in LoROM if you wanna fiddle live in Geiger's).
A few choices that I've found seem particularly conducive to coin color are 07, 11 and 15, but I'm sure there are others. These are the same palettes used by spells and (I think) weapons, so best not to mess with the palettes themselves, lest you suffer the consequences, but 1480C dictates which one is used by this command specifically, so have at it!
Title: Re: Changing details of Dark Wave
Post by: Bahamut ZERO on September 14, 2016, 02:35:14 PM
That's what I did!  I kept the Darkness color scheme but swapped in the coin graphic from FFVI.  It looks amazing IMO!

(http://i135.photobucket.com/albums/q155/fedorajoe/harleyHack000_zpsg72l3xma.png)

I kept the trailing graphic and made it a darker color.  It gives the impression of the shit just flying at you at top speed.

Whoa, that looks AWESOME! Since you used FF6's coin, I'm totally trying out FF5's to see the results!


Oh thank you!  I normally don't share much because people hate when you over-share and then don't produce, no matter the arena.  But I'm so excited about this coin toss thing that I kinda couldn't help it.

You can always post pics in my graphics thread if you want. I originally made it as showcase/share if-one-wants-to kind of thread kind of like RHDN's Screenshots thread,  but at the time the only folks I knew that were messing with graphics were Chillyfeez, Gerdankenschild, and myself so it's just a bunch of random stuff I've done.  :hmm:

Hell, since I've been meaning to update the original post with links to whatever patches I've posted, I'll redo the post/thread name in case anyone digs the idea of a thread to show stuff off.


Hey, if you guys want to change the palette of the waves/coins/flying fartblasters: the byte in ROM that specifically determines which palette is used for Dark Wave is 1480C in ROM (2C80C in LoROM if you wanna fiddle live in Geiger's).
A few choices that I've found seem particularly conducive to coin color are 07, 11 and 15, but I'm sure there are others. These are the same palettes used by spells and (I think) weapons, so best not to mess with the palettes themselves, lest you suffer the consequences, but 1480C dictates which one is used by this command specifically, so have at it!

Oh boy, thanks for the info!
Title: Re: Changing details of Dark Wave
Post by: fedorajoe on September 14, 2016, 05:21:57 PM
Sweet!  I'll post some stuff later in your thread.  :)
Title: Re: Changing details of Dark Wave
Post by: thepatirckinator on September 16, 2016, 09:35:04 PM
I hope you like my new victory pose and get damaged sprite as I worked on Sprite conversion of Dream Golbez from Wii/Mobile Phone to SNES. There was two that I couldn't convert cause he had Pressure and Darkwave command which I believe that was made from scratch.