Options
All
  • Public
  • Public/Protected
  • All
Menu

Helper class which handles factions in the game.

Hierarchy

  • Faction

Index

Constructors

  • Create a new faction from an IFaction or faction name.

    Parameters

    • ns: NS

      The Netscript object.

    • faction: string | IFaction

      Faction to instantiate.

    Returns Faction

Properties

_faction: IFaction

The faction this represents

_ns: NS

The Netscript object.

Methods

  • canJoin(): boolean
  • Checks if faction requirements are met.

    Returns boolean

    true if requirements are satisfied, false otherwise.

  • getAugmentations(name?: Factions): string[]
  • Returns list of all augmentations.

    Parameters

    Returns string[]

    All augmentations offered by this faction.

  • getAugmentationsInReach(name?: Factions): string[]
  • Gets list of augmentations that are "in-reach", ie:

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

    Parameters

    Returns string[]

    Augmentations that are within reach of purchasing.

  • 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.

  • getName(): string
  • Get the faction's name.

    Returns string

    Faction's name.

  • getNeededAugmentations(name?: Factions): string[]
  • Returns list of augmentations that are not yet purchased.

    Parameters

    Returns string[]

    Augmentations that are not already owned.

  • getReputation(): number
  • Returns current reputation for the faction.

    Returns number

    Current reputation, as number.

  • Returns requirements for the faction.

    Returns IFactionRequirements

    All augmentations offered by this faction.

  • getUniqueAugmentationsInReach(name?: Factions): string[]
  • Gets list of augmentations that are "in-reach" and unique to this faction.

    Parameters

    Returns string[]

    Unique augmentations that are within reach of purchasing.

  • Checks if the faction has already been joined.

    Parameters

    • name: Factions = ...

      The name of the faction to check, defaults to this.

    Returns boolean

    True if faction has been joined, false otherwise.

  • shouldJoin(): boolean
  • Checks if user should join the faction.

    Returns boolean

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

Generated using TypeDoc