Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal EnableDelayedExpansion
- title Battle Code: Open Source!
- color 0B
- goto stats
- :: startups
- :stats
- ::player
- :: magic
- set /a MP_max = 25
- set /a MP_current = %MP_max%
- :: health
- set /a HP_max = 50
- set /a HP_current = %HP_max%
- :: damage
- set /a ATK_max = 13
- set /a ATK_min = 11
- set /a ATK_average = %ATK_min% + (%ATK_max% - %ATK_min%)
- ::spells
- :: mega-hit
- set /a MEGA_cost = 15
- set /a MEGA_ATK = 16
- :: blessing
- set /a BLESS_cost = 20
- set /a BLESS_amount = 25
- ::enemy
- :: health
- set /a BOAR_HP_max = 30
- set /a BOAR_HP_current = %BOAR_HP_max%
- :: damage
- set /a BOAR_ATK_max = 9
- set /a BOAR_ATK_min = 7
- set /a BOAR ATK_average = %BOAR_ATK_min% + (%BOAR_ATK_max% - %BOAR_ATK_min%)
- :: exp gain
- set /a BOAR_exp = 12
- :: once all is said and done...
- goto mainmenu
- :mainmenu
- cls
- echo -~~~~~~~~~~~~-
- echo.
- echo 1) Play
- echo 2) Exit
- echo -~~~~~~~~~~~~-
- echo.
- set /p mainmenu=
- if %mainmenu% == 1 goto ready
- if %mainmenu% == 2 exit
- goto mainmenu
- :ready
- cls
- echo -~~~~~~~~~~~~-
- echo.
- echo 1) Fight
- echo 2) Back to menu
- echo 3) Check stats
- echo -~~~~~~~~~~~~-
- echo.
- set /p ready=
- if %ready% == 1 goto fight
- if %ready% == 2 goto mainmenu
- if %ready% == 3 goto viewstats
- goto ready
- :viewstats
- cls
- echo -~~~~~~~~~~~~-
- echo.
- echo HP: [ %HP_current% / %HP_max% ]
- echo MP: [ %MP_current% / %MP_max%
- echo ATK: [ %ATK_average% ]
- echo -~~~~~~~~~~~~-
- echo.
- echo 1) Heal
- echo 2) Back to main
- echo -~~~~~~~~~~~~-
- echo.
- set /p statsviewed=
- if %statsviewed% == 1 goto heal
- if %statsviewed% == 2 goto ready
- goto viewstats
- :heal
- set /a HP_current = %HP_max%
- set /a MP_current = %MP_max%
- goto viewstats
- :fight
- cls
- set /a MP_current = %MP_current% + 4
- if %MP_current% GTR %MP_max% set /a MP_current = %MP_max%
- if %HP_current% LEQ 0 goto lost
- if %BOAR_HP_current% LEQ 0 goto won
- if %HP_current% GTR %HP_max% set /a HP_current = %HP_max%
- if %MP_current% LSS 0 set /a MP_current = 0
- echo -~~~~~~~~~~~~-
- echo.
- echo You:
- echo HP: [ %HP_current% / %HP_max% ]
- echo MP: [ %MP_current% / %MP_max% ]
- echo -~~~~~~~~~~~~-
- echo.
- echo Boar:
- echo HP [ %BOAR_HP_current% / %BOAR_HP_max% ]
- echo -~~~~~~~~~~~~-
- echo.
- echo 1) Attack
- echo 2) Magic
- echo 3) Flee
- echo -~~~~~~~~~~~~-
- echo.
- set /p fight=
- if %fight% == 1 goto attack
- if %fight% == 2 goto attackmagic
- if %fight% == 3 goto fled
- goto fight
- :attack
- :: your attack
- set /a ATK_hit = %RANDOM% * 3 / 32768 + 1
- if %ATK_hit% == 1 set /a BOAR_HP_current = %BOAR_HP_current% - %ATK_min%
- if %ATK_hit% == 2 set /a BOAR_HP_current = %BOAR_HP_current% - %ATK_average%
- if %ATK_hit% == 3 set /a BOAR_HP_current = %BOAR_HP_current% - %ATK_max%
- :: enemy's attack
- set /a BOAR_hit = %RANDOM% * 3 / 32768 + 1
- if %BOAR_hit% == 1 set /a HP_current = %HP_current% - %BOAR_ATK_min%
- if %BOAR_hit% == 2 set /a HP_current = %HP_current% - %BOAR_ATK_average%
- if %BOAR_hit% == 3 set /a HP_current = %HP_current% - %BOAR_ATK_max%
- goto fight
- :attackmagic
- cls
- echo -~~~~~~~~~~~~-
- echo.
- echo MP: [ %MP_current% / %MP_max% ]
- echo -~~~~~~~~~~~~-
- echo.
- echo 1) Mega-Strike
- echo 2) Blessing
- echo 3) Quit
- echo -~~~~~~~~~~~~-
- echo.
- set /p spellactivate=
- if %spellactivate% == 1 goto calculatemega
- if %spellactivate% == 2 goto calculateblessing
- if %spellactivate% == 3 goto fight
- goto attackmagic
- :outofmp
- cls
- echo -~~~~~~~~~~~~-
- echo.
- echo Not enough MP!
- echo -~~~~~~~~~~~~-
- echo.
- echo 1) Back
- echo -~~~~~~~~~~~~-
- echo.
- set /p mpmorelikeempty=
- if %mpmorelikeempty% = 1 goto attackmagic
- goto outofmp
- :calculatemega
- if %MP_current% LSS %MEGA_cost% goto outofmp
- set /a MP_current = %MP_current% - %MEGA_cost%
- set /a BOAR_HP_current = %BOAR_HP_current% - %MEGA_ATK%
- set /a BOAR_hit = %RANDOM% * 3 / 32768 + 1
- if %BOAR_hit% == 1 set /a HP_current = %HP_current% - %BOAR_ATK_min%
- if %BOAR_hit% == 2 set /a HP_current = %HP_current% - %BOAR_ATK_average%
- if %BOAR_hit% == 3 set /a HP_current = %HP_current% - %BOAR_ATK_max%
- goto fight
- :calculateblessing
- if %MP_current% LSS %BLESS_cost% goto outofmp
- set /a MP_current = %MP_current% - %BLESS_cost%
- set /a HP_current = %HP_current% + %BLESS_amount%
- set /a BOAR_hit = %RANDOM% * 3 / 32768 + 1
- if %BOAR_hit% == 1 set /a HP_current = %HP_current% - %BOAR_ATK_min%
- if %BOAR_hit% == 2 set /a HP_current = %HP_current% - %BOAR_ATK_average%
- if %BOAR_hit% == 3 set /a HP_current = %HP_current% - %BOAR_ATK_max%
- goto fight
- :fled
- cls
- set /a BOAR_HP_current = %BOAR_HP_max%
- echo -~~~~~~~~~~~~-
- echo.
- echo You have successfully fled from battle.
- echo -~~~~~~~~~~~~-
- echo.
- echo 1) Back to main
- echo -~~~~~~~~~~~~-
- echo.
- set /p fled=
- if %fled% == 1 goto ready
- goto fled
- :won
- cls
- set /a EXP_current = %EXP_current% + %BOAR_exp%
- if %EXP_current% GEQ %EXP_max% goto levelup
- set /a BOAR_HP_current = %BOAR_HP_max%
- echo -~~~~~~~~~~~~-
- echo.
- echo You killed the boar.
- echo -~~~~~~~~~~~~-
- echo.
- echo +%BOAR_exp% EXP!
- echo -~~~~~~~~~~~~-
- echo.
- echo 1) Back to menu
- echo 2) Fight again
- set /p won=
- if %won% == 1 goto ready
- if %won% == 2 goto fight
- goto won
- :lost
- cls
- set /a HP_current = %HP_max%
- set /a BOAR_HP_current = %BOAR_HP_max%
- echo -~~~~~~~~~~~~-
- echo.
- echo You lost.
- echo -~~~~~~~~~~~~-
- echo.
- echo 1) Back to menu
- echo -~~~~~~~~~~~~-
- echo.
- set /p lose =
- if %lose% == 1 goto ready
- goto lost
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement