test fixes and final cleanup

This commit is contained in:
Moka 2024-11-09 17:19:45 +01:00
parent 5ba47c7fb1
commit a64a94193d
3 changed files with 14 additions and 12 deletions

View File

@ -71,7 +71,7 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter =
let pokemon: PlayerPokemon;
if (randSeedInt(SHINY_MAGIKARP_WEIGHT) === 0 || isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE) {
// If no HA mon found or you roll 1%, give shiny Magikarp with HA and random variant
// If no HA mon found or you roll 1%, give shiny Magikarp with random variant
species = getPokemonSpecies(Species.MAGIKARP);
pokemon = new PlayerPokemon(scene, species, 5, 2, species.formIndex, undefined, true);
} else {

View File

@ -84,8 +84,6 @@ export default class MysteryEncounterIntroVisuals extends Phaser.GameObjects.Con
constructor(scene: BattleScene, encounter: MysteryEncounter) {
super(scene, -72, 76);
this.shinySparkleSprites = [];
this.encounter = encounter;
this.enterFromRight = encounter.enterIntroVisualsFromRight ?? false;
// Shallow copy configs to allow visual config updates at runtime without dirtying master copy of Encounter
@ -129,6 +127,7 @@ export default class MysteryEncounterIntroVisuals extends Phaser.GameObjects.Con
// Sprites with custom X or Y defined will not count for normal spacing requirements
const spacingValue = Math.round((maxX - minX) / Math.max(this.spriteConfigs.filter(s => !s.x && !s.y).length, 1));
this.shinySparkleSprites = [];
const shinySparkleSprites = scene.add.container(0, 0);
this.spriteConfigs?.forEach((config) => {
const { spriteKey, isItem, hasShadow, scale, x, y, yShadow, alpha, isPokemon, isShiny, variant } = config;
@ -274,19 +273,23 @@ export default class MysteryEncounterIntroVisuals extends Phaser.GameObjects.Con
this.getSprites().map((sprite, i) => {
if (!this.spriteConfigs[i].isItem) {
sprite.setTexture(this.spriteConfigs[i].spriteKey);
// Show the first frame for a smooth transition when the animation starts.
sprite.setTexture(this.spriteConfigs[i].spriteKey).setFrame(0);
if (sprite.texture.frameTotal > 1) {
// Show the first animation frame for a smooth transition when the animation starts.
const firstFrame = sprite.texture.frames["0001.png"];
sprite.setFrame(firstFrame ?? 0);
}
}
});
this.getTintSprites().map((tintSprite, i) => {
if (!this.spriteConfigs[i].isItem) {
tintSprite.setTexture(this.spriteConfigs[i].spriteKey);
tintSprite.setTexture(this.spriteConfigs[i].spriteKey).setFrame(0);
if (tintSprite.texture.frameTotal > 1) {
// Show the first frame for a smooth transition when the animation starts.
const firstFrame = tintSprite.texture.frames["0001.png"];
tintSprite.setFrame(firstFrame ?? 0);
}
}
});
this.spriteConfigs.every((config, i) => {

View File

@ -204,7 +204,6 @@ export class EncounterPhase extends BattlePhase {
battle.seenEnemyPartyMemberIds.add(enemyPokemon.id);
const playerPokemon = this.scene.getPlayerPokemon();
if (playerPokemon?.visible) {
//TODO HERE
this.scene.field.moveBelow(enemyPokemon as Pokemon, playerPokemon);
}
enemyPokemon.tint(0, 0.5);