Skip to content

Commit

Permalink
Deploy preview for PR 5675 🛫
Browse files Browse the repository at this point in the history
  • Loading branch information
umbralOptimatum committed Nov 22, 2024
1 parent c6294f9 commit 8f1c9af
Showing 1 changed file with 43 additions and 78 deletions.
121 changes: 43 additions & 78 deletions docs/preview/pr-5675/scripts/script.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -29423,26 +29423,21 @@ class Quest {
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : 'Generic Quest Description. This should be overriden.';
}
set customDescription(customDescription) {
this._customDescription = customDescription;
}
get customDescription() {
if (!this._customDescription) {
return undefined;
}
const description = (_a = this.customDescription) !== null && _a !== void 0 ? _a : this.defaultDescription;
if (!this.inQuestLine) {
// Quest descriptions currently only supported for questlines
return this._customDescription;
// Quest translations currently only supported for questlines
return description;
}
if (!this.cachedTranslatedDescription) {
this.cachedTranslatedDescription = App.translation.get(
// e.g. Example Quest.step 1.123456789
`${this.parentQuestLine.name}.step ${this.parentQuestLine.quests().findIndex(q => q === this) + 1}.${GameHelper.translationHash(this._customDescription)}`, 'questlines', { defaultValue: this._customDescription });
// Keys are formatted like "Example Quest.step 1.123456789"
`${this.parentQuestLine.name}.step ${this.parentQuestLine.quests().findIndex(q => q === this) + 1}.${GameHelper.translationHash(description)}`, 'questlines', { defaultValue: description });
}
return this.cachedTranslatedDescription();
}
get defaultDescription() {
return 'Generic Quest Description. This should be overriden.';
}
static generateData() {
return [1, 0];
}
Expand Down Expand Up @@ -29702,8 +29697,7 @@ class DefeatPokemonsQuest extends Quest {
return super.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Defeat ${this.amount.toLocaleString('en-US')} Pokémon on ${Routes.getName(this.route, this.region, false, true)}.`;
return `Defeat ${this.amount.toLocaleString('en-US')} Pokémon on ${Routes.getName(this.route, this.region, false, true)}.`;
}
toJSON() {
const json = super.toJSON();
Expand All @@ -29728,9 +29722,8 @@ class CapturePokemonsQuest extends Quest {
const reward = amount * GameConstants.CAPTURE_POKEMONS_BASE_REWARD;
return super.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Capture or hatch ${this.amount.toLocaleString('en-US')} Pokémon.`;
get defaultDescription() {
return `Capture or hatch ${this.amount.toLocaleString('en-US')} Pokémon.`;
}
toJSON() {
const json = super.toJSON();
Expand Down Expand Up @@ -29773,9 +29766,8 @@ class CapturePokemonTypesQuest extends Quest {
const reward = amount * GameConstants.CAPTURE_POKEMONS_BASE_REWARD * this.weights[type].weight * 2;
return super.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Capture or hatch ${this.amount.toLocaleString('en-US')} ${PokemonType[this.type]}-type Pokémon.`;
get defaultDescription() {
return `Capture or hatch ${this.amount.toLocaleString('en-US')} ${PokemonType[this.type]}-type Pokémon.`;
}
toJSON() {
const json = super.toJSON();
Expand Down Expand Up @@ -29805,7 +29797,7 @@ class ClearBattleFrontierQuest extends Quest {
const reward = Math.ceil(amount * GameConstants.DEFEAT_POKEMONS_BASE_REWARD * 8);
return super.randomizeReward(reward);
}
get description() {
get defaultDescription() {
const suffix = this.amount > 1 ? 's' : '';
return `Clear ${this.amount.toLocaleString('en-US')} Stages in the Battle Frontier.`;
}
Expand Down Expand Up @@ -29833,9 +29825,8 @@ class GainFarmPointsQuest extends Quest {
const reward = Math.ceil(amount * GameConstants.GAIN_FARM_POINTS_BASE_REWARD);
return super.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Gain ${this.amount.toLocaleString('en-US')} Farm Points.`;
get defaultDescription() {
return `Gain ${this.amount.toLocaleString('en-US')} Farm Points.`;
}
toJSON() {
const json = super.toJSON();
Expand Down Expand Up @@ -29868,9 +29859,8 @@ class GainMoneyQuest extends Quest {
const reward = Math.ceil(amount / baseAmount * GameConstants.GAIN_MONEY_BASE_REWARD);
return GainMoneyQuest.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Gain ${this.amount.toLocaleString('en-US')} Pokédollars.`;
get defaultDescription() {
return `Gain ${this.amount.toLocaleString('en-US')} Pokédollars.`;
}
toJSON() {
const json = super.toJSON();
Expand Down Expand Up @@ -29902,9 +29892,8 @@ class GainTokensQuest extends Quest {
const reward = Math.ceil(amount / baseAmount * GameConstants.GAIN_TOKENS_BASE_REWARD);
return GainTokensQuest.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Gain ${this.amount.toLocaleString('en-US')} Dungeon Tokens.`;
get defaultDescription() {
return `Gain ${this.amount.toLocaleString('en-US')} Dungeon Tokens.`;
}
toJSON() {
const json = super.toJSON();
Expand Down Expand Up @@ -29950,9 +29939,8 @@ class GainGemsQuest extends Quest {
const reward = amount * GameConstants.DEFEAT_POKEMONS_BASE_REWARD * this.weights[type].weight * 0.5;
return super.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Gain ${this.amount.toLocaleString('en-US')} ${PokemonType[this.type]} gems.`;
get defaultDescription() {
return `Gain ${this.amount.toLocaleString('en-US')} ${PokemonType[this.type]} gems.`;
}
toJSON() {
const json = super.toJSON();
Expand Down Expand Up @@ -29983,9 +29971,8 @@ class HatchEggsQuest extends Quest {
const reward = Math.ceil(amount * GameConstants.HATCH_EGGS_BASE_REWARD);
return super.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Hatch ${this.amount.toLocaleString('en-US')} ${GameConstants.pluralizeString('Egg', this.amount)}.`;
get defaultDescription() {
return `Hatch ${this.amount.toLocaleString('en-US')} ${GameConstants.pluralizeString('Egg', this.amount)}.`;
}
toJSON() {
const json = super.toJSON();
Expand All @@ -30011,10 +29998,7 @@ class MineLayersQuest extends Quest {
const reward = Math.ceil(amount * GameConstants.MINE_LAYERS_BASE_REWARD);
return super.randomizeReward(reward);
}
get description() {
if (this.customDescription) {
return this.customDescription;
}
get defaultDescription() {
const suffix = this.amount > 1 ? 's' : '';
return `Mine ${this.amount.toLocaleString('en-US')} layer${suffix} in the Underground.`;
}
Expand Down Expand Up @@ -30042,10 +30026,7 @@ class MineItemsQuest extends Quest {
const reward = Math.ceil(amount * GameConstants.MINE_ITEMS_BASE_REWARD);
return super.randomizeReward(reward);
}
get description() {
if (this.customDescription) {
return this.customDescription;
}
get defaultDescription() {
const suffix = this.amount > 1 ? 's' : '';
return `Mine ${this.amount.toLocaleString('en-US')} item${suffix} in the Underground.`;
}
Expand All @@ -30070,9 +30051,8 @@ class CatchShiniesQuest extends Quest {
const reward = Math.ceil(amount * GameConstants.SHINY_BASE_REWARD);
return super.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Capture or hatch ${this.amount.toLocaleString('en-US')} shiny Pokémon.`;
get defaultDescription() {
return `Capture or hatch ${this.amount.toLocaleString('en-US')} shiny Pokémon.`;
}
toJSON() {
const json = super.toJSON();
Expand All @@ -30098,9 +30078,8 @@ class CatchShadowsQuest extends Quest {
const reward = Math.ceil(amount * GameConstants.SHADOW_BASE_REWARD);
return super.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Catch ${this.amount.toLocaleString('en-US')} Shadow Pokémon.`;
get defaultDescription() {
return `Catch ${this.amount.toLocaleString('en-US')} Shadow Pokémon.`;
}
toJSON() {
const json = super.toJSON();
Expand Down Expand Up @@ -30147,11 +30126,8 @@ class DefeatGymQuest extends Quest {
const reward = Math.min(5000, Math.ceil(attacksToWin * GameConstants.DEFEAT_POKEMONS_BASE_REWARD * GameConstants.ACTIVE_QUEST_MULTIPLIER * amount));
return super.randomizeReward(reward);
}
get description() {
get defaultDescription() {
var _a;
if (this.customDescription) {
return this.customDescription;
}
const elite = this.gymTown.includes('Elite') || this.gymTown.includes('Champion');
const displayName = (_a = GymList[this.gymTown]) === null || _a === void 0 ? void 0 : _a.displayName;
const leaderName = GymList[this.gymTown].leaderName.replace(/\d+/g, '').trim();
Expand Down Expand Up @@ -30223,11 +30199,10 @@ class DefeatDungeonQuest extends Quest {
const reward = Math.min(5000, Math.ceil(completeDungeonsReward + collectTokensReward));
return super.randomizeReward(reward);
}
get description() {
var _a;
get defaultDescription() {
const { subRegion } = TownList[this.dungeon];
const subRegionName = SubRegions.getSubRegionById(this.region, subRegion).name;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Defeat the ${this.dungeon} dungeon in ${subRegionName} ${this.amount.toLocaleString('en-US')} times.`;
return `Defeat the ${this.dungeon} dungeon in ${subRegionName} ${this.amount.toLocaleString('en-US')} times.`;
}
toJSON() {
const json = super.toJSON();
Expand Down Expand Up @@ -30261,9 +30236,8 @@ class UsePokeballQuest extends Quest {
const reward = Math.ceil(amount * (pokeball + 1) * (pokeball + 1) * GameConstants.DEFEAT_POKEMONS_BASE_REWARD);
return super.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Use ${this.amount.toLocaleString('en-US')} ${ItemList[GameConstants.Pokeball[this.pokeball]].displayName}s.`;
get defaultDescription() {
return `Use ${this.amount.toLocaleString('en-US')} ${ItemList[GameConstants.Pokeball[this.pokeball]].displayName}s.`;
}
toJSON() {
const json = super.toJSON();
Expand Down Expand Up @@ -30306,10 +30280,7 @@ class UseOakItemQuest extends Quest {
const reward = amount * GameConstants.USE_OAK_ITEM_BASE_REWARD;
return super.randomizeReward(reward);
}
get description() {
if (this.customDescription) {
return this.customDescription;
}
get defaultDescription() {
const desc = [];
desc.push(`Equip the ${GameConstants.humanifyString(OakItemType[this.item])} and`);
if (this.item == OakItemType.Magic_Ball) {
Expand Down Expand Up @@ -30361,9 +30332,8 @@ class HarvestBerriesQuest extends Quest {
const reward = Math.ceil(fieldAmt * Math.pow(harvestTime, .7) * 30);
return super.randomizeReward(reward);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Harvest ${this.amount.toLocaleString('en-US')} ${BerryType[this.berryType]} ${GameConstants.pluralizeString('Berry', this.amount)} at the farm.`;
get defaultDescription() {
return `Harvest ${this.amount.toLocaleString('en-US')} ${BerryType[this.berryType]} ${GameConstants.pluralizeString('Berry', this.amount)} at the farm.`;
}
toJSON() {
const json = super.toJSON();
Expand Down Expand Up @@ -34161,9 +34131,8 @@ class BuyPokeballsQuest extends Quest {
this.pokeball = pokeball;
this.focus = App.game.statistics.pokeballsPurchased[this.pokeball];
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Buy ${this.amount.toLocaleString('en-US')} ${ItemList[GameConstants.Pokeball[this.pokeball]].displayName}s.`;
get defaultDescription() {
return `Buy ${this.amount.toLocaleString('en-US')} ${ItemList[GameConstants.Pokeball[this.pokeball]].displayName}s.`;
}
toJSON() {
const json = super.toJSON();
Expand All @@ -34180,10 +34149,7 @@ class CaptureSpecificPokemonQuest extends Quest {
this.focus = ko.pureComputed(() => App.game.statistics.pokemonCaptured[this.pokemon.id]() - (includeBreeding ? 0 : App.game.statistics.pokemonHatched[this.pokemon.id]()));
this.includeBreeding = includeBreeding;
}
get description() {
if (this.customDescription) {
return this.customDescription;
}
get defaultDescription() {
if (this.amount === 1) {
return `Capture ${this.includeBreeding ? 'or hatch ' : ''}${this.pokemon.name}.`;
}
Expand Down Expand Up @@ -34214,9 +34180,8 @@ class DefeatDungeonBossQuest extends Quest {
}
this.focus = ko.observable(0);
}
get description() {
var _a;
return (_a = this.customDescription) !== null && _a !== void 0 ? _a : `Defeat ${this.dungeonBoss} in ${this.dungeon}.`;
get defaultDescription() {
return `Defeat ${this.dungeonBoss} in ${this.dungeon}.`;
}
onLoad() {
super.onLoad();
Expand Down

0 comments on commit 8f1c9af

Please sign in to comment.