rpg stat系统问题

时间:2018-11-06 19:50:44

标签: batch-file

我正在批量制作rpg游戏,这是到目前为止的统计系统代码

:SPSPEND
CLS
Echo You have %SP% stat points to spend, every stat point used increases         that skill by 5.
Echo 1. Strength=%Strength%
Echo 2. Agility=%Agility%
Echo 3. Magic=%Magic%
Echo 4. Vitality=%MaxHP%
Echo 5. Defence=%Defence%
Echo 6. Archery=%Archery%
set /p choice=Choose what to put points into:
if %choice%=="1" Set /a Strength==%strength%+5
if %choice%=="2"
if %choice%=="3"
if %choice%=="4"
if %choice%=="5"
if %choice%=="6"
cls
set /a SP==%SP%-1
goto :rest

不确定如何格式化soz。我在两件事上需要帮助:我该如何做才能使其不会关闭并不能正常工作,以及如果有人输入了我已经设定的东西以外的其他东西,我该如何进行故障保护。 预先感谢

1 个答案:

答案 0 :(得分:0)

我相信这就是您想要的。 我已经对其进行了测试,并且肯定可以使用

:SPSPEND
CLS
if %SP% leq 0 goto end
Echo You have %SP% stat points to spend, every stat point used increases             that skill by 5.
Echo 1. Strength=%Strength%
Echo 2. Agility=%Agility%
Echo 3. Magic=%Magic%
Echo 4. Vitality=%MaxHP%
Echo 5. Defence=%Defence%
Echo 6. Archery=%Archery%
set /p choice=Choose what to put points into:
if "%choice%"=="1" Set /a Strength=%Strength%+5& set /a SP=%SP%-1& goto SPSPEND
if "%choice%"=="2" Set /a Agility=%Agility%+5& set /a SP=%SP%-1& goto SPSPEND
if "%choice%"=="3" Set /a Magic=%Magic%+5& set /a SP=%SP%-1& goto SPSPEND
if "%choice%"=="4" Set /a MaxHP=%MaxHP%+5& set /a SP=%SP%-1& goto SPSPEND
if "%choice%"=="5" Set /a Defence=%Defence%+5& set /a SP=%SP%-1& goto SPSPEND
if "%choice%"=="6" Set /a Archery=%Archery%+5& set /a SP=%SP%-1& goto SPSPEND
echo invalid choice
pause
goto SPSPEND
cls
:end
pause
goto :rest