mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-05 23:19:25 +02:00
Merge branch 'beta' into damo-MysteryEncounterCollection
This commit is contained in:
commit
12f5b6ddec
@ -3528,6 +3528,7 @@ export class BattleScene extends SceneBase {
|
||||
this.gameMode.hasMysteryEncounters &&
|
||||
battleType === BattleType.WILD &&
|
||||
!this.gameMode.isBoss(waveIndex) &&
|
||||
waveIndex % 10 !== 1 &&
|
||||
waveIndex < highestMysteryEncounterWave &&
|
||||
waveIndex > lowestMysteryEncounterWave
|
||||
);
|
||||
|
@ -1191,11 +1191,11 @@ export const pokemonEvolutions: PokemonEvolutions = {
|
||||
new SpeciesEvolution(SpeciesId.KOMMO_O, 45, null, null)
|
||||
],
|
||||
[SpeciesId.COSMOG]: [
|
||||
new SpeciesEvolution(SpeciesId.COSMOEM, 1, null, {key: EvoCondKey.FRIENDSHIP, value: 40}, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
new SpeciesEvolution(SpeciesId.COSMOEM, 1, null, {key: EvoCondKey.FRIENDSHIP, value: 43}, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
],
|
||||
[SpeciesId.COSMOEM]: [
|
||||
new SpeciesEvolution(SpeciesId.SOLGALEO, 23, EvolutionItem.SUN_FLUTE, null, SpeciesWildEvolutionDelay.VERY_LONG),
|
||||
new SpeciesEvolution(SpeciesId.LUNALA, 23, EvolutionItem.MOON_FLUTE, null, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
new SpeciesEvolution(SpeciesId.SOLGALEO, 13, EvolutionItem.SUN_FLUTE, null, SpeciesWildEvolutionDelay.VERY_LONG),
|
||||
new SpeciesEvolution(SpeciesId.LUNALA, 13, EvolutionItem.MOON_FLUTE, null, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
],
|
||||
[SpeciesId.MELTAN]: [
|
||||
new SpeciesEvolution(SpeciesId.MELMETAL, 48, null, null)
|
||||
|
1784
src/data/balance/pokemon-species.ts
Normal file
1784
src/data/balance/pokemon-species.ts
Normal file
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,6 @@ import { pokemonEvolutions } from "#balance/pokemon-evolutions";
|
||||
import { speciesStarterCosts } from "#balance/starters";
|
||||
import { pokemonFormChanges } from "#data/pokemon-forms";
|
||||
import type { PokemonSpecies } from "#data/pokemon-species";
|
||||
import { getPokemonSpeciesForm } from "#data/pokemon-species";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { ChallengeType } from "#enums/challenge-type";
|
||||
import { Challenges } from "#enums/challenges";
|
||||
@ -26,7 +25,7 @@ import { PokemonMove } from "#moves/pokemon-move";
|
||||
import type { DexAttrProps, GameData } from "#system/game-data";
|
||||
import { BooleanHolder, isBetween, type NumberHolder, randSeedItem } from "#utils/common";
|
||||
import { deepCopy } from "#utils/data";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
import { getPokemonSpecies, getPokemonSpeciesForm } from "#utils/pokemon-utils";
|
||||
import { toCamelCase, toSnakeCase } from "#utils/strings";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -2,7 +2,7 @@ import { pokerogueApi } from "#api/pokerogue-api";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { speciesStarterCosts } from "#balance/starters";
|
||||
import type { PokemonSpeciesForm } from "#data/pokemon-species";
|
||||
import { getPokemonSpeciesForm, PokemonSpecies } from "#data/pokemon-species";
|
||||
import { PokemonSpecies } from "#data/pokemon-species";
|
||||
import { BiomeId } from "#enums/biome-id";
|
||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||
import type { SpeciesId } from "#enums/species-id";
|
||||
@ -10,7 +10,7 @@ import { PlayerPokemon } from "#field/pokemon";
|
||||
import type { Starter } from "#ui/starter-select-ui-handler";
|
||||
import { randSeedGauss, randSeedInt, randSeedItem } from "#utils/common";
|
||||
import { getEnumValues } from "#utils/enums";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
import { getPokemonSpecies, getPokemonSpeciesForm } from "#utils/pokemon-utils";
|
||||
|
||||
export interface DailyRunConfig {
|
||||
seed: number;
|
||||
|
@ -59,7 +59,7 @@ export const TeleportingHijinksEncounter: MysteryEncounter = MysteryEncounterBui
|
||||
)
|
||||
.withEncounterTier(MysteryEncounterTier.COMMON)
|
||||
.withSceneWaveRangeRequirement(...CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES)
|
||||
.withSceneRequirement(new WaveModulusRequirement([1, 2, 3], 10)) // Must be in first 3 waves after boss wave
|
||||
.withSceneRequirement(new WaveModulusRequirement([2, 3, 4], 10)) // Must be in first 3 waves after boss wave
|
||||
.withSceneRequirement(new MoneyRequirement(0, MONEY_COST_MULTIPLIER)) // Must be able to pay teleport cost
|
||||
.withAutoHideIntroVisuals(false)
|
||||
.withCatchAllowed(true)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@ import { loadBattlerTag, SerializableBattlerTag } from "#data/battler-tags";
|
||||
import { allSpecies } from "#data/data-lists";
|
||||
import type { Gender } from "#data/gender";
|
||||
import { PokemonMove } from "#data/moves/pokemon-move";
|
||||
import { getPokemonSpeciesForm, type PokemonSpeciesForm } from "#data/pokemon-species";
|
||||
import type { PokemonSpeciesForm } from "#data/pokemon-species";
|
||||
import type { TypeDamageMultiplier } from "#data/type";
|
||||
import type { AbilityId } from "#enums/ability-id";
|
||||
import type { BerryType } from "#enums/berry-type";
|
||||
@ -16,6 +16,7 @@ import type { IllusionData } from "#types/illusion-data";
|
||||
import type { TurnMove } from "#types/turn-move";
|
||||
import type { CoerceNullPropertiesToUndefined } from "#types/type-helpers";
|
||||
import { isNullOrUndefined } from "#utils/common";
|
||||
import { getPokemonSpeciesForm } from "#utils/pokemon-utils";
|
||||
|
||||
/**
|
||||
* The type that {@linkcode PokemonSpeciesForm} is converted to when an object containing it serializes it.
|
||||
|
@ -1244,12 +1244,58 @@ export const trainerConfigs: TrainerConfigs = {
|
||||
.setHasDouble("Breeders")
|
||||
.setPartyTemplateFunc(() =>
|
||||
getWavePartyTemplate(
|
||||
trainerPartyTemplates.FOUR_WEAKER,
|
||||
trainerPartyTemplates.FIVE_WEAKER,
|
||||
trainerPartyTemplates.SIX_WEAKER,
|
||||
trainerPartyTemplates.FOUR_WEAK,
|
||||
trainerPartyTemplates.FIVE_WEAK,
|
||||
trainerPartyTemplates.SIX_WEAK,
|
||||
),
|
||||
)
|
||||
.setSpeciesFilter(s => s.baseTotal < 450),
|
||||
.setSpeciesPools({
|
||||
[TrainerPoolTier.COMMON]: [
|
||||
SpeciesId.PICHU,
|
||||
SpeciesId.CLEFFA,
|
||||
SpeciesId.IGGLYBUFF,
|
||||
SpeciesId.TOGEPI,
|
||||
SpeciesId.TYROGUE,
|
||||
SpeciesId.SMOOCHUM,
|
||||
SpeciesId.AZURILL,
|
||||
SpeciesId.BUDEW,
|
||||
SpeciesId.CHINGLING,
|
||||
SpeciesId.BONSLY,
|
||||
SpeciesId.MIME_JR,
|
||||
SpeciesId.HAPPINY,
|
||||
SpeciesId.MANTYKE,
|
||||
SpeciesId.TOXEL,
|
||||
],
|
||||
[TrainerPoolTier.UNCOMMON]: [
|
||||
SpeciesId.DITTO,
|
||||
SpeciesId.ELEKID,
|
||||
SpeciesId.MAGBY,
|
||||
SpeciesId.WYNAUT,
|
||||
SpeciesId.MUNCHLAX,
|
||||
SpeciesId.RIOLU,
|
||||
SpeciesId.AUDINO,
|
||||
],
|
||||
[TrainerPoolTier.RARE]: [
|
||||
SpeciesId.ALOLA_RATTATA,
|
||||
SpeciesId.ALOLA_SANDSHREW,
|
||||
SpeciesId.ALOLA_VULPIX,
|
||||
SpeciesId.ALOLA_DIGLETT,
|
||||
SpeciesId.ALOLA_MEOWTH,
|
||||
SpeciesId.GALAR_PONYTA,
|
||||
],
|
||||
[TrainerPoolTier.SUPER_RARE]: [
|
||||
SpeciesId.ALOLA_GEODUDE,
|
||||
SpeciesId.ALOLA_GRIMER,
|
||||
SpeciesId.GALAR_MEOWTH,
|
||||
SpeciesId.GALAR_SLOWPOKE,
|
||||
SpeciesId.GALAR_FARFETCHD,
|
||||
SpeciesId.HISUI_GROWLITHE,
|
||||
SpeciesId.HISUI_VOLTORB,
|
||||
SpeciesId.HISUI_QWILFISH,
|
||||
SpeciesId.HISUI_SNEASEL,
|
||||
SpeciesId.HISUI_ZORUA,
|
||||
],
|
||||
}),
|
||||
[TrainerType.CLERK]: new TrainerConfig(++t)
|
||||
.setHasGenders("Clerk Female")
|
||||
.setHasDouble("Colleagues")
|
||||
|
@ -144,6 +144,7 @@ export const trainerPartyTemplates = {
|
||||
FIVE_WEAK_BALANCED: new TrainerPartyTemplate(5, PartyMemberStrength.WEAK, false, true),
|
||||
SIX_WEAKER: new TrainerPartyTemplate(6, PartyMemberStrength.WEAKER),
|
||||
SIX_WEAKER_SAME: new TrainerPartyTemplate(6, PartyMemberStrength.WEAKER, true),
|
||||
SIX_WEAK: new TrainerPartyTemplate(6, PartyMemberStrength.WEAK),
|
||||
SIX_WEAK_SAME: new TrainerPartyTemplate(6, PartyMemberStrength.WEAK, true),
|
||||
SIX_WEAK_BALANCED: new TrainerPartyTemplate(6, PartyMemberStrength.WEAK, false, true),
|
||||
|
||||
|
@ -60,7 +60,7 @@ import {
|
||||
} from "#data/pokemon-data";
|
||||
import type { SpeciesFormChange } from "#data/pokemon-forms";
|
||||
import type { PokemonSpeciesForm } from "#data/pokemon-species";
|
||||
import { getFusedSpeciesName, getPokemonSpeciesForm, PokemonSpecies } from "#data/pokemon-species";
|
||||
import { PokemonSpecies } from "#data/pokemon-species";
|
||||
import { getRandomStatus, getStatusEffectOverlapText, Status } from "#data/status-effect";
|
||||
import { getTerrainBlockMessage, TerrainType } from "#data/terrain";
|
||||
import type { TypeDamageMultiplier } from "#data/type";
|
||||
@ -168,7 +168,7 @@ import {
|
||||
toDmgValue,
|
||||
} from "#utils/common";
|
||||
import { getEnumValues } from "#utils/enums";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
import { getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm } from "#utils/pokemon-utils";
|
||||
import { argbFromRgba, QuantizerCelebi, rgbaFromArgb } from "@material/material-color-utilities";
|
||||
import i18next from "i18next";
|
||||
import Phaser from "phaser";
|
||||
|
@ -2,10 +2,10 @@ import { initAbilities } from "#abilities/ability";
|
||||
import { initBiomes } from "#balance/biomes";
|
||||
import { initEggMoves } from "#balance/egg-moves";
|
||||
import { initPokemonPrevolutions, initPokemonStarters } from "#balance/pokemon-evolutions";
|
||||
import { initSpecies } from "#balance/pokemon-species";
|
||||
import { initChallenges } from "#data/challenge";
|
||||
import { initTrainerTypeDialogue } from "#data/dialogue";
|
||||
import { initPokemonForms } from "#data/pokemon-forms";
|
||||
import { initSpecies } from "#data/pokemon-species";
|
||||
import { initModifierPools } from "#modifiers/init-modifier-pools";
|
||||
import { initModifierTypes } from "#modifiers/modifier-type";
|
||||
import { initMoves } from "#moves/move";
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { Gender } from "#data/gender";
|
||||
import { CustomPokemonData, PokemonBattleData, PokemonSummonData } from "#data/pokemon-data";
|
||||
import { getPokemonSpeciesForm } from "#data/pokemon-species";
|
||||
import { Status } from "#data/status-effect";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import type { BiomeId } from "#enums/biome-id";
|
||||
@ -14,7 +13,7 @@ import { TrainerSlot } from "#enums/trainer-slot";
|
||||
import { EnemyPokemon, Pokemon } from "#field/pokemon";
|
||||
import { PokemonMove } from "#moves/pokemon-move";
|
||||
import type { Variant } from "#sprites/variant";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
import { getPokemonSpecies, getPokemonSpeciesForm } from "#utils/pokemon-utils";
|
||||
|
||||
export class PokemonData {
|
||||
public id: number;
|
||||
|
@ -1,11 +1,10 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { getPokemonSpeciesForm } from "#data/pokemon-species";
|
||||
import { DexAttr } from "#enums/dex-attr";
|
||||
import type { SessionSaveData, SystemSaveData } from "#system/game-data";
|
||||
import type { SessionSaveMigrator } from "#types/session-save-migrator";
|
||||
import type { SystemSaveMigrator } from "#types/system-save-migrator";
|
||||
import { isNullOrUndefined } from "#utils/common";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
import { getPokemonSpecies, getPokemonSpeciesForm } from "#utils/pokemon-utils";
|
||||
|
||||
/**
|
||||
* If a starter is caught, but the only forms registered as caught are not starterSelectable,
|
||||
|
@ -25,7 +25,7 @@ import { getNatureName } from "#data/nature";
|
||||
import type { SpeciesFormChange } from "#data/pokemon-forms";
|
||||
import { pokemonFormChanges } from "#data/pokemon-forms";
|
||||
import type { PokemonSpecies } from "#data/pokemon-species";
|
||||
import { getPokemonSpeciesForm, normalForm } from "#data/pokemon-species";
|
||||
import { normalForm } from "#data/pokemon-species";
|
||||
import { AbilityAttr } from "#enums/ability-attr";
|
||||
import type { AbilityId } from "#enums/ability-id";
|
||||
import { BiomeId } from "#enums/biome-id";
|
||||
@ -56,7 +56,7 @@ import { addBBCodeTextObject, addTextObject, getTextColor, getTextStyleOptions }
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { BooleanHolder, getLocalizedSpriteKey, isNullOrUndefined, padInt, rgbHexToRgba } from "#utils/common";
|
||||
import { getEnumValues } from "#utils/enums";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
import { getPokemonSpecies, getPokemonSpeciesForm } from "#utils/pokemon-utils";
|
||||
import { toTitleCase } from "#utils/strings";
|
||||
import { argbFromRgba } from "@material/material-color-utilities";
|
||||
import i18next from "i18next";
|
||||
|
@ -15,7 +15,7 @@ import {
|
||||
import { speciesTmMoves } from "#balance/tms";
|
||||
import { allAbilities, allMoves, allSpecies } from "#data/data-lists";
|
||||
import type { PokemonForm, PokemonSpecies } from "#data/pokemon-species";
|
||||
import { getPokemonSpeciesForm, getPokerusStarters, normalForm } from "#data/pokemon-species";
|
||||
import { normalForm } from "#data/pokemon-species";
|
||||
import { AbilityAttr } from "#enums/ability-attr";
|
||||
import { AbilityId } from "#enums/ability-id";
|
||||
import { BiomeId } from "#enums/biome-id";
|
||||
@ -46,6 +46,7 @@ import { addWindow } from "#ui/ui-theme";
|
||||
import { BooleanHolder, fixedInt, getLocalizedSpriteKey, padInt, randIntRange, rgbHexToRgba } from "#utils/common";
|
||||
import type { StarterPreferences } from "#utils/data";
|
||||
import { loadStarterPreferences } from "#utils/data";
|
||||
import { getPokemonSpeciesForm, getPokerusStarters } from "#utils/pokemon-utils";
|
||||
import { argbFromRgba } from "@material/material-color-utilities";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -5,7 +5,6 @@ import { allMoves } from "#data/data-lists";
|
||||
import { getEggTierForSpecies } from "#data/egg";
|
||||
import type { EggHatchData } from "#data/egg-hatch-data";
|
||||
import { Gender } from "#data/gender";
|
||||
import { getPokemonSpeciesForm } from "#data/pokemon-species";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
@ -13,6 +12,7 @@ import type { PlayerPokemon } from "#field/pokemon";
|
||||
import { PokemonInfoContainer } from "#ui/pokemon-info-container";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { padInt, rgbHexToRgba } from "#utils/common";
|
||||
import { getPokemonSpeciesForm } from "#utils/pokemon-utils";
|
||||
import { argbFromRgba } from "@material/material-color-utilities";
|
||||
|
||||
/**
|
||||
|
@ -24,7 +24,6 @@ import { Gender, getGenderColor, getGenderSymbol } from "#data/gender";
|
||||
import { getNatureName } from "#data/nature";
|
||||
import { pokemonFormChanges } from "#data/pokemon-forms";
|
||||
import type { PokemonSpecies } from "#data/pokemon-species";
|
||||
import { getPokemonSpeciesForm, getPokerusStarters } from "#data/pokemon-species";
|
||||
import { AbilityAttr } from "#enums/ability-attr";
|
||||
import { AbilityId } from "#enums/ability-id";
|
||||
import { Button } from "#enums/buttons";
|
||||
@ -72,6 +71,7 @@ import {
|
||||
} from "#utils/common";
|
||||
import type { StarterPreferences } from "#utils/data";
|
||||
import { loadStarterPreferences, saveStarterPreferences } from "#utils/data";
|
||||
import { getPokemonSpeciesForm, getPokerusStarters } from "#utils/pokemon-utils";
|
||||
import { toTitleCase } from "#utils/strings";
|
||||
import { argbFromRgba } from "@material/material-color-utilities";
|
||||
import i18next from "i18next";
|
||||
|
@ -1,6 +1,9 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { POKERUS_STARTER_COUNT, speciesStarterCosts } from "#balance/starters";
|
||||
import { allSpecies } from "#data/data-lists";
|
||||
import type { PokemonSpecies } from "#data/pokemon-species";
|
||||
import type { PokemonSpecies, PokemonSpeciesForm } from "#data/pokemon-species";
|
||||
import type { SpeciesId } from "#enums/species-id";
|
||||
import { randSeedItem } from "./common";
|
||||
|
||||
/**
|
||||
* Gets the {@linkcode PokemonSpecies} object associated with the {@linkcode SpeciesId} enum given
|
||||
@ -19,3 +22,104 @@ export function getPokemonSpecies(species: SpeciesId | SpeciesId[]): PokemonSpec
|
||||
}
|
||||
return allSpecies[species - 1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the daily list of starters with Pokerus.
|
||||
* @returns A list of starters with Pokerus
|
||||
*/
|
||||
export function getPokerusStarters(): PokemonSpecies[] {
|
||||
const pokerusStarters: PokemonSpecies[] = [];
|
||||
const date = new Date();
|
||||
date.setUTCHours(0, 0, 0, 0);
|
||||
globalScene.executeWithSeedOffset(
|
||||
() => {
|
||||
while (pokerusStarters.length < POKERUS_STARTER_COUNT) {
|
||||
const randomSpeciesId = Number.parseInt(randSeedItem(Object.keys(speciesStarterCosts)), 10);
|
||||
const species = getPokemonSpecies(randomSpeciesId);
|
||||
if (!pokerusStarters.includes(species)) {
|
||||
pokerusStarters.push(species);
|
||||
}
|
||||
}
|
||||
},
|
||||
0,
|
||||
date.getTime().toString(),
|
||||
);
|
||||
return pokerusStarters;
|
||||
}
|
||||
|
||||
export function getFusedSpeciesName(speciesAName: string, speciesBName: string): string {
|
||||
const fragAPattern = /([a-z]{2}.*?[aeiou(?:y$)\-']+)(.*?)$/i;
|
||||
const fragBPattern = /([a-z]{2}.*?[aeiou(?:y$)\-'])(.*?)$/i;
|
||||
|
||||
const [speciesAPrefixMatch, speciesBPrefixMatch] = [speciesAName, speciesBName].map(n => /^(?:[^ ]+) /.exec(n));
|
||||
const [speciesAPrefix, speciesBPrefix] = [speciesAPrefixMatch, speciesBPrefixMatch].map(m => (m ? m[0] : ""));
|
||||
|
||||
if (speciesAPrefix) {
|
||||
speciesAName = speciesAName.slice(speciesAPrefix.length);
|
||||
}
|
||||
if (speciesBPrefix) {
|
||||
speciesBName = speciesBName.slice(speciesBPrefix.length);
|
||||
}
|
||||
|
||||
const [speciesASuffixMatch, speciesBSuffixMatch] = [speciesAName, speciesBName].map(n => / (?:[^ ]+)$/.exec(n));
|
||||
const [speciesASuffix, speciesBSuffix] = [speciesASuffixMatch, speciesBSuffixMatch].map(m => (m ? m[0] : ""));
|
||||
|
||||
if (speciesASuffix) {
|
||||
speciesAName = speciesAName.slice(0, -speciesASuffix.length);
|
||||
}
|
||||
if (speciesBSuffix) {
|
||||
speciesBName = speciesBName.slice(0, -speciesBSuffix.length);
|
||||
}
|
||||
|
||||
const splitNameA = speciesAName.split(/ /g);
|
||||
const splitNameB = speciesBName.split(/ /g);
|
||||
|
||||
const fragAMatch = fragAPattern.exec(speciesAName);
|
||||
const fragBMatch = fragBPattern.exec(speciesBName);
|
||||
|
||||
let fragA: string;
|
||||
let fragB: string;
|
||||
|
||||
fragA = splitNameA.length === 1 ? (fragAMatch ? fragAMatch[1] : speciesAName) : splitNameA[splitNameA.length - 1];
|
||||
|
||||
if (splitNameB.length === 1) {
|
||||
if (fragBMatch) {
|
||||
const lastCharA = fragA.slice(fragA.length - 1);
|
||||
const prevCharB = fragBMatch[1].slice(fragBMatch.length - 1);
|
||||
fragB = (/[-']/.test(prevCharB) ? prevCharB : "") + fragBMatch[2] || prevCharB;
|
||||
if (lastCharA === fragB[0]) {
|
||||
if (/[aiu]/.test(lastCharA)) {
|
||||
fragB = fragB.slice(1);
|
||||
} else {
|
||||
const newCharMatch = new RegExp(`[^${lastCharA}]`).exec(fragB);
|
||||
if (newCharMatch?.index !== undefined && newCharMatch.index > 0) {
|
||||
fragB = fragB.slice(newCharMatch.index);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fragB = speciesBName;
|
||||
}
|
||||
} else {
|
||||
fragB = splitNameB[splitNameB.length - 1];
|
||||
}
|
||||
|
||||
if (splitNameA.length > 1) {
|
||||
fragA = `${splitNameA.slice(0, splitNameA.length - 1).join(" ")} ${fragA}`;
|
||||
}
|
||||
|
||||
fragB = `${fragB.slice(0, 1).toLowerCase()}${fragB.slice(1)}`;
|
||||
|
||||
return `${speciesAPrefix || speciesBPrefix}${fragA}${fragB}${speciesBSuffix || speciesASuffix}`;
|
||||
}
|
||||
|
||||
export function getPokemonSpeciesForm(species: SpeciesId, formIndex: number): PokemonSpeciesForm {
|
||||
const retSpecies: PokemonSpecies =
|
||||
species >= 2000
|
||||
? allSpecies.find(s => s.speciesId === species)! // TODO: is the bang correct?
|
||||
: allSpecies[species - 1];
|
||||
if (formIndex < retSpecies.forms?.length) {
|
||||
return retSpecies.forms[formIndex];
|
||||
}
|
||||
return retSpecies;
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ describe("Moves - Whirlwind", () => {
|
||||
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.TOTODILE]);
|
||||
|
||||
// expect the enemy to have at least 4 pokemon, necessary for this check to even work
|
||||
expect(game.scene.getEnemyParty().length, "enemy must have exactly 4 pokemon").toBe(4);
|
||||
expect(game.scene.getEnemyParty().length, "enemy must have exactly 4 pokemon").toBeGreaterThanOrEqual(4);
|
||||
|
||||
const user = game.scene.getPlayerPokemon()!;
|
||||
|
||||
|
@ -174,7 +174,7 @@ describe("Berries Abound - Mystery Encounter", () => {
|
||||
});
|
||||
|
||||
it("should start battle if fastest pokemon is slower than boss below wave 50", async () => {
|
||||
game.override.startingWave(41);
|
||||
game.override.startingWave(42);
|
||||
const encounterTextSpy = vi.spyOn(EncounterDialogueUtils, "showEncounterText");
|
||||
await game.runToMysteryEncounter(MysteryEncounterType.BERRIES_ABOUND, defaultParty);
|
||||
|
||||
|
@ -253,7 +253,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
||||
});
|
||||
|
||||
it("should start battle against the Bug-Type Superfan with wave 70 party template", async () => {
|
||||
game.override.startingWave(61);
|
||||
game.override.startingWave(63);
|
||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||
|
||||
@ -268,7 +268,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
||||
});
|
||||
|
||||
it("should start battle against the Bug-Type Superfan with wave 100 party template", async () => {
|
||||
game.override.startingWave(81);
|
||||
game.override.startingWave(83);
|
||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||
|
||||
@ -284,7 +284,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
||||
});
|
||||
|
||||
it("should start battle against the Bug-Type Superfan with wave 120 party template", async () => {
|
||||
game.override.startingWave(111);
|
||||
game.override.startingWave(113);
|
||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||
|
||||
@ -302,7 +302,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
||||
});
|
||||
|
||||
it("should start battle against the Bug-Type Superfan with wave 140 party template", async () => {
|
||||
game.override.startingWave(131);
|
||||
game.override.startingWave(133);
|
||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||
|
||||
@ -320,7 +320,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
||||
});
|
||||
|
||||
it("should start battle against the Bug-Type Superfan with wave 160 party template", async () => {
|
||||
game.override.startingWave(151);
|
||||
game.override.startingWave(153);
|
||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||
|
||||
@ -338,7 +338,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
||||
});
|
||||
|
||||
it("should start battle against the Bug-Type Superfan with wave 180 party template", async () => {
|
||||
game.override.startingWave(171);
|
||||
game.override.startingWave(173);
|
||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||
|
||||
|
@ -79,14 +79,6 @@ describe("Teleporting Hijinks - Mystery Encounter", () => {
|
||||
expect(TeleportingHijinksEncounter.options.length).toBe(3);
|
||||
});
|
||||
|
||||
it("should run in waves that are X1", async () => {
|
||||
game.override.startingWave(11).mysteryEncounterTier(MysteryEncounterTier.COMMON);
|
||||
|
||||
await game.runToMysteryEncounter();
|
||||
|
||||
expect(scene.currentBattle?.mysteryEncounter?.encounterType).toBe(MysteryEncounterType.TELEPORTING_HIJINKS);
|
||||
});
|
||||
|
||||
it("should run in waves that are X2", async () => {
|
||||
game.override.startingWave(32).mysteryEncounterTier(MysteryEncounterTier.COMMON);
|
||||
|
||||
@ -103,8 +95,16 @@ describe("Teleporting Hijinks - Mystery Encounter", () => {
|
||||
expect(scene.currentBattle?.mysteryEncounter?.encounterType).toBe(MysteryEncounterType.TELEPORTING_HIJINKS);
|
||||
});
|
||||
|
||||
it("should NOT run in waves that are not X1, X2, or X3", async () => {
|
||||
game.override.startingWave(54);
|
||||
it("should run in waves that are X4", async () => {
|
||||
game.override.startingWave(54).mysteryEncounterTier(MysteryEncounterTier.COMMON);
|
||||
|
||||
await game.runToMysteryEncounter();
|
||||
|
||||
expect(scene.currentBattle?.mysteryEncounter?.encounterType).toBe(MysteryEncounterType.TELEPORTING_HIJINKS);
|
||||
});
|
||||
|
||||
it("should NOT run in waves that are not X2, X3, or X4", async () => {
|
||||
game.override.startingWave(67);
|
||||
|
||||
await game.runToMysteryEncounter();
|
||||
|
||||
|
@ -24,7 +24,7 @@ describe("Mystery Encounters", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
scene = game.scene;
|
||||
game.override.startingWave(11).mysteryEncounterChance(100);
|
||||
game.override.startingWave(12).mysteryEncounterChance(100);
|
||||
});
|
||||
|
||||
it("Spawns a mystery encounter", async () => {
|
||||
@ -37,12 +37,20 @@ describe("Mystery Encounters", () => {
|
||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(MysteryEncounterPhase.name);
|
||||
});
|
||||
|
||||
it("Encounters should not run on X1 waves", async () => {
|
||||
game.override.startingWave(11);
|
||||
|
||||
await game.runToMysteryEncounter();
|
||||
|
||||
expect(scene.currentBattle.mysteryEncounter).toBeUndefined();
|
||||
});
|
||||
|
||||
it("Encounters should not run below wave 10", async () => {
|
||||
game.override.startingWave(9);
|
||||
|
||||
await game.runToMysteryEncounter();
|
||||
|
||||
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.MYSTERIOUS_CHALLENGERS);
|
||||
expect(scene.currentBattle.mysteryEncounter).toBeUndefined();
|
||||
});
|
||||
|
||||
it("Encounters should not run above wave 180", async () => {
|
||||
|
@ -27,7 +27,7 @@ describe("Mystery Encounter Phases", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.startingWave(11).mysteryEncounterChance(100).seed("test"); // Seed guarantees wild encounter to be replaced by ME
|
||||
game.override.startingWave(12).mysteryEncounterChance(100).seed("test"); // Seed guarantees wild encounter to be replaced by ME
|
||||
});
|
||||
|
||||
describe("MysteryEncounterPhase", () => {
|
||||
|
@ -3,7 +3,6 @@ import type { BattleScene } from "#app/battle-scene";
|
||||
import { getGameMode } from "#app/game-mode";
|
||||
import { getDailyRunStarters } from "#data/daily-run";
|
||||
import { Gender } from "#data/gender";
|
||||
import { getPokemonSpeciesForm } from "#data/pokemon-species";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { GameModes } from "#enums/game-modes";
|
||||
import type { MoveId } from "#enums/move-id";
|
||||
@ -11,7 +10,7 @@ import type { SpeciesId } from "#enums/species-id";
|
||||
import { PlayerPokemon } from "#field/pokemon";
|
||||
import type { StarterMoveset } from "#system/game-data";
|
||||
import type { Starter } from "#ui/starter-select-ui-handler";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
import { getPokemonSpecies, getPokemonSpeciesForm } from "#utils/pokemon-utils";
|
||||
|
||||
/** Function to convert Blob to string */
|
||||
export function blobToString(blob) {
|
||||
|
Loading…
Reference in New Issue
Block a user