diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-08-19 13:18:54 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-08-19 13:18:54 +0200 |
commit | 218da95a4b387ee5ac25f168d1529419039f2e54 (patch) | |
tree | 21375d6aae287da413cbfc1002c2c8eeb7bba1ed /resources/js/classes/utility/TechniqueEffect.js | |
parent | 91d048ef0f994446aaee91e3afcbd99788e439d7 (diff) |
refactor: enemy -> opponent, State.monsters~ -> State.Trainer.monsters
Diffstat (limited to 'resources/js/classes/utility/TechniqueEffect.js')
-rw-r--r-- | resources/js/classes/utility/TechniqueEffect.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/resources/js/classes/utility/TechniqueEffect.js b/resources/js/classes/utility/TechniqueEffect.js index 10e9399..852efad 100644 --- a/resources/js/classes/utility/TechniqueEffect.js +++ b/resources/js/classes/utility/TechniqueEffect.js @@ -5,11 +5,16 @@ class TechniqueEffect { type = ''; /** - * @type {(('user' | 'target')|Monster)} + * @type {('user' | 'target')} */ recipient = null; /** + * @type {Monster[]} + */ + recipients = []; + + /** * @type {('give' | 'remove')} */ application = ''; @@ -56,8 +61,8 @@ class TechniqueEffect { * @type {Monster} */ setUser (user) { - if (this.recipient === 'user') { - this.recipient = user; + if (['user', 'both'].includes(this.recipient)) { + this.recipients.push(user); } } @@ -65,8 +70,8 @@ class TechniqueEffect { * @type {Monster} */ setTarget (target) { - if (this.recipient === 'target') { - this.recipient = target; + if (['target', 'both'].includes(this.recipient)) { + this.recipients.push(target); } } } |