Skip to content

Commit

Permalink
[v0.10.18] Live website
Browse files Browse the repository at this point in the history
  • Loading branch information
auto-deploy committed Jan 6, 2024
1 parent 1083ce8 commit 9a59bbb
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions docs/scripts/script.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit 9a59bbb

Please sign in to comment.