FEATURE: BitNode options (#1411)

This commit is contained in:
catloversg
2024-07-15 04:30:30 +07:00
committed by GitHub
parent 0e1e8a9862
commit 783120c886
71 changed files with 1315 additions and 308 deletions
@@ -6,12 +6,16 @@ import { Factions } from "../../Faction/Factions";
import { Gang } from "../../Gang/Gang";
import { GangConstants } from "../../Gang/data/Constants";
import { isFactionWork } from "../../Work/FactionWork";
import { canAccessBitNodeFeature } from "../../BitNode/BitNodeUtils";
export function canAccessGang(this: PlayerObject): boolean {
if (this.bitNodeOptions.disableGang) {
return false;
}
if (this.bitNodeN === 2) {
return true;
}
if (this.sourceFileLvl(2) <= 0) {
if (this.activeSourceFileLvl(2) === 0) {
return false;
}
@@ -19,7 +23,7 @@ export function canAccessGang(this: PlayerObject): boolean {
}
export function isAwareOfGang(this: PlayerObject): boolean {
return this.bitNodeN === 2 || this.sourceFileLvl(2) >= 1;
return canAccessBitNodeFeature(2) && !this.bitNodeOptions.disableGang;
}
export function getGangFaction(this: PlayerObject): Faction {