Skip to content

Commit

Permalink
Merge branch 'main' into version_converter_hotfix2
Browse files Browse the repository at this point in the history
  • Loading branch information
xsn34kzx authored Sep 10, 2024
2 parents a6229de + 16fc3a8 commit 969cce5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/battle-scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2765,17 +2765,17 @@ export default class BattleScene extends SceneBase {
playerParty.forEach(p => {
keys.push(p.getSpriteKey(true));
keys.push(p.getBattleSpriteKey(true, true));
keys.push("cry/" + p.species.getCryKey(p.species.formIndex));
if (p.fusionSpecies && p.getSpeciesForm() !== p.getFusionSpeciesForm()) {
keys.push("cry/" + p.species.getCryKey(p.formIndex));
if (p.fusionSpecies) {
keys.push("cry/"+p.fusionSpecies.getCryKey(p.fusionFormIndex));
}
});
// enemyParty has to be operated on separately from playerParty because playerPokemon =/= enemyPokemon
const enemyParty = this.getEnemyParty();
enemyParty.forEach(p => {
keys.push(p.getSpriteKey(true));
keys.push("cry/" + p.species.getCryKey(p.species.formIndex));
if (p.fusionSpecies && p.getSpeciesForm() !== p.getFusionSpeciesForm()) {
keys.push("cry/" + p.species.getCryKey(p.formIndex));
if (p.fusionSpecies) {
keys.push("cry/"+p.fusionSpecies.getCryKey(p.fusionFormIndex));
}
});
Expand Down
2 changes: 0 additions & 2 deletions src/field/pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3524,7 +3524,6 @@ export default interface Pokemon {

export class PlayerPokemon extends Pokemon {
public compatibleTms: Moves[];
public usedTms: Moves[];

constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex?: integer, formIndex?: integer, gender?: Gender, shiny?: boolean, variant?: Variant, ivs?: integer[], nature?: Nature, dataSource?: Pokemon | PokemonData) {
super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource);
Expand All @@ -3548,7 +3547,6 @@ export class PlayerPokemon extends Pokemon {
}
}
this.generateCompatibleTms();
this.usedTms = [];
}

initBattleInfo(): void {
Expand Down
6 changes: 6 additions & 0 deletions src/phases/learn-move-phase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
if (emptyMoveIndex > -1) {
pokemon.setMove(emptyMoveIndex, this.moveId);
if (this.fromTM) {
if (!pokemon.usedTMs) {
pokemon.usedTMs = [];
}
pokemon.usedTMs.push(this.moveId);
}
initMoveAnim(this.scene, this.moveId).then(() => {
Expand Down Expand Up @@ -91,6 +94,9 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
this.scene.ui.showText(i18next.t("battle:learnMoveForgetSuccess", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: pokemon.moveset[moveIndex]!.getName() }), null, () => { // TODO: is the bang correct?
this.scene.ui.showText(i18next.t("battle:learnMoveAnd"), null, () => {
if (this.fromTM) {
if (!pokemon.usedTMs) {
pokemon.usedTMs = [];
}
pokemon.usedTMs.push(this.moveId);
}
pokemon.setMove(moveIndex, Moves.NONE);
Expand Down
2 changes: 1 addition & 1 deletion src/system/version-converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function applySystemDataPatches(data: SystemSaveData) {
// --- PATCHES ---

// Fix Starter Data
if (data.gameVersion) {
if (data.starterData) {
for (const starterId of defaultStarterSpecies) {
data.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1;
data.dexData[starterId].caughtAttr |= DexAttr.FEMALE;
Expand Down

0 comments on commit 969cce5

Please sign in to comment.