diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-08-27 14:35:50 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-08-27 14:35:50 +0200 |
commit | 5582c3c07069f7766aabd81f3a4a3f97def134e9 (patch) | |
tree | a1c450f079187430ac39c194f5be53058f10f910 /resources/js/classes | |
parent | b025d1655483aa13a29ab5594255460b48143a5a (diff) |
more areas!
Diffstat (limited to 'resources/js/classes')
-rw-r--r-- | resources/js/classes/Area.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/resources/js/classes/Area.js b/resources/js/classes/Area.js index f518f22..5a3a062 100644 --- a/resources/js/classes/Area.js +++ b/resources/js/classes/Area.js @@ -3,7 +3,6 @@ class Area { monsterProgress = 0; trainerProgress = 0; - isCompleted = false; constructor (slug) { this.slug = slug; @@ -15,14 +14,25 @@ class Area { return translate(this.alternateSlug) || slugToName(this.slug); } + get isCompleted () { + return this.monsterProgress >= this.requiredEncounters && this.trainerProgress >= this.trainers.length; + } + get alternateSlug () { return DB.areas[this.slug]['modules/tuxemon.slug']; } + /** + * @returns {Object[]} + */ get encounters () { return DB.areas[this.slug].encounters; } + get encounterPercentTotal () { + return DB.areas[this.slug].encounter_percent_total; + } + get requiredEncounters () { return DB.areas[this.slug].requiredEncounters; } |