mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-02 13:42:19 +02:00
Small fixes, clearing logs, implementing suggestions
This commit is contained in:
parent
7d71d5fd1e
commit
d78f3a7e52
@ -122,8 +122,8 @@ export class FusionSpeciesFormEvolution extends SpeciesFormEvolution {
|
|||||||
|
|
||||||
export class SpeciesEvolutionCondition {
|
export class SpeciesEvolutionCondition {
|
||||||
public predicate: EvolutionConditionPredicate;
|
public predicate: EvolutionConditionPredicate;
|
||||||
public enforceFunc: EvolutionConditionEnforceFunc | undefined;
|
public enforceFunc?: EvolutionConditionEnforceFunc;
|
||||||
public description: String;
|
public description: string;
|
||||||
|
|
||||||
constructor(predicate: EvolutionConditionPredicate, enforceFunc?: EvolutionConditionEnforceFunc) {
|
constructor(predicate: EvolutionConditionPredicate, enforceFunc?: EvolutionConditionEnforceFunc) {
|
||||||
this.predicate = predicate;
|
this.predicate = predicate;
|
||||||
@ -138,13 +138,12 @@ export class GenderEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
super(p => p.gender === gender, p => p.gender = gender);
|
super(p => p.gender === gender, p => p.gender = gender);
|
||||||
this.gender = gender;
|
this.gender = gender;
|
||||||
this.description = i18next.t("pokemonEvolutions:gender", { gender: i18next.t(`pokemonEvolutions:${Gender[gender]}`) });
|
this.description = i18next.t("pokemonEvolutions:gender", { gender: i18next.t(`pokemonEvolutions:${Gender[gender]}`) });
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TimeOfDayEvolutionCondition extends SpeciesEvolutionCondition {
|
export class TimeOfDayEvolutionCondition extends SpeciesEvolutionCondition {
|
||||||
public timesOfDay: TimeOfDay[];
|
public timesOfDay: TimeOfDay[];
|
||||||
constructor(tod: string) {
|
constructor(tod: "day" | "night") {
|
||||||
if (tod === "day") {
|
if (tod === "day") {
|
||||||
super(p => globalScene.arena.getTimeOfDay() === TimeOfDay.DAWN || globalScene.arena.getTimeOfDay() === TimeOfDay.DAY);
|
super(p => globalScene.arena.getTimeOfDay() === TimeOfDay.DAWN || globalScene.arena.getTimeOfDay() === TimeOfDay.DAY);
|
||||||
this.timesOfDay = [ TimeOfDay.DAWN, TimeOfDay.DAY ];
|
this.timesOfDay = [ TimeOfDay.DAWN, TimeOfDay.DAY ];
|
||||||
@ -156,7 +155,6 @@ export class TimeOfDayEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
this.timesOfDay = [];
|
this.timesOfDay = [];
|
||||||
}
|
}
|
||||||
this.description = i18next.t("pokemonEvolutions:timeOfDay", { tod: i18next.t(`pokemonEvolutions:${tod}`) });
|
this.description = i18next.t("pokemonEvolutions:timeOfDay", { tod: i18next.t(`pokemonEvolutions:${tod}`) });
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,26 +163,24 @@ export class MoveEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
constructor(move: Moves) {
|
constructor(move: Moves) {
|
||||||
super(p => p.moveset.filter(m => m?.moveId === move).length > 0);
|
super(p => p.moveset.filter(m => m?.moveId === move).length > 0);
|
||||||
this.move = move;
|
this.move = move;
|
||||||
const moveKey = Moves[this.move].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("") as unknown as string;
|
const moveKey = Moves[this.move].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("");
|
||||||
this.description = i18next.t("pokemonEvolutions:move", { move: i18next.t(`move:${moveKey}.name`) });
|
this.description = i18next.t("pokemonEvolutions:move", { move: i18next.t(`move:${moveKey}.name`) });
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FriendshipEvolutionCondition extends SpeciesEvolutionCondition {
|
export class FriendshipEvolutionCondition extends SpeciesEvolutionCondition {
|
||||||
public amount: integer;
|
public amount: integer;
|
||||||
constructor(amount: integer) {
|
constructor(amount: number) {
|
||||||
super(p => p.friendship >= amount);
|
super(p => p.friendship >= amount);
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.description = i18next.t("pokemonEvolutions:friendship");
|
this.description = i18next.t("pokemonEvolutions:friendship");
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FriendshipTimeOfDayEvolutionCondition extends SpeciesEvolutionCondition {
|
export class FriendshipTimeOfDayEvolutionCondition extends SpeciesEvolutionCondition {
|
||||||
public amount: integer;
|
public amount: integer;
|
||||||
public timesOfDay: TimeOfDay[];
|
public timesOfDay: TimeOfDay[];
|
||||||
constructor(amount:integer, tod: string) {
|
constructor(amount: number, tod: "day" | "night") {
|
||||||
if (tod === "day") {
|
if (tod === "day") {
|
||||||
super(p => p.friendship >= amount && (globalScene.arena.getTimeOfDay() === TimeOfDay.DAWN || globalScene.arena.getTimeOfDay() === TimeOfDay.DAY));
|
super(p => p.friendship >= amount && (globalScene.arena.getTimeOfDay() === TimeOfDay.DAWN || globalScene.arena.getTimeOfDay() === TimeOfDay.DAY));
|
||||||
this.timesOfDay = [ TimeOfDay.DAWN, TimeOfDay.DAY ];
|
this.timesOfDay = [ TimeOfDay.DAWN, TimeOfDay.DAY ];
|
||||||
@ -197,19 +193,17 @@ export class FriendshipTimeOfDayEvolutionCondition extends SpeciesEvolutionCondi
|
|||||||
}
|
}
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.description = i18next.t("pokemonEvolutions:friendshipTimeOfDay", { tod: i18next.t(`pokemonEvolutions:${tod}`) });
|
this.description = i18next.t("pokemonEvolutions:friendshipTimeOfDay", { tod: i18next.t(`pokemonEvolutions:${tod}`) });
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FriendshipMoveTypeEvolutionCondition extends SpeciesEvolutionCondition {
|
export class FriendshipMoveTypeEvolutionCondition extends SpeciesEvolutionCondition {
|
||||||
public amount: integer;
|
public amount: integer;
|
||||||
public type: Type;
|
public type: Type;
|
||||||
constructor(amount: integer, type: Type) {
|
constructor(amount: number, type: Type) {
|
||||||
super(p => p.friendship >= amount && !!p.getMoveset().find(m => m?.getMove().type === type));
|
super(p => p.friendship >= amount && !!p.getMoveset().find(m => m?.getMove().type === type));
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.description = i18next.t("pokemonEvolutions:friendshipMoveType", { type: i18next.t(`pokemonInfo:Type.${Type[this.type]}`) });
|
this.description = i18next.t("pokemonEvolutions:friendshipMoveType", { type: i18next.t(`pokemonInfo:Type.${Type[this.type]}`) });
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +211,6 @@ export class ShedinjaEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
constructor() {
|
constructor() {
|
||||||
super(p => globalScene.getPlayerParty().length < 6 && globalScene.pokeballCounts[PokeballType.POKEBALL] > 0);
|
super(p => globalScene.getPlayerParty().length < 6 && globalScene.pokeballCounts[PokeballType.POKEBALL] > 0);
|
||||||
this.description = i18next.t("pokemonEvolutions:shedinja");
|
this.description = i18next.t("pokemonEvolutions:shedinja");
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,7 +220,6 @@ export class PartyTypeEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
super(p => !!globalScene.getPlayerParty().find(p => p.getTypes(false, false, true).indexOf(type) > -1));
|
super(p => !!globalScene.getPlayerParty().find(p => p.getTypes(false, false, true).indexOf(type) > -1));
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.description = i18next.t("pokemonEvolutions:partyType", { type: i18next.t(`pokemonInfo:Type.${Type[this.type]}`) });
|
this.description = i18next.t("pokemonEvolutions:partyType", { type: i18next.t(`pokemonInfo:Type.${Type[this.type]}`) });
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +229,6 @@ export class CaughtEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
super(p => !!globalScene.gameData.dexData[species].caughtAttr);
|
super(p => !!globalScene.gameData.dexData[species].caughtAttr);
|
||||||
this.species = species;
|
this.species = species;
|
||||||
this.description = i18next.t("pokemonEvolutions:caught", { species: i18next.t(`pokemon:${Species[this.species].toLowerCase()}`) });
|
this.description = i18next.t("pokemonEvolutions:caught", { species: i18next.t(`pokemon:${Species[this.species].toLowerCase()}`) });
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +246,6 @@ export class MoveTypeEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
super(p => p.moveset.filter(m => m?.getMove().type === type).length > 0);
|
super(p => p.moveset.filter(m => m?.getMove().type === type).length > 0);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.description = i18next.t("pokemonEvolutions:moveType", { type: i18next.t(`pokemonInfo:Type.${Type[this.type]}`) });
|
this.description = i18next.t("pokemonEvolutions:moveType", { type: i18next.t(`pokemonInfo:Type.${Type[this.type]}`) });
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,7 +256,6 @@ export class TreasureEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
+ globalScene.findModifiers(m => m instanceof MoneyMultiplierModifier
|
+ globalScene.findModifiers(m => m instanceof MoneyMultiplierModifier
|
||||||
|| m instanceof ExtraModifierModifier || m instanceof TempExtraModifierModifier).length > 9);
|
|| m instanceof ExtraModifierModifier || m instanceof TempExtraModifierModifier).length > 9);
|
||||||
this.description = i18next.t("pokemonEvolutions:treasure");
|
this.description = i18next.t("pokemonEvolutions:treasure");
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,9 +265,8 @@ export class TyrogueEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
super(p =>
|
super(p =>
|
||||||
p.getMoveset(true).find(m => m && [ Moves.LOW_SWEEP, Moves.MACH_PUNCH, Moves.RAPID_SPIN ].includes(m?.moveId))?.moveId === move);
|
p.getMoveset(true).find(m => m && [ Moves.LOW_SWEEP, Moves.MACH_PUNCH, Moves.RAPID_SPIN ].includes(m?.moveId))?.moveId === move);
|
||||||
this.move = move;
|
this.move = move;
|
||||||
const moveKey = Moves[this.move].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("") as unknown as string;
|
const moveKey = Moves[this.move].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("");
|
||||||
this.description = i18next.t("pokemonEvolutions:move", { move: i18next.t(`move:${moveKey}.name`) });
|
this.description = i18next.t("pokemonEvolutions:move", { move: i18next.t(`move:${moveKey}.name`) });
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,14 +276,13 @@ export class NatureEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
super(p => natures.indexOf(p.getNature()) > -1);
|
super(p => natures.indexOf(p.getNature()) > -1);
|
||||||
this.natures = natures;
|
this.natures = natures;
|
||||||
this.description = i18next.t("pokemonEvolutions:nature");
|
this.description = i18next.t("pokemonEvolutions:nature");
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MoveTimeOfDayEvolutionCondition extends SpeciesEvolutionCondition {
|
export class MoveTimeOfDayEvolutionCondition extends SpeciesEvolutionCondition {
|
||||||
public move: Moves;
|
public move: Moves;
|
||||||
public timesOfDay: TimeOfDay[];
|
public timesOfDay: TimeOfDay[];
|
||||||
constructor(move: Moves, tod: string) {
|
constructor(move: Moves, tod: "day" | "night") {
|
||||||
if (tod === "day") {
|
if (tod === "day") {
|
||||||
super(p => p.moveset.filter(m => m?.moveId === move).length > 0 && (globalScene.arena.getTimeOfDay() === TimeOfDay.DAWN || globalScene.arena.getTimeOfDay() === TimeOfDay.DAY));
|
super(p => p.moveset.filter(m => m?.moveId === move).length > 0 && (globalScene.arena.getTimeOfDay() === TimeOfDay.DAWN || globalScene.arena.getTimeOfDay() === TimeOfDay.DAY));
|
||||||
this.move = move;
|
this.move = move;
|
||||||
@ -308,9 +295,8 @@ export class MoveTimeOfDayEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
super(p => false);
|
super(p => false);
|
||||||
this.timesOfDay = [];
|
this.timesOfDay = [];
|
||||||
}
|
}
|
||||||
const moveKey = Moves[this.move].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("") as unknown as string;
|
const moveKey = Moves[this.move].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("");
|
||||||
this.description = i18next.t("pokemonEvolutions:moveTimeOfDay", { move: i18next.t(`move:${moveKey}.name`), tod: i18next.t(`pokemonEvolutions:${tod}`) });
|
this.description = i18next.t("pokemonEvolutions:moveTimeOfDay", { move: i18next.t(`move:${moveKey}.name`), tod: i18next.t(`pokemonEvolutions:${tod}`) });
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,7 +306,6 @@ export class BiomeEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
super(p => biomes.filter(b => b === globalScene.arena.biomeType).length > 0);
|
super(p => biomes.filter(b => b === globalScene.arena.biomeType).length > 0);
|
||||||
this.biomes = biomes;
|
this.biomes = biomes;
|
||||||
this.description = i18next.t("pokemonEvolutions:biome");
|
this.description = i18next.t("pokemonEvolutions:biome");
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,9 +318,8 @@ export class DunsparceEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
const moveKey = Moves[Moves.HYPER_DRILL].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("") as unknown as string;
|
const moveKey = Moves[Moves.HYPER_DRILL].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("");
|
||||||
this.description = i18next.t("pokemonEvolutions:move", { move: i18next.t(`move:${moveKey}.name`) });
|
this.description = i18next.t("pokemonEvolutions:move", { move: i18next.t(`move:${moveKey}.name`) });
|
||||||
// console.log("Description:", this.description);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,7 +333,6 @@ export class TandemausEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interface PokemonEvolutions {
|
interface PokemonEvolutions {
|
||||||
[key: string]: SpeciesFormEvolution[]
|
[key: string]: SpeciesFormEvolution[]
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,7 @@ export class SpeciesFormChangeCondition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export abstract class SpeciesFormChangeTrigger {
|
export abstract class SpeciesFormChangeTrigger {
|
||||||
public description: String = "";
|
public description: string = "";
|
||||||
|
|
||||||
canChange(pokemon: Pokemon): boolean {
|
canChange(pokemon: Pokemon): boolean {
|
||||||
return true;
|
return true;
|
||||||
@ -224,26 +224,18 @@ export abstract class SpeciesFormChangeTrigger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class SpeciesFormChangeManualTrigger extends SpeciesFormChangeTrigger {
|
export class SpeciesFormChangeManualTrigger extends SpeciesFormChangeTrigger {
|
||||||
canChange(pokemon: Pokemon): boolean {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SpeciesFormChangeAbilityTrigger extends SpeciesFormChangeTrigger {
|
export class SpeciesFormChangeAbilityTrigger extends SpeciesFormChangeTrigger {
|
||||||
public description: String = i18next.t("pokemonEvolutions:Forms.ability");
|
public description: string = i18next.t("pokemonEvolutions:Forms.ability");
|
||||||
|
|
||||||
canChange(pokemon: Pokemon): boolean {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SpeciesFormChangeCompoundTrigger {
|
export class SpeciesFormChangeCompoundTrigger {
|
||||||
public description: String = "";
|
public description: string = "";
|
||||||
public triggers: SpeciesFormChangeTrigger[];
|
public triggers: SpeciesFormChangeTrigger[];
|
||||||
|
|
||||||
constructor(...triggers: SpeciesFormChangeTrigger[]) {
|
constructor(...triggers: SpeciesFormChangeTrigger[]) {
|
||||||
this.triggers = triggers;
|
this.triggers = triggers;
|
||||||
//
|
|
||||||
this.description = this.triggers.filter(trigger => trigger?.description?.length > 0).map(trigger => trigger.description).join(", ");
|
this.description = this.triggers.filter(trigger => trigger?.description?.length > 0).map(trigger => trigger.description).join(", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1034,10 +1026,3 @@ export function initPokemonForms() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checking that descripions are correct; to be removed
|
|
||||||
// for (const speciesChanges of Object.values(pokemonFormChanges)) {
|
|
||||||
// for (const formChange of speciesChanges) {
|
|
||||||
// console.log(formChange.trigger.description);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user