[UI] Status moves only show 1x or 0x for effectiveness hints (#6119)

This commit is contained in:
NightKev 2025-07-20 00:48:27 -07:00 committed by GitHub
parent 275ea48744
commit 8dd6608e10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 7 deletions

View File

@ -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 {

View File

@ -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];
}