mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-01 05:52:17 +02:00
Undo new evolution changes
This commit is contained in:
parent
446d6455c5
commit
309f27f337
@ -10,7 +10,7 @@ import { Biome } from "#enums/biome";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { TimeOfDay } from "#enums/time-of-day";
|
||||
import { EvoTrackerModifier, EvoTrackerMoveUseModifier, EvoTrackerRecoilModifier, SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { EvoTrackerModifier, SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||
import type { SpeciesStatBoosterItem, SpeciesStatBoosterModifierType } from "#app/modifier/modifier-type";
|
||||
import { speciesStarterCosts } from "./starters";
|
||||
@ -100,19 +100,16 @@ enum EvoCondKey {
|
||||
SPECIES_CAUGHT,
|
||||
GENDER,
|
||||
NATURE,
|
||||
MOVE_USE_COUNT,
|
||||
RECOIL_DAMAGE_COUNT,
|
||||
HELD_ITEM, // Currently checks only for species stat booster items
|
||||
}
|
||||
|
||||
type EvolutionConditionData =
|
||||
{key: EvoCondKey.FRIENDSHIP | EvoCondKey.RANDOM_FORM | EvoCondKey.EVO_TREASURE_TRACKER | EvoCondKey.RECOIL_DAMAGE_COUNT, value: number} |
|
||||
{key: EvoCondKey.FRIENDSHIP | EvoCondKey.RANDOM_FORM | EvoCondKey.EVO_TREASURE_TRACKER, value: number} |
|
||||
{key: EvoCondKey.MOVE, move: Moves} |
|
||||
{key: EvoCondKey.TIME, time: TimeOfDay[]} |
|
||||
{key: EvoCondKey.BIOME, biome: Biome[]} |
|
||||
{key: EvoCondKey.GENDER, gender: Gender} |
|
||||
{key: EvoCondKey.MOVE_TYPE | EvoCondKey.PARTY_TYPE, pkmnType: PokemonType} |
|
||||
{key: EvoCondKey.MOVE_USE_COUNT, move: Moves, value: number} |
|
||||
{key: EvoCondKey.SPECIES_CAUGHT, speciesCaught: Species} |
|
||||
{key: EvoCondKey.HELD_ITEM, itemKey: SpeciesStatBoosterItem} |
|
||||
{key: EvoCondKey.NATURE, nature: Nature[]} |
|
||||
@ -156,10 +153,6 @@ export class SpeciesEvolutionCondition {
|
||||
return i18next.t("pokemonEvolutions:treasure");
|
||||
case EvoCondKey.SPECIES_CAUGHT:
|
||||
return i18next.t("pokemonEvolutions:caught", {species: getPokemonSpecies(cond.speciesCaught).name});
|
||||
case EvoCondKey.MOVE_USE_COUNT:
|
||||
return i18next.t("pokemonEvolutions:useMoveCount", {move: allMoves[cond.move].name, count: cond.value});
|
||||
case EvoCondKey.RECOIL_DAMAGE_COUNT:
|
||||
return i18next.t("pokemonEvolutions:recoil");
|
||||
case EvoCondKey.HELD_ITEM:
|
||||
return i18next.t(`pokemonEvolutions:heldItem.${cond.itemKey}`);
|
||||
}
|
||||
@ -204,13 +197,6 @@ export class SpeciesEvolutionCondition {
|
||||
}
|
||||
case EvoCondKey.SPECIES_CAUGHT:
|
||||
return !!globalScene.gameData.dexData[cond.speciesCaught].caughtAttr;
|
||||
case EvoCondKey.MOVE_USE_COUNT:
|
||||
return pokemon.getHeldItems().some(m =>
|
||||
m instanceof EvoTrackerMoveUseModifier &&
|
||||
m.shouldApply(pokemon, cond.move) &&
|
||||
m.getStackCount() >= cond.value);
|
||||
case EvoCondKey.RECOIL_DAMAGE_COUNT:
|
||||
return pokemon.getHeldItems().some(m => m instanceof EvoTrackerRecoilModifier && m.getStackCount() >= cond.value);
|
||||
case EvoCondKey.HELD_ITEM:
|
||||
return pokemon.getHeldItems().some(m => m instanceof SpeciesStatBoosterModifier && (m.type as SpeciesStatBoosterModifierType).key === cond.itemKey)
|
||||
}
|
||||
@ -642,8 +628,8 @@ export const pokemonEvolutions: PokemonEvolutions = {
|
||||
new SpeciesEvolution(Species.KIRLIA, 20, null, null)
|
||||
],
|
||||
[Species.KIRLIA]: [
|
||||
new SpeciesEvolution(Species.GARDEVOIR, 30, null, null),
|
||||
new SpeciesEvolution(Species.GALLADE, 30, EvolutionItem.DAWN_STONE, {key: EvoCondKey.GENDER, gender: Gender.MALE})
|
||||
new SpeciesEvolution(Species.GARDEVOIR, 30, null, {key: EvoCondKey.GENDER, gender: Gender.FEMALE}),
|
||||
new SpeciesEvolution(Species.GALLADE, 30, null, {key: EvoCondKey.GENDER, gender: Gender.MALE})
|
||||
],
|
||||
[Species.SURSKIT]: [
|
||||
new SpeciesEvolution(Species.MASQUERAIN, 22, null, null)
|
||||
@ -731,8 +717,8 @@ export const pokemonEvolutions: PokemonEvolutions = {
|
||||
new SpeciesEvolution(Species.DUSCLOPS, 37, null, null)
|
||||
],
|
||||
[Species.SNORUNT]: [
|
||||
new SpeciesEvolution(Species.GLALIE, 42, null, null),
|
||||
new SpeciesEvolution(Species.FROSLASS, 42, EvolutionItem.DAWN_STONE, {key: EvoCondKey.GENDER, gender: Gender.FEMALE})
|
||||
new SpeciesEvolution(Species.GLALIE, 42, null, {key: EvoCondKey.GENDER, gender: Gender.MALE}),
|
||||
new SpeciesEvolution(Species.FROSLASS, 42, null, {key: EvoCondKey.GENDER, gender: Gender.FEMALE})
|
||||
],
|
||||
[Species.SPHEAL]: [
|
||||
new SpeciesEvolution(Species.SEALEO, 32, null, null)
|
||||
@ -1542,7 +1528,7 @@ export const pokemonEvolutions: PokemonEvolutions = {
|
||||
new SpeciesEvolution(Species.MAMOSWINE, 1, null, {key: EvoCondKey.MOVE, move: Moves.ANCIENT_POWER}, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
],
|
||||
[Species.STANTLER]: [
|
||||
new SpeciesEvolution(Species.WYRDEER, 1, null, {key: EvoCondKey.MOVE_USE_COUNT, move: Moves.PSYSHIELD_BASH, value: 10}, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
new SpeciesEvolution(Species.WYRDEER, 25, null, {key: EvoCondKey.MOVE, move: Moves.PSYSHIELD_BASH}, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
],
|
||||
[Species.LOMBRE]: [
|
||||
new SpeciesEvolution(Species.LUDICOLO, 1, EvolutionItem.WATER_STONE, null, SpeciesWildEvolutionDelay.LONG)
|
||||
@ -1586,8 +1572,8 @@ export const pokemonEvolutions: PokemonEvolutions = {
|
||||
new SpeciesEvolution(Species.LILLIGANT, 1, EvolutionItem.SUN_STONE, null, SpeciesWildEvolutionDelay.LONG)
|
||||
],
|
||||
[Species.BASCULIN]: [
|
||||
new SpeciesFormEvolution(Species.BASCULEGION, "white-striped", "female", 1, null, [{key: EvoCondKey.GENDER, gender: Gender.FEMALE}, {key: EvoCondKey.RECOIL_DAMAGE_COUNT, value: 294}], SpeciesWildEvolutionDelay.VERY_LONG),
|
||||
new SpeciesFormEvolution(Species.BASCULEGION, "white-striped", "male", 1, null, [{key: EvoCondKey.GENDER, gender: Gender.MALE}, {key: EvoCondKey.RECOIL_DAMAGE_COUNT, value: 294}], SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
new SpeciesFormEvolution(Species.BASCULEGION, "white-striped", "female", 40, null, [{key: EvoCondKey.GENDER, gender: Gender.FEMALE}], SpeciesWildEvolutionDelay.VERY_LONG),
|
||||
new SpeciesFormEvolution(Species.BASCULEGION, "white-striped", "male", 40, null, [{key: EvoCondKey.GENDER, gender: Gender.MALE}], SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
],
|
||||
[Species.MINCCINO]: [
|
||||
new SpeciesEvolution(Species.CINCCINO, 1, EvolutionItem.SHINY_STONE, null, SpeciesWildEvolutionDelay.LONG)
|
||||
@ -1788,7 +1774,7 @@ export const pokemonEvolutions: PokemonEvolutions = {
|
||||
new SpeciesEvolution(Species.ALOLA_GOLEM, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
],
|
||||
[Species.PRIMEAPE]: [
|
||||
new SpeciesEvolution(Species.ANNIHILAPE, 1, null, {key: EvoCondKey.MOVE_USE_COUNT, move: Moves.RAGE_FIST, value: 10}, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
new SpeciesEvolution(Species.ANNIHILAPE, 35, null, {key: EvoCondKey.MOVE, move: Moves.RAGE_FIST}, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
],
|
||||
[Species.GOLBAT]: [
|
||||
new SpeciesEvolution(Species.CROBAT, 1, null, {key: EvoCondKey.FRIENDSHIP, value: 120}, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||
|
@ -70,7 +70,6 @@ import { allAbilities, allMoves } from "../data-lists";
|
||||
import {
|
||||
AttackTypeBoosterModifier,
|
||||
BerryModifier,
|
||||
EvoTrackerRecoilModifier,
|
||||
PokemonHeldItemModifier,
|
||||
PokemonMoveAccuracyBoosterModifier,
|
||||
PokemonMultiHitModifier,
|
||||
@ -1680,12 +1679,6 @@ export class RecoilAttr extends MoveEffectAttr {
|
||||
user.damageAndUpdate(recoilDamage, { result: HitResult.INDIRECT, ignoreSegments: true });
|
||||
globalScene.queueMessage(i18next.t("moveTriggers:hitWithRecoil", { pokemonName: getPokemonNameWithAffix(user) }));
|
||||
user.turnData.damageTaken += recoilDamage;
|
||||
if (!user.isFainted() && user.hasSpecies(Species.BASCULIN, "white-striped") && move.id !== Moves.STRUGGLE) {
|
||||
const modifier = modifierTypes.EVOLUTION_TRACKER_BASCULIN()
|
||||
.withIdFromFunc(modifierTypes.EVOLUTION_TRACKER_BASCULIN)
|
||||
.newModifier(user, recoilDamage) as EvoTrackerRecoilModifier;
|
||||
globalScene.addModifier(modifier);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -99,8 +99,6 @@ import {
|
||||
TempExtraModifierModifier,
|
||||
CriticalCatchChanceBoosterModifier,
|
||||
FieldEffectModifier,
|
||||
EvoTrackerMoveUseModifier,
|
||||
EvoTrackerRecoilModifier,
|
||||
} from "#app/modifier/modifier";
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import Overrides from "#app/overrides";
|
||||
@ -1928,27 +1926,6 @@ export const modifierTypes = {
|
||||
"relic_gold",
|
||||
(type, args) => new EvoTrackerModifier(type, (args[0] as Pokemon).id, Species.GIMMIGHOUL, 10, (args[1] as number ?? 1)),
|
||||
),
|
||||
|
||||
EVOLUTION_TRACKER_PRIMEAPE: () =>
|
||||
new PokemonHeldItemModifierType(
|
||||
"modifierType:ModifierType.EVOLUTION_TRACKER_PRIMEAPE",
|
||||
"tm_ghost",
|
||||
(type, args) => new EvoTrackerMoveUseModifier(type, (args[0] as Pokemon).id, Species.PRIMEAPE, Moves.RAGE_FIST, 10)
|
||||
),
|
||||
|
||||
EVOLUTION_TRACKER_STANTLER: () =>
|
||||
new PokemonHeldItemModifierType(
|
||||
"modifierType:ModifierType.EVOLUTION_TRACKER_STANTLER",
|
||||
"tm_psychic",
|
||||
(type, args) => new EvoTrackerMoveUseModifier(type, (args[0] as Pokemon).id, Species.STANTLER, Moves.PSYSHIELD_BASH, 10)
|
||||
),
|
||||
|
||||
EVOLUTION_TRACKER_BASCULIN: () =>
|
||||
new PokemonHeldItemModifierType(
|
||||
"modifierType:ModifierType.EVOLUTION_TRACKER_BASCULIN",
|
||||
"tm_water",
|
||||
(type, args) => new EvoTrackerRecoilModifier(type, (args[0] as Pokemon).id, Species.BASCULIN, 294, (args[1] as number ?? 1))
|
||||
),
|
||||
|
||||
MEGA_BRACELET: () =>
|
||||
new ModifierType(
|
||||
|
@ -941,122 +941,6 @@ export class EvoTrackerModifier extends PokemonHeldItemModifier {
|
||||
}
|
||||
}
|
||||
|
||||
export class EvoTrackerMoveUseModifier extends PokemonHeldItemModifier {
|
||||
protected species: Species;
|
||||
protected move: Moves;
|
||||
protected required: number;
|
||||
public isTransferable = false;
|
||||
|
||||
constructor(type: ModifierType, pokemonId: number, species: Species, move: Moves, required: number, stackCount?: number) {
|
||||
super(type, pokemonId, stackCount);
|
||||
this.species = species;
|
||||
this.move = move;
|
||||
this.required = required;
|
||||
}
|
||||
|
||||
matchType(modifier: Modifier): boolean {
|
||||
return (
|
||||
modifier instanceof EvoTrackerMoveUseModifier &&
|
||||
modifier.species === this.species &&
|
||||
modifier.move === this.move &&
|
||||
modifier.required === this.required
|
||||
);
|
||||
}
|
||||
|
||||
clone(): PersistentModifier {
|
||||
return new EvoTrackerMoveUseModifier(this.type, this.pokemonId, this.species, this.move, this.required, this.stackCount);
|
||||
}
|
||||
|
||||
getArgs(): any[] {
|
||||
return super.getArgs().concat([this.species, this.move, this.required]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the {@linkcode EvoTrackerMoveUseModifier}
|
||||
* @returns always `true`
|
||||
*/
|
||||
override apply(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
getIconStackText(virtual?: boolean): Phaser.GameObjects.BitmapText | null {
|
||||
const text = globalScene.add.bitmapText(10, 15, "item-count", this.getStackCount().toString(), 11);
|
||||
text.letterSpacing = -0.5;
|
||||
if (this.getStackCount() >= this.required) {
|
||||
text.setTint(0xf89890);
|
||||
}
|
||||
text.setOrigin(0, 0);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
override shouldApply(pokemon?: Pokemon, move?: Moves): boolean {
|
||||
return move === this.move;
|
||||
}
|
||||
|
||||
getMaxHeldItemCount(pokemon: Pokemon): number {
|
||||
return 999;
|
||||
}
|
||||
|
||||
override getSpecies(): Species {
|
||||
return this.species;
|
||||
}
|
||||
}
|
||||
|
||||
export class EvoTrackerRecoilModifier extends PokemonHeldItemModifier {
|
||||
protected species: Species;
|
||||
protected required: number;
|
||||
public isTransferable = false;
|
||||
|
||||
constructor(type: ModifierType, pokemonId: number, species: Species, required: number, stackCount?: number) {
|
||||
super(type, pokemonId, stackCount);
|
||||
this.species = species;
|
||||
this.required = required;
|
||||
}
|
||||
|
||||
matchType(modifier: Modifier): boolean {
|
||||
return (
|
||||
modifier instanceof EvoTrackerRecoilModifier && modifier.species === this.species && modifier.required === this.required
|
||||
);
|
||||
}
|
||||
|
||||
clone(): PersistentModifier {
|
||||
return new EvoTrackerRecoilModifier(this.type, this.pokemonId, this.species, this.required, this.stackCount);
|
||||
}
|
||||
|
||||
getArgs(): any[] {
|
||||
return super.getArgs().concat([this.species, this.required]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the {@linkcode EvoTrackerModifier}
|
||||
* @returns always `true`
|
||||
*/
|
||||
override apply(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
getIconStackText(virtual?: boolean): Phaser.GameObjects.BitmapText | null {
|
||||
const text = globalScene.add.bitmapText(10, 15, "item-count", (this.getStackCount()).toString(), 11);
|
||||
text.letterSpacing = -0.5;
|
||||
if (this.getStackCount() >= this.required) {
|
||||
text.setTint(0xf89890);
|
||||
}
|
||||
text.setOrigin(0, 0);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
getMaxHeldItemCount(pokemon: Pokemon): number {
|
||||
return 9999;
|
||||
}
|
||||
|
||||
override getSpecies(): Species {
|
||||
return this.species;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Currently used by Shuckle Juice item
|
||||
*/
|
||||
|
@ -20,7 +20,7 @@ import type { EnemyPokemon } from "#app/field/pokemon";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { HitResult, PlayerPokemon, PokemonMove } from "#app/field/pokemon";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { EvoTrackerRecoilModifier, PokemonInstantReviveModifier } from "#app/modifier/modifier";
|
||||
import { PokemonInstantReviveModifier } from "#app/modifier/modifier";
|
||||
import { SwitchType } from "#enums/switch-type";
|
||||
import i18next from "i18next";
|
||||
import { DamageAnimPhase } from "./damage-anim-phase";
|
||||
@ -118,13 +118,6 @@ export class FaintPhase extends PokemonPhase {
|
||||
);
|
||||
globalScene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true);
|
||||
|
||||
if (pokemon.isPlayer() && pokemon.hasSpecies(Species.BASCULIN, "white-striped")) { // Reset counter
|
||||
const modifier = globalScene.findModifier(m => m instanceof EvoTrackerRecoilModifier && m.pokemonId === pokemon.id);
|
||||
if (!isNullOrUndefined(modifier)) {
|
||||
globalScene.removeModifier(modifier);
|
||||
}
|
||||
}
|
||||
|
||||
pokemon.resetTera();
|
||||
|
||||
if (pokemon.turnData.attacksReceived?.length) {
|
||||
|
@ -57,7 +57,6 @@ import {
|
||||
DamageMoneyRewardModifier,
|
||||
EnemyAttackStatusEffectChanceModifier,
|
||||
EnemyEndureChanceModifier,
|
||||
EvoTrackerMoveUseModifier,
|
||||
FlinchChanceModifier,
|
||||
HitHealModifier,
|
||||
PokemonMultiHitModifier,
|
||||
@ -789,11 +788,6 @@ export class MoveEffectPhase extends PokemonPhase {
|
||||
if (this.lastHit) {
|
||||
globalScene.triggerPokemonFormChange(user, SpeciesFormChangePostMoveTrigger);
|
||||
|
||||
// Increment evo counter for Primeape and Stantler
|
||||
if (user.isPlayer()) {
|
||||
this.incrementMoveUseEvoCounters(user);
|
||||
}
|
||||
|
||||
// Multi-hit check for Wimp Out/Emergency Exit
|
||||
if (user.turnData.hitCount > 1) {
|
||||
applyPostDamageAbAttrs(PostDamageAbAttr, target, 0, target.hasPassive(), false, [], user);
|
||||
@ -801,23 +795,6 @@ export class MoveEffectPhase extends PokemonPhase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Increments evolution tracker stack for "Use move X times" evolutions, namely Primeape and Stantler
|
||||
* @param user {@linkcode Pokemon} the move's user
|
||||
*/
|
||||
incrementMoveUseEvoCounters(user: Pokemon) {
|
||||
// Increment evo counter for Primeape and Stantler
|
||||
if (
|
||||
((user.hasSpecies(Species.PRIMEAPE) && this.move.id === Moves.RAGE_FIST) ||
|
||||
(user.hasSpecies(Species.STANTLER) && this.move.id === Moves.PSYSHIELD_BASH))) {
|
||||
const modifier = (this.move.id === Moves.RAGE_FIST ?
|
||||
modifierTypes.EVOLUTION_TRACKER_PRIMEAPE().withIdFromFunc(modifierTypes.EVOLUTION_TRACKER_PRIMEAPE) :
|
||||
modifierTypes.EVOLUTION_TRACKER_STANTLER().withIdFromFunc(modifierTypes.EVOLUTION_TRACKER_STANTLER))
|
||||
.newModifier(user) as EvoTrackerMoveUseModifier;
|
||||
globalScene.addModifier(modifier); // Adds modifier or increments existing stack
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sub-method of for {@linkcode applyMoveEffects} that applies damage to the target.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user