mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-07 07:59:26 +02:00
Fixed objectValues
issues
This commit is contained in:
parent
5e7a5a7a94
commit
ad26adf426
@ -1,4 +1,4 @@
|
|||||||
import type { EnumValues } from "#types/enum-types";
|
import type { ObjectValues } from "#types/type-helpers";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enum representing the various "classes" of item effects that can be applied.
|
* Enum representing the various "classes" of item effects that can be applied.
|
||||||
@ -34,4 +34,4 @@ export const HeldItemEffect = {
|
|||||||
INCREMENTING_STAT: 52,
|
INCREMENTING_STAT: 52,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type HeldItemEffect = EnumValues<typeof HeldItemEffect>;
|
export type HeldItemEffect = ObjectValues<typeof HeldItemEffect>;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { EnumValues } from "#types/enum-types";
|
import type { ObjectValues } from "#types/type-helpers";
|
||||||
|
|
||||||
// TODO: make category the lower 2 bytes
|
// TODO: make category the lower 2 bytes
|
||||||
export const HeldItemId = {
|
export const HeldItemId = {
|
||||||
@ -94,7 +94,7 @@ export const HeldItemId = {
|
|||||||
GIMMIGHOUL_EVO_TRACKER: 0x0A01,
|
GIMMIGHOUL_EVO_TRACKER: 0x0A01,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type HeldItemId = EnumValues<typeof HeldItemId>;
|
export type HeldItemId = ObjectValues<typeof HeldItemId>;
|
||||||
|
|
||||||
type HeldItemNameMap = {
|
type HeldItemNameMap = {
|
||||||
[k in HeldItemName as (typeof HeldItemId)[k]]: k
|
[k in HeldItemName as (typeof HeldItemId)[k]]: k
|
||||||
@ -127,7 +127,7 @@ export const HeldItemCategoryId = {
|
|||||||
EVO_TRACKER: 0x0A00,
|
EVO_TRACKER: 0x0A00,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type HeldItemCategoryId = EnumValues<typeof HeldItemCategoryId>;
|
export type HeldItemCategoryId = ObjectValues<typeof HeldItemCategoryId>;
|
||||||
|
|
||||||
const ITEM_CATEGORY_MASK = 0xFF00
|
const ITEM_CATEGORY_MASK = 0xFF00
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { EnumValues } from "#types/enum-types";
|
import type { ObjectValues } from "#types/type-helpers";
|
||||||
|
|
||||||
export const RewardId = {
|
export const RewardId = {
|
||||||
NONE: 0x0000,
|
NONE: 0x0000,
|
||||||
@ -69,7 +69,7 @@ export const RewardId = {
|
|||||||
RARE_FORM_CHANGE_ITEM: 0x2E02,
|
RARE_FORM_CHANGE_ITEM: 0x2E02,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type RewardId = EnumValues<typeof RewardId>;
|
export type RewardId = ObjectValues<typeof RewardId>;
|
||||||
|
|
||||||
export const RewardCategoryId = {
|
export const RewardCategoryId = {
|
||||||
NONE: 0x0000,
|
NONE: 0x0000,
|
||||||
@ -90,7 +90,7 @@ export const RewardCategoryId = {
|
|||||||
FORM_CHANGE_ITEM: 0x0F00,
|
FORM_CHANGE_ITEM: 0x0F00,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type RewardCategoryId = EnumValues<typeof RewardCategoryId>;
|
export type RewardCategoryId = ObjectValues<typeof RewardCategoryId>;
|
||||||
|
|
||||||
const ITEM_CATEGORY_MASK = 0xFF00
|
const ITEM_CATEGORY_MASK = 0xFF00
|
||||||
|
|
||||||
|
@ -7,11 +7,11 @@ import { BerryUsedEvent } from "#events/battle-scene";
|
|||||||
import type { Pokemon } from "#field/pokemon";
|
import type { Pokemon } from "#field/pokemon";
|
||||||
import { ConsumableHeldItem } from "#items/held-item";
|
import { ConsumableHeldItem } from "#items/held-item";
|
||||||
import { TrainerItemEffect } from "#items/trainer-item";
|
import { TrainerItemEffect } from "#items/trainer-item";
|
||||||
import type { EnumValues } from "#types/enum-types";
|
import type { ObjectValues } from "#types/type-helpers";
|
||||||
import { BooleanHolder } from "#utils/common";
|
import { BooleanHolder } from "#utils/common";
|
||||||
|
|
||||||
type BerryTypeToHeldItemMap = {
|
type BerryTypeToHeldItemMap = {
|
||||||
[key in EnumValues<typeof BerryType>]: HeldItemId;
|
[key in ObjectValues<typeof BerryType>]: HeldItemId;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Rework this to use a bitwise XOR
|
// TODO: Rework this to use a bitwise XOR
|
||||||
|
Loading…
Reference in New Issue
Block a user