mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-09 00:49:27 +02:00
More minor fixes
This commit is contained in:
parent
c7a1b0fac5
commit
4ed0fd0384
@ -11,11 +11,11 @@ import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { RewardTier } from "#enums/reward-tier";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { TrainerItemId } from "#enums/trainer-item-id";
|
||||
import { assignItemToFirstFreePokemon } from "#items/item-utility";
|
||||
import { PokemonMove } from "#moves/pokemon-move";
|
||||
import { showEncounterText } from "#mystery-encounters/encounter-dialogue-utils";
|
||||
import type { EnemyPartyConfig, EnemyPokemonConfig } from "#mystery-encounters/encounter-phase-utils";
|
||||
import {
|
||||
assignItemToFirstFreePokemon,
|
||||
initBattleWithEnemyConfig,
|
||||
leaveEncounterWithoutBattle,
|
||||
loadCustomMovesForEncounter,
|
||||
|
@ -61,7 +61,7 @@ export class InstantReviveHeldItem extends ConsumableHeldItem {
|
||||
// Reapply Commander on the Pokemon's side of the field, if applicable
|
||||
const field = pokemon.isPlayer() ? globalScene.getPlayerField() : globalScene.getEnemyField();
|
||||
for (const p of field) {
|
||||
applyAbAttrs("CommanderAbAttr", p, null, false);
|
||||
applyAbAttrs("CommanderAbAttr", { pokemon: p });
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1,11 +1,15 @@
|
||||
import type { BattleScene } from "#app/battle-scene";
|
||||
import { TurnHeldItemTransferModifier } from "#modifiers/modifier";
|
||||
import { allSpecies } from "#data/data-lists";
|
||||
import { HeldItemId } from "#enums/held-item-id";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { PlayerPokemon } from "#field/pokemon";
|
||||
import {
|
||||
Achv,
|
||||
AchvTier,
|
||||
achvs,
|
||||
DamageAchv,
|
||||
HealAchv,
|
||||
HeldItemAchv,
|
||||
LevelAchv,
|
||||
ModifierAchv,
|
||||
MoneyAchv,
|
||||
@ -204,32 +208,26 @@ describe("LevelAchv", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("ModifierAchv", () => {
|
||||
describe("HeldItemAchv", () => {
|
||||
it("should create an instance of ModifierAchv", () => {
|
||||
const modifierAchv = new ModifierAchv(
|
||||
const heldItemAchv = new HeldItemAchv(
|
||||
"",
|
||||
"Test Modifier Achievement",
|
||||
"Test Held Item Achievement",
|
||||
"Test Description",
|
||||
"modifier_icon",
|
||||
10,
|
||||
() => true,
|
||||
);
|
||||
expect(modifierAchv).toBeInstanceOf(ModifierAchv);
|
||||
expect(modifierAchv instanceof Achv).toBe(true);
|
||||
expect(heldItemAchv).toBeInstanceOf(HeldItemAchv);
|
||||
expect(heldItemAchv instanceof Achv).toBe(true);
|
||||
});
|
||||
|
||||
it("should validate the achievement based on the modifier function", () => {
|
||||
const modifierAchv = new ModifierAchv(
|
||||
"",
|
||||
"Test Modifier Achievement",
|
||||
"Test Description",
|
||||
"modifier_icon",
|
||||
10,
|
||||
() => true,
|
||||
);
|
||||
const modifier = new TurnHeldItemTransferModifier(null!, 3, 1);
|
||||
|
||||
expect(modifierAchv.validate([modifier])).toBe(true);
|
||||
it("should validate the mini black hole achievement", () => {
|
||||
const heldItemAchv = achvs.MINI_BLACK_HOLE;
|
||||
const pokemon = new PlayerPokemon(allSpecies[SpeciesId.BULBASAUR], 1);
|
||||
expect(heldItemAchv.validate([pokemon])).toBe(false);
|
||||
pokemon.heldItemManager.add(HeldItemId.MINI_BLACK_HOLE);
|
||||
expect(heldItemAchv.validate([pokemon])).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user