mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 08:42:53 +02:00
GO: Various changes before 2.6.0 (#1120)
This commit is contained in:
@@ -16,7 +16,7 @@ import { getCoreBonus } from "../Server/ServerHelpers";
|
||||
export function NetscriptStanek(): InternalAPI<IStanek> {
|
||||
function checkStanekAPIAccess(ctx: NetscriptContext): void {
|
||||
if (!Player.hasAugmentation(AugmentationName.StaneksGift1, true)) {
|
||||
throw helpers.makeRuntimeErrorMsg(ctx, "Stanek's Gift is not installed");
|
||||
throw helpers.errorMessage(ctx, "Stanek's Gift is not installed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,9 @@ export function NetscriptStanek(): InternalAPI<IStanek> {
|
||||
checkStanekAPIAccess(ctx);
|
||||
const fragment = staneksGift.findFragment(rootX, rootY);
|
||||
//Check whether the selected fragment can ge charged
|
||||
if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `No fragment with root (${rootX}, ${rootY}).`);
|
||||
if (!fragment) throw helpers.errorMessage(ctx, `No fragment with root (${rootX}, ${rootY}).`);
|
||||
if (fragment.fragment().type == FragmentType.Booster) {
|
||||
throw helpers.makeRuntimeErrorMsg(
|
||||
throw helpers.errorMessage(
|
||||
ctx,
|
||||
`The fragment with root (${rootX}, ${rootY}) is a Booster Fragment and thus cannot be charged.`,
|
||||
);
|
||||
@@ -79,7 +79,7 @@ export function NetscriptStanek(): InternalAPI<IStanek> {
|
||||
const fragmentId = helpers.number(ctx, "fragmentId", _fragmentId);
|
||||
checkStanekAPIAccess(ctx);
|
||||
const fragment = FragmentById(fragmentId);
|
||||
if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid fragment id: ${fragmentId}`);
|
||||
if (!fragment) throw helpers.errorMessage(ctx, `Invalid fragment id: ${fragmentId}`);
|
||||
const can = staneksGift.canPlace(rootX, rootY, rotation, fragment);
|
||||
return can;
|
||||
},
|
||||
@@ -90,7 +90,7 @@ export function NetscriptStanek(): InternalAPI<IStanek> {
|
||||
const fragmentId = helpers.number(ctx, "fragmentId", _fragmentId);
|
||||
checkStanekAPIAccess(ctx);
|
||||
const fragment = FragmentById(fragmentId);
|
||||
if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid fragment id: ${fragmentId}`);
|
||||
if (!fragment) throw helpers.errorMessage(ctx, `Invalid fragment id: ${fragmentId}`);
|
||||
return staneksGift.place(rootX, rootY, rotation, fragment);
|
||||
},
|
||||
getFragment: (ctx) => (_rootX, _rootY) => {
|
||||
|
||||
Reference in New Issue
Block a user