Inherit shininess from splices

pull/2/head
Flashfyre 2023-11-05 23:48:04 -05:00
parent 28f8fdfdc1
commit 79c5b3d4f3
5 changed files with 12 additions and 8 deletions

View File

@ -379,7 +379,7 @@ export class EncounterPhase extends BattlePhase {
const enemyField = this.scene.getEnemyField(); const enemyField = this.scene.getEnemyField();
enemyField.forEach((enemyPokemon, e) => { enemyField.forEach((enemyPokemon, e) => {
if (enemyPokemon.shiny) if (enemyPokemon.isShiny())
this.scene.unshiftPhase(new ShinySparklePhase(this.scene, BattlerIndex.ENEMY + e)); this.scene.unshiftPhase(new ShinySparklePhase(this.scene, BattlerIndex.ENEMY + e));
}); });
@ -670,7 +670,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
onEnd(): void { onEnd(): void {
const pokemon = this.getPokemon(); const pokemon = this.getPokemon();
if (pokemon.shiny) if (pokemon.isShiny())
this.scene.unshiftPhase(new ShinySparklePhase(this.scene, pokemon.getBattlerIndex())); this.scene.unshiftPhase(new ShinySparklePhase(this.scene, pokemon.getBattlerIndex()));
pokemon.resetTurnData(); pokemon.resetTurnData();

View File

@ -461,6 +461,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return this.gender; return this.gender;
} }
isShiny(): boolean {
return this.shiny || (this.fusionSpecies && this.fusionShiny);
}
getMoveset(ignoreOverride?: boolean): PokemonMove[] { getMoveset(ignoreOverride?: boolean): PokemonMove[] {
if (!ignoreOverride && this.summonData?.moveset) if (!ignoreOverride && this.summonData?.moveset)
return this.summonData.moveset; return this.summonData.moveset;

View File

@ -365,7 +365,7 @@ export class GameData {
setPokemonSpeciesCaught(pokemon: Pokemon, species: PokemonSpecies): Promise<void> { setPokemonSpeciesCaught(pokemon: Pokemon, species: PokemonSpecies): Promise<void> {
return new Promise<void>((resolve) => { return new Promise<void>((resolve) => {
const dexEntry = this.getDexEntry(species, pokemon.shiny, pokemon.formIndex, pokemon.gender === Gender.FEMALE, pokemon.abilityIndex); const dexEntry = this.getDexEntry(species, pokemon.isShiny(), pokemon.formIndex, pokemon.gender === Gender.FEMALE, pokemon.abilityIndex);
const hasPrevolution = pokemonPrevolutions.hasOwnProperty(species.speciesId); const hasPrevolution = pokemonPrevolutions.hasOwnProperty(species.speciesId);
if (!dexEntry.caught) { if (!dexEntry.caught) {
const newCatch = !this.getDefaultDexEntry(species); const newCatch = !this.getDefaultDexEntry(species);
@ -389,7 +389,7 @@ export class GameData {
} }
getPokemonDexEntry(pokemon: Pokemon) { getPokemonDexEntry(pokemon: Pokemon) {
return this.getDexEntry(pokemon.species, pokemon.shiny, pokemon.formIndex, pokemon.gender === Gender.FEMALE, pokemon.abilityIndex); return this.getDexEntry(pokemon.species, pokemon.isShiny(), pokemon.formIndex, pokemon.gender === Gender.FEMALE, pokemon.abilityIndex);
} }
getDexEntry(species: PokemonSpecies, shiny: boolean, formIndex: integer, female: boolean, abilityIndex: integer): DexEntry { getDexEntry(species: PokemonSpecies, shiny: boolean, formIndex: integer, female: boolean, abilityIndex: integer): DexEntry {

View File

@ -686,7 +686,7 @@ class PartySlot extends Phaser.GameObjects.Container {
slotInfoContainer.add(statusIndicator); slotInfoContainer.add(statusIndicator);
} }
if (this.pokemon.shiny) { if (this.pokemon.isShiny()) {
const shinyStar = this.scene.add.image(0, 0, 'shiny_star'); const shinyStar = this.scene.add.image(0, 0, 'shiny_star');
shinyStar.setOrigin(0, 0); shinyStar.setOrigin(0, 0);
shinyStar.setPositionRelative(slotName, -8, 2); shinyStar.setPositionRelative(slotName, -8, 2);

View File

@ -190,11 +190,11 @@ export default class SummaryUiHandler extends UiHandler {
this.summaryContainer.setVisible(true); this.summaryContainer.setVisible(true);
this.cursor = -1; this.cursor = -1;
this.shinyOverlay.setVisible(this.pokemon.shiny); this.shinyOverlay.setVisible(this.pokemon.isShiny());
this.numberText.setText(Utils.padInt(this.pokemon.species.speciesId, 3)); this.numberText.setText(Utils.padInt(this.pokemon.species.speciesId, 3));
this.numberText.setColor(getTextColor(!this.pokemon.shiny ? TextStyle.SUMMARY : TextStyle.SUMMARY_GOLD)); this.numberText.setColor(getTextColor(!this.pokemon.isShiny() ? TextStyle.SUMMARY : TextStyle.SUMMARY_GOLD));
this.numberText.setShadowColor(getTextColor(!this.pokemon.shiny ? TextStyle.SUMMARY : TextStyle.SUMMARY_GOLD, true)); this.numberText.setShadowColor(getTextColor(!this.pokemon.isShiny() ? TextStyle.SUMMARY : TextStyle.SUMMARY_GOLD, true));
this.pokemonSprite.play(this.pokemon.getSpriteKey(true)); this.pokemonSprite.play(this.pokemon.getSpriteKey(true));
this.pokemon.cry(); this.pokemon.cry();