2017-02-25 6 views
0

代わりに「見知らぬ人」を入れようとしています。このコードでは、場所の説明で[名詞]をお知らせします

記載されていない項目は何もしません。場所を説明する際に

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

「名詞」は、前のアクションの主目的が何であっても、この場合は「上向き」であることを示すグローバル変数です。 2回目に見たとき、前のオブジェクトにアクセスしようとしますが、パーサーが失敗したため、結果はnullオブジェクト、「何もありません」です。

私はあなたが何をしようとしているのかは分かりませんが、そのような部屋の説明に常にあるとは思わない男性を参照しようとすると、ほぼ間違ったアプローチになります。あなたがやろうとしていることが出口の前に男性を列挙することであれば、エミリーショート拡張による部屋説明制御が役立つかもしれません。

+0

しかし、ゲームから削除できる文字の一般的な参照を作成するにはどうすればよいですか? – user3091874

+0

@ user3091874あなたは何を意味するのか分かりません。 – curiousdannii

+0

私はゲームのキャラクターとその部屋の説明の彼の言及をすべて削除する必要があります。 – user3091874

関連する問題