Address other PR comments (reality-upgrade-lock)

This commit is contained in:
SpectralFlame 2023-06-22 20:25:37 -05:00 committed by cyip92
parent 9ea82dcb63
commit 871c52d935
5 changed files with 29 additions and 9 deletions

View File

@ -8612,7 +8612,10 @@ kbd {
position: absolute;
font-size: 5rem;
padding: 0.5rem 1.8rem;
color: black;
opacity: 0.4;
user-select: none;
pointer-events: none;
}
.c-reality-upgrade-btn--black-hole-unlock {

View File

@ -112,6 +112,11 @@ export const Enslaved = {
// "autoRelease" should only be true when called with the Ra upgrade
useStoredTime(autoRelease) {
if (!this.canRelease(autoRelease)) return;
const maxInversion = player.requirementChecks.reality.slowestBH <= 1e-300;
if (ImaginaryUpgrade(24).isLockingMechanics && Ra.isRunning && maxInversion) {
if (!autoRelease) ImaginaryUpgrade(24).tryShowWarningModal("discharge your Black Hole");
return;
}
player.requirementChecks.reality.slowestBH = 1;
let release = player.celestials.enslaved.stored;
if (Enslaved.isRunning) {

View File

@ -262,17 +262,29 @@ export const Glyphs = {
activeGlyph(activeIndex) {
return this.active[activeIndex];
},
// eslint-disable-next-line complexity
equip(glyph, targetSlot) {
const forbiddenByPelle = Pelle.isDisabled("glyphs") || ["effarig", "reality", "cursed"].includes(glyph.type);
if (Pelle.isDoomed && forbiddenByPelle) return;
if (GameEnd.creditsEverClosed) return;
if (this.activeWithoutCompanion.length > 0) {
if (RealityUpgrade(9).isLockingMechanics) RealityUpgrade(9).tryShowWarningModal();
if (ImaginaryUpgrade(25).isLockingMechanics) ImaginaryUpgrade(25).tryShowWarningModal();
const isCompanion = glyph.type === "companion";
if (RealityUpgrade(9).isLockingMechanics) {
if (this.activeWithoutCompanion.length > 0 && !isCompanion) {
RealityUpgrade(9).tryShowWarningModal("equip another non-Companion Glyph");
return;
}
if (glyph.level < 3 && !isCompanion) {
RealityUpgrade(9).tryShowWarningModal(`equip a Glyph whose level is less than ${formatInt(3)}`);
return;
}
}
if (RealityUpgrade(24).isLockingMechanics && this.activeWithoutCompanion.length === 0 && !isCompanion) {
RealityUpgrade(24).tryShowWarningModal();
return;
}
if (RealityUpgrade(24).isLockingMechanics && this.activeWithoutCompanion.length === 0) {
RealityUpgrade(24).tryShowWarningModal();
if (ImaginaryUpgrade(25).isLockingMechanics && Glyphs.active.countWhere(g => g === null) === 4) {
ImaginaryUpgrade(25).tryShowWarningModal();
return;
}
@ -281,7 +293,7 @@ export const Glyphs = {
throw new Error("Inconsistent inventory indexing");
}
let sameSpecialTypeIndex = -1;
if (glyph.type === "effarig" || glyph.type === "reality") {
if (["effarig", "reality"].includes(glyph.type)) {
sameSpecialTypeIndex = this.active.findIndex(x => x && x.type === glyph.type);
}
if (this.active[targetSlot] === null) {

View File

@ -311,7 +311,7 @@ export const imaginaryUpgrades = [
Glyphs.activeWithoutCompanion.length <= 1 && TimeStudy.reality.isBought,
checkEvent: GAME_EVENT.GAME_TICK_AFTER,
canLock: true,
lockEvent: "equip more than one Glyph",
lockEvent: "equip another Glyph",
description: "Unlock Pelle, Celestial of Antimatter",
},
];

View File

@ -126,7 +126,7 @@ export const realityUpgrades = [
Glyphs.activeWithoutCompanion.length === 1 && Glyphs.activeWithoutCompanion[0].level >= 3,
checkEvent: GAME_EVENT.ETERNITY_RESET_AFTER,
canLock: true,
lockEvent: "equip more than one Glyph",
// There are two locking events - equipping a glyph with too low a level, and equipping a second glyph
description: "Gain another Glyph slot",
effect: () => 1
},
@ -346,7 +346,7 @@ export const realityUpgrades = [
checkRequirement: () => MachineHandler.gainedRealityMachines.gte(5000) &&
Glyphs.activeWithoutCompanion.length === 0,
canLock: true,
lockEvent: "equip a Glyph",
lockEvent: "equip a non-Companion Glyph",
checkEvent: GAME_EVENT.REALITY_RESET_BEFORE,
description: "Gain another Glyph slot",
effect: () => 1