我正在开发一个程序,用于为D&D游戏生成当天的天气。我希望程序在生成暴风雨天气时,通过红色文本显示警告,以便DM知道这种天气不太寻常。为了减少按键次数,它必须在同一屏幕上显示详细的天气文本。
目前,在暴风雨的部分,我有以下内容:
:des4a
cls
type c:\AutoDM\WeatherGen\data\forcast1.txt
color 0c
echo There is an Ashstorm!
color 0a
echo.
echo It is %temp% degrees and the sky is invisible threw the thick
echo billowing clouds of ash.
echo.
echo # Survival checks to light a fire are at +15.
echo # Small unprotected flames will be snuffed out.
echo # Non-firearm ranged attacks are at a -8 to hit.
echo # Preception checks take a -10 for every 10 feet of distance.
echo # Survival checks to get along in the wild are at +15.
echo # Stealth checks are at a +5.
echo.
echo SPECIAL!
echo.
set /a die=6
set /a inches=%random%%%die+1
echo # The ashstorm will deposit %inches% inches of ash durring its
echo durration.
echo # Tracking a target after an ashstorm is at a +15.
type c:\AutoDM\WeatherGen\data\forcast2.txt
echo.
echo.
pause
goto menu
类型命令调用包含每个条目的页眉和页脚的文本文档,以帮助程序看起来更专业,并提供边框以协助换行。它们不能被删除。请不要建议任何会使我无法像现在这样使用类型命令的东西。请理解,这条红色文本行将添加到程序的许多不同部分,每次生成器中的每个生物群系都有一个风暴。我希望它不超过2或3行代码(但如果只有一种方法可以做好...)
我能否将红色的那一行与其余部分分别显示为绿色?或者应该让程序发出哔声以引起注意?您有更好、更简单的想法吗?我该如何做到这一点?
ECHO(
来终止当前行以便下一行。 - dbenham