Skip to content

Commit

Permalink
[Enhancement/Item] Add Achievement to Unlock Eviolite (pagefaultgames…
Browse files Browse the repository at this point in the history
…#3390)

* Add Achievement & Adjust Weight Function

* Create `EVIOLITE` Unlockable

* Add Placeholder Localization Entries

* Add `de` Localization

Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>

* Add `ko` Localization

Co-authored-by: returntoice <dieandbecome@gmail.com>

* Add Placeholder `ja` Entry

* Add `pt-BR` Localization

Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br>

* Add `fr` Localization

Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>

* Add Missing Placeholders for Localization

* Add `fr` Localization (female)

Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>

---------

Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
Co-authored-by: returntoice <dieandbecome@gmail.com>
Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br>
Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>
  • Loading branch information
5 people authored Aug 8, 2024
1 parent 00d039c commit 7230402
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/locales/ca-ES/achv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export const PGMachv: AchievementTranslationEntries = {
name: "Undefeated",
description: "Beat the game in classic mode",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "Bring Your Child To Work Day",
description: "Beat the game in Classic Mode with at least one unevolved party member."
},

"MONO_GEN_ONE": {
name: "The Original Rival",
Expand Down
6 changes: 6 additions & 0 deletions src/locales/de/achv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ export const PGMachv: AchievementTranslationEntries = {
name: "Ungeschlagen",
description: "Beende den klassischen Modus erfolgreich.",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "'Bringe dein Kind mit zur Arbeit'-Tag" ,
description: "Beende den klassischen Modus erfolgreich mit mindestens einem nicht entwickeltem Pokémon in deinem Team"
},

"MONO_GEN_ONE": {
name: "Der originale Rivale",
description: "Schließe die 'Nur 1. Generation' Herausforderung ab.",
Expand Down Expand Up @@ -348,6 +353,7 @@ export const PGFachv: AchievementTranslationEntries = {
"HIDDEN_ABILITY": PGMachv.HIDDEN_ABILITY,
"PERFECT_IVS": PGMachv.PERFECT_IVS,
"CLASSIC_VICTORY": PGMachv.CLASSIC_VICTORY,
"UNEVOLVED_CLASSIC_VICTORY": PGMachv.UNEVOLVED_CLASSIC_VICTORY,
"MONO_GEN_ONE": PGMachv.MONO_GEN_ONE,
"MONO_GEN_TWO": PGMachv.MONO_GEN_TWO,
"MONO_GEN_THREE": PGMachv.MONO_GEN_THREE,
Expand Down
4 changes: 4 additions & 0 deletions src/locales/en/achv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export const PGMachv: AchievementTranslationEntries = {
name: "Undefeated",
description: "Beat the game in classic mode",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "Bring Your Child To Work Day",
description: "Beat the game in Classic Mode with at least one unevolved party member."
},

"MONO_GEN_ONE": {
name: "The Original Rival",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/es/achv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export const PGMachv: AchievementTranslationEntries = {
name: "Imbatible",
description: "Completa el juego en modo clásico.",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "Bring Your Child To Work Day",
description: "Beat the game in Classic Mode with at least one unevolved party member."
},

"MONO_GEN_ONE": {
name: "The Original Rival",
Expand Down
8 changes: 8 additions & 0 deletions src/locales/fr/achv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export const PGMachv: AchievementTranslationEntries = {
name: "Invaincu",
description: "Terminer le jeu en mode classique",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "Le stagiaire de 3e",
description: "Terminer le mode Classique avec au moins un Pokémon non-évolué dans l’équipe."
},

"MONO_GEN_ONE": {
name: "Le rival originel",
Expand Down Expand Up @@ -439,6 +443,10 @@ export const PGFachv: AchievementTranslationEntries = {
name: "Invaincue",
description: "Terminer le jeu en mode classique",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "Le stagiaire de 3e",
description: "Terminer le mode Classique avec au moins un Pokémon non-évolué dans l’équipe."
},

"MONO_GEN_ONE": {
name: "Le rival originel",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/it/achv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export const PGMachv: AchievementTranslationEntries = {
name: "Imbattuto",
description: "Vinci in modalità classica",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "Bring Your Child To Work Day",
description: "Beat the game in Classic Mode with at least one unevolved party member."
},

"MONO_GEN_ONE": {
name: "Rivale Originale",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/ja/achv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export const PGMachv: AchievementTranslationEntries = {
name: "Undefeated",
description: "Beat the game in classic mode",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "Bring Your Child To Work Day",
description: "Beat the game in Classic Mode with at least one unevolved party member."
},

"MONO_GEN_ONE": {
name: "The Original Rival",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/ko/achv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export const PGMachv: AchievementTranslationEntries = {
name: "무패",
description: "클래식 모드 클리어",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "우리집 꿈나무",
description: "최종 진화형이 아닌 포켓몬을 데리고 클래식 모드 클리어."
},

"MONO_GEN_ONE": {
name: "근본 라이벌",
Expand Down
8 changes: 8 additions & 0 deletions src/locales/pt_BR/achv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export const PGMachv: AchievementTranslationEntries = {
name: "Invencível",
description: "Vença o jogo no modo clássico",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "Tire as Crianças da Sala",
description: "Vença o jogo no Modo Clássico com pelo menos um membro da equipe não evoluído.."
},

"MONO_GEN_ONE": {

Expand Down Expand Up @@ -440,6 +444,10 @@ export const PGFachv: AchievementTranslationEntries = {
name: "Invencível",
description: "Vença o jogo no modo clássico",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "Bring Your Child To Work Day",
description: "Beat the game in Classic Mode with at least one unevolved party member."
},

"MONO_GEN_ONE": {

Expand Down
4 changes: 4 additions & 0 deletions src/locales/zh_CN/achv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export const PGMachv: AchievementTranslationEntries = {
name: "战无不胜",
description: "在经典模式中通关游戏",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "Bring Your Child To Work Day",
description: "Beat the game in Classic Mode with at least one unevolved party member."
},

"MONO_GEN_ONE": {
name: "最初的劲敌",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/zh_TW/achv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export const PGMachv: AchievementTranslationEntries = {
name: "戰無不勝",
description: "在經典模式中通關遊戲",
},
"UNEVOLVED_CLASSIC_VICTORY": {
name: "Bring Your Child To Work Day",
description: "Beat the game in Classic Mode with at least one unevolved party member."
},

"MONO_GEN_ONE": {
name: "最初的勁敵",
Expand Down
7 changes: 6 additions & 1 deletion src/modifier/modifier-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,12 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.MINT, 4),
new WeightedModifierType(modifierTypes.RARE_EVOLUTION_ITEM, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 15) * 4, 32), 32),
new WeightedModifierType(modifierTypes.AMULET_COIN, skipInLastClassicWaveOrDefault(3)),
//new WeightedModifierType(modifierTypes.EVIOLITE, (party: Pokemon[]) => party.some(p => ((p.getSpeciesForm(true).speciesId in pokemonEvolutions) || (p.isFusion() && (p.getFusionSpeciesForm(true).speciesId in pokemonEvolutions))) && !p.getHeldItems().some(i => i instanceof Modifiers.EvolutionStatBoosterModifier)) ? 10 : 0),
new WeightedModifierType(modifierTypes.EVIOLITE, (party: Pokemon[]) => {
if (party[0].scene.gameData.unlocks[Unlockables.EVIOLITE]) {
return party.some(p => ((p.getSpeciesForm(true).speciesId in pokemonEvolutions) || (p.isFusion() && (p.getFusionSpeciesForm(true).speciesId in pokemonEvolutions))) && !p.getHeldItems().some(i => i instanceof Modifiers.EvolutionStatBoosterModifier)) ? 10 : 0;
}
return 0;
}),
new WeightedModifierType(modifierTypes.SPECIES_STAT_BOOSTER, 12),
new WeightedModifierType(modifierTypes.LEEK, (party: Pokemon[]) => {
const checkedSpecies = [ Species.FARFETCHD, Species.GALAR_FARFETCHD, Species.SIRFETCHD ];
Expand Down
5 changes: 5 additions & 0 deletions src/phases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import { PlayerGender } from "#enums/player-gender";
import { Species } from "#enums/species";
import { TrainerType } from "#enums/trainer-type";
import { applyChallenges, ChallengeType } from "./data/challenge";
import { pokemonEvolutions } from "./data/pokemon-evolutions";

const { t } = i18next;

Expand Down Expand Up @@ -4287,6 +4288,7 @@ export class GameOverPhase extends BattlePhase {
if (this.victory && newClear) {
if (this.scene.gameMode.isClassic) {
firstClear = this.scene.validateAchv(achvs.CLASSIC_VICTORY);
this.scene.validateAchv(achvs.UNEVOLVED_CLASSIC_VICTORY);
this.scene.gameData.gameStats.sessionsWon++;
for (const pokemon of this.scene.getParty()) {
this.awardRibbon(pokemon);
Expand Down Expand Up @@ -4387,6 +4389,9 @@ export class GameOverPhase extends BattlePhase {
if (!this.scene.gameData.unlocks[Unlockables.MINI_BLACK_HOLE]) {
this.scene.unshiftPhase(new UnlockPhase(this.scene, Unlockables.MINI_BLACK_HOLE));
}
if (!this.scene.gameData.unlocks[Unlockables.EVIOLITE] && this.scene.getParty().some(p => p.getSpeciesForm(true).speciesId in pokemonEvolutions)) {
this.scene.unshiftPhase(new UnlockPhase(this.scene, Unlockables.EVIOLITE));
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/system/achv.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Modifier } from "typescript";
import BattleScene from "../battle-scene";
import { TurnHeldItemTransferModifier } from "../modifier/modifier";
import { pokemonEvolutions } from "#app/data/pokemon-evolutions";
import i18next from "i18next";
import * as Utils from "../utils";
import { PlayerGender } from "#enums/player-gender";
Expand Down Expand Up @@ -240,6 +241,8 @@ export function getAchievementDescription(localizationKey: string): string {
return i18next.t(`${genderPrefix}achv:PERFECT_IVS.description` as ParseKeys);
case "CLASSIC_VICTORY":
return i18next.t(`${genderPrefix}achv:CLASSIC_VICTORY.description` as ParseKeys);
case "UNEVOLVED_CLASSIC_VICTORY":
return i18next.t(`${genderPrefix}achv:UNEVOLVED_CLASSIC_VICTORY.description` as ParseKeys);
case "MONO_GEN_ONE":
return i18next.t(`${genderPrefix}achv:MONO_GEN_ONE.description` as ParseKeys);
case "MONO_GEN_TWO":
Expand Down Expand Up @@ -326,6 +329,7 @@ export const achvs = {
HIDDEN_ABILITY: new Achv("HIDDEN_ABILITY","", "HIDDEN_ABILITY.description","ability_charm", 75),
PERFECT_IVS: new Achv("PERFECT_IVS","", "PERFECT_IVS.description","blunder_policy", 100),
CLASSIC_VICTORY: new Achv("CLASSIC_VICTORY","", "CLASSIC_VICTORY.description","relic_crown", 150),
UNEVOLVED_CLASSIC_VICTORY: new Achv("UNEVOLVED_CLASSIC_VICTORY", "", "UNEVOLVED_CLASSIC_VICTORY.description", "eviolite", 175, c => c.getParty().some(p => p.getSpeciesForm(true).speciesId in pokemonEvolutions)),
MONO_GEN_ONE_VICTORY: new ChallengeAchv("MONO_GEN_ONE","", "MONO_GEN_ONE.description", "ribbon_gen1", 100, c => c instanceof SingleGenerationChallenge && c.value === 1),
MONO_GEN_TWO_VICTORY: new ChallengeAchv("MONO_GEN_TWO","", "MONO_GEN_TWO.description", "ribbon_gen2", 100, c => c instanceof SingleGenerationChallenge && c.value === 2),
MONO_GEN_THREE_VICTORY: new ChallengeAchv("MONO_GEN_THREE","", "MONO_GEN_THREE.description", "ribbon_gen3", 100, c => c instanceof SingleGenerationChallenge && c.value === 3),
Expand Down
3 changes: 2 additions & 1 deletion src/system/game-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ export class GameData {
this.unlocks = {
[Unlockables.ENDLESS_MODE]: false,
[Unlockables.MINI_BLACK_HOLE]: false,
[Unlockables.SPLICED_ENDLESS_MODE]: false
[Unlockables.SPLICED_ENDLESS_MODE]: false,
[Unlockables.EVIOLITE]: false
};
this.achvUnlocks = {};
this.voucherUnlocks = {};
Expand Down
8 changes: 6 additions & 2 deletions src/system/unlockables.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import i18next from "i18next";
import { GameMode, GameModes } from "../game-mode";

export enum Unlockables {
ENDLESS_MODE,
MINI_BLACK_HOLE,
SPLICED_ENDLESS_MODE
SPLICED_ENDLESS_MODE,
EVIOLITE
}

export function getUnlockableName(unlockable: Unlockables) {
switch (unlockable) {
case Unlockables.ENDLESS_MODE:
return `${GameMode.getModeName(GameModes.ENDLESS)} Mode`;
case Unlockables.MINI_BLACK_HOLE:
return "Mini Black Hole";
return i18next.t("modifierType:ModifierType.MINI_BLACK_HOLE.name");
case Unlockables.SPLICED_ENDLESS_MODE:
return `${GameMode.getModeName(GameModes.SPLICED_ENDLESS)} Mode`;
case Unlockables.EVIOLITE:
return i18next.t("modifierType:ModifierType.EVIOLITE.name");
}
}

0 comments on commit 7230402

Please sign in to comment.