From 9a59bbba4f5b1f84e50082d9c31cd48ee655bd44 Mon Sep 17 00:00:00 2001 From: auto-deploy Date: Sat, 6 Jan 2024 06:56:18 +0000 Subject: [PATCH] [v0.10.18] Live website --- docs/scripts/script.min.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/scripts/script.min.js b/docs/scripts/script.min.js index 446a045109..180991d6cb 100644 --- a/docs/scripts/script.min.js +++ b/docs/scripts/script.min.js @@ -28871,13 +28871,21 @@ class DefeatGymQuest extends Quest { this.region = GameConstants.getGymRegion(this.gymTown); this.focus = App.game.statistics.gymsDefeated[GameConstants.getGymIndex(this.gymTown)]; } + // Only add Defeat Gym Quest if the player has defeated the first gym (Brock). + static canComplete() { + return App.game.badgeCase.hasBadge(BadgeEnums.Boulder); + } static generateData() { const amount = SeededRand.intBetween(5, 20); - const region = SeededRand.intBetween(0, player.highestRegion()); - // Only use unlocked gyms - const possibleGyms = GameConstants.RegionGyms[region].filter(gymTown => GymList[gymTown].flags.quest && GymList[gymTown].isUnlocked()); - // If no gyms unlocked in this region, just use the first gym of the region - const gymTown = possibleGyms.length ? SeededRand.fromArray(possibleGyms) : GameConstants.RegionGyms[region][0]; + let maxRegion = player.highestRegion(); + // Check if first gym of highest region has been cleared. If not, pick one region lower than highest. + if (!App.game.badgeCase.hasBadge(GymList[GameConstants.RegionGyms[player.highestRegion()][0]].badgeReward)) { + maxRegion -= 1; + } + const region = SeededRand.intBetween(0, maxRegion); + // Only use cleared gyms. + const possibleGyms = GameConstants.RegionGyms[region].filter(gymTown => GymList[gymTown].flags.quest && GymList[gymTown].clears()); + const gymTown = SeededRand.fromArray(possibleGyms); const reward = this.calcReward(amount, gymTown); return [amount, reward, gymTown]; }