diff options
Diffstat (limited to 'resources/js/classes/Technique.js')
-rw-r--r-- | resources/js/classes/Technique.js | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/resources/js/classes/Technique.js b/resources/js/classes/Technique.js new file mode 100644 index 0000000..a24e094 --- /dev/null +++ b/resources/js/classes/Technique.js @@ -0,0 +1,77 @@ +class Technique { + #accuracy = 0; + #potency = 0; + #power = 0; + + constructor (slug) { + this.slug = slug; + + this.resetStats(); + } + + get name () { + return slugToName(this.slug); + } + + get types () { + return DB.techniques[this.slug].types; + } + + get range () { + return DB.techniques[this.slug].range; + } + + get animation () { + return DB.techniques[this.slug].animation; + } + + get sfx () { + return DB.techniques[this.slug].sfx; + } + + /** + * @returns {string[]} + */ + get effects () { + return DB.techniques[this.slug].effects; + } + + get accuracy () { + return this.#accuracy; + } + set accuracy (accuracy) { + this.#accuracy = accuracy; + } + + get potency () { + return this.#potency; + } + set potency (potency) { + this.#potency = potency; + } + + get power () { + return this.#power; + } + set power (power) { + this.#power = power; + } + + get stats () { + const accuracy = DB.techniques[this.slug].accuracy; + const potency = DB.techniques[this.slug].potency; + const power = DB.techniques[this.slug].power; + + return { + accuracy, + potency, + power, + }; + } + + resetStats () { + this.accuracy = this.stats.accuracy; + this.potency = this.stats.potency; + this.power = this.stats.power; + } +} |