diff options
Diffstat (limited to 'resources/js/classes')
-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`; + } +} |