summaryrefslogtreecommitdiff
path: root/resources/js/classes
diff options
context:
space:
mode:
Diffstat (limited to 'resources/js/classes')
-rw-r--r--resources/js/classes/Monster.js3
-rw-r--r--resources/js/classes/utility/TechniqueEffect.js12
2 files changed, 15 insertions, 0 deletions
diff --git a/resources/js/classes/Monster.js b/resources/js/classes/Monster.js
index 69bb654..84ea5da 100644
--- a/resources/js/classes/Monster.js
+++ b/resources/js/classes/Monster.js
@@ -112,6 +112,9 @@ class Monster {
return translate(this.slug) || slugToName(this.slug);
}
+ /**
+ * @returns {Object[]}
+ */
getLearnableTechniques () {
return this.moveset.filter((move) => this.level >= move.level_learned);
}
diff --git a/resources/js/classes/utility/TechniqueEffect.js b/resources/js/classes/utility/TechniqueEffect.js
index 852efad..fe38888 100644
--- a/resources/js/classes/utility/TechniqueEffect.js
+++ b/resources/js/classes/utility/TechniqueEffect.js
@@ -25,6 +25,11 @@ class TechniqueEffect {
statusEffect = null;
/**
+ * @type {ElementType}
+ */
+ switchType = '';
+
+ /**
* @type {Monster}
*/
user = null;
@@ -52,6 +57,13 @@ class TechniqueEffect {
this.recipient = effectCode.split(' ')[1];
}
+ else if (effectCode.startsWith('switch')) {
+ this.type = 'switch';
+
+ this.recipient = effectCode.split(' ')[1].split(',')[0];
+ this.switchType = effectCode.split(' ')[1].split(',')[1];
+ }
+
else {
this.type = effectCode;
}