Overview Screenshots Downloads News Documentation Thanks Simugraph Home Page

H-World - Item attributes configuration

Item attributes

Items in H-World can have special attributes. Beyond their basic attributes defined in [module]/data/things.sects some can have special attributes, e.g. as a result of magic enchantment or special craftsmanship of the manufacturer.

The fraction of items that get special attributes can be configured in the level templates for each level. For further details see the Level configuration page.

Attribute definitions

The attribute definitions are read from [module]/data/attributes.sects. Each section defines one attribute.

An attribute definition looks like this:

begin section att_slicing
prefix = slicing
postfix = of slicing
effect = Cdamage
target = self
modifier.base = 20
modifier.range = 20
modifier.price = 40
curse_chance = 0
end section

This atribute describes particularly sharp, "slicing", blades. The section name is referenced by the attribute mappings (see next section) but can be chosen freely.

Property Description
prefix (string) If an item has special attributes, the attributes will be added to the base item name. If attributes are listed before the name, the prefix entry is used, if they are listed after the name, the postfix entry is used. The exact handling of item name generation is done in the Lua function calculate_ident_string() which is usually given in [module]/scripts/core.lua
postfix (string) Postfix string, used in item name generation.
target (string) If this is "self", the special attribute affects the item itself. If this is "owner" the being who wields/uses the is affected. E.g. a sharp sword has "self", it it particularly sharp by itself. E.g. an item that makes the wielder faster has "owner" because it rather affects its owner than itself.
effect (string) Name of the property to affect.
modifier.base (int) Minimum value of the modification.
modifier.range (int) Range of the modification - no all "sharp" swords are equally sharp. Total modification is modifier.base + random(modifier.range). The range actually is 0..n-1 thus 0 isn't an allowed value here (1 results in a range of 0..0).
modifier.price (int) Each point of modification alters the item value by this amount.
curse_chance (int) This is the chance in percent to make the item sticky if it carries this special attribute. Sticky ("cursed") items can't be taken off by the player, unless the stickyness ("curse") is removed.

Attribute mappings

Some attributes fit only to some item types. E.g. only some things can be "sharp", others can't.

The mapping which types of attributes fit to which item types is given in [module]/data/item_attributes.sects. Each section defines one mapping.

An attribute mapping definition looks like this:

begin section blade
attribute-0 = att_protective
attribute-1 = att_heroic
attribute-2 = att_battlesome
attribute-3 = att_glowing
attribute-4 = att_shining
attribute-5 = att_blunt
attribute-6 = att_sharp
attribute-7 = att_slicing
attribute-8 = att_piercing
attribute-9 = att_handy
attribute-10 = att_impractical
attribute-11 = att_dead
attribute-12 = att_weakening
attribute-13 = att_stamina
attribute-14 = att_regeneration
end section

This section lists the attributes that are allowed for the item type blade. (The item types are part of the item definitions in [module]/data/things.sects. See also Items and monster configuration). The list must be continuously numbered, H-World will stop looking for attributes once one entry is missing (it thinks a missing entry marks the end of the listing. This is a limitation of the sects file format).

Item types that don't have mappings can't get special attributes. The code checks that attributes are only given once, if an item is about to get several attributes.

Hansjörg Malthaner
Last modified: 12-Sep-2004