mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-29 10:49:29 +02:00
Added form index to boss custom seed
This commit is contained in:
parent
4d83674d1c
commit
5f017597da
@ -213,27 +213,27 @@ export function getDailyEventSeedStarters(seed: string): Starter[] | null {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expects the seed to contain: /boss\d{4}/
|
* Expects the seed to contain: /boss\d{4}\d{2}/
|
||||||
* Where the boss is 4 digits for the SpeciesId.
|
* Where the boss is 4 digits for the SpeciesId and 2 digits for the form index
|
||||||
* Currently does not support form index.
|
* @returns A {@linkcode PokemonSpeciesForm} containing the boss or null if no valid match.
|
||||||
* @returns A {@linkcode PokemonSpecies} containing the boss species or null if no valid match.
|
|
||||||
*/
|
*/
|
||||||
export function getDailyEventSeedBoss(seed: string): PokemonSpecies | null {
|
export function getDailyEventSeedBoss(seed: string): PokemonSpeciesForm | null {
|
||||||
if (!isDailyEventSeed(seed)) {
|
if (!isDailyEventSeed(seed)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const match = /boss(\d{4})/g.exec(seed);
|
const match = /boss(\d{4})(\d{2})/g.exec(seed);
|
||||||
if (match && match.length === 2) {
|
if (match && match.length === 3) {
|
||||||
const speciesId = Number.parseInt(match[1]) as SpeciesId;
|
const speciesId = Number.parseInt(match[1]) as SpeciesId;
|
||||||
|
const formIndex = Number.parseInt(match[2]);
|
||||||
|
|
||||||
if (!Object.values(SpeciesId).includes(speciesId)) {
|
if (!Object.values(SpeciesId).includes(speciesId)) {
|
||||||
// Incorrect event seed, abort.
|
// Incorrect event seed, abort.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const species = getPokemonSpecies(speciesId);
|
const starterForm = getPokemonSpeciesForm(speciesId, formIndex);
|
||||||
return species;
|
return starterForm;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -39,6 +39,7 @@ import {
|
|||||||
TrappedTag,
|
TrappedTag,
|
||||||
TypeImmuneTag,
|
TypeImmuneTag,
|
||||||
} from "#data/battler-tags";
|
} from "#data/battler-tags";
|
||||||
|
import { getDailyEventSeedBoss } from "#data/daily-run";
|
||||||
import { allAbilities, allMoves } from "#data/data-lists";
|
import { allAbilities, allMoves } from "#data/data-lists";
|
||||||
import { getLevelTotalExp } from "#data/exp";
|
import { getLevelTotalExp } from "#data/exp";
|
||||||
import {
|
import {
|
||||||
@ -6256,6 +6257,11 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
this.species.forms[Overrides.OPP_FORM_OVERRIDES[speciesId]]
|
this.species.forms[Overrides.OPP_FORM_OVERRIDES[speciesId]]
|
||||||
) {
|
) {
|
||||||
this.formIndex = Overrides.OPP_FORM_OVERRIDES[speciesId];
|
this.formIndex = Overrides.OPP_FORM_OVERRIDES[speciesId];
|
||||||
|
} else if (globalScene.gameMode.isDaily && globalScene.gameMode.isWaveFinal(globalScene.currentBattle.waveIndex)) {
|
||||||
|
const eventBoss = getDailyEventSeedBoss(globalScene.seed);
|
||||||
|
if (!isNullOrUndefined(eventBoss)) {
|
||||||
|
this.formIndex = eventBoss.formIndex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dataSource) {
|
if (!dataSource) {
|
||||||
|
@ -15,6 +15,7 @@ import type { Arena } from "#field/arena";
|
|||||||
import { classicFixedBattles, type FixedBattleConfigs } from "#trainers/fixed-battle-configs";
|
import { classicFixedBattles, type FixedBattleConfigs } from "#trainers/fixed-battle-configs";
|
||||||
import { applyChallenges } from "#utils/challenge-utils";
|
import { applyChallenges } from "#utils/challenge-utils";
|
||||||
import { BooleanHolder, isNullOrUndefined, randSeedInt, randSeedItem } from "#utils/common";
|
import { BooleanHolder, isNullOrUndefined, randSeedInt, randSeedItem } from "#utils/common";
|
||||||
|
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
interface GameModeConfig {
|
interface GameModeConfig {
|
||||||
@ -213,7 +214,8 @@ export class GameMode implements GameModeConfig {
|
|||||||
if (this.isDaily && this.isWaveFinal(waveIndex)) {
|
if (this.isDaily && this.isWaveFinal(waveIndex)) {
|
||||||
const eventBoss = getDailyEventSeedBoss(globalScene.seed);
|
const eventBoss = getDailyEventSeedBoss(globalScene.seed);
|
||||||
if (!isNullOrUndefined(eventBoss)) {
|
if (!isNullOrUndefined(eventBoss)) {
|
||||||
return eventBoss;
|
// Cannot set form index here, it will be overriden when adding it as enemy pokemon.
|
||||||
|
return getPokemonSpecies(eventBoss.speciesId);
|
||||||
}
|
}
|
||||||
|
|
||||||
const allFinalBossSpecies = allSpecies.filter(
|
const allFinalBossSpecies = allSpecies.filter(
|
||||||
|
Loading…
Reference in New Issue
Block a user