_internal.classes.faction._base.Faction - vladzaharia/bitburner GitHub Wiki
_internal/classes/faction/_base.Faction
Helper class which handles factions in the game.
- canJoin
- getAugmentations
- getAugmentationsInReach
- getLocation
- getName
- getNeededAugmentations
- getReputation
- getRequirements
- getUniqueAugmentationsInReach
- isJoined
- shouldJoin
• new Faction(ns, faction)
Create a new faction from an IFaction or faction name.
| Name | Type | Description |
|---|---|---|
ns |
NS |
The Netscript object. |
faction |
string | IFaction
|
Faction to instantiate. |
_internal/classes/faction/_base.ts:29
• Private _faction: IFaction
The faction this represents
_internal/classes/faction/_base.ts:20
• Private _ns: NS
The Netscript object.
_internal/classes/faction/_base.ts:17
▸ canJoin(): boolean
Checks if faction requirements are met.
boolean
true if requirements are satisfied, false otherwise.
_internal/classes/faction/_base.ts:65
▸ getAugmentations(name?): string[]
Returns list of all augmentations.
| Name | Type |
|---|---|
name |
Factions |
string[]
All augmentations offered by this faction.
_internal/classes/faction/_base.ts:222
▸ 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
| Name | Type |
|---|---|
name |
Factions |
string[]
Augmentations that are within reach of purchasing.
_internal/classes/faction/_base.ts:264
▸ getLocation(): undefined | Cities
Get the location to travel to for this faction.
undefined | Cities
The location that we'd need to travel to to get an invitation, null if unneeded.
_internal/classes/faction/_base.ts:205
▸ getName(): string
Get the faction's name.
string
Faction's name.
_internal/classes/faction/_base.ts:45
▸ getNeededAugmentations(name?): string[]
Returns list of augmentations that are not yet purchased.
| Name | Type |
|---|---|
name |
Factions |
string[]
Augmentations that are not already owned.
_internal/classes/faction/_base.ts:251
▸ getReputation(): number
Returns current reputation for the faction.
number
Current reputation, as number.
_internal/classes/faction/_base.ts:240
▸ getRequirements(): IFactionRequirements
Returns requirements for the faction.
All augmentations offered by this faction.
_internal/classes/faction/_base.ts:231
▸ getUniqueAugmentationsInReach(name?): string[]
Gets list of augmentations that are "in-reach" and unique to this faction.
| Name | Type |
|---|---|
name |
Factions |
string[]
Unique augmentations that are within reach of purchasing.
_internal/classes/faction/_base.ts:289
▸ isJoined(name?): boolean
Checks if the faction has already been joined.
| Name | Type | Description |
|---|---|---|
name |
Factions |
The name of the faction to check, defaults to this. |
boolean
True if faction has been joined, false otherwise.
_internal/classes/faction/_base.ts:55
▸ shouldJoin(): boolean
Checks if user should join the faction.
boolean
True if the faction has no enemies or more augmentations available than enemies.