2

我对 Inform 很陌生,看起来这不应该太难做,但我还没有找到方法。我想根据玩家的来源更改房间的描述。类似于以下内容:

The Town Square is a room. "As you enter the small town square, [if yourself came from West]
  the rising sun makes silhouettes of the roofs and spires to the East.[otherwise]your long
  shadow strides before you as the Sun rises behind.[end if]"

解决这个问题的最佳方法是什么?

4

1 回答 1

3

我找到了一个合理的解决方案:

The last location is a room that varies.
Orientation is a direction that varies.

Before going to anywhere, now the last location is the location of the player.
After going to anywhere:
    now orientation is the best route from the last location to the location, using even locked doors;
    continue the action.

The Town Square is a room. "As you enter the small town square, [if orientation is east]
the rising Sun makes silhouettes of the roofs and spires to the East.[otherwise if orientation is west]
your long shadow strides before you as the Sun rises behind.[end if]"

“使用偶数上锁的门”修饰符确保即使门在玩家身后关闭并锁上也能正常工作。该解决方案确实假设玩家是通过可逆路线来的,但情况可能并非总是如此,例如玩家已经传送。

于 2016-07-13T21:23:23.233 回答