Advertisement
BlueberryBots

[Batch] Open Source, No Credit RPG Battling System

Aug 14th, 2020
620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 5.59 KB | None | 0 0
  1. @echo off
  2. setlocal EnableDelayedExpansion
  3. title Battle Code: Open Source!
  4. color 0B
  5. goto stats
  6.  
  7.  
  8.                 :: startups
  9.     :stats
  10.  
  11.             ::player
  12.        
  13.         :: magic
  14.     set /a MP_max = 25
  15.     set /a MP_current = %MP_max%
  16.  
  17.         :: health
  18.     set /a HP_max = 50
  19.     set /a HP_current = %HP_max%
  20.  
  21.         :: damage
  22.     set /a ATK_max = 13
  23.     set /a ATK_min = 11
  24.     set /a ATK_average = %ATK_min% + (%ATK_max% - %ATK_min%)
  25.    
  26.             ::spells
  27.        
  28.         :: mega-hit
  29.     set /a MEGA_cost = 15
  30.     set /a MEGA_ATK = 16
  31.    
  32.         :: blessing
  33.     set /a BLESS_cost = 20
  34.     set /a BLESS_amount = 25
  35.    
  36.    
  37.             ::enemy
  38.        
  39.         :: health
  40.     set /a BOAR_HP_max = 30
  41.     set /a BOAR_HP_current = %BOAR_HP_max%
  42.    
  43.         :: damage
  44.     set /a BOAR_ATK_max = 9
  45.     set /a BOAR_ATK_min = 7
  46.     set /a BOAR ATK_average = %BOAR_ATK_min% + (%BOAR_ATK_max% - %BOAR_ATK_min%)
  47.    
  48.         :: exp gain
  49.     set /a BOAR_exp = 12
  50.    
  51.             :: once all is said and done...
  52.             goto mainmenu
  53.            
  54.            
  55.     :mainmenu
  56. cls
  57. echo -~~~~~~~~~~~~-
  58. echo.
  59. echo 1) Play
  60. echo 2) Exit
  61. echo -~~~~~~~~~~~~-
  62. echo.
  63.     set /p mainmenu=
  64.         if %mainmenu% == 1 goto ready
  65.         if %mainmenu% == 2 exit
  66.             goto mainmenu
  67.            
  68.  
  69.     :ready
  70. cls
  71. echo -~~~~~~~~~~~~-
  72. echo.
  73. echo 1) Fight
  74. echo 2) Back to menu
  75. echo 3) Check stats
  76. echo -~~~~~~~~~~~~-
  77. echo.
  78.     set /p ready=
  79.         if %ready% == 1 goto fight
  80.         if %ready% == 2 goto mainmenu
  81.         if %ready% == 3 goto viewstats
  82.             goto ready
  83.        
  84.    
  85.     :viewstats
  86. cls
  87. echo -~~~~~~~~~~~~-
  88. echo.
  89. echo HP: [ %HP_current% / %HP_max% ]
  90. echo MP: [ %MP_current% / %MP_max%
  91. echo ATK: [ %ATK_average% ]
  92. echo -~~~~~~~~~~~~-
  93. echo.
  94. echo 1) Heal
  95. echo 2) Back to main
  96. echo -~~~~~~~~~~~~-
  97. echo.
  98.     set /p statsviewed=
  99.         if %statsviewed% == 1 goto heal
  100.         if %statsviewed% == 2 goto ready
  101.             goto viewstats
  102.            
  103.    
  104.     :heal
  105.     set /a HP_current = %HP_max%
  106.     set /a MP_current = %MP_max%
  107.             goto viewstats
  108.  
  109.    
  110.     :fight
  111. cls
  112.  
  113.     set /a MP_current = %MP_current% + 4
  114.         if %MP_current% GTR %MP_max% set /a MP_current = %MP_max%
  115.    
  116.         if %HP_current% LEQ 0 goto lost
  117.         if %BOAR_HP_current% LEQ 0 goto won
  118.         if %HP_current% GTR %HP_max% set /a HP_current = %HP_max%
  119.         if %MP_current% LSS 0 set /a MP_current = 0
  120.        
  121. echo -~~~~~~~~~~~~-
  122. echo.
  123. echo You:
  124. echo HP: [ %HP_current% / %HP_max% ]
  125. echo MP: [ %MP_current% / %MP_max% ]
  126. echo -~~~~~~~~~~~~-
  127. echo.
  128. echo Boar:
  129. echo HP [ %BOAR_HP_current% / %BOAR_HP_max% ]
  130. echo -~~~~~~~~~~~~-
  131. echo.
  132. echo 1) Attack
  133. echo 2) Magic
  134. echo 3) Flee
  135. echo -~~~~~~~~~~~~-
  136. echo.
  137.     set /p fight=
  138.         if %fight% == 1 goto attack
  139.         if %fight% == 2 goto attackmagic
  140.         if %fight% == 3 goto fled
  141.             goto fight
  142.            
  143.    
  144.     :attack
  145.    
  146.         :: your attack
  147.     set /a ATK_hit = %RANDOM% * 3 / 32768 + 1
  148.         if %ATK_hit% == 1 set /a BOAR_HP_current = %BOAR_HP_current% - %ATK_min%
  149.         if %ATK_hit% == 2 set /a BOAR_HP_current = %BOAR_HP_current% - %ATK_average%
  150.         if %ATK_hit% == 3 set /a BOAR_HP_current = %BOAR_HP_current% - %ATK_max%
  151.        
  152.         :: enemy's attack
  153.     set /a BOAR_hit = %RANDOM% * 3 / 32768 + 1
  154.         if %BOAR_hit% == 1 set /a HP_current = %HP_current% - %BOAR_ATK_min%
  155.         if %BOAR_hit% == 2 set /a HP_current = %HP_current% - %BOAR_ATK_average%
  156.         if %BOAR_hit% == 3 set /a HP_current = %HP_current% - %BOAR_ATK_max%
  157.        
  158.             goto fight
  159.            
  160.            
  161.     :attackmagic
  162. cls
  163. echo -~~~~~~~~~~~~-
  164. echo.
  165. echo MP: [ %MP_current% / %MP_max% ]
  166. echo -~~~~~~~~~~~~-
  167. echo.
  168. echo 1) Mega-Strike
  169. echo 2) Blessing
  170. echo 3) Quit
  171. echo -~~~~~~~~~~~~-
  172. echo.
  173.     set /p spellactivate=
  174.         if %spellactivate% == 1 goto calculatemega
  175.         if %spellactivate% == 2 goto calculateblessing
  176.         if %spellactivate% == 3 goto fight
  177.             goto attackmagic
  178.            
  179.    
  180.     :outofmp
  181. cls
  182. echo -~~~~~~~~~~~~-
  183. echo.
  184. echo Not enough MP!
  185. echo -~~~~~~~~~~~~-
  186. echo.
  187. echo 1) Back
  188. echo -~~~~~~~~~~~~-
  189. echo.
  190.     set /p mpmorelikeempty=
  191.         if %mpmorelikeempty% = 1 goto attackmagic
  192.             goto outofmp
  193.        
  194.    
  195.     :calculatemega
  196.    
  197.         if %MP_current% LSS %MEGA_cost% goto outofmp
  198.        
  199.     set /a MP_current = %MP_current% - %MEGA_cost%
  200.     set /a BOAR_HP_current = %BOAR_HP_current% - %MEGA_ATK%
  201.    
  202.     set /a BOAR_hit = %RANDOM% * 3 / 32768 + 1
  203.         if %BOAR_hit% == 1 set /a HP_current = %HP_current% - %BOAR_ATK_min%
  204.         if %BOAR_hit% == 2 set /a HP_current = %HP_current% - %BOAR_ATK_average%
  205.         if %BOAR_hit% == 3 set /a HP_current = %HP_current% - %BOAR_ATK_max%
  206.  
  207.             goto fight
  208.        
  209.    
  210.     :calculateblessing
  211.    
  212.         if %MP_current% LSS %BLESS_cost% goto outofmp
  213.    
  214.     set /a MP_current = %MP_current% - %BLESS_cost%
  215.     set /a HP_current = %HP_current% + %BLESS_amount%
  216.    
  217.     set /a BOAR_hit = %RANDOM% * 3 / 32768 + 1
  218.         if %BOAR_hit% == 1 set /a HP_current = %HP_current% - %BOAR_ATK_min%
  219.         if %BOAR_hit% == 2 set /a HP_current = %HP_current% - %BOAR_ATK_average%
  220.         if %BOAR_hit% == 3 set /a HP_current = %HP_current% - %BOAR_ATK_max%
  221.        
  222.             goto fight
  223.    
  224.    
  225.     :fled
  226. cls
  227.     set /a BOAR_HP_current = %BOAR_HP_max%
  228. echo -~~~~~~~~~~~~-
  229. echo.
  230. echo You have successfully fled from battle.
  231. echo -~~~~~~~~~~~~-
  232. echo.
  233. echo 1) Back to main
  234. echo -~~~~~~~~~~~~-
  235. echo.
  236.     set /p fled=
  237.         if %fled% == 1 goto ready
  238.             goto fled
  239.            
  240.            
  241.     :won
  242. cls
  243.     set /a EXP_current = %EXP_current% + %BOAR_exp%
  244.         if %EXP_current% GEQ %EXP_max% goto levelup
  245.    
  246.         set /a BOAR_HP_current = %BOAR_HP_max%
  247.  
  248. echo -~~~~~~~~~~~~-
  249. echo.
  250. echo You killed the boar.
  251. echo -~~~~~~~~~~~~-
  252. echo.
  253. echo        +%BOAR_exp% EXP!
  254. echo -~~~~~~~~~~~~-
  255. echo.
  256. echo 1) Back to menu
  257. echo 2) Fight again
  258.     set /p won=
  259.         if %won% == 1 goto ready
  260.         if %won% == 2 goto fight
  261.             goto won
  262.            
  263.            
  264.     :lost
  265. cls
  266.     set /a HP_current = %HP_max%
  267.     set /a BOAR_HP_current = %BOAR_HP_max%
  268. echo -~~~~~~~~~~~~-
  269. echo.
  270. echo You lost.
  271. echo -~~~~~~~~~~~~-
  272. echo.
  273. echo 1) Back to menu
  274. echo -~~~~~~~~~~~~-
  275. echo.
  276.     set /p lose =
  277.         if %lose% == 1 goto ready
  278.             goto lost
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement