mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 00:12:16 +02:00
Apply Own Review Suggestions
This commit is contained in:
parent
24338efe63
commit
d0216229c0
@ -24,7 +24,7 @@ import { ArenaTagType } from "#enums/arena-tag-type";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { Stat, BattleStat, getStatKey, BATTLE_STATS, EFFECTIVE_STATS, EffectiveStat } from "#app/enums/stat.js";
|
||||
import { Stat, type BattleStat, type EffectiveStat, BATTLE_STATS, EFFECTIVE_STATS, getStatKey } from "#app/enums/stat";
|
||||
|
||||
export class Ability implements Localizable {
|
||||
public id: Abilities;
|
||||
|
@ -16,7 +16,7 @@ import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import i18next from "#app/plugins/i18n.js";
|
||||
import { Stat, BattleStat, EFFECTIVE_STATS, EffectiveStat, getStatKey } from "#app/enums/stat";
|
||||
import { Stat, type BattleStat, type EffectiveStat, EFFECTIVE_STATS, getStatKey } from "#app/enums/stat";
|
||||
|
||||
export enum BattlerTagLapseType {
|
||||
FAINT,
|
||||
@ -1302,7 +1302,7 @@ export class HighestStatBoostTag extends AbilityBattlerTag {
|
||||
break;
|
||||
}
|
||||
|
||||
pokemon.scene.queueMessage(i18next.t("battle:battlerTagsHighestStatBoostOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), statName: getStatKey(highestStat) }), null, false, null, true);
|
||||
pokemon.scene.queueMessage(i18next.t("battle:battlerTagsHighestStatBoostOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), statName: i18next.t(getStatKey(highestStat)) }), null, false, null, true);
|
||||
}
|
||||
|
||||
onRemove(pokemon: Pokemon): void {
|
||||
|
@ -7,7 +7,7 @@ import { DoubleBerryEffectAbAttr, ReduceBerryUseThresholdAbAttr, applyAbAttrs }
|
||||
import i18next from "i18next";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
import { BattleStat, Stat } from "#app/enums/stat";
|
||||
import { Stat, type BattleStat } from "#app/enums/stat";
|
||||
|
||||
export function getBerryName(berryType: BerryType): string {
|
||||
return i18next.t(`berry:${BerryType[berryType]}.name`);
|
||||
|
@ -26,7 +26,7 @@ import { Biome } from "#enums/biome";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { MoveUsedEvent } from "#app/events/battle-scene.js";
|
||||
import { Stat, BATTLE_STATS, BattleStat, EFFECTIVE_STATS, EffectiveStat, getStatKey } from "#app/enums/stat";
|
||||
import { Stat, type BattleStat, type EffectiveStat, BATTLE_STATS, EFFECTIVE_STATS, getStatKey } from "#app/enums/stat";
|
||||
|
||||
export enum MoveCategory {
|
||||
PHYSICAL,
|
||||
@ -4969,8 +4969,8 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
||||
}
|
||||
let ret = this.user ? Math.floor((1 - user.getHpRatio()) * 20) : super.getUserBenefitScore(user, target, move);
|
||||
if (this.user && this.batonPass) {
|
||||
const battleStatTotal = user.getStatStages().reduce((bs: integer, total: integer) => total += bs, 0);
|
||||
ret = ret / 2 + (Phaser.Tweens.Builders.GetEaseFunction("Sine.easeOut")(Math.min(Math.abs(battleStatTotal), 10) / 10) * (battleStatTotal >= 0 ? 10 : -10));
|
||||
const statStageTotal = user.getStatStages().reduce((s: integer, total: integer) => total += s, 0);
|
||||
ret = ret / 2 + (Phaser.Tweens.Builders.GetEaseFunction("Sine.easeOut")(Math.min(Math.abs(statStageTotal), 10) / 10) * (statStageTotal >= 0 ? 10 : -10));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import { TextStyle, getBBCodeFrag } from "../ui/text";
|
||||
import { Nature } from "#enums/nature";
|
||||
import { UiTheme } from "#enums/ui-theme";
|
||||
import i18next from "i18next";
|
||||
import { Stat, EFFECTIVE_STATS, getShortenedStatKey } from "#app/enums/stat.js";
|
||||
import { Stat, EFFECTIVE_STATS, getShortenedStatKey } from "#app/enums/stat";
|
||||
|
||||
export { Nature };
|
||||
|
||||
@ -27,7 +27,7 @@ export function getNatureName(nature: Nature, includeStatEffects: boolean = fals
|
||||
const textStyle = forStarterSelect ? TextStyle.SUMMARY_ALT : TextStyle.WINDOW;
|
||||
const getTextFrag = !ignoreBBCode ? (text: string, style: TextStyle) => getBBCodeFrag(text, style, uiTheme) : (text: string, style: TextStyle) => text;
|
||||
if (increasedStat && decreasedStat) {
|
||||
ret = `${getTextFrag(`${ret}${!forStarterSelect ? "\n" : " "}(`, textStyle)}${getTextFrag(`+${i18next.t(getShortenedStatKey(increasedStat))}`, TextStyle.SUMMARY_PINK)}${getTextFrag("/", textStyle)}${getTextFrag(`-${getShortenedStatKey(decreasedStat)}`, TextStyle.SUMMARY_BLUE)}${getTextFrag(")", textStyle)}`;
|
||||
ret = `${getTextFrag(`${ret}${!forStarterSelect ? "\n" : " "}(`, textStyle)}${getTextFrag(`+${i18next.t(getShortenedStatKey(increasedStat))}`, TextStyle.SUMMARY_PINK)}${getTextFrag("/", textStyle)}${getTextFrag(`-${i18next.t(getShortenedStatKey(decreasedStat))}`, TextStyle.SUMMARY_BLUE)}${getTextFrag(")", textStyle)}`;
|
||||
} else {
|
||||
ret = getTextFrag(`${ret}${!forStarterSelect ? "\n" : " "}(-)`, textStyle);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import { Constructor } from "#app/utils";
|
||||
import * as Utils from "../utils";
|
||||
import { Type, TypeDamageMultiplier, getTypeDamageMultiplier, getTypeRgb } from "../data/type";
|
||||
import { getLevelTotalExp } from "../data/exp";
|
||||
import { BATTLE_STATS, EFFECTIVE_STATS, Stat } from "#enums/stat";
|
||||
import { Stat, type PermanentStat, type BattleStat, type EffectiveStat, PERMANENT_STATS, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat";
|
||||
import { DamageMoneyRewardModifier, EnemyDamageBoosterModifier, EnemyDamageReducerModifier, EnemyEndureChanceModifier, EnemyFusionChanceModifier, HiddenAbilityRateBoosterModifier, BaseStatModifier, PokemonFriendshipBoosterModifier, PokemonHeldItemModifier, PokemonNatureWeightModifier, ShinyRateBoosterModifier, SurviveDamageModifier, TempStatStageBoosterModifier, TempCritBoosterModifier, StatBoosterModifier, CritBoosterModifier, TerastallizeModifier } from "../modifier/modifier";
|
||||
import { PokeballType } from "../data/pokeball";
|
||||
import { Gender } from "../data/gender";
|
||||
@ -49,7 +49,6 @@ import { Biome } from "#enums/biome";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { getPokemonNameWithAffix } from "#app/messages.js";
|
||||
import { PermanentStat, BattleStat, PERMANENT_STATS, EffectiveStat } from "#app/enums/stat"; // TODO: Add type
|
||||
|
||||
export enum FieldPosition {
|
||||
CENTER,
|
||||
|
@ -23,7 +23,7 @@ import Overrides from "#app/overrides";
|
||||
import { ModifierType, modifierTypes } from "./modifier-type";
|
||||
import { Command } from "#app/ui/command-ui-handler.js";
|
||||
import { Species } from "#enums/species";
|
||||
import { BATTLE_STATS, PermanentStat, TEMP_BATTLE_STATS, TempBattleStat } from "#app/enums/stat"; // TODO: Add Type
|
||||
import { type PermanentStat, type TempBattleStat, BATTLE_STATS, TEMP_BATTLE_STATS } from "#app/enums/stat";
|
||||
import i18next from "i18next";
|
||||
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
|
@ -64,7 +64,7 @@ import { Species } from "#enums/species";
|
||||
import { TrainerType } from "#enums/trainer-type";
|
||||
import { applyChallenges, ChallengeType } from "./data/challenge";
|
||||
import { pokemonEvolutions } from "./data/pokemon-evolutions";
|
||||
import { Stat, BattleStat, getStatKey, getStatStageChangeDescriptionKey } from "#enums/stat";
|
||||
import { Stat, type BattleStat, getStatKey, getStatStageChangeDescriptionKey } from "#enums/stat";
|
||||
|
||||
const { t } = i18next;
|
||||
|
||||
|
@ -8,7 +8,7 @@ import { PlayerGender } from "#enums/player-gender";
|
||||
import { ParseKeys } from "i18next";
|
||||
import { Challenge, FreshStartChallenge, SingleGenerationChallenge, SingleTypeChallenge } from "#app/data/challenge.js";
|
||||
import { ConditionFn } from "#app/@types/common.js";
|
||||
import { getShortenedStatKey, Stat } from "#app/enums/stat.js";
|
||||
import { Stat, getShortenedStatKey } from "#app/enums/stat";
|
||||
|
||||
export enum AchvTier {
|
||||
COMMON,
|
||||
|
@ -53,7 +53,7 @@ describe("Abilities - Moxie", () => {
|
||||
expect(playerPokemon.getStatStage(Stat.ATK)).toBe(1);
|
||||
}, 20000);
|
||||
|
||||
// TODO: Activate this test when MOXIE is corrected to work faint and not battle victory
|
||||
// TODO: Activate this test when MOXIE is corrected to work on faint and not on battle victory
|
||||
it.todo("should raise ATK stat stage by 1 when defeating an ally Pokemon", async() => {
|
||||
game.override.battleType("double");
|
||||
const moveToUse = Moves.AERIAL_ACE;
|
||||
|
@ -37,7 +37,7 @@ describe("Items - Eviolite", () => {
|
||||
|
||||
const partyMember = game.scene.getParty()[0];
|
||||
|
||||
// Checking consoe log to make sure Eviolite is applied when getEffectiveStat (with the appropriate stat) is called
|
||||
// Checking console log to make sure Eviolite is applied when getEffectiveStat (with the appropriate stat) is called
|
||||
partyMember.getEffectiveStat(Stat.DEF);
|
||||
expect(consoleSpy).toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:ModifierType.EVIOLITE.name"), "");
|
||||
|
||||
|
@ -37,7 +37,7 @@ describe("Items - Light Ball", () => {
|
||||
|
||||
const partyMember = game.scene.getParty()[0];
|
||||
|
||||
// Checking consoe log to make sure Light Ball is applied when getEffectiveStat (with the appropriate stat) is called
|
||||
// Checking console log to make sure Light Ball is applied when getEffectiveStat (with the appropriate stat) is called
|
||||
partyMember.getEffectiveStat(Stat.DEF);
|
||||
expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.LIGHT_BALL.name"), "");
|
||||
|
||||
|
@ -37,7 +37,7 @@ describe("Items - Metal Powder", () => {
|
||||
|
||||
const partyMember = game.scene.getParty()[0];
|
||||
|
||||
// Checking consoe log to make sure Metal Powder is applied when getEffectiveStat (with the appropriate stat) is called
|
||||
// Checking console log to make sure Metal Powder is applied when getEffectiveStat (with the appropriate stat) is called
|
||||
partyMember.getEffectiveStat(Stat.DEF);
|
||||
expect(consoleSpy).toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.METAL_POWDER.name"), "");
|
||||
|
||||
|
@ -37,7 +37,7 @@ describe("Items - Quick Powder", () => {
|
||||
|
||||
const partyMember = game.scene.getParty()[0];
|
||||
|
||||
// Checking consoe log to make sure Quick Powder is applied when getEffectiveStat (with the appropriate stat) is called
|
||||
// Checking console log to make sure Quick Powder is applied when getEffectiveStat (with the appropriate stat) is called
|
||||
partyMember.getEffectiveStat(Stat.DEF);
|
||||
expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.QUICK_POWDER.name"), "");
|
||||
|
||||
|
@ -37,7 +37,7 @@ describe("Items - Thick Club", () => {
|
||||
|
||||
const partyMember = game.scene.getParty()[0];
|
||||
|
||||
// Checking consoe log to make sure Thick Club is applied when getEffectiveStat (with the appropriate stat) is called
|
||||
// Checking console log to make sure Thick Club is applied when getEffectiveStat (with the appropriate stat) is called
|
||||
partyMember.getEffectiveStat(Stat.DEF);
|
||||
expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.THICK_CLUB.name"), "");
|
||||
|
||||
|
@ -65,7 +65,7 @@ describe("Moves - Baton Pass", () => {
|
||||
// arrange
|
||||
game.override
|
||||
.startingWave(5)
|
||||
.enemyMoveset([ Moves.NASTY_PLOT, Moves.NASTY_PLOT, Moves.NASTY_PLOT, Moves.NASTY_PLOT ]);
|
||||
.enemyMoveset(new Array(4).fill([Moves.NASTY_PLOT]);
|
||||
await game.startBattle([
|
||||
Species.RAICHU,
|
||||
Species.SHUCKLE
|
||||
@ -77,7 +77,7 @@ describe("Moves - Baton Pass", () => {
|
||||
|
||||
// round 2 - baton pass
|
||||
game.scene.getEnemyPokemon()!.hp = 100;
|
||||
game.override.enemyMoveset([ Moves.BATON_PASS, Moves.BATON_PASS, Moves.BATON_PASS, Moves.BATON_PASS ]);
|
||||
game.override.enemyMoveset(new Array(4).fill(Moves.BATON_PASS));
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
await game.phaseInterceptor.to(PostSummonPhase, false);
|
||||
|
||||
|
@ -36,7 +36,7 @@ describe("Moves - Spit Up", () => {
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
game.override.enemyLevel(2000);
|
||||
|
||||
game.override.moveset([ spitUp.id, spitUp.id, spitUp.id, spitUp.id ]);
|
||||
game.override.moveset(new Array(4).fill(spitUp.id));
|
||||
game.override.ability(Abilities.NONE);
|
||||
|
||||
vi.spyOn(spitUp, "calculateBattlePower");
|
||||
|
@ -6,7 +6,7 @@ import { addWindow } from "./ui-theme";
|
||||
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
||||
import {Button} from "#enums/buttons";
|
||||
import i18next from "i18next";
|
||||
import { Stat, PERMANENT_STATS, getStatKey } from "#app/enums/stat.js";
|
||||
import { Stat, PERMANENT_STATS, getStatKey } from "#app/enums/stat";
|
||||
|
||||
export default class BattleMessageUiHandler extends MessageUiHandler {
|
||||
private levelUpStatsContainer: Phaser.GameObjects.Container;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText";
|
||||
import BattleScene from "../battle-scene";
|
||||
import { TextStyle, addBBCodeTextObject, addTextObject, getTextColor } from "./text";
|
||||
import { getStatKey, PERMANENT_STATS } from "#app/enums/stat.js";
|
||||
import { PERMANENT_STATS, getStatKey } from "#app/enums/stat.js";
|
||||
import i18next from "i18next";
|
||||
|
||||
const ivChartSize = 24;
|
||||
|
@ -22,7 +22,7 @@ import { Ability } from "../data/ability.js";
|
||||
import i18next from "i18next";
|
||||
import {modifierSortFunc} from "../modifier/modifier";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import { Stat, getStatKey, PERMANENT_STATS } from "#app/enums/stat.js";
|
||||
import { Stat, PERMANENT_STATS, getStatKey } from "#app/enums/stat.js";
|
||||
|
||||
enum Page {
|
||||
PROFILE,
|
||||
|
Loading…
Reference in New Issue
Block a user