5 inform7
我有以下代码:
After going to room1:
if button1 is switched on:
say "You hear a loud noise in the distance!";
Run Code Online (Sandbox Code Playgroud)
不幸的是,这会阻止打印房间描述。如果我加上“继续行动”;最后,输出是“你听到远处有很大的噪音!” 在房间描述之前。我真的想先看一下房间描述。如果我加上“试试看;” 作为第一行,它打破了简短/详细模型。我如何编码以获得以下输出?
(详细)
>e
Room1
This is a small room.
There is a letter here.
You hear a loud noise in the distance!
Run Code Online (Sandbox Code Playgroud)
(简短,在第二次访问房间时)
>e
Room1
There is a letter here.
You hear a loud noise in the distance!
Run Code Online (Sandbox Code Playgroud)
发生这种情况是因为“之后”规则在“报告”规则之前运行,并且房间描述由报告规则打印。所以你有几个选择来修复它:
在您的后规则中打印房间描述。正如您所注意到的,“尝试寻找”打破了简短模式,因为它总是像玩家输入 LOOK 一样做出响应,但您可以使用另一个短语代替(在关于寻找的标准规则部分中提到):
After going to room1:
produce a room description with going spacing conventions;
if button1 is switched on:
say "You hear a loud noise in the distance!"Run Code Online (Sandbox Code Playgroud)从打印房间描述后运行的“报告进行中”规则打印您的消息:
Last report going rule (this is the report loud noise in the distance rule):
if the room gone to is room1 and button1 is switched on:
say "You hear a loud noise in the distance!"Run Code Online (Sandbox Code Playgroud)从“每回合”规则打印您的消息,该规则在所有动作规则手册之后运行:
Every turn when the player is in room1 and the player was not in room1:
if button1 is switched on:
say "You hear a loud noise in the distance!"Run Code Online (Sandbox Code Playgroud)