mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-19 23:02:19 +02:00
merge
This commit is contained in:
parent
b3ccf8d9b6
commit
15fbd9a54f
@ -884,7 +884,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getPlayerParty(fakeShininess: boolean = true): PlayerPokemon[] {
|
public getPlayerParty(fakeShininess = true): PlayerPokemon[] {
|
||||||
const party = this.party;
|
const party = this.party;
|
||||||
if (!fakeShininess) {
|
if (!fakeShininess) {
|
||||||
party.map(pokemon => {
|
party.map(pokemon => {
|
||||||
|
@ -8,7 +8,7 @@ import i18next from "i18next";
|
|||||||
* @param pokemon {@linkcode Pokemon} name and battle context will be retrieved from this instance
|
* @param pokemon {@linkcode Pokemon} name and battle context will be retrieved from this instance
|
||||||
* @returns {string} ex: "Wild Gengar", "Ectoplasma sauvage"
|
* @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) {
|
if (!pokemon) {
|
||||||
return "Missigno";
|
return "Missigno";
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
|
|||||||
this.player ? 36 : 248,
|
this.player ? 36 : 248,
|
||||||
this.player ? 80 : 44,
|
this.player ? 80 : 44,
|
||||||
"pb",
|
"pb",
|
||||||
getPokeballAtlasKey(pokemon.battleData.illusion.pokeball ?? pokemon.pokeball)
|
getPokeballAtlasKey(pokemon.battleData.illusion.pokeball ?? pokemon.pokeball),
|
||||||
);
|
);
|
||||||
pokeball.setVisible(false);
|
pokeball.setVisible(false);
|
||||||
pokeball.setOrigin(0.5, 0.625);
|
pokeball.setOrigin(0.5, 0.625);
|
||||||
@ -177,7 +177,11 @@ export class SummonPhase extends PartyMemberPokemonPhase {
|
|||||||
}
|
}
|
||||||
globalScene.currentBattle.seenEnemyPartyMemberIds.add(pokemon.id);
|
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.updateModifiers(this.player);
|
||||||
globalScene.updateFieldScale();
|
globalScene.updateFieldScale();
|
||||||
pokemon.showInfo();
|
pokemon.showInfo();
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
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 { allMoves, ForceSwitchOutAttr } from "#app/data/moves/move";
|
||||||
import { getPokeballTintColor } from "#app/data/pokeball";
|
import { getPokeballTintColor } from "#app/data/pokeball";
|
||||||
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms";
|
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms";
|
||||||
|
@ -798,7 +798,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
|||||||
while (
|
while (
|
||||||
nameTextWidth >
|
nameTextWidth >
|
||||||
(this.player || !this.boss ? 60 : 98) -
|
(this.player || !this.boss ? 60 : 98) -
|
||||||
((pokemon.gender !== Gender.GENDERLESS ? 6 : 0) +
|
((gender !== Gender.GENDERLESS ? 6 : 0) +
|
||||||
(pokemon.fusionSpecies ? 8 : 0) +
|
(pokemon.fusionSpecies ? 8 : 0) +
|
||||||
(pokemon.isShiny() ? 8 : 0) +
|
(pokemon.isShiny() ? 8 : 0) +
|
||||||
(Math.min(pokemon.level.toString().length, 3) - 3) * 8)
|
(Math.min(pokemon.level.toString().length, 3) - 3) * 8)
|
||||||
|
@ -1582,7 +1582,9 @@ class PartySlot extends Phaser.GameObjects.Container {
|
|||||||
const fusionShinyStar = globalScene.add.image(0, 0, "shiny_star_small_2");
|
const fusionShinyStar = globalScene.add.image(0, 0, "shiny_star_small_2");
|
||||||
fusionShinyStar.setOrigin(0, 0);
|
fusionShinyStar.setOrigin(0, 0);
|
||||||
fusionShinyStar.setPosition(shinyStar.x, shinyStar.y);
|
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);
|
slotInfoContainer.add(fusionShinyStar);
|
||||||
}
|
}
|
||||||
|
@ -348,8 +348,14 @@ export default class SummaryUiHandler extends UiHandler {
|
|||||||
this.pokemonSprite.setPipelineData("isTerastallized", this.pokemon.isTerastallized);
|
this.pokemonSprite.setPipelineData("isTerastallized", this.pokemon.isTerastallized);
|
||||||
this.pokemonSprite.setPipelineData("ignoreTimeTint", true);
|
this.pokemonSprite.setPipelineData("ignoreTimeTint", true);
|
||||||
this.pokemonSprite.setPipelineData("spriteKey", this.pokemon.getSpriteKey());
|
this.pokemonSprite.setPipelineData("spriteKey", this.pokemon.getSpriteKey());
|
||||||
this.pokemonSprite.setPipelineData("shiny", this.pokemon.battleData.illusion.basePokemon?.shiny ?? this.pokemon.shiny);
|
this.pokemonSprite.setPipelineData(
|
||||||
this.pokemonSprite.setPipelineData("variant", this.pokemon.battleData.illusion.basePokemon?.variant ?? this.pokemon.variant);
|
"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 => {
|
["spriteColors", "fusionSpriteColors"].map(k => {
|
||||||
delete this.pokemonSprite.pipelineData[`${k}Base`];
|
delete this.pokemonSprite.pipelineData[`${k}Base`];
|
||||||
if (this.pokemon?.summonData?.speciesForm) {
|
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.setPosition(this.shinyIcon.x, this.shinyIcon.y);
|
||||||
this.fusionShinyIcon.setVisible(doubleShiny);
|
this.fusionShinyIcon.setVisible(doubleShiny);
|
||||||
if (isFusion) {
|
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));
|
this.pokeball.setFrame(getPokeballAtlasKey(this.pokemon.pokeball));
|
||||||
|
@ -3,9 +3,7 @@ import Phaser from "phaser";
|
|||||||
import GameManager from "#test/testUtils/gameManager";
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
import overrides from "#app/overrides";
|
import overrides from "#app/overrides";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import {
|
import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
TurnEndPhase,
|
|
||||||
} from "#app/phases/turn-end-phase";
|
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { PokeballType } from "#app/enums/pokeball";
|
import { PokeballType } from "#app/enums/pokeball";
|
||||||
@ -88,8 +86,22 @@ describe("Abilities - Illusion", () => {
|
|||||||
|
|
||||||
const flameThrower = enemy.getMoveset()[0]!.getMove();
|
const flameThrower = enemy.getMoveset()[0]!.getMove();
|
||||||
const psychic = enemy.getMoveset()[1]!.getMove();
|
const psychic = enemy.getMoveset()[1]!.getMove();
|
||||||
const flameThrowerEffectiveness = zoroark.getAttackTypeEffectiveness(flameThrower.type, enemy, undefined, undefined, flameThrower, true);
|
const flameThrowerEffectiveness = zoroark.getAttackTypeEffectiveness(
|
||||||
const psychicEffectiveness = zoroark.getAttackTypeEffectiveness(psychic.type, enemy, undefined, undefined, psychic, true);
|
flameThrower.type,
|
||||||
|
enemy,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
flameThrower,
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
const psychicEffectiveness = zoroark.getAttackTypeEffectiveness(
|
||||||
|
psychic.type,
|
||||||
|
enemy,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
psychic,
|
||||||
|
true,
|
||||||
|
);
|
||||||
expect(psychicEffectiveness).above(flameThrowerEffectiveness);
|
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 () => {
|
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]);
|
await game.classicMode.startBattle([Species.ABRA, Species.ZOROARK, Species.AXEW]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user