Skip to content

Game Data: Items

Mark Eliasen edited this page Feb 11, 2018 · 1 revision

Item Data Files

The items in the game is defined in the ./game/data(.new)/items.json file. If you want to add/remove items to the game, you can do so here.

Item Objects

Each item object can consist of the following information (based on the item type/subtype):

{
    "id": "",
    "name": "",
    "description": "",
    "type": "weapon|armour|consumable|trash",
    "subtype": "[melee|ranged|ammo]|[body]|[food|drug]",
    "stats": {
        "price": 123,
        "stackable": true|false,
        "durability": 123,
        "damage_min": 123,
        "damage_max": 321,
        "damage_bonus": 123,
        "damage_reduction": 123,
        "priceRange": [Mean, Min, Max],
        "useEffect": {
            "id": "drug",
            "modifiers": {
                "exp": 1,
                "health": -1
            }
        }
    }
}

General Details

The following genral information is required for every type of item:

  • id: This is the item ID. It must be unique and a string.
  • name: The item name which the players will see
  • description: (optional, but recommended) This is the description of the item, when a player inspects it.
  • type: the type of item it is. The type of item also defines what stats the item needs. You can choose between the following types:
    • weapon
    • armour
    • consumable
    • trash
  • subtype: The subtype allows you to more granularly define the type of item it is. The subtype can potentially alter which stats are required for the item. You can choose between the following sub types:
    • weapon subtypes: melee, ranged, ammo
    • armour subtypes: body
    • consumable subtypes: food, drug
    • trash subtypes: none.

Stats

The stats required for an item is largely dependent on the type and potential subtype of an item.

The following stats are required, unless otherwise stated, for ALL items:

  • price
    • This is the base price for the item.
    • Type: Number
  • priceRange
    • (option) if the price of an item should be randomised instead of fixed.
    • Type: array, with [mean, min, max] price for the item.
  • stackable
    • If an item should be stackable or not.
    • Type: Boolean
  • useEffect:
    • (option) When using an item, this defined which effect should be trigged.
    • Type: array, with [mean, min, max] price for the item.

Stats, like durablity, can mean different things based on the item type (like armour) or whether the item is stackable or not. The following stats are required depending on the item type:

  • Type weapon:
    • damage_min
      • The minimum damage the weapon produces.
      • Type: Number
    • damage_max
      • The maximum damage the weapon produces.
      • Type: Number
  • Type armour:
    • damage_reduction
      • How much ranged damaged will be reduced.
      • Type: Number
    • durability
      • The total amount of damage the item will soak before getting destroyed.
      • Type: Number
  • Type consumable:
    • useEffect
      • Required. Defined the effect the item has on use
      • Type: Object

Note on item durability

Durability current means multiple things. If an item is stackable, it means how many of the item they have, where if its not stackable it depends on the item type. This is likely to be changed in the future to reduce confusion and allow more flexibility with the items

Use Effect

Use effects are triggered when a player "uses" and item, from the inventory screen.

useEffect objects consist of the follow:

{
    "id": "effectID",
    "modifiers": {
        "exp": 10, // example
        "health": -10 // example
    }
}

The modifiers overwrites the detaults for the effect. This could be (as show in the example above) how much EXP you gain and how much health you loose, from using this item.

The effect must be defined before it can be used.

Clone this wiki locally