diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-08-31 20:23:06 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-08-31 20:23:06 +0200 |
commit | c657c77d0cf49afba627b93848e1915e2ce7d3ff (patch) | |
tree | 5d96a65df277f52558cd5ff84f2fefbf4480a926 /resources/js/classes/Npc.js | |
parent | 7f6ab8779bd143b1b5f3465e3681abcbc113d19d (diff) |
story and npcs
Diffstat (limited to 'resources/js/classes/Npc.js')
-rw-r--r-- | resources/js/classes/Npc.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/resources/js/classes/Npc.js b/resources/js/classes/Npc.js new file mode 100644 index 0000000..6121bce --- /dev/null +++ b/resources/js/classes/Npc.js @@ -0,0 +1,15 @@ +class Npc { + name = ''; + spriteName = ''; + + constructor (slug) { + this.slug = slug; + + this.name = translate(slug) || slugToName(slug.replace('spyder_', '')); + this.spriteName = DB.npcs[slug]?.template[0].sprite_name; + } + + get sprite () { + return `/modules/tuxemon/mods/tuxemon/gfx/sprites/player/${this.spriteName}.png`; + } +} |