mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-06 23:49:26 +02:00
[UI] Status moves only show 1x or 0x for effectiveness hints (#6119)
This commit is contained in:
parent
275ea48744
commit
8dd6608e10
@ -305,10 +305,11 @@ export abstract class Move implements Localizable {
|
||||
|
||||
/**
|
||||
* Checks if the move is immune to certain types.
|
||||
*
|
||||
* Currently looks at cases of Grass types with powder moves and Dark types with moves affected by Prankster.
|
||||
* @param {Pokemon} user the source of this move
|
||||
* @param {Pokemon} target the target of this move
|
||||
* @param {PokemonType} type the type of the move's target
|
||||
* @param user - The source of this move
|
||||
* @param target - The target of this move
|
||||
* @param type - The type of the move's target
|
||||
* @returns boolean
|
||||
*/
|
||||
isTypeImmune(user: Pokemon, target: Pokemon, type: PokemonType): boolean {
|
||||
|
@ -322,7 +322,6 @@ export class FightUiHandler extends UiHandler implements InfoToggle {
|
||||
|
||||
/**
|
||||
* Gets multiplier text for a pokemon's move against a specific opponent
|
||||
* Returns undefined if it's a status move
|
||||
*/
|
||||
private getEffectivenessText(pokemon: Pokemon, opponent: Pokemon, pokemonMove: PokemonMove): string | undefined {
|
||||
const effectiveness = opponent.getMoveEffectiveness(
|
||||
@ -333,8 +332,11 @@ export class FightUiHandler extends UiHandler implements InfoToggle {
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
if (effectiveness === undefined) {
|
||||
return undefined;
|
||||
if (pokemonMove.getMove().category === MoveCategory.STATUS) {
|
||||
if (effectiveness === 0) {
|
||||
return "0x";
|
||||
}
|
||||
return "1x";
|
||||
}
|
||||
|
||||
return `${effectiveness}x`;
|
||||
@ -391,7 +393,12 @@ export class FightUiHandler extends UiHandler implements InfoToggle {
|
||||
),
|
||||
)
|
||||
.sort((a, b) => b - a)
|
||||
.map(effectiveness => getTypeDamageMultiplierColor(effectiveness ?? 0, "offense"));
|
||||
.map(effectiveness => {
|
||||
if (pokemonMove.getMove().category === MoveCategory.STATUS && effectiveness !== 0) {
|
||||
return undefined;
|
||||
}
|
||||
return getTypeDamageMultiplierColor(effectiveness ?? 0, "offense");
|
||||
});
|
||||
|
||||
return moveColors[0];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user