more bug fix cleanup and PR feedback

This commit is contained in:
ImperialSympathizer 2024-09-26 14:34:51 -04:00
parent 8818c91f84
commit 168fa82d58
5 changed files with 12 additions and 14 deletions

View File

@ -24,6 +24,7 @@ import { BerryType } from "#enums/berry-type";
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
import { Stat } from "#enums/stat";
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
import i18next from "i18next";
/** the i18n namespace for this encounter */
const namespace = "mysteryEncounter:absoluteAvarice";
@ -263,7 +264,7 @@ export const AbsoluteAvariceEncounter: MysteryEncounter =
// Provides 1x Reviver Seed to each party member at end of battle
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 party = scene.getParty();
party.forEach(p => {

View File

@ -178,6 +178,9 @@ const MISC_TUTOR_MOVES = [
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];
/**
@ -219,11 +222,12 @@ export const BugTypeSuperfanEncounter: MysteryEncounter =
female: true,
});
let beedrillKeys, butterfreeKeys;
let beedrillKeys: { spriteKey: string, fileRoot: string }, butterfreeKeys: { spriteKey: string, fileRoot: string };
if (scene.currentBattle.waveIndex < WAVE_LEVEL_BREAKPOINTS[3]) {
beedrillKeys = getSpriteKeysFromSpecies(Species.BEEDRILL, false);
butterfreeKeys = getSpriteKeysFromSpecies(Species.BUTTERFREE, false);
} else {
// Mega Beedrill/Gmax Butterfree
beedrillKeys = getSpriteKeysFromSpecies(Species.BEEDRILL, false, 1);
butterfreeKeys = getSpriteKeysFromSpecies(Species.BUTTERFREE, false, 1);
}

View File

@ -500,7 +500,7 @@ function generateItemsOfTier(scene: BattleScene, pokemon: PlayerPokemon, numItem
}
const randIndex = randSeedInt(pool.length);
const newItemType = pool[randIndex];
let newMod;
let newMod: PokemonHeldItemModifierType;
if (tier === "Berries") {
newMod = generateModifierType(scene, modifierTypes.BERRY, [newItemType[0]]) as PokemonHeldItemModifierType;
} else {

View File

@ -13,7 +13,7 @@ import * as Utils from "../utils";
import { getBerryEffectFunc, getBerryPredicate } from "../data/berry";
import { BattlerTagType } from "#enums/battler-tag-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 { VoucherType } from "../system/voucher";
import { FormChangeItem, SpeciesFormChangeItemTrigger, SpeciesFormChangeLapseTeraTrigger, SpeciesFormChangeTeraTrigger } from "../data/pokemon-forms";

View File

@ -1198,13 +1198,6 @@ export class GameData {
return resolve([false, false]);
}
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 => {
if (response.ok) {
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
// Prevents form changes, nature changes, etc. from unintentionally updating the dex data of a "rental" pokemon
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);
} else {
return new Promise(resolve => resolve(false));
return Promise.resolve(false);
}
}
@ -1727,7 +1720,7 @@ export class GameData {
addStarterCandy(species: PokemonSpecies, count: integer): void {
// Only gain candies if the Pokemon has already been marked as caught in dex (ignore "rental" pokemon)
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.starterData[species.speciesId].candyCount += count;
}