Attributes are a set of qualities that any item either has or hasnt. An item can have none of the possible attributes, all of the possible attributes, or any combination in between. Initial attributes are given to an object in its definition using the keyword has (see the section on Definitions in Detail), while they are given and taken away during the course of the game using the ensure command. Many of the attributes do not have any pre-determined purpose and may be used by the author at will. The best way to determine the full effect of any given attribute is to search for it in the library file.
All ensure commands are of the following syntax:
ensure Item has/hasnt Attribute
There is nothing really tricky about the ensure command. You are either giving an item an attribute with a command like:
ensure dungeon has DARK
or taking an attribute away from an item with a command like:
ensure lantern hasnt LUMINOUS
Below is a list of the attributes that can be given to an object, and some brief notes on each.
Attribute | Description |
---|---|
CLOSED | If an object has the attribute CLOSED, its children will not be accessible to the player. |
LOCKED | If an object has the attribute LOCKED, it cannot be opened or closed by the player. |
DEAD | An object that has the attribute DEAD must also have the attribute ANIMATE. A DEAD object may not be killed, talked to, shown things or given things. |
IGNITABLE | An object that has the attribute IGNITABLE may be used to light an object that has the object FLAMMABLE. |
WORN | An object that has the attribute WORN will not burden the player with its mass. In order to wear an object it must also have the attribute WEARABLE. When an object has the WORN attribute, the player will not be able to drop it or give it away. |
CONCEALING | An object that has the attribute CONCEALING must also have the attribute ANIMATE. This attribute indicates that when the object is examined, the objects that it is carrying should not be listed. |
LUMINOUS | When it is present, an object that has the attribute LUMINOUS will allow the player to enter a location that has the attribute DARK. |
WEARABLE | The player may wear an object that has the attribute WEARABLE. |
CLOSABLE | An object that has the attribute CLOSABLE may be opened and closed by the player. |
LOCKABLE | An object that has the attribute LOCKABLE may be locked and unlocked by the player. |
ANIMATE | An object that has the attribute ANIMATE may be killed, talked to, shown things or given things. |
LIQUID | An object that has the attribute LIQUID must be carried within an object that has the attribute CONTAINER and may be drunk or poured by the player. |
CONTAINER | An object that has the attribute CONTAINER may have other objects put inside it. If it also has CLOSABLE it must not have CLOSED for the player to put things in it. A container may hold as many mass units as its capacity element is set to. |
SURFACE | An object that has the attribute SURFACE may have things placed on top of it. A surface may hold as many mass units as its capacity element is set to. |
PLURAL | If an object is defined with a plural name, it should be given the attribute PLURAL so the library will avoid printing sentences such as "The boulders is to heavy to go throwing around." |
FLAMMABLE | An object that has the attribute FLAMMABLE may be lit using an object that has the attribute IGNITABLE. |
BURNING | When an object that has the attribute FLAMMABLE is lit, it will be given the attributes BURNING and LUMINOUS. |
ON | Free for use by the author. |
DAMAGED | Free for use by the author. |
FEMALE | This attribute should be given to any object that has the attribute ANIMATE and represents a female character. This will enable the library to refer to the character correctly. |
POSSESIVE | If an object has the attributes ANIMATE and POSSESIVE the player will not be able to take objects from them or ask them for objects unless specifically coded for. |
OUT_OF_REACH | An object that has the attribute OUT_OF_REACH cannot be touched, even when it is in the same location as the player. |
TOUCHED | An object that has the attribute TOUCHED has been moved from its starting position by the player. If the object's long property points to a function, this attribute can be tested to give an appropriate description. |
SCORED | Free for use by the author. |
SITTING | If the player is currently sitting, this attribute should be given, as the function +movement will check if it is set before moving the player. |
CUSTOM1 CUSTOM2 CUSTOM3 CUSTOM4 CUSTOM5 |
Free for use by the author. |
Below is a list of the attributes that can be given to a location, and some brief notes on each.
Attribute | Description |
---|---|
VISITED | When the player enters a location, it is automatically given the attribute VISITED. This may be tested for to provide a shorter description on subsequent visits. When the JACL interpreter is set to verbose mode (the DISPLAY_MODE variable is set to 1), locations will permanently have the attribute VISITED taken away from them. |
DARK | If a location has the attribute DARK, the player must be carrying an object that has the attribute LUMINOUS in order to enter it. |
DARKNESS | If the player's current location has the attribute DARK and no object with the attribute LUMINOUS is present, the player will be prevented from performing any actions that require the ability to see. You should never manually give or take the attribute DARKNESS to or from a location, only the attribute DARK. |
ON_WATER | If a location has the attribute ON_WATER, any object dropped will sink out of sight and end up in limbo. |
UNDER_WATER | If a location has the attribute UNDER_WATER, nothing may be lit, exposed liquids will dissipate and no talking is possible. |
WITHOUT_AIR | If a location has the attribute WITHOUT_AIR, the OXYGEN_LEFT variable will be decremented until it reaches zero and suffocation occurs. |
OUTDOORS | If a location has the attribute OUTDOORS, any desired effects of weather should be applied. |
MID_AIR | If a location has the attribute MID_AIR, any object dropped will fall out of sight and end up in limbo. Actions such as jumping will not be allowed either. |
MID_WATER | If a location has the attribute MID_WATER any object dropped will sink out of sight and end up in limbo. |
TIGHT_ROPE | If a location has the attribute TIGHT_ROPE, any object dropped will fall out of sight and end up in limbo. |
POLLUTED | Free for use by the author. |
SOLVED | Free for use by the author. |
LOCATION | All locations have the attribute LOCATION. If this is taken away the location will become an object. |
SCORED | Free for use by the author. |
CUSTOM1 CUSTOM2 CUSTOM3 CUSTOM4 CUSTOM5 |
Free for use by the author. |
A common use of the CUSTOMx attributes is to check if an action has already been performed. This may be useful if it is not logically possible to perform the action twice, or each subsequent attempt would result in a different outcome. Another possibility is that you would like to give a lengthy response the first time, then a short response on all subsequent times. Below is a rather minimal example of this:
{open_override ensure door hasnt CLOSED if door hasnt CUSTOM1 write "<p>You hold you breath as the door slowly " write "creaks open.^" ensure door has CUSTOM1 break endif write "<p>You open the door again.^" }