diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-08-21 01:26:53 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-08-21 01:26:53 +0200 |
commit | ca093f0fb457a7037eb8a3acf3304e0646fa4278 (patch) | |
tree | 26e0e20b38a14ba4f7c3c9f33748fa68168863e9 /resources/js/classes | |
parent | 43a28ad77190f2e55e2e6ba65a9a7b5b1f5dea6c (diff) |
opponent counter attacks
Diffstat (limited to 'resources/js/classes')
-rw-r--r-- | resources/js/classes/Monster.js | 3 | ||||
-rw-r--r-- | resources/js/classes/utility/TechniqueEffect.js | 12 |
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; } |