mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-24 07:23:24 +02:00
Fixed fiery fallout encounter and relative test by making sure that isCategoryId works properly
This commit is contained in:
parent
849550808a
commit
dbfbc24c8a
@ -299,7 +299,7 @@ export const FieryFalloutEncounter: MysteryEncounter = MysteryEncounterBuilder.w
|
||||
|
||||
function giveLeadPokemonAttackTypeBoostItem() {
|
||||
// Give first party pokemon attack type boost item for free at end of battle
|
||||
const leadPokemon = globalScene.getPlayerParty()?.[0];
|
||||
const leadPokemon = globalScene.getPlayerParty()[0];
|
||||
if (leadPokemon) {
|
||||
// Generate type booster held item, default to Charcoal if item fails to generate
|
||||
let item = getNewHeldItemFromCategory(HeldItemCategoryId.TYPE_ATTACK_BOOSTER, leadPokemon);
|
||||
|
@ -129,7 +129,7 @@ export function getHeldItemCategory(itemId: HeldItemId): HeldItemCategoryId {
|
||||
}
|
||||
|
||||
export function isCategoryId(id: number): boolean {
|
||||
return (id & ITEM_CATEGORY_MASK) === id && id in HeldItemCategoryId;
|
||||
return (Object.values(HeldItemCategoryId) as number[]).includes(id);
|
||||
}
|
||||
|
||||
export function isItemInCategory(itemId: HeldItemId, category: HeldItemCategoryId): boolean {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { allHeldItems } from "#app/data/data-lists";
|
||||
import {
|
||||
type HeldItemCategoryId,
|
||||
isCategoryId,
|
||||
isItemInCategory,
|
||||
isItemInRequested,
|
||||
type HeldItemCategoryId,
|
||||
type HeldItemId,
|
||||
} from "#app/enums/held-item-id";
|
||||
import type { FormChangeItem } from "#enums/form-change-item";
|
||||
|
@ -180,8 +180,8 @@ describe("Fiery Fallout - Mystery Encounter", () => {
|
||||
expect(scene.phaseManager.getCurrentPhase()?.constructor.name).toBe(SelectModifierPhase.name);
|
||||
|
||||
const hasAttackBooster = scene
|
||||
.getPlayerParty()?.[0]
|
||||
.heldItemManager.hasItemCategory(HeldItemCategoryId.TYPE_ATTACK_BOOSTER);
|
||||
.getPlayerParty()[0]
|
||||
.heldItemManager.hasItem(HeldItemCategoryId.TYPE_ATTACK_BOOSTER);
|
||||
expect(hasAttackBooster).toBe(true);
|
||||
});
|
||||
});
|
||||
@ -266,8 +266,8 @@ describe("Fiery Fallout - Mystery Encounter", () => {
|
||||
expect(scene.phaseManager.getCurrentPhase()?.constructor.name).toBe(SelectModifierPhase.name);
|
||||
|
||||
const hasAttackBooster = scene
|
||||
.getPlayerParty()?.[0]
|
||||
.heldItemManager.hasItemCategory(HeldItemCategoryId.TYPE_ATTACK_BOOSTER);
|
||||
.getPlayerParty()[0]
|
||||
.heldItemManager.hasItem(HeldItemCategoryId.TYPE_ATTACK_BOOSTER);
|
||||
expect(hasAttackBooster).toBe(true);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user