Users browsing this thread: 1 Guest(s)
Gaining a greater health from Potions?

#30
Posts: 23
Threads: 4
Thanks Received: 1
Thanks Given: 0
Joined: Sep 2015
Reputation: 0
Status
Zombie
Ok...I suck.  So, I have another possibly wrong solution for y'all.  I hope to not screw up anything else.  It seems the correct answer includes "all of the above" solutions.  And, rather than try to change as little as possible, I just went for a small rewrite of the section governing potions and


Code:
C3/8C33:    5A                PHY
            20    2B    8C        JSR $8C2B
            20    21    83        JSR $8321        (Multiplies A by 30)
            7A                PLY
            AE    34    21        LDX $2134
            86    B0            STX $B0
            20    CD    8C        JSR $8CCD        (gets magnitude of item)
            BF    13    50    D8    LDA $D85013,X    (Load item properties X)
            10    29            BPL $8C76        (Branch if not "Manipulates 1/16ths of actual value affected")
            29    08            AND #$08        (Check if it "Restores HP")
            F0    0D            BEQ                (skip to the MP check if it doesn't)
            B9    0B    00        LDA $000B,Y        max health, high bit
            85    F3            STA $F3
            B9    0C    00        LDA $000C,Y        max health, low bit
            85    F4            STA $F4
            20    9B    8C        JSR    hp heals    now, jump to where it would normally go if it was 1/16ths healing.
            A6    B0            LDX $B0
            BF    13    50    D8    LDA $D85013,X  (Load weapon/item properties X)
            29    10            AND #$10       (Check if it "Restores MP")
            F0    0D            BEQ $8C75      (Exit if it doesn't)
            B9    0F    00        LDA $000F,Y        max mp, high bit
            85    F3            STA $F3
            B9    10    00        LDA $0010,Y        max mp, low bit
            85    F4            STA $F4
            20    B4    8C        JSR    mp heals    go to where MP should go
            60                RTS

8C72:        29    08            AND #$08       (Check if it "Restores HP")
            F0    0D            BEQ $8CA0      (Branch if it doesn't)
            EA                NOP
            A9    80            LDA 80            loads data as if HP was 640, so 1/16th would be 40.
            85    F3            STA $F3
            EA                NOP
            A9    02            LDA    02
            85    F4            STA $F4
            20    9B    8C        JSR hp heals
            A6    B0            LDX $B0
            BF    13    50    D8    LDA $D85013,X    (Load item properties X)
            29    10            AND #$10        (Check if it "Restores MP")
            F0    0D            BEQ $8CCC        (Exit if not)
            EA                NOP
            A9    80            LDA 80
            85    F3            STA $F3
            EA                NOP
            A9    02            LDA    02
            85    F4            STA $F4
            20    B4    8C        JSR    mp heals
            60                RTS

8C9B:        20    65    0D        JSR $0D65
            20    92    0D        JSR $0D92
            20    D6    8C        JSR $8CD6
            C2    21            REP #$21
            A5    E9            LDA $E9
            79    09    00        ADC $0009,Y
            99    09    00        STA $0009,Y
            E2    20            SEP #$20          (8 bit memory/accum.)
            20    9A    2B        JSR $2B9A        (Heal HP)
            60                RTS

8CB4:        20    65    0D        JSR $0D65
            20    9F    0D        JSR $0D9F
            20    D6    8C        JSR $8CD6
            C2    21            REP #$21
            A5    E9            LDA $E9
            79    0D    00        ADC $000D,Y
            99    0D    00        STA $000D,Y
            E2    20            SEP #$20          (8 bit memory/accum.)
            20    BC    2B        JSR $2BBC        (Heal MP)
            60                RTS


This hopefully will make potions heal for 40*their listed power.  You'll need the Superball fix to make this work, too, because you want them to heal for 40* their listed power in battle, too.

This shouldn't screw up any items that have the "max out" bit set.  I looked for the Dried Meat special effect code, and it looks like it just points to a return, so Dried meat should be a superball, too.

Items will only be able to heal for 40*power, or power*max HP/16, though, so I'll keep looking for a better wolution.
  Find
Quote  



Messages In This Thread
RE: Gaining a greater health from Potions? - by funkydiscogod - 01-09-2016, 10:18 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite