Update shiny luck mechanics and count both fusion components
This commit is contained in:
1 parent
6603417e40
commit
5e7356636e
18 files changed
+160
-21
No files matched your search
+26
-4
@@ -31,6 +31,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||
private ownedIcon: Phaser.GameObjects.Sprite;
|
||||
private teraIcon: Phaser.GameObjects.Sprite;
|
||||
private shinyIcon: Phaser.GameObjects.Sprite;
|
||||
private fusionShinyIcon: Phaser.GameObjects.Sprite;
|
||||
private splicedIcon: Phaser.GameObjects.Sprite;
|
||||
private statusIndicator: Phaser.GameObjects.Sprite;
|
||||
private levelContainer: Phaser.GameObjects.Container;
|
||||
@@ -101,6 +102,13 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||
this.shinyIcon.setInteractive(new Phaser.Geom.Rectangle(0, 0, 12, 15), Phaser.Geom.Rectangle.Contains);
|
||||
this.add(this.shinyIcon);
|
||||
|
||||
this.fusionShinyIcon = this.scene.add.sprite(0, 0, 'shiny_star_2');
|
||||
this.fusionShinyIcon.setVisible(false);
|
||||
this.fusionShinyIcon.setOrigin(0, 0);
|
||||
this.fusionShinyIcon.setScale(0.5)
|
||||
this.fusionShinyIcon.setPosition(this.shinyIcon.x, this.shinyIcon.y);
|
||||
this.add(this.fusionShinyIcon);
|
||||
|
||||
this.splicedIcon = this.scene.add.sprite(0, 0, 'icon_spliced');
|
||||
this.splicedIcon.setVisible(false);
|
||||
this.splicedIcon.setOrigin(0, 0);
|
||||
@@ -183,21 +191,35 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||
});
|
||||
this.teraIcon.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip());
|
||||
|
||||
const isFusion = pokemon.isFusion();
|
||||
|
||||
this.splicedIcon.setPositionRelative(this.nameText, nameTextWidth + this.genderText.displayWidth + 1 + (this.teraIcon.visible ? this.teraIcon.displayWidth + 1 : 0), 2.5);
|
||||
this.splicedIcon.setVisible(!!pokemon.fusionSpecies);
|
||||
this.splicedIcon.setVisible(isFusion);
|
||||
if (this.splicedIcon.visible) {
|
||||
this.splicedIcon.on('pointerover', () => (this.scene as BattleScene).ui.showTooltip(null, `${pokemon.species.getName(pokemon.formIndex)}/${pokemon.fusionSpecies.getName(pokemon.fusionFormIndex)}`));
|
||||
this.splicedIcon.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip());
|
||||
}
|
||||
|
||||
const doubleShiny = isFusion && pokemon.shiny && pokemon.fusionShiny;
|
||||
const baseVariant = !doubleShiny ? pokemon.getVariant() : pokemon.variant;
|
||||
|
||||
this.shinyIcon.setPositionRelative(this.nameText, nameTextWidth + this.genderText.displayWidth + 1 + (this.teraIcon.visible ? this.teraIcon.displayWidth + 1 : 0) + (this.splicedIcon.visible ? this.splicedIcon.displayWidth + 1 : 0), 2.5);
|
||||
this.shinyIcon.setVisible(!!pokemon.isShiny());
|
||||
this.shinyIcon.setTint(getVariantTint(pokemon.getVariant()));
|
||||
this.shinyIcon.setTexture(`shiny_star${doubleShiny ? '_1' : ''}`);
|
||||
this.shinyIcon.setVisible(pokemon.isShiny());
|
||||
this.shinyIcon.setTint(getVariantTint(baseVariant));
|
||||
if (this.shinyIcon.visible) {
|
||||
this.shinyIcon.on('pointerover', () => (this.scene as BattleScene).ui.showTooltip(null, `Shiny${pokemon.getVariant() ? ` (${pokemon.getVariant() === 2 ? 'Epic' : 'Rare'})` : ''}`));
|
||||
const shinyDescriptor = doubleShiny || baseVariant ?
|
||||
`${baseVariant === 2 ? 'Epic' : baseVariant === 1 ? 'Rare' : 'Common'}${doubleShiny ? `/${pokemon.fusionVariant === 2 ? 'Epic' : pokemon.fusionVariant === 1 ? 'Rare' : 'Common'}` : ''}`
|
||||
: '';
|
||||
this.shinyIcon.on('pointerover', () => (this.scene as BattleScene).ui.showTooltip(null, `Shiny${shinyDescriptor ? ` (${shinyDescriptor})` : ''}`));
|
||||
this.shinyIcon.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip());
|
||||
}
|
||||
|
||||
this.fusionShinyIcon.setPosition(this.shinyIcon.x, this.shinyIcon.y);
|
||||
this.fusionShinyIcon.setVisible(doubleShiny);
|
||||
if (isFusion)
|
||||
this.fusionShinyIcon.setTint(getVariantTint(pokemon.fusionVariant));
|
||||
|
||||
if (!this.player) {
|
||||
const dexEntry = pokemon.scene.gameData.dexData[pokemon.species.speciesId];
|
||||
this.ownedIcon.setVisible(!!dexEntry.caughtAttr);
|
||||
|
||||
@@ -138,6 +138,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
|
||||
const maxUpgradeCount = typeOptions.map(to => to.upgradeCount).reduce((max, current) => Math.max(current, max), 0);
|
||||
|
||||
this.scene.showFieldOverlay(750);
|
||||
this.scene.updateAndShowLuckText(750);
|
||||
|
||||
let i = 0;
|
||||
|
||||
@@ -363,6 +364,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
|
||||
this.eraseCursor();
|
||||
|
||||
this.scene.hideFieldOverlay(250);
|
||||
this.scene.hideLuckText(750);
|
||||
|
||||
const options = this.options.concat(this.shopOptionsRows.flat());
|
||||
this.options.splice(0, this.options.length);
|
||||
|
||||
@@ -900,12 +900,23 @@ class PartySlot extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
if (this.pokemon.isShiny()) {
|
||||
const shinyStar = this.scene.add.image(0, 0, 'shiny_star_small');
|
||||
const doubleShiny = this.pokemon.isFusion() && this.pokemon.shiny && this.pokemon.fusionShiny;
|
||||
|
||||
const shinyStar = this.scene.add.image(0, 0, `shiny_star_small${doubleShiny ? '_1' : ''}`);
|
||||
shinyStar.setOrigin(0, 0);
|
||||
shinyStar.setPositionRelative(slotName, -9, 3);
|
||||
shinyStar.setTint(getVariantTint(this.pokemon.getVariant()));
|
||||
shinyStar.setTint(getVariantTint(!doubleShiny ? this.pokemon.getVariant() : this.pokemon.variant));
|
||||
|
||||
slotInfoContainer.add(shinyStar);
|
||||
|
||||
if (doubleShiny) {
|
||||
const fusionShinyStar = this.scene.add.image(0, 0, `shiny_star_small_2`);
|
||||
fusionShinyStar.setOrigin(0, 0);
|
||||
fusionShinyStar.setPosition(shinyStar.x, shinyStar.y);
|
||||
fusionShinyStar.setTint(getVariantTint(this.pokemon.fusionVariant));
|
||||
|
||||
slotInfoContainer.add(fusionShinyStar);
|
||||
}
|
||||
}
|
||||
|
||||
if (partyUiMode !== PartyUiMode.TM_MODIFIER) {
|
||||
|
||||
@@ -18,6 +18,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
|
||||
private pokemonNatureLabelText: Phaser.GameObjects.Text;
|
||||
private pokemonNatureText: BBCodeText;
|
||||
private pokemonShinyIcon: Phaser.GameObjects.Image;
|
||||
private pokemonFusionShinyIcon: Phaser.GameObjects.Image;
|
||||
private pokemonMovesContainer: Phaser.GameObjects.Container;
|
||||
private pokemonMovesContainers: Phaser.GameObjects.Container[];
|
||||
private pokemonMoveBgs: Phaser.GameObjects.NineSlice[];
|
||||
@@ -114,6 +115,11 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
|
||||
this.pokemonShinyIcon.setInteractive(new Phaser.Geom.Rectangle(0, 0, 12, 15), Phaser.Geom.Rectangle.Contains);
|
||||
this.add(this.pokemonShinyIcon);
|
||||
|
||||
this.pokemonFusionShinyIcon = this.scene.add.image(this.pokemonShinyIcon.x, this.pokemonShinyIcon.y, 'shiny_star_2');
|
||||
this.pokemonFusionShinyIcon.setOrigin(0, 0);
|
||||
this.pokemonFusionShinyIcon.setScale(0.75);
|
||||
this.add(this.pokemonFusionShinyIcon);
|
||||
|
||||
this.setVisible(false);
|
||||
}
|
||||
|
||||
@@ -135,12 +141,25 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
|
||||
|
||||
this.pokemonNatureText.setText(getNatureName(pokemon.getNature(), true, false, false, this.scene.uiTheme));
|
||||
|
||||
this.pokemonShinyIcon.setTint(getVariantTint(pokemon.getVariant()));
|
||||
const isFusion = pokemon.isFusion();
|
||||
const doubleShiny = isFusion && pokemon.shiny && pokemon.fusionShiny;
|
||||
const baseVariant = !doubleShiny ? pokemon.getVariant() : pokemon.variant;
|
||||
|
||||
this.pokemonShinyIcon.setTexture(`shiny_star${doubleShiny ? '_1' : ''}`);
|
||||
this.pokemonShinyIcon.setVisible(pokemon.isShiny());
|
||||
this.pokemonShinyIcon.setTint(getVariantTint(baseVariant));
|
||||
if (this.pokemonShinyIcon.visible) {
|
||||
this.pokemonShinyIcon.on('pointerover', () => (this.scene as BattleScene).ui.showTooltip(null, `Shiny${pokemon.getVariant() ? ` (${pokemon.getVariant() === 2 ? 'Epic' : 'Rare'})` : ''}`, true));
|
||||
const shinyDescriptor = doubleShiny || baseVariant ?
|
||||
`${baseVariant === 2 ? 'Epic' : baseVariant === 1 ? 'Rare' : 'Common'}${doubleShiny ? `/${pokemon.fusionVariant === 2 ? 'Epic' : pokemon.fusionVariant === 1 ? 'Rare' : 'Common'}` : ''}`
|
||||
: '';
|
||||
this.pokemonShinyIcon.on('pointerover', () => (this.scene as BattleScene).ui.showTooltip(null, `Shiny${shinyDescriptor ? ` (${shinyDescriptor})` : ''}`, true));
|
||||
this.pokemonShinyIcon.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip());
|
||||
}
|
||||
|
||||
this.pokemonFusionShinyIcon.setPosition(this.pokemonShinyIcon.x, this.pokemonShinyIcon.y);
|
||||
this.pokemonFusionShinyIcon.setVisible(doubleShiny);
|
||||
if (isFusion)
|
||||
this.pokemonFusionShinyIcon.setTint(getVariantTint(pokemon.fusionVariant));
|
||||
|
||||
const originalIvs: integer[] = this.scene.gameData.dexData[pokemon.species.speciesId].caughtAttr
|
||||
? this.scene.gameData.dexData[pokemon.species.speciesId].ivs
|
||||
|
||||
@@ -43,6 +43,7 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
private levelText: Phaser.GameObjects.Text;
|
||||
private genderText: Phaser.GameObjects.Text;
|
||||
private shinyIcon: Phaser.GameObjects.Image;
|
||||
private fusionShinyIcon: Phaser.GameObjects.Image;
|
||||
private statusContainer: Phaser.GameObjects.Container;
|
||||
private status: Phaser.GameObjects.Image;
|
||||
private summaryPageContainer: Phaser.GameObjects.Container;
|
||||
@@ -125,6 +126,12 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
this.shinyIcon.setInteractive(new Phaser.Geom.Rectangle(0, 0, 12, 15), Phaser.Geom.Rectangle.Contains);
|
||||
this.summaryContainer.add(this.shinyIcon);
|
||||
|
||||
this.fusionShinyIcon = this.scene.add.image(0, 0, 'shiny_star_2');
|
||||
this.fusionShinyIcon.setVisible(false);
|
||||
this.fusionShinyIcon.setOrigin(0, 0);
|
||||
this.fusionShinyIcon.setScale(0.75)
|
||||
this.summaryContainer.add(this.fusionShinyIcon);
|
||||
|
||||
this.pokeball = this.scene.add.sprite(6, -19, 'pb');
|
||||
this.pokeball.setOrigin(0, 1);
|
||||
this.summaryContainer.add(this.pokeball);
|
||||
@@ -137,8 +144,6 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
this.genderText.setOrigin(0, 1);
|
||||
this.summaryContainer.add(this.genderText);
|
||||
|
||||
|
||||
|
||||
this.statusContainer = this.scene.add.container(-106, -16);
|
||||
|
||||
const statusBg = this.scene.add.image(0, 0, 'summary_status');
|
||||
@@ -237,21 +242,35 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
|
||||
this.nameText.setText(this.pokemon.name);
|
||||
|
||||
const isFusion = this.pokemon.isFusion();
|
||||
|
||||
this.splicedIcon.setPositionRelative(this.nameText, this.nameText.displayWidth + 2, 3);
|
||||
this.splicedIcon.setVisible(!!this.pokemon.fusionSpecies);
|
||||
this.splicedIcon.setVisible(isFusion);
|
||||
if (this.splicedIcon.visible) {
|
||||
this.splicedIcon.on('pointerover', () => (this.scene as BattleScene).ui.showTooltip(null, `${this.pokemon.species.getName(this.pokemon.formIndex)}/${this.pokemon.fusionSpecies.getName(this.pokemon.fusionFormIndex)}`, true));
|
||||
this.splicedIcon.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip());
|
||||
}
|
||||
|
||||
const doubleShiny = isFusion && this.pokemon.shiny && this.pokemon.fusionShiny;
|
||||
const baseVariant = !doubleShiny ? this.pokemon.getVariant() : this.pokemon.variant;
|
||||
|
||||
this.shinyIcon.setPositionRelative(this.nameText, this.nameText.displayWidth + (this.splicedIcon.visible ? this.splicedIcon.displayWidth + 1 : 0) + 1, 3);
|
||||
this.shinyIcon.setTint(getVariantTint(this.pokemon.getVariant()));
|
||||
this.shinyIcon.setTexture(`shiny_star${doubleShiny ? '_1' : ''}`);
|
||||
this.shinyIcon.setVisible(this.pokemon.isShiny());
|
||||
this.shinyIcon.setTint(getVariantTint(baseVariant));
|
||||
if (this.shinyIcon.visible) {
|
||||
this.shinyIcon.on('pointerover', () => (this.scene as BattleScene).ui.showTooltip(null, `Shiny${this.pokemon.getVariant() ? ` (${this.pokemon.getVariant() === 2 ? 'Epic' : 'Rare'})` : ''}`, true));
|
||||
const shinyDescriptor = doubleShiny || baseVariant ?
|
||||
`${baseVariant === 2 ? 'Epic' : baseVariant === 1 ? 'Rare' : 'Common'}${doubleShiny ? `/${this.pokemon.fusionVariant === 2 ? 'Epic' : this.pokemon.fusionVariant === 1 ? 'Rare' : 'Common'}` : ''}`
|
||||
: '';
|
||||
this.shinyIcon.on('pointerover', () => (this.scene as BattleScene).ui.showTooltip(null, `Shiny${shinyDescriptor ? ` (${shinyDescriptor})` : ''}`, true));
|
||||
this.shinyIcon.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip());
|
||||
}
|
||||
|
||||
this.fusionShinyIcon.setPosition(this.shinyIcon.x, this.shinyIcon.y);
|
||||
this.fusionShinyIcon.setVisible(doubleShiny);
|
||||
if (isFusion)
|
||||
this.fusionShinyIcon.setTint(getVariantTint(this.pokemon.fusionVariant));
|
||||
|
||||
this.pokeball.setFrame(getPokeballAtlasKey(this.pokemon.pokeball));
|
||||
this.levelText.setText(this.pokemon.level.toString());
|
||||
this.genderText.setText(getGenderSymbol(this.pokemon.getGender(true)));
|
||||
|
||||
Reference in new issue
Block a user