Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Essence

Essences guarantee at least exactly one mod depending on itemclass or are not applicable. They should provide a mod for every equipment type.

Hierarchy

Index

Constructors

constructor

  • Parameters

    • props: EssenceProps

      props of a specific essence (contains the guarenteed mod)

    • mods: ModProps[]

      mods that are rolled onto the item after th guarenteed is applied

    Returns Essence

Properties

mods

mods: Mod[]

props

Methods

applicableTo

  • applicableTo(item: Item): ApplicableFlags
  • applicable if the essence guarantees a mod for the itemclass and the rarity is either white or rare (only if essence can reforge)

    Parameters

    Returns ApplicableFlags

applyTo

  • applyTo(item: Item, options?: Partial<{ force: boolean }>): Item
  • add the guarenteed mod and fill up the rest like alchemy

    Parameters

    • item: Item
    • Default value options: Partial<{ force: boolean }> = {}

    Returns Item

chooseMod

  • chooseMod(item: Item): Mod | undefined
  • Parameters

    Returns Mod | undefined

    Mod if the itemclass of the Item is eligible

getAvailableMods

  • getAvailableMods(): Mod[]
  • returns a copy of #mods

    we can stick with a shallow copy since Mod are supposed to be immutable

    Returns Mod[]

isApplicableTo

  • isApplicableTo(container: Item, whitelist?: string[]): boolean
  • Parameters

    • container: Item
    • Default value whitelist: string[] = []

    Returns boolean

isModApplicableTo

isModSpawnableOn

isTopTier

  • isTopTier(): boolean
  • Returns boolean

    true if the essence is the best of its type

modForItemclass

  • modForItemclass(itemclass: string): Mod | undefined
  • Parameters

    • itemclass: string

    Returns Mod | undefined

    the guaranteed mod for the itemclass

modsFor

  • only one mod per itemclass

    Parameters

    • item: Item
    • Default value whitelist: string[] = []

    Returns Array<GeneratorDetails<Mod>>

reforges

  • reforges(): boolean
  • Returns boolean

    true if the essence can reforge (i.e. reroll) the item

rollMod

  • adds a mod from chooseMod ignoring if it's applicable

    Parameters

    Returns Item

spawnweightFor

  • spawnweightFor(mod: Mod, container: Item): number | undefined
  • Parameters

    Returns number | undefined

Static build

Static buildMods

  • Parameters

    Returns Mod[]

Static modFilter

  • Parameters

    Returns boolean

Generated using TypeDoc