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