Refactor challenges and add fresh start (#2964)

* Refactor challenges and add fresh start

* Add achievement for fresh start challenge
This commit is contained in:
Xavion3 2024-07-11 11:36:17 +10:00 committed by GitHub
parent 01f6ec2ef3
commit 991051fa09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -264,6 +264,10 @@ export const PGMachv: AchievementTranslationEntries = {
"MONO_FAIRY": {
name: "Hey! Listen!",
},
"FRESH_START": {
name: "First Try!",
description: "Complete the fresh start challenge."
}
} as const;
// Achievement translations for the when the player character is female (it for now uses the same translations as the male version)

View File

@ -5,7 +5,7 @@ import i18next from "i18next";
import * as Utils from "../utils";
import { PlayerGender } from "#enums/player-gender";
import { ParseKeys } from "i18next";
import { Challenge, SingleGenerationChallenge, SingleTypeChallenge } from "#app/data/challenge.js";
import { Challenge, FreshStartChallenge, SingleGenerationChallenge, SingleTypeChallenge } from "#app/data/challenge.js";
export enum AchvTier {
COMMON,
@ -276,6 +276,8 @@ export function getAchievementDescription(localizationKey: string): string {
case "MONO_DARK":
case "MONO_FAIRY":
return i18next.t(`${genderPrefix}achv:MonoType.description` as ParseKeys, {"type": i18next.t(`pokemonInfo:Type.${localizationKey.slice(5)}`)});
case "FRESH_START":
return i18next.t(`${genderPrefix}achv:FRESH_START.description` as ParseKeys);
default:
return "";
}
@ -350,6 +352,7 @@ export const achvs = {
MONO_DRAGON: new ChallengeAchv("MONO_DRAGON","", "MONO_DRAGON.description", "dragon_fang", 100, c => c instanceof SingleTypeChallenge && c.value === 16),
MONO_DARK: new ChallengeAchv("MONO_DARK","", "MONO_DARK.description", "black_glasses", 100, c => c instanceof SingleTypeChallenge && c.value === 17),
MONO_FAIRY: new ChallengeAchv("MONO_FAIRY","", "MONO_FAIRY.description", "fairy_feather", 100, c => c instanceof SingleTypeChallenge && c.value === 18),
FRESH_START: new ChallengeAchv("FRESH_START","", "FRESH_START.description", "mystic_ticket", 100, c => c instanceof FreshStartChallenge && c.value === 1),
};
export function initAchievements() {