在位置描述中通知7 [名词]

时间:2017-02-25 12:59:33

标签: inform7

我试图把“陌生人”改为[名词]。在这段代码中:

  

列出不起眼的物品的规则:什么也不做。

A staircase is a kind of door. A staircase is usually open.
A staircase is seldom openable. The ladder is a staircase. 
The ladder is above the Entry and below the Reception. 
The description of Entry is "You see ladder forward.".
A stranger man is man in the Reception. 
The description of Reception is "You see [the noun] at the reception. On the left side is corridor.".

在描述位置时,我看到“向上”而不是“陌生人”。但是在攻击和remove the noun from play;之后,我看到“没有” - 好吧。

Entry
You see ladder forward.

>up

Reception
You see the up at the reception. On the left side is corridor.

>attack man
You attack the stranger man, causing 5 points of damage!

The stranger man attacks you, causing 7 points of damage!

>attack man
You attack the stranger man, causing 8 points of damage!

The stranger man attacks you, causing 7 points of damage!

>attack man
You attack the stranger man, causing 6 points of damage!

The stranger man attacks you, causing 2 points of damage!

>attack man
You attack the stranger man, causing 4 points of damage!

The stranger man attacks you, causing 8 points of damage!

>attack man
You attack the stranger man, causing 10 points of damage!

The stranger man die, you win!

>attack man
You can't see any such thing.

>look
Reception
You see nothing at the reception. On the left side is corridor.

为什么会这样?

1 个答案:

答案 0 :(得分:1)

“名词”是一个全局变量,指的是前一个动作的主要对象,在这种情况下是“向上”的方向。当你第二次看时,它会尝试访问前一个对象,但由于解析器失败,结果是空对象,“没有”。

我不太确定你想要做什么,但试图引用那些不会总是在房间描述中那样的人,这几乎肯定是错误的做法。如果你要做的是在退出前列出那个人,那么Emily Short扩展的房间描述控制可能有所帮助。