Users browsing this thread: 1 Guest(s)
Gaining a greater health from Potions?
12-22-2015, 01:04 AM
(This post was last modified: 12-22-2015, 01:11 AM by Everything.)
Here are the two subroutines in bank C3 that calculate the amount of hp/mp restored when you use an item from the menu. funkydiscogod has the right idea, you could modify these if you want to change the effect in the menu.
One idea that might work is to add something like this in an unused part of bank C3 (maybe somewhere in C3/F091-C3/FFFF) and then replace the address for the original hp/mp subroutine (at C3/8C41) with wherever you add the new code. This will multiply an item's hp/mp value by 40.
Code:
; [ Load Item HP/MP Restored ]
; this is for items that restore an exact amount of hp/mp
C3/8CCD: BF 14 50 D8 LDA $D85014,X ; hp/mp restored
C3/8CD1: 85 B2 STA $B2
C3/8CD3: 64 B3 STZ $B3
C3/8CD5: 60 RTS
; [ Calculate Fraction of Max HP/MP Restored ]
; this is for items that restore 1/16ths of max hp/mp
C3/8CD6: AD 12 42 LDA $4212
C3/8CD9: 29 40 AND #$40
C3/8CDB: F0 F9 BEQ $8CD6
C3/8CDD: A5 F3 LDA $F3
C3/8CDF: 8D 1B 21 STA $211B
C3/8CE2: A5 F4 LDA $F4
C3/8CE4: 8D 1B 21 STA $211B
C3/8CE7: A5 B2 LDA $B2
C3/8CE9: 8D 1C 21 STA $211C
C3/8CEC: 8D 1C 21 STA $211C
C3/8CEF: AD 36 21 LDA $2136
C3/8CF2: 85 EB STA $EB
C3/8CF4: 64 EC STZ $EC
C3/8CF6: C2 20 REP #$20
C3/8CF8: AD 34 21 LDA $2134
C3/8CFB: 85 E9 STA $E9
C3/8CFD: 46 EB LSR $EB
C3/8CFF: 66 E9 ROR $E9
C3/8D01: 46 EB LSR $EB
C3/8D03: 66 E9 ROR $E9
C3/8D05: 46 EB LSR $EB
C3/8D07: 66 E9 ROR $E9
C3/8D09: 46 EB LSR $EB
C3/8D0B: 66 E9 ROR $E9
C3/8D0D: E2 20 SEP #$20
C3/8D0F: 60 RTS
One idea that might work is to add something like this in an unused part of bank C3 (maybe somewhere in C3/F091-C3/FFFF) and then replace the address for the original hp/mp subroutine (at C3/8C41) with wherever you add the new code. This will multiply an item's hp/mp value by 40.
Code:
LDA $D85014,X
STA $4202
LDA #$28 ; multiply by 40
STA $4203
NOP
NOP
NOP
NOP
LDY $4216
STY $B2
RTS
C3/8C40: 20 CD 8C JSR $8CCD ; change this to point to your new subroutine
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)