Make G-Max Pokemon larger scaled
This commit is contained in:
parent
94b9f8116d
commit
58b000ae06
|
@ -543,6 +543,7 @@ export class EncounterPhase extends BattlePhase {
|
|||
if (enemyPokemon.isShiny())
|
||||
this.scene.validateAchv(achvs.SEE_SHINY);
|
||||
});
|
||||
this.scene.updateFieldScale();
|
||||
if (showEncounterMessage)
|
||||
this.scene.ui.showText(this.getEncounterMessage(), null, () => this.end(), 1500);
|
||||
else
|
||||
|
@ -945,6 +946,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
|
|||
}
|
||||
addPokeballOpenParticles(this.scene, pokemon.x, pokemon.y - 16, pokemon.pokeball);
|
||||
this.scene.updateModifiers(this.player);
|
||||
this.scene.updateFieldScale();
|
||||
pokemon.showInfo();
|
||||
pokemon.playAnim();
|
||||
pokemon.setVisible(true);
|
||||
|
@ -952,11 +954,12 @@ export class SummonPhase extends PartyMemberPokemonPhase {
|
|||
pokemon.setScale(0.5);
|
||||
pokemon.tint(getPokeballTintColor(pokemon.pokeball));
|
||||
pokemon.untint(250, 'Sine.easeIn');
|
||||
this.scene.updateFieldScale();
|
||||
this.scene.tweens.add({
|
||||
targets: pokemon,
|
||||
duration: 250,
|
||||
ease: 'Sine.easeIn',
|
||||
scale: 1,
|
||||
scale: pokemon.getSpriteScale(),
|
||||
onComplete: () => {
|
||||
pokemon.cry();
|
||||
pokemon.getSprite().clearTint();
|
||||
|
@ -1100,6 +1103,8 @@ export class ReturnPhase extends SwitchSummonPhase {
|
|||
pokemon.resetTurnData();
|
||||
pokemon.resetSummonData();
|
||||
|
||||
this.scene.updateFieldScale();
|
||||
|
||||
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -884,6 +884,16 @@ export default class BattleScene extends Phaser.Scene {
|
|||
return this.arena;
|
||||
}
|
||||
|
||||
updateFieldScale(): Promise<void> {
|
||||
return new Promise(resolve => {
|
||||
const fieldScale = Math.floor(Math.pow(1 / this.getField().filter(p => p?.isActive())
|
||||
.map(p => p.getSpriteScale())
|
||||
.reduce((highestScale: number, scale: number) => highestScale = Math.max(scale, highestScale), 0), 0.7) * 40
|
||||
) / 40;
|
||||
this.setFieldScale(fieldScale).then(() => resolve());
|
||||
});
|
||||
}
|
||||
|
||||
setFieldScale(scale: number, instant: boolean = false): Promise<void> {
|
||||
return new Promise(resolve => {
|
||||
scale *= 6;
|
||||
|
|
|
@ -400,7 +400,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
}
|
||||
|
||||
getSpriteScale(): number {
|
||||
if (this.species.speciesId === Species.ETERNATUS && this.formIndex)
|
||||
const formKey = this.getFormKey();
|
||||
if (formKey.indexOf(SpeciesFormKey.GIGANTAMAX) > -1 || formKey.indexOf(SpeciesFormKey.ETERNAMAX) > -1)
|
||||
return 1.5;
|
||||
return 1;
|
||||
}
|
||||
|
@ -1266,7 +1267,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
this.loadAssets().then(() => {
|
||||
this.calculateStats();
|
||||
this.scene.updateModifiers(this.isPlayer(), true);
|
||||
this.updateInfo().then(() => resolve());
|
||||
Promise.all([ this.updateInfo(), this.scene.updateFieldScale() ]).then(() => resolve());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -324,7 +324,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
|||
let nameSizeTest = addTextObject(this.scene, 0, 0, displayName, TextStyle.BATTLE_INFO);
|
||||
nameTextWidth = nameSizeTest.displayWidth;
|
||||
|
||||
while (nameTextWidth > 60 - ((pokemon.gender !== Gender.GENDERLESS ? 6 : 0) + (pokemon.fusionSpecies ? 6 : 0) + (pokemon.isShiny() ? 8 : 0) + (Math.min(pokemon.level.toString().length, 3) - 3) * 8)) {
|
||||
while (nameTextWidth > (this.player || !this.boss ? 60 : 98) - ((pokemon.gender !== Gender.GENDERLESS ? 6 : 0) + (pokemon.fusionSpecies ? 6 : 0) + (pokemon.isShiny() ? 8 : 0) + (Math.min(pokemon.level.toString().length, 3) - 3) * 8)) {
|
||||
displayName = `${displayName.slice(0, displayName.endsWith('.') ? -2 : -1).trimEnd()}.`;
|
||||
nameSizeTest.setText(displayName);
|
||||
nameTextWidth = nameSizeTest.displayWidth;
|
||||
|
|
Loading…
Reference in New Issue