12/06/2012

Batch Battle Sytem

Here is my batch battle system!


set /p name=Enter your name:
goto set

:set
set hp=100
set exp=0
ser exptill=50
set gold=0
set weappower=3
set lvl=1
set power=3
set powergain=1
set pots=2
goto em1


::   #   ENEMY 1  ##########################################################################

:em1
set en1hp=20
cls
echo You were attacked by a snake!
pause >nul
goto fightem1

:fightem1
cls
echo You have %hp% health
echo Snake has %en1hp%
echo.
echo 1 Attack
echo 2 Drink potion
set input=2
set /p input=...
if %input% equ 1 goto attackem1
if %input% equ 2 goto drinkpotem1
goto fightem1

:attackem1
cls
set /a en1hp=%en1hp% - (%power% + %weappower%)
if %en1hp% leq 0 goto killedem1
set /a hp=%hp% - 4
if %hp% leq 0 goto GameOver
goto fightem1

:drinkpotem1
if %pots% lss 1 (
    echo You don't have any potions...
    pause >nul
    goto fightem1
)
set /a hp=%hp% + 50
set /a pots=%pots% - 1
goto fightem1

:killedem1
cls
echo You killed a Snake!
echo you gained 7 exp and 6 gold
set /a exp=%exp% + 7
set /a gold=%gold% + 6
pause >nul
goto box


:box
cls
echo Yes, you have beaten your first ememy in the forest
pause
cls
goto box















Thats what I use taken from my batch game!
This battle system is completly customizable and you can change the variables to what ever you want.

No comments:

Post a Comment