Item stealing items prioritize rarer items

Item stealing items prioritize rarer items; reward premium voucher for subsequent classic clears
This commit is contained in:
Flashfyre committed 2024-02-22 00:34:54 -05:00
1 parent 7ad099b243
commit 9c986f44ac
3 files changed
+27 -3

No files matched your search

+14
View File
@@ -59,6 +59,20 @@ export class ModifierType {
this.tier = tier;
}
getOrInferTier(): ModifierTier {
if (this.tier)
return this.tier;
if (!this.id)
return null;
for (let tier of Utils.getEnumValues(ModifierTier)) {
if (!modifierPool.hasOwnProperty(tier))
continue;
if (modifierPool[tier].find(m => (m as WeightedModifierType).modifierType.id === (this.generatorId || this.id)))
return (this.tier = tier);
}
return null;
}
withIdFromFunc(func: ModifierTypeFunc): ModifierType {
this.id = Object.keys(modifierTypes).find(k => modifierTypes[k] === func);
return this;