所以我正在进行批量游戏,我需要一些帮助。我让玩家获得更多人并为他们分配工作(完成),但我希望他们能够在一天内完成多项工作。一个例子是,他们将增加10人砍伐10棵树。那就是2天。我怎样才能让你的工作人员在一天之内无法使用?
答案 0 :(得分:0)
首先,或许:Arqade会给你一些想法,即使语言不同,执行某些任务的整体方法仍然存在。
对于游戏批处理问题,你需要很多论据。
我在这里扩展了Mallesh的答案
:[ set %lumTime% to amount of time lumberjacks are busy, variable can be copied with different names for different professions. ]
:[ You would call this block of code when the user intends to activate "lumberJack" profession, ]
:[ This code will check if they still have days left to work, if they do, echo error]
1 if %lumTime% gtr 0 (
2 cls & echo Lumberjacks can't be used for %lumTime% days! & goto :place
3 ) else (
4 set lumTime=10 & echo lumberJack's are now active! & goto :place
5 )
:[ The above command line per line: ]
:[ 1= If command, check if lumTime is over, not equal, to 0, if it is, then the workers are still busy]
:[ 2= "( cls & echo Lumberjacks can't be used for %busyTime% days! & goto :place )" is what is run if the if check is true, which tells the user that they are busy ]
:[ 3= "else" tells the command that the next block of code is what to run if the if check is false. ]
:[ 4= "( set lumTime=10 )" is the above mentioned block of code, and sets it to 10, so ten days of work ]
:[ 5= Close 4's code block, syntax requirement. ]
:[ Do note, it can also be written as: ]
if %lumTime% gtr 0 ( cls & echo Lumberjacks can't be used for %busyTime% days! ) else ( set lumTime=1 )
对IF命令有更多帮助:IF-DOS
答案 1 :(得分:-1)
为这些对象设置时间标志。