Compound inventory (room description) details

For this, you are dealing with the code in WriteAfterEntry(), which is never very fun. It is not written in a manner that makes for easy extensibility.

However, you can make use of the printing inventory desription details and printing room description details activities to do a wholesale replacement of the basics in a way that makes extensibility much easier:

The item being described is an object that varies. The item being described variable translates into I6 as "parameter_object".

Description notes is a thing based rulebook. The description notes rulebook has a list of texts called descriptive notes.

Description notes for a closed container:
	add "closed" to descriptive notes.

Description notes for a locked container:
	add "locked" to descriptive notes.

Description notes for an open openable container:
	add "open" to descriptive notes.

Description notes for an open container containing no visible thing:
	add "empty" to descriptive notes.

Description notes for a lit thing:
	unless the printing room description details activity is going on and the location is lighted:
		add "providing light" to descriptive notes.

Description notes for a worn thing:
	add "worn" to descriptive notes.

Last description notes:
	if descriptive notes is not empty:
		say " ([descriptive notes])".

For printing room description details of something (called item):
	follow the description notes rules for item.

For printing inventory details of something (called item):
	follow the description notes rules for item.

I’m not sure that it replicates all of the niceties of the built-in system, but it might not be too hard to close any observed gaps.

You would add your own descriptive text with additional rules in the rulebook, like so:

Description notes for a wacky thing:
	add "wacky" to descriptive notes.

You would have to provide a property or definition for wacky first, of course.

EDIT: Anybody wanting to use this to try to fully emulate existing code should see this post by Zed which lists many ways that inventory and room description detais differ by default.

3 Likes