mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-18 13:29:25 +02:00
Merge ee80615436
into 6c0253ada4
This commit is contained in:
commit
3e395968d7
69764
src/data/balance/tms.ts
69764
src/data/balance/tms.ts
File diff suppressed because one or more lines are too long
@ -620,26 +620,14 @@ export class CompatibleMoveRequirement extends EncounterPokemonRequirement {
|
|||||||
|
|
||||||
override queryParty(partyPokemon: PlayerPokemon[]): PlayerPokemon[] {
|
override queryParty(partyPokemon: PlayerPokemon[]): PlayerPokemon[] {
|
||||||
if (!this.invertQuery) {
|
if (!this.invertQuery) {
|
||||||
return partyPokemon.filter(
|
return partyPokemon.filter(pokemon => this.requiredMoves.some(m => pokemon.isTmCompatible(m, true)));
|
||||||
pokemon =>
|
|
||||||
this.requiredMoves.filter(learnableMove =>
|
|
||||||
pokemon.compatibleTms.filter(tm => !pokemon.moveset.find(m => m.moveId === tm)).includes(learnableMove),
|
|
||||||
).length > 0,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
// for an inverted query, we only want to get the pokemon that don't have ANY of the listed learnableMoves
|
// for an inverted query, we only want to get the pokemon that don't have ANY of the listed learnableMoves
|
||||||
return partyPokemon.filter(
|
return partyPokemon.filter(pokemon => !this.requiredMoves.some(m => pokemon.isTmCompatible(m, true)));
|
||||||
pokemon =>
|
|
||||||
this.requiredMoves.filter(learnableMove =>
|
|
||||||
pokemon.compatibleTms.filter(tm => !pokemon.moveset.find(m => m.moveId === tm)).includes(learnableMove),
|
|
||||||
).length === 0,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDialogueToken(pokemon?: PlayerPokemon): [string, string] {
|
override getDialogueToken(pokemon?: PlayerPokemon): [string, string] {
|
||||||
const includedCompatMoves = this.requiredMoves.filter(reqMove =>
|
const includedCompatMoves = this.requiredMoves.filter(reqMove => pokemon?.isTmCompatible(reqMove, true));
|
||||||
pokemon?.compatibleTms.filter(tm => !pokemon.moveset.find(m => m.moveId === tm)).includes(reqMove),
|
|
||||||
);
|
|
||||||
if (includedCompatMoves.length > 0) {
|
if (includedCompatMoves.length > 0) {
|
||||||
return ["compatibleMove", MoveId[includedCompatMoves[0]]];
|
return ["compatibleMove", MoveId[includedCompatMoves[0]]];
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ export class CanLearnMoveRequirement extends EncounterPokemonRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.excludeTmMoves) {
|
if (!this.excludeTmMoves) {
|
||||||
allPokemonMoves.push(...(pkm.compatibleTms ?? []));
|
allPokemonMoves.push(...(pkm.getCompatibleTms() ?? []));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.excludeEggMoves) {
|
if (!this.excludeEggMoves) {
|
||||||
|
@ -13,10 +13,12 @@ import {
|
|||||||
pokemonSpeciesLevelMoves,
|
pokemonSpeciesLevelMoves,
|
||||||
} from "#balance/pokemon-level-moves";
|
} from "#balance/pokemon-level-moves";
|
||||||
import { speciesStarterCosts } from "#balance/starters";
|
import { speciesStarterCosts } from "#balance/starters";
|
||||||
|
import { speciesFormTmList, speciesTmList } from "#balance/tms";
|
||||||
import type { GrowthRate } from "#data/exp";
|
import type { GrowthRate } from "#data/exp";
|
||||||
import { Gender } from "#data/gender";
|
import { Gender } from "#data/gender";
|
||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
import { DexAttr } from "#enums/dex-attr";
|
import { DexAttr } from "#enums/dex-attr";
|
||||||
|
import type { MoveId } from "#enums/move-id";
|
||||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
import type { PokemonType } from "#enums/pokemon-type";
|
import type { PokemonType } from "#enums/pokemon-type";
|
||||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||||
@ -351,6 +353,41 @@ export abstract class PokemonSpeciesForm {
|
|||||||
return `pokemon_icons_${this.generation}${isVariant ? "v" : ""}`;
|
return `pokemon_icons_${this.generation}${isVariant ? "v" : ""}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiles a list of all TMs compatible with this SpeciesForm
|
||||||
|
* @param formIndex formIndex to check
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
getCompatibleTms(formIndex?: number): MoveId[] {
|
||||||
|
const tms: MoveId[] = [];
|
||||||
|
tms.push(...speciesTmList[this.speciesId]);
|
||||||
|
if (speciesFormTmList.hasOwnProperty(this.speciesId)) {
|
||||||
|
formIndex = this.formIndex ?? formIndex ?? -1;
|
||||||
|
const formKey = getPokemonSpecies(this.speciesId).forms[formIndex].formKey;
|
||||||
|
tms.push(...(speciesFormTmList[this.speciesId][formKey] ?? []));
|
||||||
|
}
|
||||||
|
return tms;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the actual formKey associated with a given formIndex
|
||||||
|
* @param formIndex The formIndex to check
|
||||||
|
*/
|
||||||
|
abstract getFormKey(formIndex?: number): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether a TM is compatible with a SpeciesForm
|
||||||
|
* @param tm The move to check for
|
||||||
|
* @param formIndex If provided, looks specifically for this form
|
||||||
|
* @returns Whether the TM is compatible with this SpeciesForm
|
||||||
|
*/
|
||||||
|
isTmCompatible(tm: MoveId, formIndex?: number): boolean {
|
||||||
|
return (
|
||||||
|
speciesTmList[this.speciesId].includes(tm) ||
|
||||||
|
speciesFormTmList[this.speciesId][this.getFormKey(formIndex)].includes(tm)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
getIconId(female: boolean, formIndex?: number, shiny?: boolean, variant?: number): string {
|
getIconId(female: boolean, formIndex?: number, shiny?: boolean, variant?: number): string {
|
||||||
if (formIndex === undefined) {
|
if (formIndex === undefined) {
|
||||||
formIndex = this.formIndex;
|
formIndex = this.formIndex;
|
||||||
@ -878,6 +915,15 @@ export class PokemonSpecies extends PokemonSpeciesForm implements Localizable {
|
|||||||
: ret;
|
: ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the actual formKey associated with the form at the specified index
|
||||||
|
* @param formIndex the formIndex to check
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
getFormKey(formIndex?: number): string {
|
||||||
|
return this.forms[formIndex ?? this.formIndex].formKey ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
localize(): void {
|
localize(): void {
|
||||||
this.name = i18next.t(`pokemon:${SpeciesId[this.speciesId].toLowerCase()}`);
|
this.name = i18next.t(`pokemon:${SpeciesId[this.speciesId].toLowerCase()}`);
|
||||||
this.category = i18next.t(`pokemonCategory:${SpeciesId[this.speciesId].toLowerCase()}_category`);
|
this.category = i18next.t(`pokemonCategory:${SpeciesId[this.speciesId].toLowerCase()}_category`);
|
||||||
@ -1317,6 +1363,13 @@ export class PokemonForm extends PokemonSpeciesForm {
|
|||||||
this.isUnobtainable = isUnobtainable;
|
this.isUnobtainable = isUnobtainable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the actual formKey for this PokemonForm
|
||||||
|
*/
|
||||||
|
getFormKey(_formIndex?: number): string {
|
||||||
|
return this.formKey;
|
||||||
|
}
|
||||||
|
|
||||||
getFormSpriteKey(_formIndex?: number) {
|
getFormSpriteKey(_formIndex?: number) {
|
||||||
return this.formSpriteKey !== null ? this.formSpriteKey : this.formKey;
|
return this.formSpriteKey !== null ? this.formSpriteKey : this.formKey;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import { timedEventManager } from "#app/global-event-manager";
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { pokemonEvolutions, pokemonPrevolutions } from "#balance/pokemon-evolutions";
|
import { pokemonEvolutions, pokemonPrevolutions } from "#balance/pokemon-evolutions";
|
||||||
import { signatureSpecies } from "#balance/signature-species";
|
import { signatureSpecies } from "#balance/signature-species";
|
||||||
import { tmSpecies } from "#balance/tms";
|
import { speciesTmList } from "#balance/tms";
|
||||||
import { modifierTypes } from "#data/data-lists";
|
import { modifierTypes } from "#data/data-lists";
|
||||||
import { doubleBattleDialogue } from "#data/double-battle-dialogue";
|
import { doubleBattleDialogue } from "#data/double-battle-dialogue";
|
||||||
import { Gender } from "#data/gender";
|
import { Gender } from "#data/gender";
|
||||||
@ -1445,7 +1445,7 @@ export const trainerConfigs: TrainerConfigs = {
|
|||||||
.setSpeciesFilter(s => s.isOfType(PokemonType.ELECTRIC)),
|
.setSpeciesFilter(s => s.isOfType(PokemonType.ELECTRIC)),
|
||||||
[TrainerType.HARLEQUIN]: new TrainerConfig(++t)
|
[TrainerType.HARLEQUIN]: new TrainerConfig(++t)
|
||||||
.setEncounterBgm(TrainerType.PSYCHIC)
|
.setEncounterBgm(TrainerType.PSYCHIC)
|
||||||
.setSpeciesFilter(s => tmSpecies[MoveId.TRICK_ROOM].indexOf(s.speciesId) > -1),
|
.setSpeciesFilter(s => speciesTmList[s.speciesId].includes(MoveId.TRICK_ROOM)),
|
||||||
[TrainerType.HIKER]: new TrainerConfig(++t)
|
[TrainerType.HIKER]: new TrainerConfig(++t)
|
||||||
.setEncounterBgm(TrainerType.BACKPACKER)
|
.setEncounterBgm(TrainerType.BACKPACKER)
|
||||||
.setPartyTemplates(
|
.setPartyTemplates(
|
||||||
@ -1589,7 +1589,7 @@ export const trainerConfigs: TrainerConfigs = {
|
|||||||
trainerPartyTemplates.TWO_AVG,
|
trainerPartyTemplates.TWO_AVG,
|
||||||
trainerPartyTemplates.THREE_AVG,
|
trainerPartyTemplates.THREE_AVG,
|
||||||
)
|
)
|
||||||
.setSpeciesFilter(s => tmSpecies[MoveId.FLY].indexOf(s.speciesId) > -1),
|
.setSpeciesFilter(s => speciesTmList[s.speciesId].includes(MoveId.FLY)),
|
||||||
[TrainerType.POKEFAN]: new TrainerConfig(++t)
|
[TrainerType.POKEFAN]: new TrainerConfig(++t)
|
||||||
.setMoneyMultiplier(1.4)
|
.setMoneyMultiplier(1.4)
|
||||||
.setName("Pokéfan")
|
.setName("Pokéfan")
|
||||||
@ -1605,7 +1605,7 @@ export const trainerConfigs: TrainerConfigs = {
|
|||||||
trainerPartyTemplates.FIVE_WEAK,
|
trainerPartyTemplates.FIVE_WEAK,
|
||||||
trainerPartyTemplates.SIX_WEAKER_SAME,
|
trainerPartyTemplates.SIX_WEAKER_SAME,
|
||||||
)
|
)
|
||||||
.setSpeciesFilter(s => tmSpecies[MoveId.HELPING_HAND].indexOf(s.speciesId) > -1),
|
.setSpeciesFilter(s => speciesTmList[s.speciesId].includes(MoveId.HELPING_HAND)),
|
||||||
[TrainerType.PRESCHOOLER]: new TrainerConfig(++t)
|
[TrainerType.PRESCHOOLER]: new TrainerConfig(++t)
|
||||||
.setMoneyMultiplier(0.2)
|
.setMoneyMultiplier(0.2)
|
||||||
.setEncounterBgm(TrainerType.YOUNGSTER)
|
.setEncounterBgm(TrainerType.YOUNGSTER)
|
||||||
|
@ -18,7 +18,7 @@ import type { LevelMoves } from "#balance/pokemon-level-moves";
|
|||||||
import { EVOLVE_MOVE, RELEARN_MOVE } from "#balance/pokemon-level-moves";
|
import { EVOLVE_MOVE, RELEARN_MOVE } from "#balance/pokemon-level-moves";
|
||||||
import { BASE_HIDDEN_ABILITY_CHANCE, BASE_SHINY_CHANCE, SHINY_EPIC_CHANCE, SHINY_VARIANT_CHANCE } from "#balance/rates";
|
import { BASE_HIDDEN_ABILITY_CHANCE, BASE_SHINY_CHANCE, SHINY_EPIC_CHANCE, SHINY_VARIANT_CHANCE } from "#balance/rates";
|
||||||
import { getStarterValueFriendshipCap, speciesStarterCosts } from "#balance/starters";
|
import { getStarterValueFriendshipCap, speciesStarterCosts } from "#balance/starters";
|
||||||
import { reverseCompatibleTms, tmPoolTiers, tmSpecies } from "#balance/tms";
|
import { tmPoolTiers } from "#balance/tms";
|
||||||
import type { SuppressAbilitiesTag } from "#data/arena-tag";
|
import type { SuppressAbilitiesTag } from "#data/arena-tag";
|
||||||
import { NoCritTag, WeakenMoveScreenTag } from "#data/arena-tag";
|
import { NoCritTag, WeakenMoveScreenTag } from "#data/arena-tag";
|
||||||
import {
|
import {
|
||||||
@ -3083,27 +3083,13 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasTrainer()) {
|
if (this.hasTrainer()) {
|
||||||
const tms = Object.keys(tmSpecies);
|
const tmset = new Set(this.species.getCompatibleTms(this.formIndex));
|
||||||
for (const tm of tms) {
|
if (this.fusionSpecies) {
|
||||||
const moveId = Number.parseInt(tm) as MoveId;
|
this.fusionSpecies.getCompatibleTms(this.fusionFormIndex).forEach(m => tmset.add(m));
|
||||||
let compatible = false;
|
|
||||||
for (const p of tmSpecies[tm]) {
|
|
||||||
if (Array.isArray(p)) {
|
|
||||||
if (
|
|
||||||
p[0] === this.species.speciesId ||
|
|
||||||
(this.fusionSpecies &&
|
|
||||||
p[0] === this.fusionSpecies.speciesId &&
|
|
||||||
p.slice(1).indexOf(this.species.forms[this.formIndex]) > -1)
|
|
||||||
) {
|
|
||||||
compatible = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else if (p === this.species.speciesId || (this.fusionSpecies && p === this.fusionSpecies.speciesId)) {
|
const tms = Array.from(tmset);
|
||||||
compatible = true;
|
for (const moveId of tms) {
|
||||||
break;
|
if (!movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(" (N)")) {
|
||||||
}
|
|
||||||
}
|
|
||||||
if (compatible && !movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(" (N)")) {
|
|
||||||
if (tmPoolTiers[moveId] === ModifierTier.COMMON && this.level >= 15) {
|
if (tmPoolTiers[moveId] === ModifierTier.COMMON && this.level >= 15) {
|
||||||
movePool.push([moveId, 4]);
|
movePool.push([moveId, 4]);
|
||||||
} else if (tmPoolTiers[moveId] === ModifierTier.GREAT && this.level >= 30) {
|
} else if (tmPoolTiers[moveId] === ModifierTier.GREAT && this.level >= 30) {
|
||||||
@ -5674,7 +5660,6 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
export class PlayerPokemon extends Pokemon {
|
export class PlayerPokemon extends Pokemon {
|
||||||
protected declare battleInfo: PlayerBattleInfo;
|
protected declare battleInfo: PlayerBattleInfo;
|
||||||
public compatibleTms: MoveId[];
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
species: PokemonSpecies,
|
species: PokemonSpecies,
|
||||||
@ -5712,7 +5697,6 @@ export class PlayerPokemon extends Pokemon {
|
|||||||
this.moveset = [];
|
this.moveset = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.generateCompatibleTms();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initBattleInfo(): void {
|
initBattleInfo(): void {
|
||||||
@ -5744,35 +5728,48 @@ export class PlayerPokemon extends Pokemon {
|
|||||||
return this.getFieldIndex();
|
return this.getFieldIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
generateCompatibleTms(): void {
|
/**
|
||||||
this.compatibleTms = [];
|
* Compiles a list of all TMs compatible with this PlayerPokemon, including its fusion
|
||||||
|
* @param excludeKnown Whether to exclude moves in its current moveset
|
||||||
|
* @param excludeLevelUp Whether to exclude moves learnable at a previous level (incl. relearn-only & evo moves)
|
||||||
|
* @param excludeUsed Whether to exclude TMs which were used before on the mon, contained in its "usedTMs" array
|
||||||
|
* @returns An array of all compatible MoveId[]
|
||||||
|
*/
|
||||||
|
getCompatibleTms(excludeKnown = false, excludeLevelUp = false, excludeUsed = false): MoveId[] {
|
||||||
|
const tms = new Set(this.species.getCompatibleTms(this.formIndex));
|
||||||
|
if (this.fusionSpecies) {
|
||||||
|
this.fusionSpecies.getCompatibleTms(this.fusionFormIndex).forEach(m => tms.add(m));
|
||||||
|
}
|
||||||
|
if (excludeKnown && excludeLevelUp && excludeUsed) {
|
||||||
|
// All these cases are covered at once by getLearnableLevelMoves
|
||||||
|
this.getLearnableLevelMoves().forEach(m => tms.delete(m));
|
||||||
|
} else {
|
||||||
|
// If any of these are true, but not all three, they need to be individually filtered
|
||||||
|
if (excludeKnown) {
|
||||||
|
this.moveset.forEach(pm => tms.delete(pm.moveId));
|
||||||
|
}
|
||||||
|
if (excludeLevelUp) {
|
||||||
|
this.getLevelMoves(undefined, true, false, true).forEach(lm => tms.delete(lm[1]));
|
||||||
|
}
|
||||||
|
if (excludeUsed) {
|
||||||
|
this.usedTMs.forEach(tm => tms.delete(tm));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Array.from(tms);
|
||||||
|
}
|
||||||
|
|
||||||
const tms = Object.keys(tmSpecies);
|
/**
|
||||||
for (const tm of tms) {
|
* Determines if a TM is compatible with this PlayerPokemon
|
||||||
const moveId = Number.parseInt(tm) as MoveId;
|
* @param tm The TM move to check for
|
||||||
let compatible = false;
|
* @param excludeKnown Whether to exclude moves in its current moveset
|
||||||
for (const p of tmSpecies[tm]) {
|
* @returns Whether it's compatible
|
||||||
if (Array.isArray(p)) {
|
*/
|
||||||
const [pkm, form] = p;
|
isTmCompatible(tm: MoveId, excludeKnown = false): boolean {
|
||||||
if (
|
return (
|
||||||
(pkm === this.species.speciesId || (this.fusionSpecies && pkm === this.fusionSpecies.speciesId)) &&
|
!(excludeKnown && this.moveset.some(pm => pm.moveId === tm)) &&
|
||||||
form === this.getFormKey()
|
(this.species.isTmCompatible(tm, this.formIndex) ||
|
||||||
) {
|
(!!this.fusionSpecies && this.fusionSpecies.isTmCompatible(tm, this.fusionFormIndex)))
|
||||||
compatible = true;
|
);
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else if (p === this.species.speciesId || (this.fusionSpecies && p === this.fusionSpecies.speciesId)) {
|
|
||||||
compatible = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (reverseCompatibleTms.indexOf(moveId) > -1) {
|
|
||||||
compatible = !compatible;
|
|
||||||
}
|
|
||||||
if (compatible) {
|
|
||||||
this.compatibleTms.push(moveId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tryPopulateMoveset(moveset: StarterMoveset): boolean {
|
tryPopulateMoveset(moveset: StarterMoveset): boolean {
|
||||||
@ -5977,8 +5974,6 @@ export class PlayerPokemon extends Pokemon {
|
|||||||
this.fusionAbilityIndex = 0;
|
this.fusionAbilityIndex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.compatibleTms.splice(0, this.compatibleTms.length);
|
|
||||||
this.generateCompatibleTms();
|
|
||||||
const updateAndResolve = () => {
|
const updateAndResolve = () => {
|
||||||
this.loadAssets().then(() => {
|
this.loadAssets().then(() => {
|
||||||
this.calculateStats();
|
this.calculateStats();
|
||||||
@ -6090,8 +6085,6 @@ export class PlayerPokemon extends Pokemon {
|
|||||||
this.abilityIndex = abilityCount - 1;
|
this.abilityIndex = abilityCount - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.compatibleTms.splice(0, this.compatibleTms.length);
|
|
||||||
this.generateCompatibleTms();
|
|
||||||
const updateAndResolve = () => {
|
const updateAndResolve = () => {
|
||||||
this.loadAssets().then(() => {
|
this.loadAssets().then(() => {
|
||||||
this.calculateStats();
|
this.calculateStats();
|
||||||
@ -6108,11 +6101,6 @@ export class PlayerPokemon extends Pokemon {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
clearFusionSpecies(): void {
|
|
||||||
super.clearFusionSpecies();
|
|
||||||
this.generateCompatibleTms();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a Promise to fuse two PlayerPokemon together
|
* Returns a Promise to fuse two PlayerPokemon together
|
||||||
* @param pokemon The PlayerPokemon to fuse to this one
|
* @param pokemon The PlayerPokemon to fuse to this one
|
||||||
@ -6152,7 +6140,6 @@ export class PlayerPokemon extends Pokemon {
|
|||||||
this.status = pokemon.status; // Inherit the other Pokemon's status
|
this.status = pokemon.status; // Inherit the other Pokemon's status
|
||||||
}
|
}
|
||||||
|
|
||||||
this.generateCompatibleTms();
|
|
||||||
this.updateInfo(true);
|
this.updateInfo(true);
|
||||||
const fusedPartyMemberIndex = globalScene.getPlayerParty().indexOf(pokemon);
|
const fusedPartyMemberIndex = globalScene.getPlayerParty().indexOf(pokemon);
|
||||||
let partyMemberIndex = globalScene.getPlayerParty().indexOf(this);
|
let partyMemberIndex = globalScene.getPlayerParty().indexOf(this);
|
||||||
|
@ -4,7 +4,7 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import Overrides from "#app/overrides";
|
import Overrides from "#app/overrides";
|
||||||
import { EvolutionItem, pokemonEvolutions } from "#balance/pokemon-evolutions";
|
import { EvolutionItem, pokemonEvolutions } from "#balance/pokemon-evolutions";
|
||||||
import { tmPoolTiers, tmSpecies } from "#balance/tms";
|
import { tmPoolTiers } from "#balance/tms";
|
||||||
import { getBerryEffectDescription, getBerryName } from "#data/berry";
|
import { getBerryEffectDescription, getBerryName } from "#data/berry";
|
||||||
import { getDailyEventSeedLuck } from "#data/daily-run";
|
import { getDailyEventSeedLuck } from "#data/daily-run";
|
||||||
import { allMoves, modifierTypes } from "#data/data-lists";
|
import { allMoves, modifierTypes } from "#data/data-lists";
|
||||||
@ -1142,10 +1142,7 @@ export class TmModifierType extends PokemonModifierType {
|
|||||||
`tm_${PokemonType[allMoves[moveId].type].toLowerCase()}`,
|
`tm_${PokemonType[allMoves[moveId].type].toLowerCase()}`,
|
||||||
(_type, args) => new TmModifier(this, (args[0] as PlayerPokemon).id),
|
(_type, args) => new TmModifier(this, (args[0] as PlayerPokemon).id),
|
||||||
(pokemon: PlayerPokemon) => {
|
(pokemon: PlayerPokemon) => {
|
||||||
if (
|
if (!pokemon.isTmCompatible(moveId, true)) {
|
||||||
pokemon.compatibleTms.indexOf(moveId) === -1 ||
|
|
||||||
pokemon.getMoveset().filter(m => m.moveId === moveId).length
|
|
||||||
) {
|
|
||||||
return PartyUiHandler.NoEffectMessage;
|
return PartyUiHandler.NoEffectMessage;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -1158,7 +1155,7 @@ export class TmModifierType extends PokemonModifierType {
|
|||||||
|
|
||||||
get name(): string {
|
get name(): string {
|
||||||
return i18next.t("modifierType:ModifierType.TmModifierType.name", {
|
return i18next.t("modifierType:ModifierType.TmModifierType.name", {
|
||||||
moveId: padInt(Object.keys(tmSpecies).indexOf(this.moveId.toString()) + 1, 3),
|
moveId: padInt(Object.keys(tmPoolTiers).indexOf(this.moveId.toString()) + 1, 3),
|
||||||
moveName: allMoves[this.moveId].name,
|
moveName: allMoves[this.moveId].name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1519,12 +1516,7 @@ class TmModifierTypeGenerator extends ModifierTypeGenerator {
|
|||||||
if (pregenArgs && pregenArgs.length === 1 && pregenArgs[0] in MoveId) {
|
if (pregenArgs && pregenArgs.length === 1 && pregenArgs[0] in MoveId) {
|
||||||
return new TmModifierType(pregenArgs[0] as MoveId);
|
return new TmModifierType(pregenArgs[0] as MoveId);
|
||||||
}
|
}
|
||||||
const partyMemberCompatibleTms = party.map(p => {
|
const partyMemberCompatibleTms = party.map(p => (p as PlayerPokemon).getCompatibleTms(true, true));
|
||||||
const previousLevelMoves = p.getLearnableLevelMoves();
|
|
||||||
return (p as PlayerPokemon).compatibleTms.filter(
|
|
||||||
tm => !p.moveset.find(m => m.moveId === tm) && !previousLevelMoves.find(lm => lm === tm),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const tierUniqueCompatibleTms = partyMemberCompatibleTms
|
const tierUniqueCompatibleTms = partyMemberCompatibleTms
|
||||||
.flat()
|
.flat()
|
||||||
.filter(tm => tmPoolTiers[tm] === tier)
|
.filter(tm => tmPoolTiers[tm] === tier)
|
||||||
|
@ -2029,9 +2029,9 @@ class PartySlot extends Phaser.GameObjects.Container {
|
|||||||
this.slotHpText.setVisible(false);
|
this.slotHpText.setVisible(false);
|
||||||
let slotTmText: string;
|
let slotTmText: string;
|
||||||
|
|
||||||
if (this.pokemon.getMoveset().filter(m => m.moveId === tmMoveId).length > 0) {
|
if (this.pokemon.getMoveset().some(m => m.moveId === tmMoveId)) {
|
||||||
slotTmText = i18next.t("partyUiHandler:learned");
|
slotTmText = i18next.t("partyUiHandler:learned");
|
||||||
} else if (this.pokemon.compatibleTms.indexOf(tmMoveId) === -1) {
|
} else if (!this.pokemon.isTmCompatible(tmMoveId)) {
|
||||||
slotTmText = i18next.t("partyUiHandler:notAble");
|
slotTmText = i18next.t("partyUiHandler:notAble");
|
||||||
} else {
|
} else {
|
||||||
slotTmText = i18next.t("partyUiHandler:able");
|
slotTmText = i18next.t("partyUiHandler:able");
|
||||||
|
@ -16,7 +16,6 @@ import {
|
|||||||
getValueReductionCandyCounts,
|
getValueReductionCandyCounts,
|
||||||
speciesStarterCosts,
|
speciesStarterCosts,
|
||||||
} from "#balance/starters";
|
} from "#balance/starters";
|
||||||
import { speciesTmMoves } from "#balance/tms";
|
|
||||||
import { allAbilities, allMoves, allSpecies } from "#data/data-lists";
|
import { allAbilities, allMoves, allSpecies } from "#data/data-lists";
|
||||||
import { Egg, getEggTierForSpecies } from "#data/egg";
|
import { Egg, getEggTierForSpecies } from "#data/egg";
|
||||||
import { GrowthRate, getGrowthRateColor } from "#data/exp";
|
import { GrowthRate, getGrowthRateColor } from "#data/exp";
|
||||||
@ -838,10 +837,7 @@ export class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.tmMoves =
|
this.tmMoves =
|
||||||
speciesTmMoves[species.speciesId]
|
species.getCompatibleTms(formIndex).sort((a, b) => (allMoves[a].name > allMoves[b].name ? 1 : -1)) ?? [];
|
||||||
?.filter(m => (Array.isArray(m) ? m[0] === formKey : true))
|
|
||||||
.map(m => (Array.isArray(m) ? m[1] : m))
|
|
||||||
.sort((a, b) => (allMoves[a].name > allMoves[b].name ? 1 : -1)) ?? [];
|
|
||||||
|
|
||||||
const passiveId = starterPassiveAbilities.hasOwnProperty(species.speciesId)
|
const passiveId = starterPassiveAbilities.hasOwnProperty(species.speciesId)
|
||||||
? species.speciesId
|
? species.speciesId
|
||||||
|
@ -12,7 +12,6 @@ import {
|
|||||||
POKERUS_STARTER_COUNT,
|
POKERUS_STARTER_COUNT,
|
||||||
speciesStarterCosts,
|
speciesStarterCosts,
|
||||||
} from "#balance/starters";
|
} from "#balance/starters";
|
||||||
import { speciesTmMoves } from "#balance/tms";
|
|
||||||
import { allAbilities, allMoves, allSpecies } from "#data/data-lists";
|
import { allAbilities, allMoves, allSpecies } from "#data/data-lists";
|
||||||
import type { PokemonForm, PokemonSpecies } from "#data/pokemon-species";
|
import type { PokemonForm, PokemonSpecies } from "#data/pokemon-species";
|
||||||
import { normalForm } from "#data/pokemon-species";
|
import { normalForm } from "#data/pokemon-species";
|
||||||
@ -1380,7 +1379,7 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
const levelMoves = pokemonSpeciesLevelMoves[species.speciesId].map(m => allMoves[m[1]].name);
|
const levelMoves = pokemonSpeciesLevelMoves[species.speciesId].map(m => allMoves[m[1]].name);
|
||||||
// This always gets egg moves from the starter
|
// This always gets egg moves from the starter
|
||||||
const eggMoves = speciesEggMoves[starterId]?.map(m => allMoves[m].name) ?? [];
|
const eggMoves = speciesEggMoves[starterId]?.map(m => allMoves[m].name) ?? [];
|
||||||
const tmMoves = speciesTmMoves[species.speciesId]?.map(m => allMoves[Array.isArray(m) ? m[1] : m].name) ?? [];
|
const tmMoves = species.getCompatibleTms().map(m => allMoves[m].name) ?? [];
|
||||||
const selectedMove1 = this.filterText.getValue(FilterTextRow.MOVE_1);
|
const selectedMove1 = this.filterText.getValue(FilterTextRow.MOVE_1);
|
||||||
const selectedMove2 = this.filterText.getValue(FilterTextRow.MOVE_2);
|
const selectedMove2 = this.filterText.getValue(FilterTextRow.MOVE_2);
|
||||||
|
|
||||||
|
@ -80,8 +80,8 @@ describe("Spec - Pokemon", () => {
|
|||||||
|
|
||||||
const fanRotom = game.field.getPlayerPokemon();
|
const fanRotom = game.field.getPlayerPokemon();
|
||||||
|
|
||||||
expect(fanRotom.compatibleTms).not.toContain(MoveId.BLIZZARD);
|
expect(fanRotom.isTmCompatible(MoveId.BLIZZARD)).toBe(false);
|
||||||
expect(fanRotom.compatibleTms).toContain(MoveId.AIR_SLASH);
|
expect(fanRotom.isTmCompatible(MoveId.AIR_SLASH)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Get correct fusion type", () => {
|
describe("Get correct fusion type", () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user