Skip to content

Commit

Permalink
Fix Merge Conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
xsn34kzx committed Aug 26, 2024
2 parents aa7d6be + 6ccb6fc commit 1a2416b
Show file tree
Hide file tree
Showing 35 changed files with 1,574 additions and 321 deletions.
Binary file modified public/images/pokemon/exp/shiny/4077.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/images/pokemon/variant/_masterlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -10806,7 +10806,7 @@
"962": [
1,
1,
2
1
],
"967": [
0,
Expand Down Expand Up @@ -11095,4 +11095,4 @@
1
]
}
}
}
17 changes: 16 additions & 1 deletion public/images/pokemon/variant/exp/back/962.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,20 @@
"fffbff": "edf8e6",
"7b827b": "6a856a",
"a7aba7": "98a798"
},
"2": {
"342930": "754156",
"0f0f0f": "0f0f0f",
"4a3942": "a5777f",
"937d85": "2f2655",
"b9aaaf": "453863",
"665b60": "211f45",
"efe3e1": "67548a",
"a7aba7": "ddac84",
"fffbff": "f7e5d0",
"e64c62": "aba7a8",
"993e49": "797877",
"501d25": "545151",
"7b827b": "a96c4b"
}
}
}
167 changes: 0 additions & 167 deletions public/images/pokemon/variant/exp/back/962_3.json

This file was deleted.

Binary file removed public/images/pokemon/variant/exp/back/962_3.png
Binary file not shown.
18 changes: 16 additions & 2 deletions src/battle-scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export default class BattleScene extends SceneBase {
public bgmVolume: number = 1;
public fieldVolume: number = 1;
public seVolume: number = 1;
public uiVolume: number = 1;
public gameSpeed: integer = 1;
public damageNumbersMode: integer = 0;
public reroll: boolean = false;
Expand Down Expand Up @@ -1755,6 +1756,7 @@ export default class BattleScene extends SceneBase {
} else {
const soundDetails = sound.key.split("/");
switch (soundDetails[0]) {

case "battle_anims":
case "cry":
if (soundDetails[1].startsWith("PRSFX- ")) {
Expand Down Expand Up @@ -1791,6 +1793,16 @@ export default class BattleScene extends SceneBase {
try {
const keyDetails = key.split("/");
switch (keyDetails[0]) {
case "level_up_fanfare":
case "item_fanfare":
case "minor_fanfare":
case "heal":
case "evolution":
case "evolution_fanfare":
// These sounds are loaded in as BGM, but played as sound effects
// When these sounds are updated in updateVolume(), they are treated as BGM however because they are placed in the BGM Cache through being called by playSoundWithoutBGM()
config["volume"] = this.masterVolume * this.bgmVolume;
break;
case "battle_anims":
case "cry":
config["volume"] = this.masterVolume * this.fieldVolume;
Expand All @@ -1799,9 +1811,11 @@ export default class BattleScene extends SceneBase {
config["volume"] *= 0.5;
}
break;
case "se":
case "ui":
default:
//As of, right now this applies to the "select", "menu_open", "error" sound effects
config["volume"] = this.masterVolume * this.uiVolume;
break;
case "se":
config["volume"] = this.masterVolume * this.seVolume;
break;
}
Expand Down
3 changes: 2 additions & 1 deletion src/data/daily-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export function getDailyRunStarters(scene: BattleScene, seed: string): Starter[]
const costSpecies = Object.keys(speciesStarters)
.map(s => parseInt(s) as Species)
.filter(s => speciesStarters[s] === cost);
const starterSpecies = getPokemonSpecies(getPokemonSpecies(Utils.randSeedItem(costSpecies)).getTrainerSpeciesForLevel(startingLevel, true, PartyMemberStrength.STRONGER));
const randPkmSpecies = getPokemonSpecies(Utils.randSeedItem(costSpecies));
const starterSpecies = getPokemonSpecies(randPkmSpecies.getTrainerSpeciesForLevel(startingLevel, true, PartyMemberStrength.STRONGER));
starters.push(getDailyRunStarter(scene, starterSpecies, startingLevel));
}
}, 0, seed);
Expand Down
3 changes: 2 additions & 1 deletion src/data/pokemon-evolutions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,8 @@ export const pokemonEvolutions: PokemonEvolutions = {
new SpeciesEvolution(Species.BLISSEY, 1, null, new SpeciesFriendshipEvolutionCondition(200), SpeciesWildEvolutionDelay.LONG)
],
[Species.PICHU]: [
new SpeciesEvolution(Species.PIKACHU, 1, null, new SpeciesFriendshipEvolutionCondition(90), SpeciesWildEvolutionDelay.SHORT)
new SpeciesFormEvolution(Species.PIKACHU, "spiky", "partner", 1, null, new SpeciesFriendshipEvolutionCondition(90), SpeciesWildEvolutionDelay.SHORT),
new SpeciesFormEvolution(Species.PIKACHU, "", "", 1, null, new SpeciesFriendshipEvolutionCondition(90), SpeciesWildEvolutionDelay.SHORT),
],
[Species.CLEFFA]: [
new SpeciesEvolution(Species.CLEFAIRY, 1, null, new SpeciesFriendshipEvolutionCondition(160), SpeciesWildEvolutionDelay.SHORT)
Expand Down
50 changes: 30 additions & 20 deletions src/data/pokemon-species.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@

import { Localizable } from "#app/interfaces/locales";
import { Abilities } from "#enums/abilities";
import { PartyMemberStrength } from "#enums/party-member-strength";
import { Species } from "#enums/species";
import { QuantizerCelebi, argbFromRgba, rgbaFromArgb } from "@material/material-color-utilities";
import i18next from "i18next";
import BattleScene, { AnySound } from "../battle-scene";
import { Variant, variantColorCache } from "./variant";
import { variantData } from "./variant";
import { GameMode } from "../game-mode";
import { StarterMoveset } from "../system/game-data";
import * as Utils from "../utils";
import { uncatchableSpecies } from "./biomes";
import { speciesEggMoves } from "./egg-moves";
import { GrowthRate } from "./exp";
import { EvolutionLevel, SpeciesWildEvolutionDelay, pokemonEvolutions, pokemonPrevolutions } from "./pokemon-evolutions";
import { Type } from "./type";
import { LevelMoves, pokemonFormLevelMoves, pokemonFormLevelMoves as pokemonSpeciesFormLevelMoves, pokemonSpeciesLevelMoves } from "./pokemon-level-moves";
import { uncatchableSpecies } from "./biomes";
import * as Utils from "../utils";
import { StarterMoveset } from "../system/game-data";
import { speciesEggMoves } from "./egg-moves";
import { GameMode } from "../game-mode";
import { QuantizerCelebi, argbFromRgba, rgbaFromArgb } from "@material/material-color-utilities";
import { VariantSet } from "./variant";
import i18next from "i18next";
import { Localizable } from "#app/interfaces/locales";
import { Stat } from "#enums/stat";
import { Abilities } from "#enums/abilities";
import { PartyMemberStrength } from "#enums/party-member-strength";
import { Species } from "#enums/species";
import { Variant, VariantSet, variantColorCache, variantData } from "./variant";

export enum Region {
NORMAL,
Expand All @@ -28,7 +25,15 @@ export enum Region {
PALDEA
}

export function getPokemonSpecies(species: Species | Species[]): PokemonSpecies {
/**
* Gets the {@linkcode PokemonSpecies} object associated with the {@linkcode Species} enum given
* @param species The species to fetch
* @returns The associated {@linkcode PokemonSpecies} object
*/
export function getPokemonSpecies(species: Species | Species[] | undefined): PokemonSpecies {
if (!species) {
throw new Error("`species` must not be undefined in `getPokemonSpecies()`");
}
// If a special pool (named trainers) is used here it CAN happen that they have a array as species (which means choose one of those two). So we catch that with this code block
if (Array.isArray(species)) {
// Pick a random species from the list
Expand Down Expand Up @@ -648,8 +653,8 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
return this.getSpeciesForLevel(level, allowEvolving, false, (isBoss ? PartyMemberStrength.WEAKER : PartyMemberStrength.AVERAGE) + (gameMode?.isEndless ? 1 : 0));
}

getTrainerSpeciesForLevel(level: integer, allowEvolving: boolean = false, strength: PartyMemberStrength): Species {
return this.getSpeciesForLevel(level, allowEvolving, true, strength);
getTrainerSpeciesForLevel(level: integer, allowEvolving: boolean = false, strength: PartyMemberStrength, currentWave: number = 0): Species {
return this.getSpeciesForLevel(level, allowEvolving, true, strength, currentWave);
}

private getStrengthLevelDiff(strength: PartyMemberStrength): integer {
Expand All @@ -669,7 +674,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
}
}

getSpeciesForLevel(level: integer, allowEvolving: boolean = false, forTrainer: boolean = false, strength: PartyMemberStrength = PartyMemberStrength.WEAKER): Species {
getSpeciesForLevel(level: integer, allowEvolving: boolean = false, forTrainer: boolean = false, strength: PartyMemberStrength = PartyMemberStrength.WEAKER, currentWave: number = 0): Species {
const prevolutionLevels = this.getPrevolutionLevels();

if (prevolutionLevels.length) {
Expand Down Expand Up @@ -730,6 +735,11 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
evolutionChance = Math.min(0.65 * easeInFunc(Math.min(Math.max(level - evolutionLevel, 0), preferredMinLevel) / preferredMinLevel) + 0.35 * easeOutFunc(Math.min(Math.max(level - evolutionLevel, 0), preferredMinLevel * 2.5) / (preferredMinLevel * 2.5)), 1);
}
}
/* (Most) Trainers shouldn't be using unevolved Pokemon by the third gym leader / wave 80. Exceptions to this include Breeders, whose large teams are balanced by the use of weaker pokemon */
if (currentWave >= 80 && forTrainer && strength > PartyMemberStrength.WEAKER) {
evolutionChance = 1;
noEvolutionChance = 0;
}

if (evolutionChance > 0) {
if (isRegionalEvolution) {
Expand All @@ -754,7 +764,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali

for (const weight of evolutionPool.keys()) {
if (randValue < weight) {
return getPokemonSpecies(evolutionPool.get(weight)!).getSpeciesForLevel(level, true, forTrainer, strength); // TODO: is the bang correct?
return getPokemonSpecies(evolutionPool.get(weight)).getSpeciesForLevel(level, true, forTrainer, strength, currentWave);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/data/trainer-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const trainerPartyTemplates = {
FIVE_WEAK_BALANCED: new TrainerPartyTemplate(5, PartyMemberStrength.WEAK, false, true),
SIX_WEAKER: new TrainerPartyTemplate(6, PartyMemberStrength.WEAKER),
SIX_WEAKER_SAME: new TrainerPartyTemplate(6, PartyMemberStrength.WEAKER, true),
SIX_WEAK_SAME: new TrainerPartyTemplate(6, PartyMemberStrength.WEAKER, true),
SIX_WEAK_SAME: new TrainerPartyTemplate(6, PartyMemberStrength.WEAK, true),
SIX_WEAK_BALANCED: new TrainerPartyTemplate(6, PartyMemberStrength.WEAK, false, true),

GYM_LEADER_1: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, PartyMemberStrength.STRONG)),
Expand Down Expand Up @@ -965,7 +965,7 @@ function getRandomPartyMemberFunc(speciesPool: Species[], trainerSlot: TrainerSl
return (scene: BattleScene, level: integer, strength: PartyMemberStrength) => {
let species = Utils.randSeedItem(speciesPool);
if (!ignoreEvolution) {
species = getPokemonSpecies(species).getTrainerSpeciesForLevel(level, true, strength);
species = getPokemonSpecies(species).getTrainerSpeciesForLevel(level, true, strength, scene.currentBattle.waveIndex);
}
return scene.addEnemyPokemon(getPokemonSpecies(species), level, trainerSlot, undefined, undefined, postProcess);
};
Expand All @@ -975,7 +975,7 @@ function getSpeciesFilterRandomPartyMemberFunc(speciesFilter: PokemonSpeciesFilt
const originalSpeciesFilter = speciesFilter;
speciesFilter = (species: PokemonSpecies) => (allowLegendaries || (!species.legendary && !species.subLegendary && !species.mythical)) && !species.isTrainerForbidden() && originalSpeciesFilter(species);
return (scene: BattleScene, level: integer, strength: PartyMemberStrength) => {
const ret = scene.addEnemyPokemon(getPokemonSpecies(scene.randomSpecies(scene.currentBattle.waveIndex, level, false, speciesFilter).getTrainerSpeciesForLevel(level, true, strength)), level, trainerSlot, undefined, undefined, postProcess);
const ret = scene.addEnemyPokemon(getPokemonSpecies(scene.randomSpecies(scene.currentBattle.waveIndex, level, false, speciesFilter).getTrainerSpeciesForLevel(level, true, strength, scene.currentBattle.waveIndex)), level, trainerSlot, undefined, undefined, postProcess);
return ret;
};
}
Expand Down
Loading

0 comments on commit 1a2416b

Please sign in to comment.