Skip to content

Commit

Permalink
fixed master star calc
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenga8533 committed Feb 4, 2024
1 parent 6d3e132 commit d8d2130
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"- Fixed skill tracker for non-max skills",
"- Fixed bits alert always shouting",
"- Fixed attribute commands",
"- Fixed master star on specific items",
"- Removed unnecessary comments"
]
14 changes: 8 additions & 6 deletions features/economy/ItemPrice.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,14 @@ export function getItemValue(item, save=true) {
if (save) valueMessage += `- ${AQUA}Reforge: ${GREEN}+${formatNumber(reforgeValue)}\n`;
}
// Master Star Values
let starValue = 0;
const upgrade_level = itemData?.dungeon_item_level ?? 0;
for (let i = 0; i < Math.max(upgrade_level - 5, 0); i++)starValue += bazaar[`${STAR_PLACEMENT[i]}_MASTER_STAR`]?.[settings.priceType];
if (starValue !== 0) {
value += starValue;
if (save) valueMessage += `- ${AQUA}Master Stars: ${GREEN}+${formatNumber(starValue)}\n`;
if (itemTag?.display?.Lore?.find(line => line.includes("DUNGEON")) !== undefined) {
let starValue = 0;
const upgrade_level = itemData?.upgrade_level ?? itemData?.dungeon_item_level ?? 0;
for (let i = 0; i < Math.max(upgrade_level - 5, 0); i++)starValue += bazaar[`${STAR_PLACEMENT[i]}_MASTER_STAR`]?.[settings.priceType];
if (starValue !== 0) {
value += starValue;
if (save) valueMessage += `- ${AQUA}Master Stars: ${GREEN}+${formatNumber(starValue)}\n`;
}
}
// Recomb Value
const recombValue = itemData?.rarity_upgrades === undefined ? 0 : bazaar?.RECOMBOBULATOR_3000?.[settings.priceType];
Expand Down

0 comments on commit d8d2130

Please sign in to comment.