Help I'm making an RPG Test Batch game and need to be able to take health away from the set Vars here's the code:
P.S Im just trying to learn/relearn and idk what I need to do at :attack to remove health from %hp% based on %mdmg%
@echo off
title RPG Game
Echo.
color a
:tutorial
echo Hello Their Welcome to the tutorial of the Game!
echo.
echo My Name Is Grayson
echo.
echo whenever you find a monster you have a few choices
echo 1 You can Fight To the Death!
echo.
echo 2 You may sometimes have the choice to block against their attack
echo.
echo 3 You can run away if your little low on HP
echo Do you understand?
echo.
echo 1) Yes!
echo 2) exit
set /p c=C:/
if "!c!" == "1" goto tutorial2
if "!c!" == "2" exit
:tutorial2
cls
echo.
echo This Game is a Battling Simulation
echo.
echo when You find a monster you will probably fight
echo.
echo How it works is you always go first, after you move the monster moves
echo.
echo the math going on in the background is: Your Hp - Monster Dmg = outcome
echo.
echo You always have a max of 100 hp but you can upgrade you Attack damage by buying new weapons
echo.
echo you start with $50
goto startstats
:startstats
set hp=100
set dmg=10
goto monster1
:monster1
set mhp=15
set mdmg=3
goto fighttutorial
:fighttutorial
cls
echo Your HP:%hp%
echo Your Damage:%dmg%
echo ------------------
echo Monster HP:%mhp%
echo Monster DMG:%mdmg%
echo.
echo Hello This is a battle
echo.
echo I'm here to help you win your first fight!
echo.
echo You can see your HP and DMG up at the top
echo.
echo You can see the monster Hp and Dmg right under your Hp and Dmg
echo.
echo 1) Hit Monster For %dmg% Dmg
echo 2) Exit The Game
set /p c=C:/
if "!c!" == "1" goto attack
if "!c!" == "2" exit
:attack
Help im making am RPG Test Batch game and...
Moderator: DosItHelp
Re: Help im making am RPG Test Batch game and...
This might help you:
penpen
Code: Select all
set "hp=100"
set "mdmg=3"
set "hp"
set /a "hp-=mdmg"
set hp