0

首先,如果有一个问题问同样的事情,我很抱歉,但我找不到它。

好吧,我目前正处于批量 RPG 的计划阶段。除了故事情节和所有这些,我还在计划功能。我正在考虑的其中之一是任务,但我不知道如何在游戏中放置任务。我先问了雅虎的答案,但有人告诉我我会在这里得到更好的答案,所以如果有人能告诉我怎么做,也许可以打一个简单的例子,那将非常感激。谢谢你。

4

3 回答 3

2

批量创建任务几乎是不可能的,但对于一个可工作的逐级 RPG,您需要执行以下操作:

:level1
set health=100
echo quest-level-1.
pause
goto level2

:level2
set health=80 
echo quest-level-2
if health=80 goto finish

:finish
You have completed the quest!
pause
goto start

这将作为一个很好的逐个任务类型的东西。如果你想让它更逼真,你也可以添加一个能量棒。

于 2012-10-23T20:34:39.207 回答
0

容易,虽然你可能认为它很难。我将向您展示我的批处理 RPG 代码(如果您使用它,它将无法工作!)

:questsC

 cls

if %Q% LEQ 0 goto quests
if %GQ% GEQ 1 goto GQuestC
if %PQ% GEQ 1 goto PQuestC
if %WQ% GEQ 1 goto WQuestC
if %CPQ% GEQ 1 goto CPQuestC

:quests
set GK=0
set PK=0
cls
echo Select a quest
echo.
echo 1) Kill 5 Goblins (+50 Gold!)
echo 2) Kill 5 Evil Pizzas (+75 Gold!)
echo 3) Kill 5 Wolfs (+150 Gold!)
echo 4) Kill 5 Chili Peppers (+200 Gold!)
echo 5) Go back home
set /p quest=
if %quest% == 1 goto QGS
if %quest% == 2 goto QPS
if %quest% == 3 goto QWS
if %quest% == 4 goto CPWS
if %quest% == 5 goto begin

:CPWS
set CPK=0
set CPQ=1
set Q=1
goto begin

:CPQuestC
if %CPK% GEQ 5 goto CPQuest
if %CPK% LSS 5 goto QuestCP

:QuestCP
cls
echo Quest not complete. You only have %CPK% kills.
pause
goto begin

:CPQuest
Start Levelup.mp3
cls
set CPQ=0
set /a Gold=%Gold%+200
set /a EXP=%EXP%+200
cls
echo Quest Complete! You got 200 gold and 200 exp!
pause
goto begin

:QWS
set WK=0
set WQ=1
set Q=1
goto begin

:QGS
set GK=0
set GQ=1
set Q=1
goto begin

:QPS
set PK=0
set PQ=1
set Q=1
goto begin

:GQuestC
if %GK% GEQ 5 goto GQuest
if %GK% LSS 5 goto QuestG

:WQuestC
if %WK% GEQ 5 goto WQuest
if %WK% LSS 5 goto QuestW

:WQuest
Start Levelup.mp3
cls
set WQ=0
set /a Gold=%Gold%+150
set /a EXP=%EXP%+150
cls
echo Quest Complete! You got 150 gold and 150 exp!
pause
goto begin

:QuestW
cls
echo Quest not complete. You only have %WK% kills.
pause
goto begin

:GQuest
Start Levelup.mp3
cls
set GQ=0
set /a Gold=%Gold%+50
set /a EXP=%EXP%+50
cls
echo Quest Complete! You got 50 gold and 50 exp!
pause
goto begin

:QuestG
cls
echo Quest not complete. You only have %GK% kills.
pause
goto begin

:QuestP
cls
echo echo Quest not complete. You only have %PK% kills.
pause
goto begin

:PQuestC
if %PK% GEQ 5 goto PQuest
if %PK% LSS 5 goto QuestP

:PQuest
Start Levelup.mp3
cls
set PQ=0
set /a Gold=%Gold%+75
set /a EXP=%EXP%+100
echo Quest Complete! You got 75 gold and 100 exp!
pause
goto begin

好的!所以首先它看起来是一个 Q,它告诉计算机是否正在进行任务。如果是这样,它会检查你有哪一个。然后它会检查您是否满足要求。然后,完成!!!像馅饼一样容易吧?研究这段代码!如果你有兴趣,这里是我的游戏的链接!我的 youtube 频道 (mineit909) 上也有教程,告诉你如何制作这个游戏。这是游戏链接。http://www.mediafire.com/?c87yz2hqawx43下载每个文件!!!如果声音文件不起作用,则在代码中取出开始(声音文件名)!将所有内容放在同一个文件夹中!!!

于 2013-03-11T00:45:19.500 回答
0

如果 %quest1% greq 1 goto questcomplete 当他们完成上述任务时,请执行以下操作:

设置任务1=1

:questcomplete cls 回声耶!你完成了任务!

于 2015-11-28T04:21:51.370 回答