Final Fantasy IV Research & Development / Re: FF II: A Threat from Within - Expanded ROM = New Features!
« on: September 17, 2016, 12:05:34 PM »As previously stated, there will be some built-in "Disc Changes" throughout the game. Thanks to the ROM expansion (and Squall's suggestion as to how to handle it), the following banks of data will be reset three or four times throughout the game, at specific points (the first one is coming soon, after the Titan battle, I think):
-Enemy Experience Given (small but noticeable adjustments up - monsters get harder as the player levels up, so it's only right they should offer more EXP)
-Dialogue Bank 1
-Dialogue Bank 3 (These will enable me to not worry about dialogue space at all)
-Dialogue Bank 2 (This will enable me to have townspeople change their text without making major adjustments to their speech algorithms)
-Event Calls (there are only 86 of these, and I've used around 50 so far. Don't have to worry about running out of these now!)
-Location Triggers (This will allow different event calls to result from the same trigger points, and will also enable me to have progress-dependent treasure chests, a la FFVI!)
In addition to all of that, I now have more freedom to tweak various pieces of game mechanics that I would have gone without doing before for fear of space limitations.
Example: Avon, the hired Bard, is now better at using items than the rest of the characters.
I had already improved the Salve command so that, instead of just using one Cure1 item to cast the Cure1 spell on all party members, now he is able to split any single-target item among all targets (works for healing and attack items).
Now, I've also made adjustments to the damage calculation formula, so when Avon uses the Item command, the Damage/Healing output is equal to (Normal Damage/Healing output * Avon's Level) / 10; and when he uses the Salve command, the Damage/Healing output is equal to (Normal Damage/Healing output * Avon's Level) / 4, then the result is divided among the entire target party. This allows Avon to keep Cure1 potions somewhat relevant for most of the early portion of the game, keep Cure2 potions relevant for at least the first half of the game, and keep Cure3 potions a viable option for pretty much the whole game (they heal one character for 9999 beginning at level 58 or so).
For those interested in seeing how it all works, when the regular damage formula would load the damage into the X register, TfW will instead run the following subroutine:
$20/8000 AD 81 26 LDA $2681 [$00:2681] Load user's ID
$20/8003 29 0F AND #$0F
$20/8005 C9 04 CMP #$04 Is it Avon?
$20/8007 F0 05 BEQ $05 [$800E] If it IS Avon, skip to 800E
---------------------------------------------
$20/8009 7B TDC
$20/800A AE 41 39 LDX $3941 [$00:3941]
$20/800D 6B RTL Otherwise use normal damage/healing output
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$20/800E AD 42 39 LDA $3942 [$00:3942] Load upper byte of Damage/Healing output
$20/8011 30 07 BMI $07 [$801A] If bit 7 is set, skip to 801A*
$20/8013 09 80 ORA #$80
$20/8015 8D 42 39 STA $3942 [$00:3942] Otherwise set bit 7*
$20/8018 80 EF BRA $EF [$8009] And jump back to 8009
---------------------------------------------
$20/801A AD 42 39 LDA $3942 [$00:3942] Load upper byte of Damage/Healing output
$20/801D 29 7F AND #$7F
$20/801F 8D 42 39 STA $3942 [$00:3942] Clear bit 7*
$20/8022 AD D1 26 LDA $26D1 [$00:26D1] Load Avon's Command used
$20/8025 C9 0A CMP #$0A Is it Salve?
$20/8027 F0 09 BEQ $09 [$8032] If so skip to 8032
$20/8029 C9 01 CMP #$01 Is it Item?
$20/802B D0 DC BNE $DC [$8009] If not jump back to 8009
---------------------------------------------
$20/802D A2 0A 00 LDX #$000A Load 000A into X
$20/8030 80 03 BRA $03 [$8035] Skip to 8035
---------------------------------------------
$20/8032 A2 04 00 LDX #$0004 Load 0004 into X
---------------------------------------------
$20/8035 AD 82 26 LDA $2682 [$00:2682] Load Avon's Level
$20/8038 85 E8 STA $E8 [$00:06E8] Store in E8
$20/803A C2 20 REP #$20
$20/803C AD 41 39 LDA $3941 [$00:3941] Load Damage/Healing output
$20/803F 20 5D 80 JSR $805D [$00:805D] E8 (2-byte) = Avon's Level * Damage/Healing output
$20/8042 A5 E8 LDA $E8 [$00:06E8] Load result
$20/8044 20 7C 80 JSR $807C [$00:807C] Divide by X
$20/8047 AA TAX Transfer result to X
$20/8048 7B TDC Clear A
$20/8049 E2 20 SEP #$20 Set A to 8-bits
$20/804B 6B RTL End
*NOTE: For some reason, this subroutine always runs twice - playing with the uppermost bit here (which isn't set for healing until after the routine runs) keeps the calculations from running twice.







