Advertisement
CheikoAsami

Game Project Bugs

Dec 6th, 2022 (edited)
1,415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 7.78 KB | None | 0 0
  1. @echo off
  2. color 0e
  3. title Array RPG Offline
  4.  
  5. :start
  6. cls
  7. echo ---------------------------
  8. echo     Array RPG Offline
  9. echo ---------------------------
  10. echo    1) Start Game
  11. echo    2) Options
  12. echo    0) Exit
  13. echo ---------------------------
  14. choice /c 120 /n >nul
  15.  
  16. if %errorlevel% == 1 (
  17.     call :playerPartyData
  18.     call :getCurrentPartyMems
  19.     set /p partyData[0].Name=Enter your Name:
  20.     goto game
  21. )
  22. if %errorlevel% == 2 (
  23.     goto options
  24. )
  25. if %errorlevel% == 3 (
  26.     exit
  27. )
  28. goto start
  29.  
  30. :playerPartyData
  31. set f=1
  32. set h=0
  33. set hires=0
  34. set hired=0
  35. set hireSelect=0
  36. set partySelect=0
  37. set partySize=0
  38. set partyData[0].Name=Player
  39. set partyData[0].Armor=Cloth Rags
  40. set partyData[0].Weapon=Bare Fists
  41. set partyData[0].Level=1
  42. set partyData[0].Kills=0
  43. set partyData[0].Gold=0
  44. set partyData[0].Class=No Class
  45. set partyData[0].ID=0
  46. set hireGen[0].Class=No Class
  47. set hireGen[0].ID=0
  48. goto:eof
  49.  
  50. :game
  51. cls
  52. echo -------------------------------------------------------------------------------------
  53. echo  Name:%partyData[0].Name% /\ Level:%partyData[0].Level% /\ Armor:%partyData[0].Armor% /\ Weapon:%partyData[0].Weapon%
  54. echo -------------------------------------------------------------------------------------
  55. echo    1) Explore
  56. echo    2) Party Menu
  57. echo    3) Hire Board
  58. echo --------------------
  59. choice /c 123 /n >nul
  60. if %errorlevel% == 1 (
  61.     goto game
  62. )
  63. if %errorlevel% == 2 (
  64.     goto PartyMenu
  65. )
  66. if %errorlevel% == 3 (
  67.     goto HireBoard
  68. )
  69. goto game
  70.  
  71. :hireClasses
  72. if %ranClass% EQU 1 (
  73.     set randomClass=Samurai
  74. )
  75. if %ranClass% EQU 2 (
  76.     set randomClass=Marksmen
  77. )
  78. if %ranClass% EQU 3 (
  79.     set randomClass=Beserker
  80. )
  81. if %ranClass% EQU 4 (
  82.     set randomClass=Mage
  83. )
  84. if %ranClass% EQU 5 (
  85.     set randomClass=Assassin
  86. )
  87. goto:eof
  88.  
  89. :createHire
  90. set /a ranCost=%random%%%1500+500
  91. set /a ranLevel=%random%%%5+1
  92. call set hireGen[%hires%].Class=%randomClass%
  93. call set /a hireGen[%hires%].ID=%hires%
  94. call set /a hireGen[%hires%].Level=%ranLevel%
  95. call set /a hireGen[%hires%].Cost=%ranCost%*%ranLevel%
  96. set /a hires+=1
  97. goto:eof
  98.  
  99. :HireBoard
  100. cls
  101. echo ---------------------------------
  102. echo          Hiring Board
  103. echo ---------------------------------
  104. echo    1) Search Hiring Papers
  105. echo    2) Inspect Hires %hires%
  106. echo    3) Deny Papers
  107. echo    0) Return
  108. echo ---------------------------------
  109. echo Results:
  110. choice /c 1230 /n >nul
  111.  
  112. if %errorlevel% == 1 (
  113.     set /a ranClass=%random%%%5+1
  114.     call :hireClasses
  115.     call :createHire
  116.     goto HireBoard
  117. )
  118. if %errorlevel% == 2 (
  119.     goto inspectHire
  120. )
  121. if %errorlevel% == 3 (
  122.     for /l %%j in (0 1 %hires%) do (
  123.     set hireGen[%%j].ID=
  124.     set hireGen[%%j].Level=
  125.     set hireGen[%%j].Class=
  126.     set hireGen[%%j].Cost=
  127. )
  128.     set /a hires=0
  129. )
  130. if %errorlevel% == 4 (
  131.     goto game
  132. )
  133. goto HireBoard
  134.  
  135. :inspectHire
  136. cls
  137. echo --------------------------
  138. echo      Inspect List
  139. echo Hire ID Selected:%hireSelect%
  140. echo --------------------------
  141. echo 1) Select Which to Hire
  142. echo 2) Hire Selected
  143. echo 0) Return
  144. echo --------------------------
  145. for /l %%j in (0 1 %hires%) do (
  146.     call echo  ID = %%hireGen[%%j].ID%%
  147.     call echo  Class = %%hireGen[%%j].Class%%
  148.     call echo  Level = %%hireGen[%%j].Level%%
  149.     call echo  Asking Price = %%hireGen[%%j].Cost%% Gold
  150.     call echo --------------------------
  151. )
  152. echo --------------------------
  153. choice /c 120 /n >nul
  154. if %errorlevel% == 1 (
  155.     set /p hireSelect=Input Hire ID:
  156.     goto inspectHire
  157. )
  158. if %errorlevel% == 2 (
  159.    
  160.     call :createHired
  161.    
  162.     goto inspectHire
  163. )
  164. if %errorlevel% == 3 (
  165.     goto HireBoard
  166. )
  167.  
  168. :createHired
  169.     set /a hired+=1
  170.     set /a hires-=1
  171. call set partyData[%hired%].Class=%%hireGen[%hireSelect%].Class%%
  172. call set partyData[%hired%].ID=%hired%
  173. call set partyData[%hired%].Name=Nameless
  174. call set partyData[%hired%].Level=%%hireGen[%hireSelect%].Level%%
  175.     set hireGen[%hireSelect%].Class=
  176.     set hireGen[%hireSelect%].Level=
  177.     set hireGen[%hireSelect%].ID=
  178.     set hireGen[%hireSelect%].Cost=
  179.     call :getCurrentPartyMems
  180. goto:eof
  181.  
  182. goto inspectHire
  183.  
  184. :getCurrentPartyMems
  185. if defined partyData[%f%].ID (
  186.     set /a partySize+=1
  187. ) else (
  188. set partyDataName=No Other Members.
  189. )
  190. goto:eof
  191.  
  192. :PartyMenu
  193. cls
  194. echo ---------------------------------
  195. echo Name:%partyDataName%
  196. echo ---------------------------------
  197. echo 1) Speak to Party Member
  198. echo 2) View Party List %partySize%
  199. echo 3) Load Characters
  200. echo 4) Save Characters
  201. echo 0) Return
  202. echo ---------------------------------
  203. echo. %error%
  204. choice /c 12340 /n >nul
  205. if %errorlevel% == 1 (
  206.     set /p partySelect=Party Member ID:
  207.     if not defined partyData[%partySelect%].ID (
  208.         set error=Not a Valid ID!
  209.         goto PartyMenu
  210.     ) else (set error=)
  211.     call :memberDialogue
  212.     call :dialogueSet
  213.     goto partyDialogue
  214. )
  215. if %errorlevel% == 2 (
  216.     goto partyList
  217. )
  218. if %errorlevel% == 3 (
  219.     call :partyLoad
  220.     goto PartyMenu
  221. )
  222. if %errorlevel% == 4 (
  223.     call :partySave
  224. )
  225. if %errorlevel% == 5 (
  226.     goto game
  227. )
  228. goto PartyMenu
  229.  
  230. :dialogueSet
  231. set memberDialogue[1]=Yes sir?
  232. set memberDialogue[2]=Something you need?
  233. set memberDialogue[3]=What do you want to ask?
  234. set memberDialogue[4]=You wanted to talk?
  235. set memberDialogue[5]=What's on your mind?
  236. if %dialogueSet% EQU 1 (
  237.     set dialogue[1]=%memberDialogue[1]%
  238. )
  239. if %dialogueSet% EQU 2 (
  240.     set dialogue[1]=%memberDialogue[2]%
  241. )
  242. if %dialogueSet% EQU 3 (
  243.     set dialogue[1]=%memberDialogue[3]%
  244. )
  245. if %dialogueSet% EQU 4 (
  246.     set dialogue[1]=%memberDialogue[4]%
  247. )
  248. if %dialogueSet% EQU 5 (
  249.     set dialogue[1]=%memberDialogue[5]%
  250. )
  251. goto:eof
  252.  
  253. :memberDialogue
  254. set /a dialogueSet=%random%%%5+1
  255. call set partyDataName=%%partyData[%partySelect%].Name%%
  256. call set partyDataLevel=%%partyData[%partySelect%].Level%%
  257. call set partyDataID=%%partyData[%partySelect%].ID%%
  258. goto:eof
  259.  
  260. :partyDialogue
  261. cls
  262. echo ---------------------------------
  263. echo    %dialogue[1]%
  264. echo ---------------------------------
  265. echo Name: %partyDataName%
  266. echo Level: %partyDataLevel%
  267. echo ID: %partyDataID%
  268. echo ---------------------------------
  269. echo    1) Inspect Gear
  270. echo    2) Change Name
  271. echo    0) Return
  272. echo ---------------------------------
  273.  
  274. choice /c 120 /n >nul
  275.  
  276. if %errorlevel% == 1 (
  277.     call :getPartyEquipment
  278.     goto memberEquipment
  279. )
  280. if %errorlevel% == 2 (
  281.     set /p partyData[%partySelect%].Name=Change Name to:
  282.     goto partyDialogue
  283. )
  284. if %errorlevel% == 3 (
  285.     goto PartyMenu
  286. )
  287. pause>nul
  288. goto partyMenu
  289.  
  290. :partySave
  291. (
  292.     for /l %%a in (0 1 %partySize%) do (
  293.         call echo set partyData[%%a].Name=%%partyData[%%a].Name%%
  294.         call echo set partyData[%%a].Level=%%partyData[%%a].Level%%
  295.         call echo set partyData[%%a].Class=%%partyData[%%a].Class%%
  296.         call echo set partyData[%%a].ID=%%partyData[%%a].ID%%
  297.     )
  298.     call echo set /a partySize=%partySize%
  299. ) > saveData.bat
  300. set error=Data Saved.
  301. goto:eof
  302.  
  303. :partyLoad
  304. if exist saveData.bat (
  305.     call saveData.bat
  306.     set error=Party Data Loaded.
  307. ) else (
  308.     set error=No Such Data Found!
  309. )
  310. set /a partySize=%partySize%
  311. goto:eof
  312.  
  313. :getPartyEquipment
  314. call set memberArmor=%%partyData[%partySelect%].Armor%%
  315. call set memberWeapon=%%partyData[%partySelect%].Weapon%%
  316. goto:eof
  317.  
  318. :memberEquipment
  319. cls
  320. echo ---------------------------
  321. echo    Inspecting %partyDataName%
  322. echo ---------------------------
  323. echo    Weapon:%memberWeapon%
  324. echo    Armor:%memberArmor%
  325. echo ---------------------------
  326. echo 1) Outfit Weapon
  327. echo 2) Outfit Armor
  328. echo 0) Return
  329. choice /c 120 /n >nul
  330. if %errorlevel% == 1 (
  331.     goto weaponOutfitter
  332. )
  333. if %errorlevel% == 2 (
  334.     goto armorOutfitter
  335. )
  336. if %errorlevel% == 3 (
  337.     set dialogue[1]=Anything else?
  338.     goto partyDialogue
  339. )
  340. goto memberEquipment
  341.  
  342. :partyList
  343. cls
  344. echo --------------------------
  345. echo       Party ID List
  346. echo --------------------------
  347. for /l %%j in (0 1 %partySize%) do (
  348.     call echo  Name = %%partyData[%%j].Name%%
  349.     call echo  Class = %%partyData[%%j].Class%%
  350.     call echo  Level = %%partyData[%%j].Level%%
  351.     call echo  ID = %%partyData[%%j].ID%%
  352.     call echo --------------------------
  353. )
  354. echo --------------------------
  355. pause>nul
  356. goto PartyMenu
Tags: Bugs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement