通知位置描述中的[名词]

问题描述:

我试图把“陌生人”,而不是[名词]。在这段代码中:通知位置描述中的[名词]

规则列出不伦不类的物品:什么也不做。

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. 

为什么会发生这种情况?

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

我不太确定你想做什么,但试图提及一个不会总是在房间描述中那样的人,那几乎肯定是错误的方法。如果您要做的是在退出前列出该男士,那么艾米莉短裤的房间描述控制功能可能会有所帮助。

+0

但是,如何创建可从游戏中删除的角色的通用引用? – user3091874

+0

@ user3091874我不确定你的意思。 – curiousdannii

+0

我需要从游戏中删除角色,以及他在房间描述中提到的所有角色。 – user3091874