Improved recycle (#3420)

This commit is contained in:
kajfik 2024-04-22 17:20:36 +02:00 committed by GitHub
parent 9e4b0616e1
commit 0e5d26c79b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,9 +82,17 @@ export class RealityAutobuyerState extends AutobuyerState {
// than everything else, preempting other settings and only checking them if it fails
// In order to reduce excessive computational load, this only ever gets checked once per reality unless filter
// settings are changed (which causes it to check again); otherwise, glyph choices would be generated every tick
const shouldCheckFilter = EffarigUnlock.glyphFilter.isUnlocked && !player.reality.hasCheckedFilter;
const dontCheckModes = [AUTO_GLYPH_SCORE.LOWEST_SACRIFICE, AUTO_GLYPH_SCORE.LOWEST_ALCHEMY,
AUTO_GLYPH_SCORE.ALCHEMY_VALUE];
const shouldCheckFilter = EffarigUnlock.glyphFilter.isUnlocked && !player.reality.hasCheckedFilter &&
!dontCheckModes.includes(AutoGlyphProcessor.scoreMode);
if (isRealityAvailable() && player.options.autoRealityForFilter && shouldCheckFilter) {
const choices = GlyphSelection.glyphList(GlyphSelection.choiceCount, gainedGlyphLevel(),
const gainedLevel = gainedGlyphLevel();
const checkModes = [AUTO_REALITY_MODE.GLYPH, AUTO_REALITY_MODE.EITHER, AUTO_REALITY_MODE.BOTH];
const levelToCheck = (checkModes.includes(this.mode))
? { actualLevel: Math.min(this.glyph, Glyphs.levelCap), rawLevel: 1 }
: gainedLevel;
const choices = GlyphSelection.glyphList(GlyphSelection.choiceCount, levelToCheck,
{ isChoosingGlyph: false });
const bestGlyph = AutoGlyphProcessor.pick(choices);
player.reality.hasCheckedFilter = true;