summaryrefslogtreecommitdiff
path: root/resources/js/classes/Npc.js
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-08-31 20:23:06 +0200
committerDaniel Weipert <code@drogueronin.de>2023-08-31 20:23:06 +0200
commitc657c77d0cf49afba627b93848e1915e2ce7d3ff (patch)
tree5d96a65df277f52558cd5ff84f2fefbf4480a926 /resources/js/classes/Npc.js
parent7f6ab8779bd143b1b5f3465e3681abcbc113d19d (diff)
story and npcs
Diffstat (limited to 'resources/js/classes/Npc.js')
-rw-r--r--resources/js/classes/Npc.js15
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`;
+ }
+}