mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 17:29:30 +02:00
Fix abilities
This commit is contained in:
parent
54ddc63a14
commit
06e7e24aa7
@ -2645,6 +2645,8 @@ function getAnticipationCondition(): AbAttrCondition {
|
||||
return (pokemon: Pokemon) => {
|
||||
for (const opponent of pokemon.getOpponents()) {
|
||||
for (const move of opponent.moveset) {
|
||||
if (move == undefined)
|
||||
continue;
|
||||
// move is super effective
|
||||
if (move.getMove() instanceof AttackMove && pokemon.getAttackTypeEffectiveness(move.getMove().type, opponent, true) >= 2) {
|
||||
return true;
|
||||
|
@ -2406,6 +2406,27 @@ export class CheckSwitchPhase extends BattlePhase {
|
||||
pk.getBattleInfo().flyoutMenu.flyoutText[2].setColor("#e8e8a8")
|
||||
}
|
||||
}
|
||||
if (false) {
|
||||
this.scene.pokemonInfoContainer.show(this.scene.getEnemyField()[0], false, 1, true);
|
||||
if (this.scene.getEnemyField()[1] != undefined) {
|
||||
this.scene.tweens.add({
|
||||
targets: this.scene.pokemonInfoContainer,
|
||||
alpha: 1,
|
||||
duration: 5000,
|
||||
onComplete: () => {
|
||||
this.scene.pokemonInfoContainer.hide(1.3)
|
||||
this.scene.tweens.add({
|
||||
targets: this.scene.pokemonInfoContainer,
|
||||
alpha: 1,
|
||||
duration: 1000,
|
||||
onComplete: () => {
|
||||
this.scene.pokemonInfoContainer.show(this.scene.getEnemyField()[1], false, 1, true);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
this.scene.ui.showText(i18next.t("battle:switchQuestion", { pokemonName: this.useName ? pokemon.name : i18next.t("battle:pokemon") }), null, () => {
|
||||
this.scene.ui.setMode(Mode.CONFIRM, () => {
|
||||
@ -2421,6 +2442,7 @@ export class CheckSwitchPhase extends BattlePhase {
|
||||
this.scene.getEnemyField()[i].getBattleInfo().flyoutMenu.flyoutText[3].text = "???"
|
||||
this.scene.getEnemyField()[i].getBattleInfo().flyoutMenu.flyoutText[2].setColor("#f8f8f8")
|
||||
}
|
||||
//this.scene.pokemonInfoContainer.hide()
|
||||
this.end();
|
||||
}, () => {
|
||||
this.scene.ui.setMode(Mode.MESSAGE);
|
||||
@ -2432,6 +2454,7 @@ export class CheckSwitchPhase extends BattlePhase {
|
||||
this.scene.getEnemyField()[i].getBattleInfo().flyoutMenu.flyoutText[3].text = "???"
|
||||
this.scene.getEnemyField()[i].getBattleInfo().flyoutMenu.flyoutText[2].setColor("#f8f8f8")
|
||||
}
|
||||
//this.scene.pokemonInfoContainer.hide()
|
||||
this.end();
|
||||
});
|
||||
});
|
||||
|
@ -207,7 +207,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
|
||||
this.setVisible(false);
|
||||
}
|
||||
|
||||
show(pokemon: Pokemon, showMoves: boolean = false, speedMultiplier: number = 1): Promise<void> {
|
||||
show(pokemon: Pokemon, showMoves: boolean = false, speedMultiplier: number = 1, lessInfo: boolean = false): Promise<void> {
|
||||
return new Promise<void>(resolve => {
|
||||
const caughtAttr = BigInt(pokemon.scene.gameData.dexData[pokemon.species.speciesId].caughtAttr);
|
||||
if (pokemon.gender > Gender.GENDERLESS) {
|
||||
@ -291,6 +291,11 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
|
||||
this.pokemonNatureLabelText.setShadowColor(getTextColor(TextStyle.WINDOW, true, this.scene.uiTheme));
|
||||
}
|
||||
|
||||
this.pokemonAbilityText.setVisible(!lessInfo)
|
||||
this.pokemonAbilityLabelText.setVisible(!lessInfo)
|
||||
this.pokemonNatureText.setVisible(!lessInfo)
|
||||
this.pokemonNatureLabelText.setVisible(!lessInfo)
|
||||
|
||||
const isFusion = pokemon.isFusion();
|
||||
const doubleShiny = isFusion && pokemon.shiny && pokemon.fusionShiny;
|
||||
const baseVariant = !doubleShiny ? pokemon.getVariant() : pokemon.variant;
|
||||
@ -328,7 +333,11 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
|
||||
? this.scene.gameData.dexData[starterSpeciesId].ivs
|
||||
: null;
|
||||
|
||||
if (lessInfo) {
|
||||
this.statsContainer.updateIvs(pokemon.species.baseStats, undefined, 255);
|
||||
} else {
|
||||
this.statsContainer.updateIvs(pokemon.ivs, originalIvs);
|
||||
}
|
||||
|
||||
this.scene.tweens.add({
|
||||
targets: this,
|
||||
|
@ -65,9 +65,10 @@ export class StatsContainer extends Phaser.GameObjects.Container {
|
||||
});
|
||||
}
|
||||
|
||||
updateIvs(ivs: integer[], originalIvs?: integer[]): void {
|
||||
updateIvs(ivs: integer[], originalIvs?: integer[], max?: integer): void {
|
||||
if (ivs) {
|
||||
const ivChartData = new Array(6).fill(null).map((_, i) => [ (ivs[ivChartStatIndexes[i]] / 31) * ivChartSize * ivChartStatCoordMultipliers[ivChartStatIndexes[i]][0], (ivs[ivChartStatIndexes[i]] / 31) * ivChartSize * ivChartStatCoordMultipliers[ivChartStatIndexes[i]][1] ] ).flat();
|
||||
var maxIV = max || 31
|
||||
const ivChartData = new Array(6).fill(null).map((_, i) => [ (ivs[ivChartStatIndexes[i]] / maxIV) * ivChartSize * ivChartStatCoordMultipliers[ivChartStatIndexes[i]][0], (ivs[ivChartStatIndexes[i]] / maxIV) * ivChartSize * ivChartStatCoordMultipliers[ivChartStatIndexes[i]][1] ] ).flat();
|
||||
const lastIvChartData = this.statsIvsCache || defaultIvChartData;
|
||||
const perfectIVColor: string = getTextColor(TextStyle.SUMMARY_GOLD, false, (this.scene as BattleScene).uiTheme);
|
||||
this.statsIvsCache = ivChartData.slice(0);
|
||||
|
Loading…
Reference in New Issue
Block a user