This commit is contained in:
Lylian 2025-03-10 12:42:35 +01:00
parent b3ccf8d9b6
commit 15fbd9a54f
8 changed files with 72 additions and 35 deletions

View File

@ -884,7 +884,7 @@ export default class BattleScene extends SceneBase {
return true;
}
public getPlayerParty(fakeShininess: boolean = true): PlayerPokemon[] {
public getPlayerParty(fakeShininess = true): PlayerPokemon[] {
const party = this.party;
if (!fakeShininess) {
party.map(pokemon => {

View File

@ -8,7 +8,7 @@ import i18next from "i18next";
* @param pokemon {@linkcode Pokemon} name and battle context will be retrieved from this instance
* @returns {string} ex: "Wild Gengar", "Ectoplasma sauvage"
*/
export function getPokemonNameWithAffix(pokemon: Pokemon | undefined, useIllusion: boolean = true): string {
export function getPokemonNameWithAffix(pokemon: Pokemon | undefined, useIllusion = true): string {
if (!pokemon) {
return "Missigno";
}

View File

@ -128,7 +128,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
this.player ? 36 : 248,
this.player ? 80 : 44,
"pb",
getPokeballAtlasKey(pokemon.battleData.illusion.pokeball ?? pokemon.pokeball)
getPokeballAtlasKey(pokemon.battleData.illusion.pokeball ?? pokemon.pokeball),
);
pokeball.setVisible(false);
pokeball.setOrigin(0.5, 0.625);
@ -177,7 +177,11 @@ export class SummonPhase extends PartyMemberPokemonPhase {
}
globalScene.currentBattle.seenEnemyPartyMemberIds.add(pokemon.id);
}
addPokeballOpenParticles(pokemon.x, pokemon.y - 16, pokemon.battleData.illusion.pokeball ?? pokemon.pokeball);
addPokeballOpenParticles(
pokemon.x,
pokemon.y - 16,
pokemon.battleData.illusion.pokeball ?? pokemon.pokeball,
);
globalScene.updateModifiers(this.player);
globalScene.updateFieldScale();
pokemon.showInfo();

View File

@ -1,5 +1,11 @@
import { globalScene } from "#app/global-scene";
import { applyPreSummonAbAttrs, applyPreSwitchOutAbAttrs, PostDamageForceSwitchAbAttr, PreSummonAbAttr, PreSwitchOutAbAttr } from "#app/data/ability";
import {
applyPreSummonAbAttrs,
applyPreSwitchOutAbAttrs,
PostDamageForceSwitchAbAttr,
PreSummonAbAttr,
PreSwitchOutAbAttr,
} from "#app/data/ability";
import { allMoves, ForceSwitchOutAttr } from "#app/data/moves/move";
import { getPokeballTintColor } from "#app/data/pokeball";
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms";

View File

@ -798,7 +798,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
while (
nameTextWidth >
(this.player || !this.boss ? 60 : 98) -
((pokemon.gender !== Gender.GENDERLESS ? 6 : 0) +
((gender !== Gender.GENDERLESS ? 6 : 0) +
(pokemon.fusionSpecies ? 8 : 0) +
(pokemon.isShiny() ? 8 : 0) +
(Math.min(pokemon.level.toString().length, 3) - 3) * 8)

View File

@ -1582,7 +1582,9 @@ class PartySlot extends Phaser.GameObjects.Container {
const fusionShinyStar = globalScene.add.image(0, 0, "shiny_star_small_2");
fusionShinyStar.setOrigin(0, 0);
fusionShinyStar.setPosition(shinyStar.x, shinyStar.y);
fusionShinyStar.setTint(getVariantTint(this.pokemon.battleData.illusion.basePokemon?.fusionVariant ?? this.pokemon.fusionVariant));
fusionShinyStar.setTint(
getVariantTint(this.pokemon.battleData.illusion.basePokemon?.fusionVariant ?? this.pokemon.fusionVariant),
);
slotInfoContainer.add(fusionShinyStar);
}

View File

@ -348,8 +348,14 @@ export default class SummaryUiHandler extends UiHandler {
this.pokemonSprite.setPipelineData("isTerastallized", this.pokemon.isTerastallized);
this.pokemonSprite.setPipelineData("ignoreTimeTint", true);
this.pokemonSprite.setPipelineData("spriteKey", this.pokemon.getSpriteKey());
this.pokemonSprite.setPipelineData("shiny", this.pokemon.battleData.illusion.basePokemon?.shiny ?? this.pokemon.shiny);
this.pokemonSprite.setPipelineData("variant", this.pokemon.battleData.illusion.basePokemon?.variant ?? this.pokemon.variant);
this.pokemonSprite.setPipelineData(
"shiny",
this.pokemon.battleData.illusion.basePokemon?.shiny ?? this.pokemon.shiny,
);
this.pokemonSprite.setPipelineData(
"variant",
this.pokemon.battleData.illusion.basePokemon?.variant ?? this.pokemon.variant,
);
["spriteColors", "fusionSpriteColors"].map(k => {
delete this.pokemonSprite.pipelineData[`${k}Base`];
if (this.pokemon?.summonData?.speciesForm) {
@ -446,7 +452,9 @@ export default class SummaryUiHandler extends UiHandler {
this.fusionShinyIcon.setPosition(this.shinyIcon.x, this.shinyIcon.y);
this.fusionShinyIcon.setVisible(doubleShiny);
if (isFusion) {
this.fusionShinyIcon.setTint(getVariantTint(this.pokemon.battleData.illusion.basePokemon?.fusionVariant ?? this.pokemon.fusionVariant));
this.fusionShinyIcon.setTint(
getVariantTint(this.pokemon.battleData.illusion.basePokemon?.fusionVariant ?? this.pokemon.fusionVariant),
);
}
this.pokeball.setFrame(getPokeballAtlasKey(this.pokemon.pokeball));

View File

@ -3,9 +3,7 @@ import Phaser from "phaser";
import GameManager from "#test/testUtils/gameManager";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import {
TurnEndPhase,
} from "#app/phases/turn-end-phase";
import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Moves } from "#enums/moves";
import { Abilities } from "#enums/abilities";
import { PokeballType } from "#app/enums/pokeball";
@ -88,8 +86,22 @@ describe("Abilities - Illusion", () => {
const flameThrower = enemy.getMoveset()[0]!.getMove();
const psychic = enemy.getMoveset()[1]!.getMove();
const flameThrowerEffectiveness = zoroark.getAttackTypeEffectiveness(flameThrower.type, enemy, undefined, undefined, flameThrower, true);
const psychicEffectiveness = zoroark.getAttackTypeEffectiveness(psychic.type, enemy, undefined, undefined, psychic, true);
const flameThrowerEffectiveness = zoroark.getAttackTypeEffectiveness(
flameThrower.type,
enemy,
undefined,
undefined,
flameThrower,
true,
);
const psychicEffectiveness = zoroark.getAttackTypeEffectiveness(
psychic.type,
enemy,
undefined,
undefined,
psychic,
true,
);
expect(psychicEffectiveness).above(flameThrowerEffectiveness);
});
@ -111,7 +123,12 @@ describe("Abilities - Illusion", () => {
});
it("copy the the name, the nickname, the gender, the shininess and the pokeball of the pokemon", async () => {
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.SCARY_FACE, Moves.SCARY_FACE, Moves.SCARY_FACE, Moves.SCARY_FACE ]);
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([
Moves.SCARY_FACE,
Moves.SCARY_FACE,
Moves.SCARY_FACE,
Moves.SCARY_FACE,
]);
await game.classicMode.startBattle([Species.ABRA, Species.ZOROARK, Species.AXEW]);