_internal.classes.faction._base.Faction - vladzaharia/bitburner GitHub Wiki

Class: Faction

_internal/classes/faction/_base.Faction

Helper class which handles factions in the game.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Faction(ns, faction)

Create a new faction from an IFaction or faction name.

Parameters

Name Type Description
ns NS The Netscript object.
faction string | IFaction Faction to instantiate.

Defined in

_internal/classes/faction/_base.ts:29

Properties

_faction

Private _faction: IFaction

The faction this represents

Defined in

_internal/classes/faction/_base.ts:20


_ns

Private _ns: NS

The Netscript object.

Defined in

_internal/classes/faction/_base.ts:17

Methods

canJoin

canJoin(): boolean

Checks if faction requirements are met.

Returns

boolean

true if requirements are satisfied, false otherwise.

Defined in

_internal/classes/faction/_base.ts:65


getAugmentations

getAugmentations(name?): string[]

Returns list of all augmentations.

Parameters

Name Type
name Factions

Returns

string[]

All augmentations offered by this faction.

Defined in

_internal/classes/faction/_base.ts:222


getAugmentationsInReach

getAugmentationsInReach(name?): string[]

Gets list of augmentations that are "in-reach", ie:

  • Rep cost can be reached within 12 hours
  • Cost is below 1 billion

Parameters

Name Type
name Factions

Returns

string[]

Augmentations that are within reach of purchasing.

Defined in

_internal/classes/faction/_base.ts:264


getLocation

getLocation(): undefined | Cities

Get the location to travel to for this faction.

Returns

undefined | Cities

The location that we'd need to travel to to get an invitation, null if unneeded.

Defined in

_internal/classes/faction/_base.ts:205


getName

getName(): string

Get the faction's name.

Returns

string

Faction's name.

Defined in

_internal/classes/faction/_base.ts:45


getNeededAugmentations

getNeededAugmentations(name?): string[]

Returns list of augmentations that are not yet purchased.

Parameters

Name Type
name Factions

Returns

string[]

Augmentations that are not already owned.

Defined in

_internal/classes/faction/_base.ts:251


getReputation

getReputation(): number

Returns current reputation for the faction.

Returns

number

Current reputation, as number.

Defined in

_internal/classes/faction/_base.ts:240


getRequirements

getRequirements(): IFactionRequirements

Returns requirements for the faction.

Returns

IFactionRequirements

All augmentations offered by this faction.

Defined in

_internal/classes/faction/_base.ts:231


getUniqueAugmentationsInReach

getUniqueAugmentationsInReach(name?): string[]

Gets list of augmentations that are "in-reach" and unique to this faction.

Parameters

Name Type
name Factions

Returns

string[]

Unique augmentations that are within reach of purchasing.

Defined in

_internal/classes/faction/_base.ts:289


isJoined

isJoined(name?): boolean

Checks if the faction has already been joined.

Parameters

Name Type Description
name Factions The name of the faction to check, defaults to this.

Returns

boolean

True if faction has been joined, false otherwise.

Defined in

_internal/classes/faction/_base.ts:55


shouldJoin

shouldJoin(): boolean

Checks if user should join the faction.

Returns

boolean

True if the faction has no enemies or more augmentations available than enemies.

Defined in

_internal/classes/faction/_base.ts:174

⚠️ **GitHub.com Fallback** ⚠️