Rename Challenges

This commit is contained in:
xsn34kzx 2025-08-06 23:24:03 -04:00
parent 39de822d7b
commit 3ca944efa6
6 changed files with 24 additions and 24 deletions

@ -1 +1 @@
Subproject commit 7898c0018a70601a6ead76c9dd497ff966cc2e2a Subproject commit 08299b8b87de17327b7f381afcb5cf1d1469cf20

View File

@ -940,9 +940,9 @@ export class LowerStarterPointsChallenge extends Challenge {
/** /**
* Implements a No Support challenge * Implements a No Support challenge
*/ */
export class NoSupportChallenge extends Challenge { export class LimitedSupportChallenge extends Challenge {
constructor() { constructor() {
super(Challenges.NO_SUPPORT, 3); super(Challenges.LIMITED_SUPPORT, 3);
} }
override applyPartyHeal(status: BooleanHolder): boolean { override applyPartyHeal(status: BooleanHolder): boolean {
@ -961,8 +961,8 @@ export class NoSupportChallenge extends Challenge {
return false; return false;
} }
static override loadChallenge(source: NoSupportChallenge | any): NoSupportChallenge { static override loadChallenge(source: LimitedSupportChallenge | any): LimitedSupportChallenge {
const newChallenge = new NoSupportChallenge(); const newChallenge = new LimitedSupportChallenge();
newChallenge.value = source.value; newChallenge.value = source.value;
newChallenge.severity = source.severity; newChallenge.severity = source.severity;
return newChallenge; return newChallenge;
@ -996,9 +996,9 @@ export class LimitedCatchChallenge extends Challenge {
/** /**
* Implements a Permanent Faint challenge * Implements a Permanent Faint challenge
*/ */
export class PermanentFaintChallenge extends Challenge { export class HardcoreChallenge extends Challenge {
constructor() { constructor() {
super(Challenges.PERMANENT_FAINT, 1); super(Challenges.HARDCORE, 1);
} }
override applyPokemonFusion(pokemon: PlayerPokemon, status: BooleanHolder): boolean { override applyPokemonFusion(pokemon: PlayerPokemon, status: BooleanHolder): boolean {
@ -1034,8 +1034,8 @@ export class PermanentFaintChallenge extends Challenge {
return false; return false;
} }
static override loadChallenge(source: PermanentFaintChallenge | any): PermanentFaintChallenge { static override loadChallenge(source: HardcoreChallenge | any): HardcoreChallenge {
const newChallenge = new PermanentFaintChallenge(); const newChallenge = new HardcoreChallenge();
newChallenge.value = source.value; newChallenge.value = source.value;
newChallenge.severity = source.severity; newChallenge.severity = source.severity;
return newChallenge; return newChallenge;
@ -1065,10 +1065,10 @@ export function copyChallenge(source: Challenge | any): Challenge {
return FlipStatChallenge.loadChallenge(source); return FlipStatChallenge.loadChallenge(source);
case Challenges.LIMITED_CATCH: case Challenges.LIMITED_CATCH:
return LimitedCatchChallenge.loadChallenge(source); return LimitedCatchChallenge.loadChallenge(source);
case Challenges.NO_SUPPORT: case Challenges.LIMITED_SUPPORT:
return NoSupportChallenge.loadChallenge(source); return LimitedSupportChallenge.loadChallenge(source);
case Challenges.PERMANENT_FAINT: case Challenges.HARDCORE:
return PermanentFaintChallenge.loadChallenge(source); return HardcoreChallenge.loadChallenge(source);
} }
throw new Error("Unknown challenge copied"); throw new Error("Unknown challenge copied");
} }
@ -1078,9 +1078,9 @@ export const allChallenges: Challenge[] = [];
export function initChallenges() { export function initChallenges() {
allChallenges.push( allChallenges.push(
new FreshStartChallenge(), new FreshStartChallenge(),
new PermanentFaintChallenge(), new HardcoreChallenge(),
new LimitedCatchChallenge(), new LimitedCatchChallenge(),
new NoSupportChallenge(), new LimitedSupportChallenge(),
new SingleGenerationChallenge(), new SingleGenerationChallenge(),
new SingleTypeChallenge(), new SingleTypeChallenge(),
new InverseBattleChallenge(), new InverseBattleChallenge(),

View File

@ -7,6 +7,6 @@ export enum Challenges {
INVERSE_BATTLE, INVERSE_BATTLE,
FLIP_STAT, FLIP_STAT,
LIMITED_CATCH, LIMITED_CATCH,
NO_SUPPORT, LIMITED_SUPPORT,
PERMANENT_FAINT, HARDCORE,
} }

View File

@ -933,7 +933,7 @@ export const achvs = {
c => c =>
c instanceof LimitedCatchChallenge && c instanceof LimitedCatchChallenge &&
c.value > 0 && c.value > 0 &&
globalScene.gameMode.challenges.some(c => c.id === Challenges.PERMANENT_FAINT && c.value > 0) && globalScene.gameMode.challenges.some(c => c.id === Challenges.HARDCORE && c.value > 0) &&
globalScene.gameMode.challenges.some(c => c.id === Challenges.FRESH_START && c.value > 0), globalScene.gameMode.challenges.some(c => c.id === Challenges.FRESH_START && c.value > 0),
), ),
BREEDERS_IN_SPACE: new Achv("BREEDERS_IN_SPACE", "", "BREEDERS_IN_SPACE.description", "moon_stone", 50).setSecret(), BREEDERS_IN_SPACE: new Achv("BREEDERS_IN_SPACE", "", "BREEDERS_IN_SPACE.description", "moon_stone", 50).setSecret(),

View File

@ -12,7 +12,7 @@ import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Challenges - Permanent Faint", () => { describe("Challenges - Hardcore", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
let game: GameManager; let game: GameManager;
@ -29,7 +29,7 @@ describe("Challenges - Permanent Faint", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.challengeMode.addChallenge(Challenges.PERMANENT_FAINT, 1, 1); game.challengeMode.addChallenge(Challenges.HARDCORE, 1, 1);
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(SpeciesId.VOLTORB) .enemySpecies(SpeciesId.VOLTORB)

View File

@ -8,7 +8,7 @@ import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Challenges - No Support", () => { describe("Challenges - Limited Support", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
let game: GameManager; let game: GameManager;
@ -34,7 +34,7 @@ describe("Challenges - No Support", () => {
it('should disable the shop in "No Shop"', async () => { it('should disable the shop in "No Shop"', async () => {
game.override.startingWave(181); game.override.startingWave(181);
game.challengeMode.addChallenge(Challenges.NO_SUPPORT, 2, 1); game.challengeMode.addChallenge(Challenges.LIMITED_SUPPORT, 2, 1);
await game.challengeMode.startBattle([SpeciesId.NUZLEAF]); await game.challengeMode.startBattle([SpeciesId.NUZLEAF]);
game.move.use(MoveId.SPLASH); game.move.use(MoveId.SPLASH);
@ -50,7 +50,7 @@ describe("Challenges - No Support", () => {
it('should disable the automatic party heal in "No Heal"', async () => { it('should disable the automatic party heal in "No Heal"', async () => {
game.override.startingWave(10); game.override.startingWave(10);
game.challengeMode.addChallenge(Challenges.NO_SUPPORT, 1, 1); game.challengeMode.addChallenge(Challenges.LIMITED_SUPPORT, 1, 1);
await game.challengeMode.startBattle([SpeciesId.NUZLEAF]); await game.challengeMode.startBattle([SpeciesId.NUZLEAF]);
const playerPokemon = game.field.getPlayerPokemon(); const playerPokemon = game.field.getPlayerPokemon();
@ -65,7 +65,7 @@ describe("Challenges - No Support", () => {
it('should disable both automatic party healing and shop in "Both"', async () => { it('should disable both automatic party healing and shop in "Both"', async () => {
game.override.startingWave(10); game.override.startingWave(10);
game.challengeMode.addChallenge(Challenges.NO_SUPPORT, 3, 1); game.challengeMode.addChallenge(Challenges.LIMITED_SUPPORT, 3, 1);
await game.challengeMode.startBattle([SpeciesId.NUZLEAF]); await game.challengeMode.startBattle([SpeciesId.NUZLEAF]);
const playerPokemon = game.field.getPlayerPokemon(); const playerPokemon = game.field.getPlayerPokemon();