-
Notifications
You must be signed in to change notification settings - Fork 1
Items
The list of all items is currently contained in config/items.xml. In this file, either currency items (money) or normal items (items, weapons) can be defined.
<item name="..." type="..." value="..." maxStackSize="..." width="..." height="..." sprite="..." />
name: The display name of the item. This is also used as an identifier, so if two items have identical names there may be problems.
type: The type of the item. Different types will cause the item to serve different purposes. Look at other items to see the possible item types; they should be self-explanatory enough for now (until we do more, then document more).
Currently existing (i.e. understood by the engine) types are:
- Sword: The player can slash at stuff with Sword-typed items.
- Bow: The player can use Bow-typed items to shoot arrows.
- Arrow: Bows can shoot Arrow-typed items (selected in-game based on order in inventory).
- Food: Food-typed items can heal the player when used.
value: The value of the item. Should you sell/have to buy the item, this is how much the item will be worth.
maxStackSize: The highest amount of item that may take up a single slot of inventory. Having more of this item will result in another stack starting, another slot taken.
width: The width of the item, in pixels. Defaults to the sprite's dimensions.
height: The height of the item, in pixels. Defaults to the sprite's dimensions.
sprite: The file path of the texture associated with this item.
sound: Path to a sound file to play on usage of the item.
cooldown: The amount of milliseconds the player must wait between item usages.
heal: The amount of HP to be healed on item usage.
Weapons (so far, items of types Sword and Bow) can be given Lua scripts to define certain characteristics of the items and their uses. For a weapon to be effective, an attack
tag needs to be added as a child to the item
tag:
<attack effect="..."> [Lua code] </attack>
The effect attribute take a path to a .gif file; on the item's use, if the path is valid, the given .gif will play as an animation from the player's position. See the Lua page for documentation on valid code for weapons.
<currency name="Penny" value="1" sprite="penny.png" />
name: The display name of the currency. Probably will be used as an identifier; don't have duplicates.
value: The amount of value one of these is worth. In this example, the Penny is worth 1 value.
sprite: The file path of the texture associated with this currency.