mirror of
https://github.com/IvarK/AntimatterDimensionsSourceCode.git
synced 2024-09-20 11:01:45 +00:00
Correctly maintain glyph count when undoing
This commit is contained in:
parent
451cfc43fe
commit
53b956080b
|
@ -31,6 +31,7 @@ export const Glyphs = {
|
|||
unseen: [],
|
||||
levelBoost: 0,
|
||||
factorsOpen: false,
|
||||
bestUndoGlyphCount: 0,
|
||||
get inventoryList() {
|
||||
return player.reality.glyphs.inventory;
|
||||
},
|
||||
|
@ -601,6 +602,9 @@ export const Glyphs = {
|
|||
const inventorySlot = Glyphs.findFreeIndex(player.options.respecIntoProtected);
|
||||
if (inventorySlot === -1 || player.reality.glyphs.undo.length === 0) return;
|
||||
const undoData = player.reality.glyphs.undo.pop();
|
||||
// We store this value here so that we can restore it later on in the reality reset code, since we immediately
|
||||
// change equipped glyph status here but only update requirement checks within finishProcessReality()
|
||||
this.bestUndoGlyphCount = player.requirementChecks.reality.maxGlyphs;
|
||||
this.unequip(undoData.targetSlot, inventorySlot);
|
||||
finishProcessReality({
|
||||
reset: true,
|
||||
|
|
|
@ -635,7 +635,12 @@ export function finishProcessReality(realityProps) {
|
|||
player.respec = false;
|
||||
player.eterc8ids = 50;
|
||||
player.eterc8repl = 40;
|
||||
if (!realityProps.glyphUndo) Player.resetRequirements("reality");
|
||||
if (realityProps.glyphUndo) {
|
||||
player.requirementChecks.reality.maxGlyphs =
|
||||
Math.max(Glyphs.bestUndoGlyphCount, player.requirementChecks.reality.maxGlyphs);
|
||||
} else {
|
||||
Player.resetRequirements("reality");
|
||||
}
|
||||
player.records.thisReality.time = 0;
|
||||
player.records.thisReality.realTime = 0;
|
||||
player.records.thisReality.maxReplicanti = DC.D0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user