Finished Gang API. Rebalanced the way Gang territory works. Added discount feature for purchasing Gang member equipment

This commit is contained in:
danielyxie
2018-10-21 20:04:32 -05:00
parent e73ebe843f
commit 0cdfe590a7
6 changed files with 185 additions and 66 deletions
+2 -4
View File
@@ -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};