mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 10:42:51 +02:00
Finished Gang API. Rebalanced the way Gang territory works. Added discount feature for purchasing Gang member equipment
This commit is contained in:
@@ -2,16 +2,14 @@ import {Player} from "./Player";
|
||||
import {Gang} from "./Gang";
|
||||
import {makeRuntimeRejectMsg} from "./NetscriptEvaluator";
|
||||
|
||||
function unknownGangApiExceptionMessage(functionName, err) {
|
||||
export function unknownGangApiExceptionMessage(functionName, err) {
|
||||
return `gang.${functionName}() failed with exception: ` + err;
|
||||
}
|
||||
|
||||
function checkGangApiAccess(workerScript, functionName) {
|
||||
export function checkGangApiAccess(workerScript, functionName) {
|
||||
const accessDenied = `gang.${functionName}() failed because you do not currently have a Gang`;
|
||||
const hasAccess = Player.gang instanceof Gang;
|
||||
if (!hasAccess) {
|
||||
throw makeRuntimeRejectMsg(workerScript, accessDenied);
|
||||
}
|
||||
}
|
||||
|
||||
export {unknownBladeburnerActionErrorMessage, unknownBladeburnerExceptionMessage, checkBladeburnerAccess};
|
||||
|
||||
Reference in New Issue
Block a user