GO: Various changes before 2.6.0 (#1120)

This commit is contained in:
Snarling
2024-02-26 08:05:10 -05:00
committed by GitHub
parent f6871f0911
commit 373ced2efe
62 changed files with 1626 additions and 2135 deletions
+5 -5
View File
@@ -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) => {