mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-29 13:02:46 +02:00
Fixing some phases
This commit is contained in:
parent
f1c6cf4419
commit
1e9239720d
@ -23,10 +23,9 @@ export class AddEnemyBuffModifierPhase extends Phase {
|
|||||||
globalScene.findModifiers(m => m instanceof EnemyPersistentModifier, false),
|
globalScene.findModifiers(m => m instanceof EnemyPersistentModifier, false),
|
||||||
),
|
),
|
||||||
true,
|
true,
|
||||||
true,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
globalScene.updateModifiers(false, true);
|
globalScene.updateModifiers(false);
|
||||||
this.end();
|
this.end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect";
|
|||||||
import { addPokeballCaptureStars, addPokeballOpenParticles } from "#app/field/anims";
|
import { addPokeballCaptureStars, addPokeballOpenParticles } from "#app/field/anims";
|
||||||
import type { EnemyPokemon } from "#app/field/pokemon";
|
import type { EnemyPokemon } from "#app/field/pokemon";
|
||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
|
||||||
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
||||||
import { achvs } from "#app/system/achv";
|
import { achvs } from "#app/system/achv";
|
||||||
import type { PartyOption } from "#app/ui/party-ui-handler";
|
import type { PartyOption } from "#app/ui/party-ui-handler";
|
||||||
@ -255,6 +254,7 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
}),
|
}),
|
||||||
null,
|
null,
|
||||||
() => {
|
() => {
|
||||||
|
const heldItemConfig = pokemon.heldItemManager.generateHeldItemConfiguration();
|
||||||
const end = () => {
|
const end = () => {
|
||||||
globalScene.phaseManager.unshiftNew("VictoryPhase", this.battlerIndex);
|
globalScene.phaseManager.unshiftNew("VictoryPhase", this.battlerIndex);
|
||||||
globalScene.pokemonInfoContainer.hide();
|
globalScene.pokemonInfoContainer.hide();
|
||||||
@ -269,19 +269,16 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
};
|
};
|
||||||
const addToParty = (slotIndex?: number) => {
|
const addToParty = (slotIndex?: number) => {
|
||||||
const newPokemon = pokemon.addToParty(this.pokeballType, slotIndex);
|
const newPokemon = pokemon.addToParty(this.pokeballType, slotIndex);
|
||||||
const modifiers = globalScene.findModifiers(m => m instanceof PokemonHeldItemModifier, false);
|
|
||||||
if (globalScene.getPlayerParty().filter(p => p.isShiny()).length === PLAYER_PARTY_MAX_SIZE) {
|
if (globalScene.getPlayerParty().filter(p => p.isShiny()).length === PLAYER_PARTY_MAX_SIZE) {
|
||||||
globalScene.validateAchv(achvs.SHINY_PARTY);
|
globalScene.validateAchv(achvs.SHINY_PARTY);
|
||||||
}
|
}
|
||||||
Promise.all(modifiers.map(m => globalScene.addModifier(m, true))).then(() => {
|
globalScene.updateModifiers(true);
|
||||||
globalScene.updateModifiers(true);
|
removePokemon();
|
||||||
removePokemon();
|
if (newPokemon) {
|
||||||
if (newPokemon) {
|
newPokemon.loadAssets().then(end);
|
||||||
newPokemon.loadAssets().then(end);
|
} else {
|
||||||
} else {
|
end();
|
||||||
end();
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
Promise.all([pokemon.hideInfo(), globalScene.gameData.setPokemonCaught(pokemon)]).then(() => {
|
Promise.all([pokemon.hideInfo(), globalScene.gameData.setPokemonCaught(pokemon)]).then(() => {
|
||||||
if (globalScene.getPlayerParty().length === PLAYER_PARTY_MAX_SIZE) {
|
if (globalScene.getPlayerParty().length === PLAYER_PARTY_MAX_SIZE) {
|
||||||
@ -306,6 +303,7 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
pokemon.variant,
|
pokemon.variant,
|
||||||
pokemon.ivs,
|
pokemon.ivs,
|
||||||
pokemon.nature,
|
pokemon.nature,
|
||||||
|
heldItemConfig,
|
||||||
pokemon,
|
pokemon,
|
||||||
);
|
);
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { applyPostBattleAbAttrs } from "#app/data/abilities/apply-ab-attrs";
|
import { applyPostBattleAbAttrs } from "#app/data/abilities/apply-ab-attrs";
|
||||||
import { LapsingPersistentModifier, LapsingPokemonHeldItemModifier } from "#app/modifier/modifier";
|
import { LapsingPersistentModifier } from "#app/modifier/modifier";
|
||||||
import { BattlePhase } from "./battle-phase";
|
import { BattlePhase } from "./battle-phase";
|
||||||
|
|
||||||
export class BattleEndPhase extends BattlePhase {
|
export class BattleEndPhase extends BattlePhase {
|
||||||
@ -81,13 +81,10 @@ export class BattleEndPhase extends BattlePhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const lapsingModifiers = globalScene.findModifiers(
|
const lapsingModifiers = globalScene.findModifiers(
|
||||||
m => m instanceof LapsingPersistentModifier || m instanceof LapsingPokemonHeldItemModifier,
|
m => m instanceof LapsingPersistentModifier,
|
||||||
) as (LapsingPersistentModifier | LapsingPokemonHeldItemModifier)[];
|
) as LapsingPersistentModifier[];
|
||||||
for (const m of lapsingModifiers) {
|
for (const m of lapsingModifiers) {
|
||||||
const args: any[] = [];
|
const args: any[] = [];
|
||||||
if (m instanceof LapsingPokemonHeldItemModifier) {
|
|
||||||
args.push(globalScene.getPokemonById(m.pokemonId));
|
|
||||||
}
|
|
||||||
if (!m.lapse(...args)) {
|
if (!m.lapse(...args)) {
|
||||||
globalScene.removeModifier(m);
|
globalScene.removeModifier(m);
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,6 @@ import type Pokemon from "#app/field/pokemon";
|
|||||||
import { FieldPosition } from "#enums/field-position";
|
import { FieldPosition } from "#enums/field-position";
|
||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import { BoostBugSpawnModifier, IvScannerModifier } from "#app/modifier/modifier";
|
import { BoostBugSpawnModifier, IvScannerModifier } from "#app/modifier/modifier";
|
||||||
import { regenerateModifierPoolThresholds } from "#app/modifier/modifier-type";
|
|
||||||
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
|
||||||
import Overrides from "#app/overrides";
|
import Overrides from "#app/overrides";
|
||||||
import { BattlePhase } from "#app/phases/battle-phase";
|
import { BattlePhase } from "#app/phases/battle-phase";
|
||||||
import { achvs } from "#app/system/achv";
|
import { achvs } from "#app/system/achv";
|
||||||
@ -271,10 +269,6 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
|
|
||||||
if (!this.loaded && battle.battleType !== BattleType.MYSTERY_ENCOUNTER) {
|
if (!this.loaded && battle.battleType !== BattleType.MYSTERY_ENCOUNTER) {
|
||||||
// generate modifiers for MEs, overriding prior ones as applicable
|
// generate modifiers for MEs, overriding prior ones as applicable
|
||||||
regenerateModifierPoolThresholds(
|
|
||||||
globalScene.getEnemyField(),
|
|
||||||
battle.battleType === BattleType.TRAINER ? ModifierPoolType.TRAINER : ModifierPoolType.WILD,
|
|
||||||
);
|
|
||||||
globalScene.generateEnemyModifiers();
|
globalScene.generateEnemyModifiers();
|
||||||
overrideModifiers(false);
|
overrideModifiers(false);
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
globalScene.phaseManager.queueMessage(i18next.t("battle:attackHitsCount", { count: hitsTotal }));
|
globalScene.phaseManager.queueMessage(i18next.t("battle:attackHitsCount", { count: hitsTotal }));
|
||||||
}
|
}
|
||||||
|
|
||||||
globalScene.applyModifiers(HitHealModifier, this.player, user);
|
applyHeldItems(ITEM_EFFECT.HIT_HEAL, { pokemon: user });
|
||||||
this.getTargets().forEach(target => {
|
this.getTargets().forEach(target => {
|
||||||
target.turnData.moveEffectiveness = null;
|
target.turnData.moveEffectiveness = null;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user