mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 14:28:36 +02:00
add singularity function for exporting game save
This commit is contained in:
@@ -53,6 +53,8 @@ import { CreateProgramWork, isCreateProgramWork } from "../Work/CreateProgramWor
|
||||
import { FactionWork } from "../Work/FactionWork";
|
||||
import { FactionWorkType } from "../Work/data/FactionWorkType";
|
||||
import { CompanyWork } from "../Work/CompanyWork";
|
||||
import { canGetBonus, onExport } from "../ExportBonus";
|
||||
import { saveObject } from "../SaveObject";
|
||||
|
||||
export function NetscriptSingularity(): InternalAPI<ISingularity> {
|
||||
const getAugmentation = function (ctx: NetscriptContext, name: string): Augmentation {
|
||||
@@ -1304,5 +1306,14 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
|
||||
if (!player.currentWork) return null;
|
||||
return player.currentWork.APICopy();
|
||||
},
|
||||
exportGame: (ctx: NetscriptContext) => (): void => {
|
||||
helpers.checkSingularityAccess(ctx);
|
||||
onExport(player);
|
||||
return saveObject.exportGame();
|
||||
},
|
||||
exportGameBonus: (ctx: NetscriptContext) => (): boolean => {
|
||||
helpers.checkSingularityAccess(ctx);
|
||||
return canGetBonus();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user