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

#31
Posts: 32
Threads: 4
Thanks Received: 0
Thanks Given: 0
Joined: Mar 2012
Reputation: 0
Status
None
(01-09-2016, 10:18 PM)funkydiscogod Wrote: 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
I've encountered a tiny problem with the code you created. I wanted my Potions and Ethers to heal 10 x the value given to them outside of battle, changing the LDA 80 and LDA 02 in both the HP and MP formulas to A0 and 00, respectively, causing the game to read max HP as 160, thus healing 10 HP for each 1/16 value entered. This works just fine, as long as you enter a value under 127, healing up to 1270 HP. Anything over 127, however, causes problems. I used the code on my X-Potions, with intention of them healing 2,500 HP, but when used outside of battle, they take *away* 30 HP. 

This is a bit of a problem for my plans, as a 10 x multiplier is the most nuanced possible factor for what I intend, since I wanted Tinctures to heal 30 MP.

The easiest way around this may actually be to edit HatZen08's code. While your code multiplies HP and MP on a separate basis, HatZen's code uses a single multiplier for both. If it could be reworked in such a way that HP and MP restorations get their own individual multipliers, it would perhaps be ideal. After all, since HP typically is already one digit greater than MP, it would make sense for them to have different multipliers, in my opinion. But I'm not sure I can figure it out on my own.

...well, the answer to my dilemma was staring me in the face. I simply took the effect attributed to Dried Meat (which in fact is nothing), re-routed its pointer to an empty area in the code, and repeated HatZen's code there, with the necessary adjustments. Now I have my 30 healing Tinctures (Ethers), 500 healing (Hi)Potions and my 2500 healing X-Potions.
  Find
Quote  

#32
Posts: 732
Threads: 36
Thanks Received: 12
Thanks Given: 41
Joined: Jan 2016
Reputation: 6
Status
None
I used the edit associated with Blowfish, and got my Superball/new Potion healing 1000 HP properly. However, I don't fully understand how to make it usable outside of battle?
  Find
Quote  

#33
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(08-13-2016, 09:25 AM)DrakeyC Wrote: I used the edit associated with Blowfish, and got my Superball/new Potion healing 1000 HP properly. However, I don't fully understand how to make it usable outside of battle?

You mean having a similar effect outside battle? In-battles effect are independent of outside battle menu effects. You need to code the same effect when fixed HP healing occurs.

Basically it's if index == superball, item's power ($B2) * constant. I could be 250 * 4 and should be done before C3/8C4F.
  Find
Quote  

#34
Posts: 732
Threads: 36
Thanks Received: 12
Thanks Given: 41
Joined: Jan 2016
Reputation: 6
Status
None
So, huh? Found C3/8C4F but what do I do there? I can't even use a Superball potion out of battle to test it.
  Find
Quote  

#35
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Copy the potion regular properties first, set item power to 250 then apply this code. No guarantee no refund!

Code:
hirom
;header

org $C38B47
JSR enabl       ;check healing items
LDA $E0        
BEQ continue    ;check if we don't heal
BRA heal

org $C38B54
continue:
JSR $8C2B

org $C38BC4
heal:

org $C38C4D
JSR freeSpace
NOP

org $C3FFD0     ;change to free space in $C3 (32 bytes needed)
freeSpace:
JSR $8C2B       ;load item index
CMP #$FA        ;do we have superbowl?
BNE notSb       ;branch if no
REP #$21
LDA $B2         ;load item power
ASL
ASL             ;multiply by 4
BRA exit
notSb:
REP #$21
LDA $B2         ;load item power
exit:
RTS

enabl:
STZ $E0
CMP #$FE        ; Dried Meat?
BEQ setBit      ; Branch if so
CMP #$E8        ; Tonic?
BEQ setBit      ; Branch if so
CMP #$E9        ; Potion?
BEQ setBit      ; Branch if so
CMP #$EA        ; X-Potion?
BEQ setBit      ; Branch if so
CMP #$FA        ; Superbowl?
BEQ setBit      ; Branch if so
RTS

setBit:
LDA #$01
STA $E0
RTS
  Find
Quote  

#36
Posts: 23
Threads: 4
Thanks Received: 1
Thanks Given: 0
Joined: Sep 2015
Reputation: 0
Status
Zombie
(08-13-2016, 11:41 AM)Madsiur Wrote: In-battles effect are independent of outside battle menu effects.

 It's almost like they were programmed by two different teams who didn't talk to eachother.
  Find
Quote  

#37
Posts: 732
Threads: 36
Thanks Received: 12
Thanks Given: 41
Joined: Jan 2016
Reputation: 6
Status
None
It's still not letting me use the Superball potion in the field. And I have that box selected.
  Find
Quote  

#38
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(08-13-2016, 11:21 PM)funkydiscogod Wrote: It's almost like they were programmed by two different teams who didn't talk to eachother.

I don't think this is far from what really happened...

Also @DrakeyC, I think the code modification I added should enable the superball... or crash the game!
  Find
Quote  

#39
Posts: 732
Threads: 36
Thanks Received: 12
Thanks Given: 41
Joined: Jan 2016
Reputation: 6
Status
None
Neither, so far. My Rom had no header, so I left that part commented out.
  Find
Quote  

#40
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Well surely there was no result because there was an error in the ASM file, hence no assembling.

I reworked the code, because of the lack of space I had to move a block of checks and use a bit check to save space. I've tested the code. Use a backup ROM and not your ROM from last night.
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • DrakeyC (08-14-2016)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite