fix runes including non martial weapons

This commit is contained in:
kvan7
2025-04-03 21:27:06 -05:00
parent f4ed41e011
commit c4b4bee47e
2 changed files with 16 additions and 6 deletions
+9 -4
View File
@@ -78,20 +78,25 @@ export const WEAPON_ONE_HANDED = new Set([
...WEAPON_ONE_HANDED_MELEE,
]);
export const WEAPONE_TWO_HANDED_MELEE = new Set([
export const WEAPON_TWO_HANDED_MELEE = new Set([
ItemCategory.TwoHandedAxe,
ItemCategory.TwoHandedMace,
ItemCategory.TwoHandedSword,
ItemCategory.Warstaff,
]);
export const MARTIAL_WEAPON = new Set([
ItemCategory.Bow,
ItemCategory.Crossbow,
...WEAPON_ONE_HANDED_MELEE,
...WEAPON_TWO_HANDED_MELEE,
]);
export const WEAPON = new Set([
ItemCategory.Staff,
ItemCategory.FishingRod,
ItemCategory.Bow,
ItemCategory.Crossbow,
...WEAPON_ONE_HANDED,
...WEAPONE_TWO_HANDED_MELEE,
...MARTIAL_WEAPON,
]);
export const ARMOUR = new Set([
+7 -2
View File
@@ -1,5 +1,10 @@
import { ItemRarity, ParsedItem } from "@/parser";
import { ARMOUR, ItemCategory, ItemEditorType, WEAPON } from "@/parser/meta";
import {
ARMOUR,
ItemCategory,
ItemEditorType,
MARTIAL_WEAPON,
} from "@/parser/meta";
function decimalPlaces(value: number, dp: number | boolean): number {
if (typeof dp === "number") {
@@ -47,7 +52,7 @@ export function getItemEditorType(item: ParsedItem): ItemEditorType {
) {
return ItemEditorType.Catalyst;
} else if (
(WEAPON.has(item.category) || ARMOUR.has(item.category)) &&
(MARTIAL_WEAPON.has(item.category) || ARMOUR.has(item.category)) &&
item.rarity &&
item.rarity !== ItemRarity.Unique
) {