In other not related issue, im trying to make a game in Batch but my Healing "Command" isnt working:
:Heal
echo You try to heal yourself
if %mana% geq 10 (
set /a mana=%mana%-%Random% %%10 +5
set /a hp=%hp%+%Random% %%20 +5
echo %name% Heals himself
echo %hp%
pause
cls
goto Monster
) else (
echo You dont have enough mana!(you need atleast 10)
)
pause
cls
goto Battle
i think is the random part that is wrong
Rest of the code:
@echo off
set hp=75
set maxhp=100
set monhp=70
set maxmonhp=100
set mana=25
set maxmana=50
:Start
cls
echo What is thy name
set /p name=
echo So your name is %name%!
pause
cls
echo Would you like to battle THE GREAT ORC?
set /p battle=
if %battle%==yes or %battle%==Yes or %battle%==y (
goto Battle
) else (
exit )
:Battle
cls
echo %name% it is your move! What would you like to do?
echo %name% HP %hp%/%maxhp% MANA %mana%/%maxmana%
echo THE ORC %monhp%/%maxmonhp%
echo.
echo Press S for Slash
echo Press H for Heal
echo Press M for Magic regen
set /p attack=
if %attack%==s goto Slash
if %attack%==h goto Heal
if %attack%==exit exit
if %attack%==m (
goto Mgrg
) else (
goto Battle )
:Slash
echo You Slash the Orc
set /a monhp=%monhp%+%Random% %%15 + 10
goto Monster
:Heal
echo You try to heal yourself
if %mana% geq 10 (
set /a mana=%mana%-%Random% %%10 +5
set /a hp=%hp%+%Random% %%20 +5
echo %name% Heals himself
echo %hp%
pause
cls
goto Monster
) else (
echo You dont have enough mana!(you need atleast 10)
)
pause
cls
goto Battle