From bcb891de173c39843afd706f5749636d89d02c7c Mon Sep 17 00:00:00 2001 From: Scooom Date: Sat, 4 Jan 2025 06:50:39 -0600 Subject: [PATCH 01/22] Implement Flip Stat Challange --- src/data/challenge.ts | 41 +++++++++++++++++++++++++++++++++++++++++ src/enums/challenges.ts | 1 + src/field/pokemon.ts | 12 ++++++++++++ src/game-mode.ts | 5 +++++ 4 files changed, 59 insertions(+) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 4301ea7b3758..fc0d5900827d 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -17,6 +17,7 @@ import { TypeColor, TypeShadow } from "#enums/color"; import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; import { pokemonFormChanges } from "#app/data/pokemon-forms"; + /** A constant for the default max cost of the starting party before a run */ const DEFAULT_PARTY_MAX_COST = 10; @@ -701,6 +702,39 @@ export class InverseBattleChallenge extends Challenge { } } +/** + * Begin Scoom Code + */ + +/** + * Implements a fresh start challenge. + */ +export class FlipStatChallenge extends Challenge { + constructor() { + super(Challenges.FLIP_STAT, 1); + } + + applyStarterChoice(pokemon: PokemonSpecies, valid: Utils.BooleanHolder): boolean { + return true; + } + + applyStarterCost(species: Species, cost: Utils.NumberHolder): boolean { + return true; + } + + + override getDifficulty(): number { + return 0; + } + + static loadChallenge(source: FlipStatChallenge | any): FlipStatChallenge { + const newChallenge = new FlipStatChallenge(); + newChallenge.value = source.value; + newChallenge.severity = source.severity; + return newChallenge; + } +} + /** * Lowers the amount of starter points available. */ @@ -886,6 +920,9 @@ export function applyChallenges(gameMode: GameMode, challengeType: ChallengeType * @returns True if any challenge was successfully applied. */ export function applyChallenges(gameMode: GameMode, challengeType: ChallengeType.MOVE_WEIGHT, pokemon: Pokemon, moveSource: MoveSourceType, move: Moves, weight: Utils.IntegerHolder): boolean; + +export function applyChallenges(gameMode: GameMode, challengeType: ChallengeType.FLIP_STAT, pokemon: Pokemon, baseStats: number[]): boolean; + export function applyChallenges(gameMode: GameMode, challengeType: ChallengeType, ...args: any[]): boolean { let ret = false; gameMode.challenges.forEach(c => { @@ -955,6 +992,9 @@ export function copyChallenge(source: Challenge | any): Challenge { return FreshStartChallenge.loadChallenge(source); case Challenges.INVERSE_BATTLE: return InverseBattleChallenge.loadChallenge(source); + case Challenges.FLIP_STAT: + return FlipStatChallenge.loadChallenge(source); + } throw new Error("Unknown challenge copied"); } @@ -967,5 +1007,6 @@ export function initChallenges() { new SingleTypeChallenge(), new FreshStartChallenge(), new InverseBattleChallenge(), + new FlipStatChallenge() ); } diff --git a/src/enums/challenges.ts b/src/enums/challenges.ts index c4dc7460dfe1..7b506a61a2fa 100644 --- a/src/enums/challenges.ts +++ b/src/enums/challenges.ts @@ -5,4 +5,5 @@ export enum Challenges { LOWER_STARTER_POINTS, FRESH_START, INVERSE_BATTLE, + FLIP_STAT, } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 30856ab416a6..647d6668ad50 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1044,6 +1044,18 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { calculateBaseStats(): number[] { const baseStats = this.getSpeciesForm(true).baseStats.slice(0); + const origStats = this.getSpeciesForm(true).baseStats.slice(0); + if (this.scene.gameMode.isFlipStatChallenge()) { + baseStats[0] = origStats[5]; + baseStats[1] = origStats[4]; + baseStats[2] = origStats[3]; + baseStats[3] = origStats[2]; + baseStats[4] = origStats[1]; + baseStats[5] = origStats[0]; + console.log("In FLIP STAT"); + } + console.log(JSON.stringify(baseStats) + " BLARG"); + console.log(JSON.stringify(origStats) + " BLARG2"); // Shuckle Juice this.scene.applyModifiers(PokemonBaseStatTotalModifier, this.isPlayer(), this, baseStats); // Old Gateau diff --git a/src/game-mode.ts b/src/game-mode.ts index 3f12c5b056ed..2d60b3276688 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -81,6 +81,11 @@ export class GameMode implements GameModeConfig { return this.hasChallenge(Challenges.FRESH_START); } + isFlipStatChallenge(): boolean { + return this.hasChallenge(Challenges.FLIP_STAT); + } + + /** * @returns either: * - override from overrides.ts From 464c931acf19b3ed01945303d452d07d16503d86 Mon Sep 17 00:00:00 2001 From: Scooom Date: Sun, 5 Jan 2025 07:47:30 -0600 Subject: [PATCH 02/22] Add Achivement --- src/system/achv.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/system/achv.ts b/src/system/achv.ts index a98e396264d0..1c02a354a5c4 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -279,6 +279,8 @@ export function getAchievementDescription(localizationKey: string): string { return i18next.t("achv:FRESH_START.description", { context: genderStr }); case "INVERSE_BATTLE": return i18next.t("achv:INVERSE_BATTLE.description", { context: genderStr }); + case "FLIP_STATS": + return i18next.t("achv:FLIP_STATS.description", { context: genderStr }); case "BREEDERS_IN_SPACE": return i18next.t("achv:BREEDERS_IN_SPACE.description", { context: genderStr }); default: @@ -358,6 +360,7 @@ export const achvs = { MONO_FAIRY: new ChallengeAchv("MONO_FAIRY", "", "MONO_FAIRY.description", "fairy_feather", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 18 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), FRESH_START: new ChallengeAchv("FRESH_START", "", "FRESH_START.description", "reviver_seed", 100, (c, scene) => c instanceof FreshStartChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), INVERSE_BATTLE: new ChallengeAchv("INVERSE_BATTLE", "", "INVERSE_BATTLE.description", "inverse", 100, c => c instanceof InverseBattleChallenge && c.value > 0), + FLIP_STATS: new ChallengeAchv("FLIP_STATS", "", "FLIP_STATS.description", "flipstat", 100, c => c instanceof FlipStatChallenge && c.value > 0), BREEDERS_IN_SPACE: new Achv("BREEDERS_IN_SPACE", "", "BREEDERS_IN_SPACE.description", "moon_stone", 50).setSecret(), }; From 757a26ff3384cdf6bbbcd120712b6ea2d7eb9bdf Mon Sep 17 00:00:00 2001 From: Scooom Date: Sun, 5 Jan 2025 07:56:54 -0600 Subject: [PATCH 03/22] Remove Debug Code --- src/field/pokemon.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 647d6668ad50..e277078e4238 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1052,10 +1052,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { baseStats[3] = origStats[2]; baseStats[4] = origStats[1]; baseStats[5] = origStats[0]; - console.log("In FLIP STAT"); } - console.log(JSON.stringify(baseStats) + " BLARG"); - console.log(JSON.stringify(origStats) + " BLARG2"); // Shuckle Juice this.scene.applyModifiers(PokemonBaseStatTotalModifier, this.isPlayer(), this, baseStats); // Old Gateau From c64c8532709fb98d2e27b2a59279c15d3cbf8c2c Mon Sep 17 00:00:00 2001 From: Scooom Date: Sun, 5 Jan 2025 08:38:08 -0600 Subject: [PATCH 04/22] Update challenge code to block other challenges. TODO: Helper function at some point --- src/system/achv.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/achv.ts b/src/system/achv.ts index 1c02a354a5c4..95f379cf8819 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -359,8 +359,8 @@ export const achvs = { MONO_DARK: new ChallengeAchv("MONO_DARK", "", "MONO_DARK.description", "black_glasses", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 17 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), MONO_FAIRY: new ChallengeAchv("MONO_FAIRY", "", "MONO_FAIRY.description", "fairy_feather", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 18 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), FRESH_START: new ChallengeAchv("FRESH_START", "", "FRESH_START.description", "reviver_seed", 100, (c, scene) => c instanceof FreshStartChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - INVERSE_BATTLE: new ChallengeAchv("INVERSE_BATTLE", "", "INVERSE_BATTLE.description", "inverse", 100, c => c instanceof InverseBattleChallenge && c.value > 0), - FLIP_STATS: new ChallengeAchv("FLIP_STATS", "", "FLIP_STATS.description", "flipstat", 100, c => c instanceof FlipStatChallenge && c.value > 0), + INVERSE_BATTLE: new ChallengeAchv("INVERSE_BATTLE", "", "INVERSE_BATTLE.description", "inverse", 100, (c, scene) => c instanceof InverseBattleChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + FLIP_STATS: new ChallengeAchv("FLIP_STATS", "", "FLIP_STATS.description", "flipstat", 100, (c, scene) => c instanceof FlipStatChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), BREEDERS_IN_SPACE: new Achv("BREEDERS_IN_SPACE", "", "BREEDERS_IN_SPACE.description", "moon_stone", 50).setSecret(), }; From c6e360eda2722d960d98cde94e7aad8dc17a68af Mon Sep 17 00:00:00 2001 From: Scooom Date: Sun, 5 Jan 2025 09:18:49 -0600 Subject: [PATCH 05/22] Add Achievment Image --- public/images/items/flipstat.png | Bin 0 -> 2384 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 public/images/items/flipstat.png diff --git a/public/images/items/flipstat.png b/public/images/items/flipstat.png new file mode 100644 index 0000000000000000000000000000000000000000..eb309038632582c6ad674d5a2815bc4cdb05dced GIT binary patch literal 2384 zcmV-W39t5vP)Px;3Q0skR9Hu~mw9wm)fL8n``kC=84Sn}35fyhGKew=l7N6|kg6?3Q38rfQ4v8V zu^@;jXu&E=#iA|+ho)7k5<&+kE&(S7BP1YGLbWmlFhCL#AV4#`_wG4e=e{5fwAkgM z=fC&vJ^OrT@9+EezM@3T(%%aM`f9`|G+>M{ZiYkA-mY%pR~!8zV)&7(prBxSzpU$@ z+p}8Jx;bd2!T5-xN$6w{QJCY~9GV2}(Pvgv3B$$-NgW>CG5@tUJKHB!rYd3Ex}r(> z>+e`jCJ>U}}oPh)AP{MwEq1Vumn$#F!I*T=-r>O-(f!UHxRG*U>xOPcZ1>I8a{? zl}8OrmJ6GT73IeuJ)_sD@Rn@_hH4l#R?<_z`KC)v1Fxd zGZ1Ii|GA#Dc0#}rjHRJ*5NQnPM{=-nS#9ZnzvLJag615? zUI;Wc>cm;Xb?HGSKNDfl;QLBE>KkJc($cQ3o^aPc7=O2Te(?XufF-t$3ZYJh_4!}U z>)HFd$=_?w=MR{Zn>B&6$ao=ces+veGaNc}dwRpPCua8c02CG$4jn%tGp}%|3+BR; z?`#0yRRrigEQv!0_r=_2`0(M|Z^?MSOZH7xuY#44YEZj{mhfUqIDun8STsbzN7okHqT2_;#Mv5GYs(FCa&ma(m6v&O&Qp{Y zhH>-{cjhlP2Dx=?fYL*y96x@XcJ11swWdY0AV)U3xCYj2ijwo;up;^Ai4y~plbSED z+7e^`n$2+I-PQ+U2ieA9Z_(#khqdp!81L`%fe^}$3CX>!pSa#$d$?Wg+Bod_T;WQD zf-OE~Ea+V<8#Zjb^RWqibJu(j@xt1sd3h$3R%$QXwlF>iO1^Nov_%B5u_Oi|5>`Zv zAwGb|bc@-#oif6}QHmA$8YOr&x0^m$d=Xh)>pY&7S2<)1Zi$Q=JEpu#o3|1l914y# zU~dEb?oWnK)(P!X9iANT(k$emIkUt^hknA|a>Le-gifg@=AK5dMvANWc)gIb#HINq z@YFa(QlgGY+!%~j#C29kvu25A?`OxU4@Y<>*T;9|aLY}a8~es?W9%T|WzfWQ-H?8p zDchVYk0{!-va^n$B;p0OIIRr9_54J%P<9*^<{1tgcDU_EP5(Zcta}2s9gCSZ)(@{; z$_S?gh{GXjcqmjt{%4v{DB|5(8$Tzig{I9So=<3r8B}SNpOogVmpQS6hA|wgb!ZwN z_2xa%4l`fZ_}*&GNT($M7j`@KObqSgk;fv)MHf5f`TAsrI*B-TR5TEAgn-rzNZCo@ zhjlSBibJ2FiiLAsE^BS5Jf;{nQL+C(Jg@%dBscT{p9|CH`Wbt#A?@;rm$_}b1ALWz z8Mms7y{XGpf{zHU4$(7yE8-V12jZ^f?7`O#CU1wUd35VO&%tatL@QRT7pBi_OIBKY z26yU1&<{lwr4;Pl&HiXUOWrgz5BYF?VK4Oq?}I-SU5nCDj8~S1kxav{-0u*dD6=te z6>Xg0Szd2gqpRt=x|BATMA4!>g=ixTxGjwZLq^du6oeWXZz(u+jxcp`CmbA<5?t*Pa2>W%%Ru)V zq@tptTXItCE$^$2ba52TRKVN(jgGMDfgL>ii0x!>dTO^^nEHY+HT7jeP5{?4EMfHG z`Q+vm#X4uhJZT4z+FFO(dM5Cmq{cd=G3<)g@+5~z9rBCVM6`VQ^0`9>4SMt;CyA~S zVx_7gZA1;vOms1-@qA$8pR941F*b{5etD<&rBhdDn6_;K?>?^(CvuKa92!3l)`$QI8pXaaWqHJBsZmpH=UfRZ>!N%{AS6 zZ0*?gB=cqoO@k2cdzC%hhB~LS8)KXo=FI+j#;<3mUEkU8#AH8h62gcd5)y=j zCJ+o-JB^Xee!>}Slk(vjO-&6Pt2WfuL9G#1d@9U+TWHg^gZXsTs%|MMDck@3(*Jd| zFveUwfBx&6X3m(^AzEKaW`@JadB~zaJb&v=(j2qLo{MD zVcGAHlH8UXewuaSfid^b>y^>_CHs~9pAJ6#-@gD^{^kkXcq{Ax0000 Date: Sun, 5 Jan 2025 12:36:24 -0600 Subject: [PATCH 06/22] Fix Ribbon not being granted --- src/system/achv.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/achv.ts b/src/system/achv.ts index 95f379cf8819..ba2312458ba4 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -5,7 +5,7 @@ import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; import i18next from "i18next"; import * as Utils from "../utils"; import { PlayerGender } from "#enums/player-gender"; -import { Challenge, FreshStartChallenge, SingleGenerationChallenge, SingleTypeChallenge, InverseBattleChallenge } from "#app/data/challenge"; +import { Challenge, FlipStatChallenge, FreshStartChallenge, SingleGenerationChallenge, SingleTypeChallenge, InverseBattleChallenge } from "#app/data/challenge"; import { ConditionFn } from "#app/@types/common"; import { Stat, getShortenedStatKey } from "#app/enums/stat"; import { Challenges } from "#app/enums/challenges"; From 1734854bd86a73a49470bcb59e967a325d54d7d1 Mon Sep 17 00:00:00 2001 From: Scooom <97370685+Scoooom@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:53:56 -0600 Subject: [PATCH 07/22] Update src/game-mode.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/game-mode.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/game-mode.ts b/src/game-mode.ts index 2d60b3276688..70fe25ab10c6 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -85,7 +85,6 @@ export class GameMode implements GameModeConfig { return this.hasChallenge(Challenges.FLIP_STAT); } - /** * @returns either: * - override from overrides.ts From fae46ecc488e1a2b2c7b2095bbefc44d68da01f2 Mon Sep 17 00:00:00 2001 From: Scooom <97370685+Scoooom@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:54:23 -0600 Subject: [PATCH 08/22] Update src/data/challenge.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/data/challenge.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index fc0d5900827d..5086e897b3bd 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -714,18 +714,6 @@ export class FlipStatChallenge extends Challenge { super(Challenges.FLIP_STAT, 1); } - applyStarterChoice(pokemon: PokemonSpecies, valid: Utils.BooleanHolder): boolean { - return true; - } - - applyStarterCost(species: Species, cost: Utils.NumberHolder): boolean { - return true; - } - - - override getDifficulty(): number { - return 0; - } static loadChallenge(source: FlipStatChallenge | any): FlipStatChallenge { const newChallenge = new FlipStatChallenge(); From 824bca73eb82d4011ae9563d7c81230637626728 Mon Sep 17 00:00:00 2001 From: Scooom <97370685+Scoooom@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:55:22 -0600 Subject: [PATCH 09/22] Update src/data/challenge.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/data/challenge.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 5086e897b3bd..49a6fe7a3ab1 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -17,7 +17,6 @@ import { TypeColor, TypeShadow } from "#enums/color"; import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; import { pokemonFormChanges } from "#app/data/pokemon-forms"; - /** A constant for the default max cost of the starting party before a run */ const DEFAULT_PARTY_MAX_COST = 10; From 5422dd7a7c4ccf77bdda2c67e58fd52d3151735a Mon Sep 17 00:00:00 2001 From: Scooom <97370685+Scoooom@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:55:47 -0600 Subject: [PATCH 10/22] Update src/data/challenge.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/data/challenge.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 49a6fe7a3ab1..726a04d4185c 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -701,10 +701,6 @@ export class InverseBattleChallenge extends Challenge { } } -/** - * Begin Scoom Code - */ - /** * Implements a fresh start challenge. */ From e9faa149c856929c37c33bc067f5ba09e2cb018e Mon Sep 17 00:00:00 2001 From: Scooom <97370685+Scoooom@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:56:16 -0600 Subject: [PATCH 11/22] Update src/data/challenge.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/data/challenge.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 726a04d4185c..ead0f75a3d32 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -977,7 +977,6 @@ export function copyChallenge(source: Challenge | any): Challenge { return InverseBattleChallenge.loadChallenge(source); case Challenges.FLIP_STAT: return FlipStatChallenge.loadChallenge(source); - } throw new Error("Unknown challenge copied"); } From 927b465695d30a56affb2a9c382d9cf417cd0dd8 Mon Sep 17 00:00:00 2001 From: Scooom Date: Mon, 6 Jan 2025 17:58:12 -0600 Subject: [PATCH 12/22] Add FLIP_STAT to enum ChallengeType --- src/data/challenge.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index ead0f75a3d32..41cacb82f8a1 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -84,6 +84,11 @@ export enum ChallengeType { * Modifies what weight AI pokemon have when generating movesets. UNIMPLEMENTED. */ MOVE_WEIGHT, + /** + * Modifies what the pokemon stats for Flip Stat Mode. + */ + FLIP_STAT, + } /** From c67c992a01e345e9c6ff0b91a19b8f95982f9bb6 Mon Sep 17 00:00:00 2001 From: Scooom Date: Mon, 6 Jan 2025 18:00:15 -0600 Subject: [PATCH 13/22] Fix comment for FlipStatChallenge --- src/data/challenge.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 41cacb82f8a1..c3a427fb0198 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -707,7 +707,7 @@ export class InverseBattleChallenge extends Challenge { } /** - * Implements a fresh start challenge. + * Implements a flip stat challenge. */ export class FlipStatChallenge extends Challenge { constructor() { From 6d36ccf2355b14b03e7b30248ed4b6a7690706e0 Mon Sep 17 00:00:00 2001 From: Scooom <97370685+Scoooom@users.noreply.github.com> Date: Mon, 6 Jan 2025 18:01:37 -0600 Subject: [PATCH 14/22] Update src/field/pokemon.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/field/pokemon.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index e277078e4238..e32f1c881752 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1044,15 +1044,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { calculateBaseStats(): number[] { const baseStats = this.getSpeciesForm(true).baseStats.slice(0); - const origStats = this.getSpeciesForm(true).baseStats.slice(0); - if (this.scene.gameMode.isFlipStatChallenge()) { - baseStats[0] = origStats[5]; - baseStats[1] = origStats[4]; - baseStats[2] = origStats[3]; - baseStats[3] = origStats[2]; - baseStats[4] = origStats[1]; - baseStats[5] = origStats[0]; - } + applyChallenges(this.scene.gameMode, ChallengeType.FLIP_STAT, this, baseStats); // Shuckle Juice this.scene.applyModifiers(PokemonBaseStatTotalModifier, this.isPlayer(), this, baseStats); // Old Gateau From 6af29300f539534cb1fe6c6031f40202c480be61 Mon Sep 17 00:00:00 2001 From: Scooom Date: Mon, 6 Jan 2025 18:06:25 -0600 Subject: [PATCH 15/22] Add applyFlipStat override to Challenge Class, and add override inside of FlipStatsChallenge --- src/data/challenge.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index c3a427fb0198..f43ea846c1a6 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -406,6 +406,16 @@ export abstract class Challenge { applyMoveWeight(pokemon: Pokemon, moveSource: MoveSourceType, move: Moves, level: Utils.IntegerHolder): boolean { return false; } + + /** + * An apply function for FlipStats. Derived classes should alter this. + * @param pokemon {@link Pokemon} What pokemon would learn the move. + * @param baseStats What are the stats to flip. + * @returns {@link boolean} Whether this function did anything. + */ + applyFlipStat(pokemon: Pokemon, baseStats: number[]) { + return false; + } } type ChallengeCondition = (data: GameData) => boolean; @@ -714,6 +724,16 @@ export class FlipStatChallenge extends Challenge { super(Challenges.FLIP_STAT, 1); } + override applyFlipStat(pokemon: Pokemon, baseStats: number[]) { + const origStats = Utils.deepCopy(baseStats); + baseStats[0] = origStats[5]; + baseStats[1] = origStats[4]; + baseStats[2] = origStats[3]; + baseStats[3] = origStats[2]; + baseStats[4] = origStats[1]; + baseStats[5] = origStats[0]; + return true; + } static loadChallenge(source: FlipStatChallenge | any): FlipStatChallenge { const newChallenge = new FlipStatChallenge(); From d71c7996d56794c235aeae1d7e3af7d78bafc417 Mon Sep 17 00:00:00 2001 From: Scooom <97370685+Scoooom@users.noreply.github.com> Date: Mon, 6 Jan 2025 18:09:39 -0600 Subject: [PATCH 16/22] Update src/game-mode.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/game-mode.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/game-mode.ts b/src/game-mode.ts index 70fe25ab10c6..3f12c5b056ed 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -81,10 +81,6 @@ export class GameMode implements GameModeConfig { return this.hasChallenge(Challenges.FRESH_START); } - isFlipStatChallenge(): boolean { - return this.hasChallenge(Challenges.FLIP_STAT); - } - /** * @returns either: * - override from overrides.ts From 172a8901e0b1b68af18d713b7bc64f05cf027b88 Mon Sep 17 00:00:00 2001 From: Scooom Date: Mon, 6 Jan 2025 18:16:13 -0600 Subject: [PATCH 17/22] Add ChallengeType.FLIP_STAT case to export function applyChallenges (Master Switch Function) --- src/data/challenge.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index f43ea846c1a6..3635cdbefad6 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -975,6 +975,9 @@ export function applyChallenges(gameMode: GameMode, challengeType: ChallengeType case ChallengeType.MOVE_WEIGHT: ret ||= c.applyMoveWeight(args[0], args[1], args[2], args[3]); break; + case ChallengeType.FLIP_STAT: + ret ||= c.applyFlipStat(args[0], args[1]); + break; } } }); From 834371951df181c6c70425ee8f54b6c32625cf89 Mon Sep 17 00:00:00 2001 From: Scooom Date: Mon, 6 Jan 2025 18:57:11 -0600 Subject: [PATCH 18/22] Properly block other challange achviements --- src/system/achv.ts | 58 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/system/achv.ts b/src/system/achv.ts index ba2312458ba4..5b9a89015dad 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -331,36 +331,36 @@ export const achvs = { PERFECT_IVS: new Achv("PERFECT_IVS", "", "PERFECT_IVS.description", "blunder_policy", 100), CLASSIC_VICTORY: new Achv("CLASSIC_VICTORY", "", "CLASSIC_VICTORY.description", "relic_crown", 150, c => c.gameData.gameStats.sessionsWon === 0), UNEVOLVED_CLASSIC_VICTORY: new Achv("UNEVOLVED_CLASSIC_VICTORY", "", "UNEVOLVED_CLASSIC_VICTORY.description", "eviolite", 175, c => c.getPlayerParty().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, scene) => c instanceof SingleGenerationChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_GEN_TWO_VICTORY: new ChallengeAchv("MONO_GEN_TWO", "", "MONO_GEN_TWO.description", "ribbon_gen2", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_GEN_THREE_VICTORY: new ChallengeAchv("MONO_GEN_THREE", "", "MONO_GEN_THREE.description", "ribbon_gen3", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 3 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_GEN_FOUR_VICTORY: new ChallengeAchv("MONO_GEN_FOUR", "", "MONO_GEN_FOUR.description", "ribbon_gen4", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 4 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_GEN_FIVE_VICTORY: new ChallengeAchv("MONO_GEN_FIVE", "", "MONO_GEN_FIVE.description", "ribbon_gen5", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 5 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_GEN_SIX_VICTORY: new ChallengeAchv("MONO_GEN_SIX", "", "MONO_GEN_SIX.description", "ribbon_gen6", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 6 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_GEN_SEVEN_VICTORY: new ChallengeAchv("MONO_GEN_SEVEN", "", "MONO_GEN_SEVEN.description", "ribbon_gen7", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 7 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_GEN_EIGHT_VICTORY: new ChallengeAchv("MONO_GEN_EIGHT", "", "MONO_GEN_EIGHT.description", "ribbon_gen8", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 8 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_GEN_NINE_VICTORY: new ChallengeAchv("MONO_GEN_NINE", "", "MONO_GEN_NINE.description", "ribbon_gen9", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 9 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_NORMAL: new ChallengeAchv("MONO_NORMAL", "", "MONO_NORMAL.description", "silk_scarf", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_FIGHTING: new ChallengeAchv("MONO_FIGHTING", "", "MONO_FIGHTING.description", "black_belt", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_FLYING: new ChallengeAchv("MONO_FLYING", "", "MONO_FLYING.description", "sharp_beak", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 3 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_POISON: new ChallengeAchv("MONO_POISON", "", "MONO_POISON.description", "poison_barb", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 4 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_GROUND: new ChallengeAchv("MONO_GROUND", "", "MONO_GROUND.description", "soft_sand", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 5 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_ROCK: new ChallengeAchv("MONO_ROCK", "", "MONO_ROCK.description", "hard_stone", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 6 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_BUG: new ChallengeAchv("MONO_BUG", "", "MONO_BUG.description", "silver_powder", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 7 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_GHOST: new ChallengeAchv("MONO_GHOST", "", "MONO_GHOST.description", "spell_tag", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 8 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_STEEL: new ChallengeAchv("MONO_STEEL", "", "MONO_STEEL.description", "metal_coat", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 9 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_FIRE: new ChallengeAchv("MONO_FIRE", "", "MONO_FIRE.description", "charcoal", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 10 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_WATER: new ChallengeAchv("MONO_WATER", "", "MONO_WATER.description", "mystic_water", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 11 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_GRASS: new ChallengeAchv("MONO_GRASS", "", "MONO_GRASS.description", "miracle_seed", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 12 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_ELECTRIC: new ChallengeAchv("MONO_ELECTRIC", "", "MONO_ELECTRIC.description", "magnet", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 13 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_PSYCHIC: new ChallengeAchv("MONO_PSYCHIC", "", "MONO_PSYCHIC.description", "twisted_spoon", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 14 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_ICE: new ChallengeAchv("MONO_ICE", "", "MONO_ICE.description", "never_melt_ice", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 15 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_DRAGON: new ChallengeAchv("MONO_DRAGON", "", "MONO_DRAGON.description", "dragon_fang", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 16 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_DARK: new ChallengeAchv("MONO_DARK", "", "MONO_DARK.description", "black_glasses", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 17 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - MONO_FAIRY: new ChallengeAchv("MONO_FAIRY", "", "MONO_FAIRY.description", "fairy_feather", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 18 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), - FRESH_START: new ChallengeAchv("FRESH_START", "", "FRESH_START.description", "reviver_seed", 100, (c, scene) => c instanceof FreshStartChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), + MONO_GEN_ONE_VICTORY: new ChallengeAchv("MONO_GEN_ONE", "", "MONO_GEN_ONE.description", "ribbon_gen1", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GEN_TWO_VICTORY: new ChallengeAchv("MONO_GEN_TWO", "", "MONO_GEN_TWO.description", "ribbon_gen2", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GEN_THREE_VICTORY: new ChallengeAchv("MONO_GEN_THREE", "", "MONO_GEN_THREE.description", "ribbon_gen3", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 3 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GEN_FOUR_VICTORY: new ChallengeAchv("MONO_GEN_FOUR", "", "MONO_GEN_FOUR.description", "ribbon_gen4", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 4 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GEN_FIVE_VICTORY: new ChallengeAchv("MONO_GEN_FIVE", "", "MONO_GEN_FIVE.description", "ribbon_gen5", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 5 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GEN_SIX_VICTORY: new ChallengeAchv("MONO_GEN_SIX", "", "MONO_GEN_SIX.description", "ribbon_gen6", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 6 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GEN_SEVEN_VICTORY: new ChallengeAchv("MONO_GEN_SEVEN", "", "MONO_GEN_SEVEN.description", "ribbon_gen7", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 7 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GEN_EIGHT_VICTORY: new ChallengeAchv("MONO_GEN_EIGHT", "", "MONO_GEN_EIGHT.description", "ribbon_gen8", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 8 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GEN_NINE_VICTORY: new ChallengeAchv("MONO_GEN_NINE", "", "MONO_GEN_NINE.description", "ribbon_gen9", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 9 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_NORMAL: new ChallengeAchv("MONO_NORMAL", "", "MONO_NORMAL.description", "silk_scarf", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_FIGHTING: new ChallengeAchv("MONO_FIGHTING", "", "MONO_FIGHTING.description", "black_belt", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_FLYING: new ChallengeAchv("MONO_FLYING", "", "MONO_FLYING.description", "sharp_beak", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 3 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_POISON: new ChallengeAchv("MONO_POISON", "", "MONO_POISON.description", "poison_barb", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 4 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GROUND: new ChallengeAchv("MONO_GROUND", "", "MONO_GROUND.description", "soft_sand", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 5 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_ROCK: new ChallengeAchv("MONO_ROCK", "", "MONO_ROCK.description", "hard_stone", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 6 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_BUG: new ChallengeAchv("MONO_BUG", "", "MONO_BUG.description", "silver_powder", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 7 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GHOST: new ChallengeAchv("MONO_GHOST", "", "MONO_GHOST.description", "spell_tag", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 8 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_STEEL: new ChallengeAchv("MONO_STEEL", "", "MONO_STEEL.description", "metal_coat", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 9 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_FIRE: new ChallengeAchv("MONO_FIRE", "", "MONO_FIRE.description", "charcoal", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 10 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_WATER: new ChallengeAchv("MONO_WATER", "", "MONO_WATER.description", "mystic_water", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 11 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GRASS: new ChallengeAchv("MONO_GRASS", "", "MONO_GRASS.description", "miracle_seed", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 12 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_ELECTRIC: new ChallengeAchv("MONO_ELECTRIC", "", "MONO_ELECTRIC.description", "magnet", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 13 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_PSYCHIC: new ChallengeAchv("MONO_PSYCHIC", "", "MONO_PSYCHIC.description", "twisted_spoon", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 14 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_ICE: new ChallengeAchv("MONO_ICE", "", "MONO_ICE.description", "never_melt_ice", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 15 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_DRAGON: new ChallengeAchv("MONO_DRAGON", "", "MONO_DRAGON.description", "dragon_fang", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 16 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_DARK: new ChallengeAchv("MONO_DARK", "", "MONO_DARK.description", "black_glasses", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 17 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_FAIRY: new ChallengeAchv("MONO_FAIRY", "", "MONO_FAIRY.description", "fairy_feather", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 18 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + FRESH_START: new ChallengeAchv("FRESH_START", "", "FRESH_START.description", "reviver_seed", 100, (c, scene) => c instanceof FreshStartChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), INVERSE_BATTLE: new ChallengeAchv("INVERSE_BATTLE", "", "INVERSE_BATTLE.description", "inverse", 100, (c, scene) => c instanceof InverseBattleChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - FLIP_STATS: new ChallengeAchv("FLIP_STATS", "", "FLIP_STATS.description", "flipstat", 100, (c, scene) => c instanceof FlipStatChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), + FLIP_STATS: new ChallengeAchv("FLIP_STATS", "", "FLIP_STATS.description", "flipstat", 100, (c, scene) => c instanceof FlipStatChallenge && c.value > 0), BREEDERS_IN_SPACE: new Achv("BREEDERS_IN_SPACE", "", "BREEDERS_IN_SPACE.description", "moon_stone", 50).setSecret(), }; From c7dcaf1ee470166b5195cd8cac3de5d97e9f3e5f Mon Sep 17 00:00:00 2001 From: Scooom Date: Mon, 6 Jan 2025 20:45:50 -0600 Subject: [PATCH 19/22] Change the way achivements are blocked by challenge modes to a more flexible method --- src/system/achv.ts | 57 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/src/system/achv.ts b/src/system/achv.ts index 5b9a89015dad..d23c719a57a2 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -289,6 +289,7 @@ export function getAchievementDescription(localizationKey: string): string { } + export const achvs = { _10K_MONEY: new MoneyAchv("10K_MONEY", "", 10000, "nugget", 10), _100K_MONEY: new MoneyAchv("100K_MONEY", "", 100000, "big_nugget", 25).setSecret(true), @@ -331,35 +332,35 @@ export const achvs = { PERFECT_IVS: new Achv("PERFECT_IVS", "", "PERFECT_IVS.description", "blunder_policy", 100), CLASSIC_VICTORY: new Achv("CLASSIC_VICTORY", "", "CLASSIC_VICTORY.description", "relic_crown", 150, c => c.gameData.gameStats.sessionsWon === 0), UNEVOLVED_CLASSIC_VICTORY: new Achv("UNEVOLVED_CLASSIC_VICTORY", "", "UNEVOLVED_CLASSIC_VICTORY.description", "eviolite", 175, c => c.getPlayerParty().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, scene) => c instanceof SingleGenerationChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_GEN_TWO_VICTORY: new ChallengeAchv("MONO_GEN_TWO", "", "MONO_GEN_TWO.description", "ribbon_gen2", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_GEN_THREE_VICTORY: new ChallengeAchv("MONO_GEN_THREE", "", "MONO_GEN_THREE.description", "ribbon_gen3", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 3 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_GEN_FOUR_VICTORY: new ChallengeAchv("MONO_GEN_FOUR", "", "MONO_GEN_FOUR.description", "ribbon_gen4", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 4 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_GEN_FIVE_VICTORY: new ChallengeAchv("MONO_GEN_FIVE", "", "MONO_GEN_FIVE.description", "ribbon_gen5", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 5 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_GEN_SIX_VICTORY: new ChallengeAchv("MONO_GEN_SIX", "", "MONO_GEN_SIX.description", "ribbon_gen6", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 6 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_GEN_SEVEN_VICTORY: new ChallengeAchv("MONO_GEN_SEVEN", "", "MONO_GEN_SEVEN.description", "ribbon_gen7", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 7 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_GEN_EIGHT_VICTORY: new ChallengeAchv("MONO_GEN_EIGHT", "", "MONO_GEN_EIGHT.description", "ribbon_gen8", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 8 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_GEN_NINE_VICTORY: new ChallengeAchv("MONO_GEN_NINE", "", "MONO_GEN_NINE.description", "ribbon_gen9", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 9 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_NORMAL: new ChallengeAchv("MONO_NORMAL", "", "MONO_NORMAL.description", "silk_scarf", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_FIGHTING: new ChallengeAchv("MONO_FIGHTING", "", "MONO_FIGHTING.description", "black_belt", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_FLYING: new ChallengeAchv("MONO_FLYING", "", "MONO_FLYING.description", "sharp_beak", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 3 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_POISON: new ChallengeAchv("MONO_POISON", "", "MONO_POISON.description", "poison_barb", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 4 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_GROUND: new ChallengeAchv("MONO_GROUND", "", "MONO_GROUND.description", "soft_sand", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 5 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_ROCK: new ChallengeAchv("MONO_ROCK", "", "MONO_ROCK.description", "hard_stone", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 6 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_BUG: new ChallengeAchv("MONO_BUG", "", "MONO_BUG.description", "silver_powder", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 7 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_GHOST: new ChallengeAchv("MONO_GHOST", "", "MONO_GHOST.description", "spell_tag", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 8 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_STEEL: new ChallengeAchv("MONO_STEEL", "", "MONO_STEEL.description", "metal_coat", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 9 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_FIRE: new ChallengeAchv("MONO_FIRE", "", "MONO_FIRE.description", "charcoal", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 10 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_WATER: new ChallengeAchv("MONO_WATER", "", "MONO_WATER.description", "mystic_water", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 11 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_GRASS: new ChallengeAchv("MONO_GRASS", "", "MONO_GRASS.description", "miracle_seed", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 12 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_ELECTRIC: new ChallengeAchv("MONO_ELECTRIC", "", "MONO_ELECTRIC.description", "magnet", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 13 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_PSYCHIC: new ChallengeAchv("MONO_PSYCHIC", "", "MONO_PSYCHIC.description", "twisted_spoon", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 14 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_ICE: new ChallengeAchv("MONO_ICE", "", "MONO_ICE.description", "never_melt_ice", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 15 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_DRAGON: new ChallengeAchv("MONO_DRAGON", "", "MONO_DRAGON.description", "dragon_fang", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 16 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_DARK: new ChallengeAchv("MONO_DARK", "", "MONO_DARK.description", "black_glasses", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 17 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - MONO_FAIRY: new ChallengeAchv("MONO_FAIRY", "", "MONO_FAIRY.description", "fairy_feather", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 18 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + MONO_GEN_ONE_VICTORY: new ChallengeAchv("MONO_GEN_ONE", "", "MONO_GEN_ONE.description", "ribbon_gen1", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_GEN_TWO_VICTORY: new ChallengeAchv("MONO_GEN_TWO", "", "MONO_GEN_TWO.description", "ribbon_gen2", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_GEN_THREE_VICTORY: new ChallengeAchv("MONO_GEN_THREE", "", "MONO_GEN_THREE.description", "ribbon_gen3", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 3 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_GEN_FOUR_VICTORY: new ChallengeAchv("MONO_GEN_FOUR", "", "MONO_GEN_FOUR.description", "ribbon_gen4", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 4 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_GEN_FIVE_VICTORY: new ChallengeAchv("MONO_GEN_FIVE", "", "MONO_GEN_FIVE.description", "ribbon_gen5", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 5 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_GEN_SIX_VICTORY: new ChallengeAchv("MONO_GEN_SIX", "", "MONO_GEN_SIX.description", "ribbon_gen6", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 6 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_GEN_SEVEN_VICTORY: new ChallengeAchv("MONO_GEN_SEVEN", "", "MONO_GEN_SEVEN.description", "ribbon_gen7", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 7 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_GEN_EIGHT_VICTORY: new ChallengeAchv("MONO_GEN_EIGHT", "", "MONO_GEN_EIGHT.description", "ribbon_gen8", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 8 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_GEN_NINE_VICTORY: new ChallengeAchv("MONO_GEN_NINE", "", "MONO_GEN_NINE.description", "ribbon_gen9", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 9 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_NORMAL: new ChallengeAchv("MONO_NORMAL", "", "MONO_NORMAL.description", "silk_scarf", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_FIGHTING: new ChallengeAchv("MONO_FIGHTING", "", "MONO_FIGHTING.description", "black_belt", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_FLYING: new ChallengeAchv("MONO_FLYING", "", "MONO_FLYING.description", "sharp_beak", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 3 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_POISON: new ChallengeAchv("MONO_POISON", "", "MONO_POISON.description", "poison_barb", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 4 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_GROUND: new ChallengeAchv("MONO_GROUND", "", "MONO_GROUND.description", "soft_sand", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 5 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_ROCK: new ChallengeAchv("MONO_ROCK", "", "MONO_ROCK.description", "hard_stone", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 6 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_BUG: new ChallengeAchv("MONO_BUG", "", "MONO_BUG.description", "silver_powder", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 7 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_GHOST: new ChallengeAchv("MONO_GHOST", "", "MONO_GHOST.description", "spell_tag", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 8 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_STEEL: new ChallengeAchv("MONO_STEEL", "", "MONO_STEEL.description", "metal_coat", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 9 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_FIRE: new ChallengeAchv("MONO_FIRE", "", "MONO_FIRE.description", "charcoal", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 10 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_WATER: new ChallengeAchv("MONO_WATER", "", "MONO_WATER.description", "mystic_water", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 11 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_GRASS: new ChallengeAchv("MONO_GRASS", "", "MONO_GRASS.description", "miracle_seed", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 12 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_ELECTRIC: new ChallengeAchv("MONO_ELECTRIC", "", "MONO_ELECTRIC.description", "magnet", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 13 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_PSYCHIC: new ChallengeAchv("MONO_PSYCHIC", "", "MONO_PSYCHIC.description", "twisted_spoon", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 14 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_ICE: new ChallengeAchv("MONO_ICE", "", "MONO_ICE.description", "never_melt_ice", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 15 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_DRAGON: new ChallengeAchv("MONO_DRAGON", "", "MONO_DRAGON.description", "dragon_fang", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 16 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_DARK: new ChallengeAchv("MONO_DARK", "", "MONO_DARK.description", "black_glasses", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 17 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + MONO_FAIRY: new ChallengeAchv("MONO_FAIRY", "", "MONO_FAIRY.description", "fairy_feather", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 18 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), FRESH_START: new ChallengeAchv("FRESH_START", "", "FRESH_START.description", "reviver_seed", 100, (c, scene) => c instanceof FreshStartChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), - INVERSE_BATTLE: new ChallengeAchv("INVERSE_BATTLE", "", "INVERSE_BATTLE.description", "inverse", 100, (c, scene) => c instanceof InverseBattleChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + INVERSE_BATTLE: new ChallengeAchv("INVERSE_BATTLE", "", "INVERSE_BATTLE.description", "inverse", 100, (c, scene) => c instanceof InverseBattleChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => [ Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), FLIP_STATS: new ChallengeAchv("FLIP_STATS", "", "FLIP_STATS.description", "flipstat", 100, (c, scene) => c instanceof FlipStatChallenge && c.value > 0), BREEDERS_IN_SPACE: new Achv("BREEDERS_IN_SPACE", "", "BREEDERS_IN_SPACE.description", "moon_stone", 50).setSecret(), }; From 20f750adc8e0a4914bc79c05a847d4084d149df5 Mon Sep 17 00:00:00 2001 From: Scooom <97370685+Scoooom@users.noreply.github.com> Date: Mon, 6 Jan 2025 20:56:38 -0600 Subject: [PATCH 20/22] Update src/system/achv.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/system/achv.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/achv.ts b/src/system/achv.ts index d23c719a57a2..58d53fd2c173 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -359,7 +359,7 @@ export const achvs = { MONO_DRAGON: new ChallengeAchv("MONO_DRAGON", "", "MONO_DRAGON.description", "dragon_fang", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 16 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), MONO_DARK: new ChallengeAchv("MONO_DARK", "", "MONO_DARK.description", "black_glasses", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 17 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), MONO_FAIRY: new ChallengeAchv("MONO_FAIRY", "", "MONO_FAIRY.description", "fairy_feather", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 18 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), - FRESH_START: new ChallengeAchv("FRESH_START", "", "FRESH_START.description", "reviver_seed", 100, (c, scene) => c instanceof FreshStartChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0) && !scene.gameMode.challenges.some(c => c.id === Challenges.FLIP_STAT && c.value > 0)), + FRESH_START: new ChallengeAchv("FRESH_START", "", "FRESH_START.description", "reviver_seed", 100, (c, scene) => c instanceof FreshStartChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), INVERSE_BATTLE: new ChallengeAchv("INVERSE_BATTLE", "", "INVERSE_BATTLE.description", "inverse", 100, (c, scene) => c instanceof InverseBattleChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => [ Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), FLIP_STATS: new ChallengeAchv("FLIP_STATS", "", "FLIP_STATS.description", "flipstat", 100, (c, scene) => c instanceof FlipStatChallenge && c.value > 0), BREEDERS_IN_SPACE: new Achv("BREEDERS_IN_SPACE", "", "BREEDERS_IN_SPACE.description", "moon_stone", 50).setSecret(), From d1cb43386a87197397e778528d83514f836e511b Mon Sep 17 00:00:00 2001 From: Scooom Date: Wed, 8 Jan 2025 19:06:38 -0600 Subject: [PATCH 21/22] Adjust the image for Flip Stat, and add an additional achivement for completing both Flip and Inverse --- src/system/achv.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/system/achv.ts b/src/system/achv.ts index 58d53fd2c173..1be19d66d51b 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -281,6 +281,8 @@ export function getAchievementDescription(localizationKey: string): string { return i18next.t("achv:INVERSE_BATTLE.description", { context: genderStr }); case "FLIP_STATS": return i18next.t("achv:FLIP_STATS.description", { context: genderStr }); + case "FLIP_INVERSE": + return i18next.t("achv:FLIP_INVERSE.description", { context: genderStr }); case "BREEDERS_IN_SPACE": return i18next.t("achv:BREEDERS_IN_SPACE.description", { context: genderStr }); default: @@ -360,8 +362,9 @@ export const achvs = { MONO_DARK: new ChallengeAchv("MONO_DARK", "", "MONO_DARK.description", "black_glasses", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 17 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), MONO_FAIRY: new ChallengeAchv("MONO_FAIRY", "", "MONO_FAIRY.description", "fairy_feather", 100, (c, scene) => c instanceof SingleTypeChallenge && c.value === 18 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), FRESH_START: new ChallengeAchv("FRESH_START", "", "FRESH_START.description", "reviver_seed", 100, (c, scene) => c instanceof FreshStartChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), - INVERSE_BATTLE: new ChallengeAchv("INVERSE_BATTLE", "", "INVERSE_BATTLE.description", "inverse", 100, (c, scene) => c instanceof InverseBattleChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => [ Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), - FLIP_STATS: new ChallengeAchv("FLIP_STATS", "", "FLIP_STATS.description", "flipstat", 100, (c, scene) => c instanceof FlipStatChallenge && c.value > 0), + INVERSE_BATTLE: new ChallengeAchv("INVERSE_BATTLE", "", "INVERSE_BATTLE.description", "inverse", 100, (c, scene) => c instanceof InverseBattleChallenge && c.value > 0), + FLIP_STATS: new ChallengeAchv("FLIP_STATS", "", "FLIP_STATS.description", "dubious_disc", 100, (c, scene) => c instanceof FlipStatChallenge && c.value > 0), + FLIP_INVERSE: new ChallengeAchv("FLIP_INVERSE", "", "FLIP_INVERSE.description", "cracked_pot", 100, (c, scene) => c instanceof FlipStatChallenge && c.value > 0 && scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), BREEDERS_IN_SPACE: new Achv("BREEDERS_IN_SPACE", "", "BREEDERS_IN_SPACE.description", "moon_stone", 50).setSecret(), }; From dc482ea2f027608b28211471243b2fb7b8184bb7 Mon Sep 17 00:00:00 2001 From: Scooom Date: Wed, 8 Jan 2025 19:14:35 -0600 Subject: [PATCH 22/22] Fix FLIP_INVERSE achivement to check ALL challanges are met, not SOME --- src/system/achv.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/achv.ts b/src/system/achv.ts index 1be19d66d51b..57a3ddbcf6c5 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -364,7 +364,7 @@ export const achvs = { FRESH_START: new ChallengeAchv("FRESH_START", "", "FRESH_START.description", "reviver_seed", 100, (c, scene) => c instanceof FreshStartChallenge && c.value > 0 && !scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), INVERSE_BATTLE: new ChallengeAchv("INVERSE_BATTLE", "", "INVERSE_BATTLE.description", "inverse", 100, (c, scene) => c instanceof InverseBattleChallenge && c.value > 0), FLIP_STATS: new ChallengeAchv("FLIP_STATS", "", "FLIP_STATS.description", "dubious_disc", 100, (c, scene) => c instanceof FlipStatChallenge && c.value > 0), - FLIP_INVERSE: new ChallengeAchv("FLIP_INVERSE", "", "FLIP_INVERSE.description", "cracked_pot", 100, (c, scene) => c instanceof FlipStatChallenge && c.value > 0 && scene.gameMode.challenges.some(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), + FLIP_INVERSE: new ChallengeAchv("FLIP_INVERSE", "", "FLIP_INVERSE.description", "cracked_pot", 100, (c, scene) => c instanceof FlipStatChallenge && c.value > 0 && scene.gameMode.challenges.every(c => [ Challenges.INVERSE_BATTLE, Challenges.FLIP_STAT ].includes(c.id) && c.value > 0)), BREEDERS_IN_SPACE: new Achv("BREEDERS_IN_SPACE", "", "BREEDERS_IN_SPACE.description", "moon_stone", 50).setSecret(), };