Skip to content
William Edwards edited this page Sep 9, 2015 · 2 revisions

The item directory contains a list of all the items the player can use. In it, you define the name of the item, its effect it has, the power it has, and the sprite image associated with it. For a list of all the currently available items, view the items page.

Here is the layout of the data with descriptions of each column:

Name Description
id The id of the individual item.
name The name of the item.
effect A comma-separated list of effects that will go off when this item is used. Multiple effects can be bound to a single item.
type The type of item this is. Different things will happen depending on the type of an item. For example, if an item's type is "Consumable", it will be removed from the player's inventory upon use.
target The target the item will affect. Can be "player", "opponent", or "both".
power Amount of power the item has. Used in "effect" calculations (such as healing).
description An in-game description of the item.
sprite The relative path to the sprite image associated with this item.

Examples

resources/db/item/potion.json

{
    "description": "Heals a monster by 50 HP.", 
    "effects": [
        "heal"
    ], 
    "id": 1, 
    "name": "Potion", 
    "power": 50, 
    "sprite": "resources/gfx/items/potion.png", 
    "target": "player",
    "type": "Consumable"
}