mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-25 00:39:27 +02:00
more bug fix cleanup and PR feedback
This commit is contained in:
parent
8818c91f84
commit
168fa82d58
@ -24,6 +24,7 @@ import { BerryType } from "#enums/berry-type";
|
|||||||
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
import i18next from "i18next";
|
||||||
|
|
||||||
/** the i18n namespace for this encounter */
|
/** the i18n namespace for this encounter */
|
||||||
const namespace = "mysteryEncounter:absoluteAvarice";
|
const namespace = "mysteryEncounter:absoluteAvarice";
|
||||||
@ -263,7 +264,7 @@ export const AbsoluteAvariceEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
// Provides 1x Reviver Seed to each party member at end of battle
|
// Provides 1x Reviver Seed to each party member at end of battle
|
||||||
const revSeed = generateModifierType(scene, modifierTypes.REVIVER_SEED);
|
const revSeed = generateModifierType(scene, modifierTypes.REVIVER_SEED);
|
||||||
encounter.setDialogueToken("foodReward", revSeed?.name ?? "Reviver Seed");
|
encounter.setDialogueToken("foodReward", revSeed?.name ?? i18next.t("modifierType:ModifierType.REVIVER_SEED.name"));
|
||||||
const givePartyPokemonReviverSeeds = () => {
|
const givePartyPokemonReviverSeeds = () => {
|
||||||
const party = scene.getParty();
|
const party = scene.getParty();
|
||||||
party.forEach(p => {
|
party.forEach(p => {
|
||||||
|
@ -178,6 +178,9 @@ const MISC_TUTOR_MOVES = [
|
|||||||
Moves.U_TURN
|
Moves.U_TURN
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wave breakpoints that determine how strong to make the Bug-Type Superfan's team
|
||||||
|
*/
|
||||||
const WAVE_LEVEL_BREAKPOINTS = [30, 50, 70, 100, 120, 140, 160];
|
const WAVE_LEVEL_BREAKPOINTS = [30, 50, 70, 100, 120, 140, 160];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -219,11 +222,12 @@ export const BugTypeSuperfanEncounter: MysteryEncounter =
|
|||||||
female: true,
|
female: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
let beedrillKeys, butterfreeKeys;
|
let beedrillKeys: { spriteKey: string, fileRoot: string }, butterfreeKeys: { spriteKey: string, fileRoot: string };
|
||||||
if (scene.currentBattle.waveIndex < WAVE_LEVEL_BREAKPOINTS[3]) {
|
if (scene.currentBattle.waveIndex < WAVE_LEVEL_BREAKPOINTS[3]) {
|
||||||
beedrillKeys = getSpriteKeysFromSpecies(Species.BEEDRILL, false);
|
beedrillKeys = getSpriteKeysFromSpecies(Species.BEEDRILL, false);
|
||||||
butterfreeKeys = getSpriteKeysFromSpecies(Species.BUTTERFREE, false);
|
butterfreeKeys = getSpriteKeysFromSpecies(Species.BUTTERFREE, false);
|
||||||
} else {
|
} else {
|
||||||
|
// Mega Beedrill/Gmax Butterfree
|
||||||
beedrillKeys = getSpriteKeysFromSpecies(Species.BEEDRILL, false, 1);
|
beedrillKeys = getSpriteKeysFromSpecies(Species.BEEDRILL, false, 1);
|
||||||
butterfreeKeys = getSpriteKeysFromSpecies(Species.BUTTERFREE, false, 1);
|
butterfreeKeys = getSpriteKeysFromSpecies(Species.BUTTERFREE, false, 1);
|
||||||
}
|
}
|
||||||
|
@ -500,7 +500,7 @@ function generateItemsOfTier(scene: BattleScene, pokemon: PlayerPokemon, numItem
|
|||||||
}
|
}
|
||||||
const randIndex = randSeedInt(pool.length);
|
const randIndex = randSeedInt(pool.length);
|
||||||
const newItemType = pool[randIndex];
|
const newItemType = pool[randIndex];
|
||||||
let newMod;
|
let newMod: PokemonHeldItemModifierType;
|
||||||
if (tier === "Berries") {
|
if (tier === "Berries") {
|
||||||
newMod = generateModifierType(scene, modifierTypes.BERRY, [newItemType[0]]) as PokemonHeldItemModifierType;
|
newMod = generateModifierType(scene, modifierTypes.BERRY, [newItemType[0]]) as PokemonHeldItemModifierType;
|
||||||
} else {
|
} else {
|
||||||
|
@ -13,7 +13,7 @@ import * as Utils from "../utils";
|
|||||||
import { getBerryEffectFunc, getBerryPredicate } from "../data/berry";
|
import { getBerryEffectFunc, getBerryPredicate } from "../data/berry";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { BerryType } from "#enums/berry-type";
|
import { BerryType } from "#enums/berry-type";
|
||||||
import { getStatusEffectHealText, StatusEffect } from "../data/status-effect";
|
import { getStatusEffectHealText, StatusEffect } from "#app/data/status-effect";
|
||||||
import { achvs } from "../system/achv";
|
import { achvs } from "../system/achv";
|
||||||
import { VoucherType } from "../system/voucher";
|
import { VoucherType } from "../system/voucher";
|
||||||
import { FormChangeItem, SpeciesFormChangeItemTrigger, SpeciesFormChangeLapseTeraTrigger, SpeciesFormChangeTeraTrigger } from "../data/pokemon-forms";
|
import { FormChangeItem, SpeciesFormChangeItemTrigger, SpeciesFormChangeLapseTeraTrigger, SpeciesFormChangeTeraTrigger } from "../data/pokemon-forms";
|
||||||
|
@ -1198,13 +1198,6 @@ export class GameData {
|
|||||||
return resolve([false, false]);
|
return resolve([false, false]);
|
||||||
}
|
}
|
||||||
const sessionData = this.getSessionSaveData(scene);
|
const sessionData = this.getSessionSaveData(scene);
|
||||||
|
|
||||||
// Filter out any "rental" Pokemon from the player's team that were used for the run
|
|
||||||
sessionData.party = sessionData.party.filter(p => {
|
|
||||||
const speciesRootForm = getPokemonSpecies(p.species).getRootSpeciesId();
|
|
||||||
return !!this.scene.gameData.dexData[speciesRootForm].caughtAttr;
|
|
||||||
});
|
|
||||||
|
|
||||||
Utils.apiPost(`savedata/session/clear?slot=${slotId}&trainerId=${this.trainerId}&secretId=${this.secretId}&clientSessionId=${clientSessionId}`, JSON.stringify(sessionData), undefined, true).then(response => {
|
Utils.apiPost(`savedata/session/clear?slot=${slotId}&trainerId=${this.trainerId}&secretId=${this.secretId}&clientSessionId=${clientSessionId}`, JSON.stringify(sessionData), undefined, true).then(response => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
loggedInUser!.lastSessionSlot = -1; // TODO: is the bang correct?
|
loggedInUser!.lastSessionSlot = -1; // TODO: is the bang correct?
|
||||||
@ -1586,10 +1579,10 @@ export class GameData {
|
|||||||
// If incrementCount === false (not a catch scenario), only update the pokemon's dex data if the Pokemon has already been marked as caught in dex
|
// If incrementCount === false (not a catch scenario), only update the pokemon's dex data if the Pokemon has already been marked as caught in dex
|
||||||
// Prevents form changes, nature changes, etc. from unintentionally updating the dex data of a "rental" pokemon
|
// Prevents form changes, nature changes, etc. from unintentionally updating the dex data of a "rental" pokemon
|
||||||
const speciesRootForm = pokemon.species.getRootSpeciesId();
|
const speciesRootForm = pokemon.species.getRootSpeciesId();
|
||||||
if (!!this.scene.gameData.dexData[speciesRootForm].caughtAttr) {
|
if (this.scene.gameData.dexData[speciesRootForm].caughtAttr) {
|
||||||
return this.setPokemonSpeciesCaught(pokemon, pokemon.species, incrementCount, fromEgg, showMessage);
|
return this.setPokemonSpeciesCaught(pokemon, pokemon.species, incrementCount, fromEgg, showMessage);
|
||||||
} else {
|
} else {
|
||||||
return new Promise(resolve => resolve(false));
|
return Promise.resolve(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1727,7 +1720,7 @@ export class GameData {
|
|||||||
addStarterCandy(species: PokemonSpecies, count: integer): void {
|
addStarterCandy(species: PokemonSpecies, count: integer): void {
|
||||||
// Only gain candies if the Pokemon has already been marked as caught in dex (ignore "rental" pokemon)
|
// Only gain candies if the Pokemon has already been marked as caught in dex (ignore "rental" pokemon)
|
||||||
const speciesRootForm = species.getRootSpeciesId();
|
const speciesRootForm = species.getRootSpeciesId();
|
||||||
if (!!this.scene.gameData.dexData[speciesRootForm].caughtAttr) {
|
if (this.scene.gameData.dexData[speciesRootForm].caughtAttr) {
|
||||||
this.scene.candyBar.showStarterSpeciesCandy(species.speciesId, count);
|
this.scene.candyBar.showStarterSpeciesCandy(species.speciesId, count);
|
||||||
this.starterData[species.speciesId].candyCount += count;
|
this.starterData[species.speciesId].candyCount += count;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user