summaryrefslogtreecommitdiff
path: root/resources/js/classes
diff options
context:
space:
mode:
Diffstat (limited to 'resources/js/classes')
-rw-r--r--resources/js/classes/Area.js3
-rw-r--r--resources/js/classes/Item.js8
-rw-r--r--resources/js/classes/Monster.js15
-rw-r--r--resources/js/classes/State.js5
-rw-r--r--resources/js/classes/StatusEffect.js3
5 files changed, 33 insertions, 1 deletions
diff --git a/resources/js/classes/Area.js b/resources/js/classes/Area.js
index b0bd710..e8d7acc 100644
--- a/resources/js/classes/Area.js
+++ b/resources/js/classes/Area.js
@@ -35,6 +35,9 @@ class Area {
return DB.areas[this.slug].map;
}
+ /**
+ * @returns {Object[]}
+ */
get locations () {
return DB.areas[this.slug].locations;
}
diff --git a/resources/js/classes/Item.js b/resources/js/classes/Item.js
index 9da6a92..40089f2 100644
--- a/resources/js/classes/Item.js
+++ b/resources/js/classes/Item.js
@@ -20,7 +20,13 @@ class Item {
}
get sprite () {
- return DB.items[this.slug].sprite;
+ const sprite = DB.items[this.slug].sprite;
+
+ if (sprite) {
+ return '/modules/tuxemon/mods/tuxemon/' + sprite;
+ }
+
+ return '';
}
get conditions () {
diff --git a/resources/js/classes/Monster.js b/resources/js/classes/Monster.js
index 84ea5da..c058a75 100644
--- a/resources/js/classes/Monster.js
+++ b/resources/js/classes/Monster.js
@@ -62,6 +62,9 @@ class Monster {
}
}
+ /**
+ * @returns {string[]}
+ */
get types () {
return DB.monsters[this.slug].types;
}
@@ -74,6 +77,18 @@ class Monster {
return DB.monsters[this.slug].moveset;
}
+ get catch_rate () {
+ return DB.monsters[this.slug].catch_rate;
+ }
+
+ get upper_catch_resistance () {
+ return DB.monsters[this.slug].upper_catch_resistance;
+ }
+
+ get lower_catch_resistance () {
+ return DB.monsters[this.slug].lower_catch_resistance;
+ }
+
/**
* @returns {DB_Evolution[]}
*/
diff --git a/resources/js/classes/State.js b/resources/js/classes/State.js
index 085d1c7..1a65efe 100644
--- a/resources/js/classes/State.js
+++ b/resources/js/classes/State.js
@@ -26,6 +26,11 @@ class State {
currentArea = null;
/**
+ * @type {AreaSlug}
+ */
+ lastVisitedTown = '';
+
+ /**
* @type {number}
*/
turn = 0;
diff --git a/resources/js/classes/StatusEffect.js b/resources/js/classes/StatusEffect.js
index e1ae9c9..d161761 100644
--- a/resources/js/classes/StatusEffect.js
+++ b/resources/js/classes/StatusEffect.js
@@ -18,6 +18,9 @@ class StatusEffect {
else if (['charging'].includes(this.slug)) {
this.turnsLeft = 2;
}
+ else if (['faint'].includes(this.slug)) {
+ this.turnsLeft = Number.MAX_SAFE_INTEGER;
+ }
else if (this.category === 'positive') {
this.turnsLeft = Math.ceil(Math.random() * 6) + 4;
}