Legendary Pokemon Changes + Cry Cleanup

This commit is contained in:
frutescens 2024-09-06 19:43:49 -07:00
parent 6b5bb78110
commit 2e09d4747e
3 changed files with 124 additions and 100 deletions

View File

@ -35,6 +35,7 @@ import { Gender } from "./data/gender";
import UIPlugin from "phaser3-rex-plugins/templates/ui/ui-plugin"; import UIPlugin from "phaser3-rex-plugins/templates/ui/ui-plugin";
import { addUiThemeOverrides } from "./ui/ui-theme"; import { addUiThemeOverrides } from "./ui/ui-theme";
import PokemonData from "./system/pokemon-data"; import PokemonData from "./system/pokemon-data";
import { MusicPreference } from "./system/settings/settings";
import { Nature } from "./data/nature"; import { Nature } from "./data/nature";
import { SpeciesFormChangeManualTrigger, SpeciesFormChangeTimeOfDayTrigger, SpeciesFormChangeTrigger, pokemonFormChanges, FormChangeItem, SpeciesFormChange } from "./data/pokemon-forms"; import { SpeciesFormChangeManualTrigger, SpeciesFormChangeTimeOfDayTrigger, SpeciesFormChangeTrigger, pokemonFormChanges, FormChangeItem, SpeciesFormChange } from "./data/pokemon-forms";
import { FormChangePhase } from "./phases/form-change-phase"; import { FormChangePhase } from "./phases/form-change-phase";
@ -157,7 +158,7 @@ export default class BattleScene extends SceneBase {
public uiTheme: UiTheme = UiTheme.DEFAULT; public uiTheme: UiTheme = UiTheme.DEFAULT;
public windowType: integer = 0; public windowType: integer = 0;
public experimentalSprites: boolean = false; public experimentalSprites: boolean = false;
public musicPreference: integer = 0; public musicPreference: integer = MusicPreference.CONSISTENT;
public moveAnimations: boolean = true; public moveAnimations: boolean = true;
public expGainsSpeed: integer = 0; public expGainsSpeed: integer = 0;
public skipSeenDialogues: boolean = false; public skipSeenDialogues: boolean = false;

View File

@ -7,10 +7,12 @@ import { GameMode } from "./game-mode";
import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/modifier"; import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/modifier";
import { PokeballType } from "./data/pokeball"; import { PokeballType } from "./data/pokeball";
import { trainerConfigs } from "#app/data/trainer-config"; import { trainerConfigs } from "#app/data/trainer-config";
import { SpeciesFormKey } from "#app/data/pokemon-species";
import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagType } from "#enums/arena-tag-type";
import { BattleSpec } from "#enums/battle-spec"; import { BattleSpec } from "#enums/battle-spec";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { PlayerGender } from "#enums/player-gender"; import { PlayerGender } from "#enums/player-gender";
import { MusicPreference } from "./system/settings/settings";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { TrainerType } from "#enums/trainer-type"; import { TrainerType } from "#enums/trainer-type";
import i18next from "#app/plugins/i18n"; import i18next from "#app/plugins/i18n";
@ -189,12 +191,12 @@ export default class Battle {
} }
getBgmOverride(scene: BattleScene): string | null { getBgmOverride(scene: BattleScene): string | null {
const battlers = this.enemyParty.slice(0, this.getBattlerCount());
if (this.battleType === BattleType.TRAINER) { if (this.battleType === BattleType.TRAINER) {
if (!this.started && this.trainer?.config.encounterBgm && this.trainer?.getEncounterMessages()?.length) { if (!this.started && this.trainer?.config.encounterBgm && this.trainer?.getEncounterMessages()?.length) {
return `encounter_${this.trainer?.getEncounterBgm()}`; return `encounter_${this.trainer?.getEncounterBgm()}`;
} }
if (scene.musicPreference === 0) { if (scene.musicPreference === MusicPreference.CONSISTENT) {
return this.trainer?.getBattleBgm() ?? null; return this.trainer?.getBattleBgm() ?? null;
} else { } else {
return this.trainer?.getMixedBattleBgm() ?? null; return this.trainer?.getMixedBattleBgm() ?? null;
@ -202,147 +204,163 @@ export default class Battle {
} else if (this.gameMode.isClassic && this.waveIndex > 195 && this.battleSpec !== BattleSpec.FINAL_BOSS) { } else if (this.gameMode.isClassic && this.waveIndex > 195 && this.battleSpec !== BattleSpec.FINAL_BOSS) {
return "end_summit"; return "end_summit";
} }
for (const pokemon of battlers) { const wildOpponents = scene.getEnemyParty();
for (const pokemon of wildOpponents) {
if (this.battleSpec === BattleSpec.FINAL_BOSS) { if (this.battleSpec === BattleSpec.FINAL_BOSS) {
if (pokemon.formIndex) { if (pokemon.species.getFormSpriteKey() === SpeciesFormKey.ETERNAMAX) {
return "battle_final"; return "battle_final";
} }
return "battle_final_encounter"; return "battle_final_encounter";
} }
if (pokemon.species.legendary || pokemon.species.subLegendary || pokemon.species.mythical) { if (pokemon.species.legendary || pokemon.species.subLegendary || pokemon.species.mythical) {
if (scene.musicPreference === 0) { if (scene.musicPreference === MusicPreference.CONSISTENT) {
if (pokemon.species.speciesId === Species.REGIROCK || pokemon.species.speciesId === Species.REGICE || pokemon.species.speciesId === Species.REGISTEEL || pokemon.species.speciesId === Species.REGIGIGAS || pokemon.species.speciesId === Species.REGIELEKI || pokemon.species.speciesId === Species.REGIDRAGO) { switch (pokemon.species.speciesId) {
case Species.REGIROCK:
case Species.REGICE:
case Species.REGISTEEL:
case Species.REGIGIGAS:
case Species.REGIDRAGO:
case Species.REGIELEKI:
return "battle_legendary_regis_g5"; return "battle_legendary_regis_g5";
} case Species.KYUREM:
if (pokemon.species.speciesId === Species.COBALION || pokemon.species.speciesId === Species.TERRAKION || pokemon.species.speciesId === Species.VIRIZION || pokemon.species.speciesId === Species.TORNADUS || pokemon.species.speciesId === Species.THUNDURUS || pokemon.species.speciesId === Species.LANDORUS || pokemon.species.speciesId === Species.KELDEO || pokemon.species.speciesId === Species.MELOETTA || pokemon.species.speciesId === Species.GENESECT) { return "battle_legendary_kyurem";
default:
if (pokemon.species.legendary) {
return "battle_legendary_res_zek";
}
return "battle_legendary_unova"; return "battle_legendary_unova";
} }
if (pokemon.species.speciesId === Species.KYUREM) { } else if (scene.musicPreference === MusicPreference.MIXED) {
return "battle_legendary_kyurem"; switch (pokemon.species.speciesId) {
} case Species.ARTICUNO:
if (pokemon.species.legendary) { case Species.ZAPDOS:
return "battle_legendary_res_zek"; case Species.MOLTRES:
} case Species.MEWTWO:
return "battle_legendary_unova"; case Species.MEW:
} else {
if (pokemon.species.speciesId === Species.ARTICUNO || pokemon.species.speciesId === Species.ZAPDOS || pokemon.species.speciesId === Species.MOLTRES || pokemon.species.speciesId === Species.MEWTWO || pokemon.species.speciesId === Species.MEW) {
return "battle_legendary_kanto"; return "battle_legendary_kanto";
} case Species.RAIKOU:
if (pokemon.species.speciesId === Species.RAIKOU) {
return "battle_legendary_raikou"; return "battle_legendary_raikou";
} case Species.ENTEI:
if (pokemon.species.speciesId === Species.ENTEI) {
return "battle_legendary_entei"; return "battle_legendary_entei";
} case Species.SUICUNE:
if (pokemon.species.speciesId === Species.SUICUNE) {
return "battle_legendary_suicune"; return "battle_legendary_suicune";
} case Species.LUGIA:
if (pokemon.species.speciesId === Species.LUGIA) {
return "battle_legendary_lugia"; return "battle_legendary_lugia";
} case Species.HO_OH:
if (pokemon.species.speciesId === Species.HO_OH) {
return "battle_legendary_ho_oh"; return "battle_legendary_ho_oh";
} case Species.REGIROCK:
if (pokemon.species.speciesId === Species.REGIROCK || pokemon.species.speciesId === Species.REGICE || pokemon.species.speciesId === Species.REGISTEEL || pokemon.species.speciesId === Species.REGIGIGAS || pokemon.species.speciesId === Species.REGIELEKI || pokemon.species.speciesId === Species.REGIDRAGO) { case Species.REGICE:
case Species.REGISTEEL:
case Species.REGIGIGAS:
case Species.REGIDRAGO:
case Species.REGIELEKI:
return "battle_legendary_regis_g6"; return "battle_legendary_regis_g6";
} case Species.GROUDON:
if (pokemon.species.speciesId === Species.GROUDON || pokemon.species.speciesId === Species.KYOGRE) { case Species.KYOGRE:
return "battle_legendary_gro_kyo"; return "battle_legendary_gro_kyo";
} case Species.RAYQUAZA:
if (pokemon.species.speciesId === Species.RAYQUAZA) {
return "battle_legendary_rayquaza"; return "battle_legendary_rayquaza";
} case Species.DEOXYS:
if (pokemon.species.speciesId === Species.DEOXYS) {
return "battle_legendary_deoxys"; return "battle_legendary_deoxys";
} case Species.HEATRAN:
if (pokemon.species.speciesId === Species.UXIE || pokemon.species.speciesId === Species.MESPRIT || pokemon.species.speciesId === Species.AZELF) { case Species.CRESSELIA:
return "battle_legendary_lake_trio"; case Species.DARKRAI:
} case Species.SHAYMIN:
if (pokemon.species.speciesId === Species.HEATRAN || pokemon.species.speciesId === Species.CRESSELIA || pokemon.species.speciesId === Species.DARKRAI || pokemon.species.speciesId === Species.SHAYMIN) {
return "battle_legendary_sinnoh"; return "battle_legendary_sinnoh";
} case Species.DIALGA:
if (pokemon.species.speciesId === Species.DIALGA || pokemon.species.speciesId === Species.PALKIA) { case Species.PALKIA:
if (pokemon.getFormKey() === "") { if (pokemon.species.getFormSpriteKey() === SpeciesFormKey.ORIGIN) {
return "battle_legendary_dia_pal";
}
if (pokemon.getFormKey() === "origin") {
return "battle_legendary_origin_forme"; return "battle_legendary_origin_forme";
} }
} return "battle_legendary_dia_pal";
if (pokemon.species.speciesId === Species.GIRATINA) { case Species.GIRATINA:
return "battle_legendary_giratina"; return "battle_legendary_giratina";
} case Species.ARCEUS:
if (pokemon.species.speciesId === Species.ARCEUS) {
return "battle_legendary_arceus"; return "battle_legendary_arceus";
} case Species.COBALION:
if (pokemon.species.speciesId === Species.COBALION || pokemon.species.speciesId === Species.TERRAKION || pokemon.species.speciesId === Species.VIRIZION || pokemon.species.speciesId === Species.TORNADUS || pokemon.species.speciesId === Species.THUNDURUS || pokemon.species.speciesId === Species.LANDORUS || pokemon.species.speciesId === Species.KELDEO || pokemon.species.speciesId === Species.MELOETTA || pokemon.species.speciesId === Species.GENESECT) { case Species.TERRAKION:
case Species.VIRIZION:
case Species.KELDEO:
case Species.TORNADUS:
case Species.LANDORUS:
case Species.THUNDURUS:
case Species.MELOETTA:
case Species.GENESECT:
return "battle_legendary_unova"; return "battle_legendary_unova";
} case Species.KYUREM:
if (pokemon.species.speciesId === Species.KYUREM) {
return "battle_legendary_kyurem"; return "battle_legendary_kyurem";
} case Species.XERNEAS:
if (pokemon.species.speciesId === Species.XERNEAS || pokemon.species.speciesId === Species.YVELTAL || pokemon.species.speciesId === Species.ZYGARDE) { case Species.YVELTAL:
case Species.XYGARDE:
return "battle_legendary_xern_yvel"; return "battle_legendary_xern_yvel";
} case Species.TAPU_KOKO:
if (pokemon.species.speciesId === Species.TAPU_KOKO || pokemon.species.speciesId === Species.TAPU_LELE || pokemon.species.speciesId === Species.TAPU_BULU || pokemon.species.speciesId === Species.TAPU_FINI) { case Species.TAPU_LELE:
case Species.TAPU_BULU:
case Species.TAPU_FINI:
return "battle_legendary_tapu"; return "battle_legendary_tapu";
} case Species.SOLGALEO:
if ([ Species.COSMOG, Species.COSMOEM, Species.SOLGALEO, Species.LUNALA ].includes(pokemon.species.speciesId)) { case Species.LUNALA:
return "battle_legendary_sol_lun"; return "battle_legendary_sol_lun";
} case Species.NECROZMA:
if (pokemon.species.speciesId === Species.NECROZMA) { switch (pokemon.getFormKey()) {
if (pokemon.getFormKey() === "") { case "dusk-mane":
case "dawn-wings":
return "battle_legendary_dusk_dawn";
case "ultra":
return "battle_legendary_ultra_nec";
default:
return "battle_legendary_sol_lun"; return "battle_legendary_sol_lun";
} }
if (pokemon.getFormKey() === "dusk-mane" || pokemon.getFormKey() === "dawn-wings") { case Species.NIHILEGO:
return "battle_legendary_dusk_dawn"; case Species.PHEROMOSA:
} case Species.BUZZWOLE:
if (pokemon.getFormKey() === "ultra") { case Species.XURKITREE:
return "battle_legendary_ultra_nec"; case Species.CELESTEELA:
} case Species.GUZZLORD:
} case Species.POIPOLE:
if ([ Species.NIHILEGO, Species.BUZZWOLE, Species.PHEROMOSA, Species.XURKITREE, Species.CELESTEELA, Species.KARTANA, Species.GUZZLORD, Species.POIPOLE, Species.NAGANADEL, Species.STAKATAKA, Species.BLACEPHALON ].includes(pokemon.species.speciesId)) { case Species.NAGANADEL:
case Species.STAKATAKA:
case Species.BLACEPHALON:
return "battle_legendary_ub"; return "battle_legendary_ub";
} case Species.ZACIAN:
if (pokemon.species.speciesId === Species.ZACIAN || pokemon.species.speciesId === Species.ZAMAZENTA) { case Species.ZAMAZENTA:
return "battle_legendary_zac_zam"; return "battle_legendary_zac_zam";
} case Species.GLASTRIER:
if (pokemon.species.speciesId === Species.GLASTRIER || pokemon.species.speciesId === Species.SPECTRIER) { case Species.SPECTRIER:
return "battle_legendary_glas_spec"; return "battle_legendary_glas_spec";
} case Species.CALYREX:
if (pokemon.species.speciesId === Species.CALYREX) {
if (pokemon.getFormKey() === "") {
return "battle_legendary_calyrex";
}
if (pokemon.getFormKey() === "ice" || pokemon.getFormKey() === "shadow") { if (pokemon.getFormKey() === "ice" || pokemon.getFormKey() === "shadow") {
return "battle_legendary_riders"; return "battle_legendary_riders";
} }
} return "battle_legendary_calyrex";
if (pokemon.species.speciesId === Species.GALAR_ARTICUNO || pokemon.species.speciesId === Species.GALAR_ZAPDOS || pokemon.species.speciesId === Species.GALAR_MOLTRES) { case Species.GALAR_ARTICUNO:
case Species.GALAR_ZAPDOS:
case Species.GALAR_MOLTRES:
return "battle_legendary_birds_galar"; return "battle_legendary_birds_galar";
} case Species.WO_CHIEN:
if (pokemon.species.speciesId === Species.WO_CHIEN || pokemon.species.speciesId === Species.CHIEN_PAO || pokemon.species.speciesId === Species.TING_LU || pokemon.species.speciesId === Species.CHI_YU) { case Species.CHIEN_PAO:
case Species.TING_LU:
case Species.CHI_YU:
return "battle_legendary_ruinous"; return "battle_legendary_ruinous";
} case Species.KORAIDON:
if (pokemon.species.speciesId === Species.KORAIDON || pokemon.species.speciesId === Species.MIRAIDON) { case Species.MIRAIDON:
return "battle_legendary_kor_mir"; return "battle_legendary_kor_mir";
} case Species.OKIDOGI:
if (pokemon.species.speciesId === Species.OKIDOGI || pokemon.species.speciesId === Species.MUNKIDORI || pokemon.species.speciesId === Species.FEZANDIPITI) { case Species.MUNKIDORI:
case Species.FEZANDIPITI:
return "battle_legendary_loyal_three"; return "battle_legendary_loyal_three";
} case Species.OGERPON:
if (pokemon.species.speciesId === Species.OGERPON) {
return "battle_legendary_ogerpon"; return "battle_legendary_ogerpon";
} case Species.TERAPAGOS:
if (pokemon.species.speciesId === Species.TERAPAGOS) {
return "battle_legendary_terapagos"; return "battle_legendary_terapagos";
} case Species.PECHARUNT:
if (pokemon.species.speciesId === Species.PECHARUNT) {
return "battle_legendary_pecharunt"; return "battle_legendary_pecharunt";
default:
if (pokemon.species.legendary) {
return "battle_legendary_res_zek";
}
return "battle_legendary_unova";
} }
if (pokemon.species.legendary) {
return "battle_legendary_res_zek";
}
return "battle_legendary_unova";
} }
} }
} }

View File

@ -162,6 +162,11 @@ export const SettingKeys = {
Shop_Overlay_Opacity: "SHOP_OVERLAY_OPACITY" Shop_Overlay_Opacity: "SHOP_OVERLAY_OPACITY"
}; };
export enum MusicPreference {
CONSISTENT,
MIXED
}
/** /**
* All Settings not related to controls * All Settings not related to controls
*/ */
@ -701,7 +706,7 @@ export function setSetting(scene: BattleScene, setting: string, value: integer):
scene.uiVolume = value ? parseInt(Setting[index].options[value].value) * 0.01 : 0; scene.uiVolume = value ? parseInt(Setting[index].options[value].value) * 0.01 : 0;
break; break;
case SettingKeys.Music_Preference: case SettingKeys.Music_Preference:
scene.musicPreference = value; scene.musicPreference = MusicPreference[value];
break; break;
case SettingKeys.Damage_Numbers: case SettingKeys.Damage_Numbers:
scene.damageNumbersMode = value; scene.damageNumbersMode = value;