72Views0Replies

Author Options:

Why won't my Batch RPG potions work correctly? Answered

     Hello there. Right now, I'm working on a Batch RPG. I have finished coding the first battle, gotten the game over screen and victory screen done, etc. The last thing I need to fix is my potion system. It works in a way where it heals my character for 300 damage, but it gives me all 300 points, if you know what I mean. Basically, I start with 243 HP, and when I get low, I use a potion. After using it, I gain 300 HP, which brings me way up to 290 hit points when I'm low on health. I want to put a "barrier" in the code to tell it when to stop adding, but I can't figure out how. Here's my code for the potions, if anybody needs to look at it:

:loop
:potionstats1
cls
set /a CHP+=%POTION%
set /a IPOTION-=%POTIONUSE%
if %CHP% equ %CHPTOT% goto manditoryb1
if %IPOTION% leq 0 goto outtapotions1
goto manditoryb1

CHP is the HP of the character, POTION is obviously the potion healing me. IPOTION is the potion in my inventory. Every time I use one, one gets taken away from my inventory. That's done by using POTIONUSE. CHPTOT is my total HP. If anyone could maybe take a look at the code and tell me if I've made a mistake or not, that would be great. Thanks!

Comments

The forums are retiring in 2021 and are now closed for new topics and comments.