UNPKG

farming-weight

Version:

Tools for calculating farming weight and fortune in Hypixel Skyblock

35 lines 1.44 kB
import { effectsToSummaries } from '../../effects/summary.js'; import { getGemstoneSourceFromSlot, getGemstoneStatFromSlot } from '../gems/index.js'; export function gemStat(item, stat, hostRarity) { const gems = item.gems; if (!gems) return 0; let sum = 0; for (const [slot, gemRarity] of Object.entries(gems)) { sum += getGemstoneStatFromSlot(slot, gemRarity, hostRarity, stat); } return sum; } export function gemEffects(item, hostRarity, sourceName, multiplier = 1) { const gems = item.gems; if (!gems) return []; const effects = []; for (const [slot, gemRarity] of Object.entries(gems)) { const source = getGemstoneSourceFromSlot(slot); if (!source) continue; effects.push(...source.getEffects(hostRarity, gemRarity, sourceName, multiplier)); } return effects; } export function gemSlotDeltaEffects(slot, hostRarity, currentGem, nextGem, sourceName, multiplier = 1) { const source = getGemstoneSourceFromSlot(slot); if (!source) return []; return source.getDeltaEffects(hostRarity, currentGem, nextGem, sourceName, multiplier); } export function gemSlotDeltaEffectSummaries(slot, hostRarity, currentGem, nextGem, sourceName, stats, multiplier = 1) { return effectsToSummaries(gemSlotDeltaEffects(slot, hostRarity, currentGem, nextGem, sourceName, multiplier), stats); } //# sourceMappingURL=gems.js.map