summaryrefslogtreecommitdiff
path: root/resources/js/classes/Item.js
blob: 9da6a9286f0d55fefa1349f430edc41b9f4c481b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class Item {
  constructor (slug) {
    this.slug = slug;
  }

  get name () {
    return translate(this.slug) || slugToName(this.slug);
  }

  get description () {
    return translate(`${this.slug}_description`) || 'ITEM_DESCRIPTION_MISSING';
  }

  get category () {
    return DB.items[this.slug].category;
  }

  get type () {
    return DB.items[this.slug].type;
  }

  get sprite () {
    return DB.items[this.slug].sprite;
  }

  get conditions () {
    return DB.items[this.slug].conditions;
  }

  get effects () {
    return DB.items[this.slug].effects;
  }
}