mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-02-25 06:13:45 +01:00
Mechanic now properly save/load
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import { Device, DeviceType, Component, DeviceID, Glitch } from "@nsdefs";
|
import { Device, DeviceType, Component, DeviceID, Glitch } from "@nsdefs";
|
||||||
import { glitchMult } from "./formulas/glitches";
|
import { glitchMult } from "./formulas/glitches";
|
||||||
import { pickOne } from "./utils";
|
import { isDeviceISocket, pickOne } from "./utils";
|
||||||
import { componentTiers } from "./formulas/components";
|
import { componentTiers } from "./formulas/components";
|
||||||
import { NewBattery, NewBus, NewCache, NewISocket, NewLock, NewOSocket, NewReducer } from "./NewDevices";
|
import { NewBattery, NewBus, NewCache, NewISocket, NewLock, NewOSocket, NewReducer } from "./NewDevices";
|
||||||
import { startRoaming } from "./glitches/roaming";
|
import { startRoaming } from "./glitches/roaming";
|
||||||
@ -33,8 +33,10 @@ export const loadMyrian = (save: string) => {
|
|||||||
startRust();
|
startRust();
|
||||||
startSegmentation();
|
startSegmentation();
|
||||||
if (!save) return;
|
if (!save) return;
|
||||||
// const savedMyrian = JSON.parse(save);
|
const savedMyrian = JSON.parse(save);
|
||||||
// Object.assign(myrian, savedMyrian);
|
Object.assign(myrian, savedMyrian);
|
||||||
|
myrian.devices.forEach((d) => (d.isBusy = false));
|
||||||
|
myrian.devices.filter(isDeviceISocket).forEach((d) => (d.content = new Array(d.maxContent).fill(d.emitting)));
|
||||||
};
|
};
|
||||||
|
|
||||||
export const inMyrianBounds = (x: number, y: number) => x >= 0 && x < myrianSize && y >= 0 && y < myrianSize;
|
export const inMyrianBounds = (x: number, y: number) => x >= 0 && x < myrianSize && y >= 0 && y < myrianSize;
|
||||||
|
@ -28,6 +28,7 @@ import { initCircadianModulator } from "./Augmentation/Augmentations";
|
|||||||
import { Go } from "./Go/Go";
|
import { Go } from "./Go/Go";
|
||||||
import { calculateExp } from "./PersonObjects/formulas/skill";
|
import { calculateExp } from "./PersonObjects/formulas/skill";
|
||||||
import { currentNodeMults } from "./BitNode/BitNodeMultipliers";
|
import { currentNodeMults } from "./BitNode/BitNodeMultipliers";
|
||||||
|
import { resetMyrian } from "./Myrian/Myrian";
|
||||||
|
|
||||||
const BitNode8StartingMoney = 250e6;
|
const BitNode8StartingMoney = 250e6;
|
||||||
function delayedDialog(message: string) {
|
function delayedDialog(message: string) {
|
||||||
@ -318,6 +319,9 @@ export function prestigeSourceFile(isFlume: boolean): void {
|
|||||||
}
|
}
|
||||||
staneksGift.prestigeSourceFile();
|
staneksGift.prestigeSourceFile();
|
||||||
|
|
||||||
|
Player.myrianConnection = false;
|
||||||
|
resetMyrian();
|
||||||
|
|
||||||
// Gain int exp
|
// Gain int exp
|
||||||
if (Player.sourceFileLvl(5) !== 0 && !isFlume) Player.gainIntelligenceExp(300);
|
if (Player.sourceFileLvl(5) !== 0 && !isFlume) Player.gainIntelligenceExp(300);
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ export function SidebarRoot(props: { page: Page }): React.ReactElement {
|
|||||||
canCorporation && { key_: Page.Corporation, icon: BusinessIcon },
|
canCorporation && { key_: Page.Corporation, icon: BusinessIcon },
|
||||||
canGang && { key_: Page.Gang, icon: SportsMmaIcon },
|
canGang && { key_: Page.Gang, icon: SportsMmaIcon },
|
||||||
canIPvGO && { key_: Page.Go, icon: BorderInnerSharp },
|
canIPvGO && { key_: Page.Go, icon: BorderInnerSharp },
|
||||||
(true || Player.myrianConnection) && { key_: Page.MyrianOS, icon: SettingsInputComponentIcon },
|
Player.myrianConnection && { key_: Page.MyrianOS, icon: SettingsInputComponentIcon },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<Divider />
|
<Divider />
|
||||||
|
Reference in New Issue
Block a user