farming-weight
Version:
Tools for calculating farming weight and fortune in Hypixel Skyblock
54 lines • 1.63 kB
JavaScript
import { Stat } from '../../constants/stats.js';
export class BaseReforge {
id;
name;
wiki;
stone;
appliesTo;
tiers;
priority;
constructor(id, definition) {
this.id = id;
this.name = definition.name;
this.wiki = definition.wiki;
this.stone = definition.stone;
this.appliesTo = definition.appliesTo;
this.tiers = definition.tiers;
this.priority = definition.priority;
}
getTier(rarity) {
return this.tiers[rarity];
}
getEffects(rarity, sourceName) {
const tier = this.getTier(rarity);
if (!tier)
return [];
return this.statsToEffects(tier.stats, sourceName);
}
statsToEffects(stats, sourceName) {
const source = sourceName ?? `Reforge: ${this.name}`;
const out = [];
for (const [statKey, value] of Object.entries(stats)) {
if (!value)
continue;
if (statKey === Stat.Overbloom) {
out.push({
source,
op: 'add-rare-pct',
value,
scope: { tags: ['overbloom'] },
relatedStats: [Stat.Overbloom],
meta: {
description: 'Normal Overbloom',
valueDisplay: 'stat',
valueStat: Stat.Overbloom,
},
});
continue;
}
out.push({ source, op: 'add-stat', stat: statKey, value });
}
return out;
}
}
//# sourceMappingURL=base.js.map