Skip to content

Commit

Permalink
BLU: hide alt items that cannot be equipped
Browse files Browse the repository at this point in the history
  • Loading branch information
xiashtra committed Oct 20, 2024
1 parent a4c0d25 commit 6cfef29
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions packages/core/src/customgear/custom_item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ export class CustomItem implements GearItem {
this.recheckStats();
}

get equipLvl() {
return this._data.equipLvl;
}

set equipLvl(equipLvl: number) {
this._data.equipLvl = equipLvl;
this.recheckStats();
}

get respectCaps() {
return this._data.respectCaps;
}
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/datamanager_xivapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ export class XivApiGearInfo implements GearItem {
name: string;
iconUrl: URL;
ilvl: number;
equipLvl: number;
displayGearSlot: DisplayGearSlot;
displayGearSlotName: DisplayGearSlotKey;
occGearSlotName: OccGearSlotKey;
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/sheet.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ // TODO: get back to fixing this at some point
import {
CURRENT_MAX_LEVEL,
CURRENT_MAX_LEVEL_BLU,
defaultItemDisplaySettings,
DefaultMateriaFillPrio,
getClassJobStats,
Expand Down Expand Up @@ -918,7 +919,9 @@ export class GearPlanSheet {
// Must be same slot
&& otherItem.occGearSlotName === thisItem.occGearSlotName
// Must be better or same stats
&& isSameOrBetterItem(otherItem, thisItem);
&& isSameOrBetterItem(otherItem, thisItem)
// if BLU, only allow items up to current max BLU level
&& (this.classJobName !== 'BLU' || otherItem.equipLvl <= CURRENT_MAX_LEVEL_BLU);
});
}
}
4 changes: 4 additions & 0 deletions packages/xivmath/src/geartypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ export interface GearItem extends XivCombatItem {
* ilvl
*/
ilvl: number;
/**
* equip level
*/
equipLvl: number;
/**
* The primary substat
*/
Expand Down
1 change: 1 addition & 0 deletions packages/xivmath/src/xivconstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export type RaceName = 'Duskwight' | 'Wildwood'
*/
export const SupportedLevels = [70, 80, 90, 100] as const;
export const CURRENT_MAX_LEVEL: SupportedLevel = 100;
export const CURRENT_MAX_LEVEL_BLU: SupportedLevel = 80;
export type SupportedLevel = typeof SupportedLevels[number];


Expand Down

0 comments on commit 6cfef29

Please sign in to comment.