Hierarchy

Constructors

Properties

Accessors

Methods

[iterator] breakContainerOnTile canCreateEntity capWeightOfItems computeContainerWeight computeCraftQualityBonus countItemsInContainer countItemsInContainerByGroup craft create createFake createSorter delete derefenceContainerReference emptyUntilValidWeight ensureContainerSorted exists findUnusedId get getAbsentPlayerWithItemInInventory getAdjacentContainers getAncestorContainers getBestItemForTier getBestSafeItem getBestSafeItems getBreakingQualityBonus getCivilizationContentsScore getContainedContainers getContainerName getContainerReference getContainerTypeForContainer getContainers getCraftChance getCraftResultChances getDefaultDurability getDisassemblyComponents getDisassemblyWeight getEfficacyTranslation getGroupDefault getGroupItems getGroups getHighestItemActionTierForAction getItemForHuman getItemInAdjacentContainersByGroup getItemInContainer getItemInContainerByGroup getItemInInventoryByGroup getItemInsertIndexInContainer getItemListTranslation getItemTranslations getItemTypeGroupName getItemTypeListTranslation getItemTypeTranslation getItemTypes getItemUseBonus getItemsByWeight getItemsInContainer getItemsInContainerByGroup getItemsInContainerByType getItemsWeight getItemsWithRecipes getMagicalWeightCapacity getMastercraftChance getMaxQualityBonus getNPCFromInventoryContainer getNPCWithItemInInventory getObjects getOrderedContainerItems getPlayerFromInventoryContainer getPlayerWithItemInInventory getQualityBasedOnSkill getRandomQuality getTile getTopLevelContainerWhenThereIsNoRoom getTradeContainerForContainer getWeight getWeightCapacity hasAdditionalRequirements hasRoomInContainer hashContainer hashContainerReference isContainableInAdjacentContainer isContainableInContainer isContainableInTradeContainer isContainer isCraftSuccessful isGroup isInGroup isInInventory isItemAcceptedAsOffer isItemExtra isItemInContainer isItemUsedForGrowingPlants isItemUsedInRecipe isItemUsedInRecipeWhenBuilt isTileContainer load loadReference moveItemToContainer moveItemsFromContainer moveItemsToContainer onRemove onUnserialized placeItemsAroundTile registerForMemoryLeakDetection remove removeContainerItems removeNulls resolveContainer saveTileReferences set setStacked summonVoidDweller tryMoveItemsToContainer updateContainedWithin updateFov updateItem updateItemOrder updateItems cacheAsync cacheDoodadsForItemRecipes canItemBeRelic clearCaches generateLookups getBestItemForTier getDisassemblyComponentsAsItemTypes getGroupDefault getGroupItems getGroups getHighestItemActionTierForAction getItemTypeGroupName getItemTypes getItemsWithRecipes getMostCommonItemColor getUseItemActions getWeight isContainer isFiltered isGroup isInGroup isItemAcceptedAsOffer isItemExtra isItemUsedForGrowingPlants isItemUsedInRecipe isItemUsedInRecipeWhenBuilt weightTree

Constructors

Properties

event: IEventEmitter<default, IItemManagerEvents>
island: default
list: ITranslationListBuilder<default, string, Quality> = ItemManager.list
loadEntity: undefined = undefined

No need to run special logic when loading items

name: "ItemManager" = "ItemManager"

Name of this object manager

objects: SaferArray<default>
reregisterObjectsForMemoryLeaks: boolean = false

Indicates if objects should be re-registered to the memory leak detector after loading

worldContainer: IContainer = ...

Tiles can be containers and they will always be contained within this container

cachedItemSpawns: Map<BiomeType, Map<WorldZ, Map<TerrainType, ItemType[]>>> = ...

Accessors

  • get game(): Game
  • Returns Game

  • get length(): number
  • Returns number

  • set length(val: number): void
  • This is likely only used during save upgrades

    Parameters

    • val: number

    Returns void

Methods

  • Returns IteratorObject<undefined | default>

  • Will break a container item on a tile, and remove it after (whether or not if it's a container)

    Parameters

    Returns void

  • Parameters

    • createdItems: default[]
    • itemWeight: number

    Returns void

  • Parameters

    Returns number

  • Parameters

    Returns number

  • Parameters

    Returns number

  • Parameters

    Returns undefined | ISorter<undefined | default>

  • Called when this object manager is not used anymore (after it was saved!)

    Returns void

  • Empties a container (on to ground or main inventory) until it has a valid contained weight in the case of verifying doodads/items.

    Parameters

    Returns void

  • Parameters

    • Optional container: IContainer
    • sorter: undefined | ISorter<undefined | default> = ...

    Returns boolean

  • Parameters

    Returns boolean

  • Returns number

  • Parameters

    • id: number

    Returns undefined | default

  • Parameters

    Returns undefined | default

  • Parameters

    • human: default<unknown, number, NPC | Player>
    • Optional includeNpcs: boolean
    • Optional ignoreOptions: boolean

    Returns IContainer[]

  • Parameters

    • container: undefined | IContainer
    • includeCurrent: boolean = true

    Returns Set<IContainer>

  • Used in cases where we break items down from their base form like in dismantling or burning items.

    Returns

    number That is distributed from the quality/value.

    Parameters

    • itemQuality: undefined | Quality

      Quality of the base item.

    • bonusValue: number

      A number that we likely will be passing to getQualityBasedOnSkill and can be based on a skill or some arbitrary value.

    Returns number

  • Get the civilization score based on contained books/text

    Returns

    number that corresponds to how much civilization score is contained within.

    Parameters

    Returns number

  • Gets the name of a container

    Returns

    Name of the container or undefined if it's ending up on the ground

    Parameters

    • Optional container: IContainer
    • debug: boolean = false

      This is for debug context (ie, include tile information, world container, etc)

    • secondPerson: boolean = true

    Returns undefined | default

  • Partitions the containables by their container

    Type Parameters

    Parameters

    • containable: CONTAINABLE[]

    Returns Map<undefined | IContainer, CONTAINABLE[]>

  • Parameters

    • human: default<unknown, number, NPC | Player>
    • recipe: IRecipe
    • qualityBonus: number
    • Optional returnQuality: boolean

    Returns number

  • Parameters

    Returns number

  • Gets the item or doodad's weight based on disassembly.

    Returns

    number equal to the weight.

    Parameters

    • itemDoodad: default | default

      An Item or Doodad to get the weight for.

    • Optional itemType: ItemType

      Pass an ItemType when checking for Doodads since reducedWeight is only available on item descriptions.

    Returns number

  • Get the translation (either message or UI based) for the efficacy of a given recipe.

    Returns

    A traslantion for the efficacy or undefined if not enough skill

    Parameters

    • human: default<unknown, number, NPC | Player>

      The player/human to check for.

    • qualityBonus: number

      The current quality bonus (via computeCraftQualityBonus).

    • maxQualityBonus: number

      The maximum quality bonus (via getMaxQualityBonus).

    • recipe: IRecipe

      The item recipe to check.

    • Optional ui: boolean

      If set to true, output the translation as a UiTranslation instead of Message.

    Returns undefined | default

  • Parameters

    Returns number

  • Return number to insert the item at a specific index. Return undefined to push the item to the end. Defaults to 0 or undefined if sort is ContainerSort.Recent, or polling the sorting algorithm otherwise

    Parameters

    Returns undefined | number

  • Formats a list translation out of an array of items.

    Parameters

    • items: default[]
    • Optional listEnder: false | ListEnder

      The way the list should end (ie and, or, etc)

    Returns default

  • Maps each item in the given array to its name translation.

    Parameters

    • items: default[]
    • article: Article = Article.None

      Whether the item name translation should include an article

    • Optional formatter: default

      A formatting translation that should be used for each item translation

    Returns default[]

  • Returns readonly ItemType[]

  • Gets the item's quality and action level (how good it is at doing the action).

    Returns

    A number (possibly 0 if no quality or action level).

    Parameters

    Returns number

  • Parameters

    • a: number
    • b: number

    Returns number

  • Parameters

    Returns number

  • Returns readonly ItemType[]

  • Parameters

    Returns number

  • Gets the chance of crafting a mastercrafted item (provided a CraftResult.CritSuccess is reached and rolls on exceptional).

    Returns

    A number equal to the chance.

    Parameters

    • skill: number

      Must be atleast 50% to get a mastercraft.

    • magicItemsUsed: number

      Must be set to at least 1 to get a mastercraft.

    • efficacyPercentage: number

      Must be set to atleast 40% to get a mastercraft.

    Returns number

  • Gets the max quality bonus that can be applied to an item (using its recipe).

    Returns

    A number for its max quality value.

    Parameters

    • itemType: ItemType

      The item to check for.

    Returns number

  • Parameters

    Returns undefined | default

  • Parameters

    Returns undefined | default

  • Parameters

    Returns undefined | default

  • Parameters

    • itemQuality: undefined | Quality
    • skillValue: number
    • allowIncreasedQuality: boolean = false
    • bonusChance: number = 0

    Returns undefined | Quality

  • Parameters

    • bonusQuality: number = 0
    • Optional relicChance: boolean

    Returns Quality

  • Gets the tile the item/container is on

    Returns

    Tile or undefined

    Parameters

    Returns undefined | default

  • Parameters

    • Optional container: IContainer
    • includeMagic: boolean = true

    Returns undefined | number

  • Parameters

    Returns boolean

  • Parameters

    Returns string

  • Parameters

    Returns boolean

  • Returns

    whether the given containable is, or is contained within, the given container

    Parameters

    Returns boolean

  • Returns

    whether the given containable is, or is contained within, a trade container

    Parameters

    Returns boolean

  • Parameters

    • obj: unknown

    Returns obj is IContainer

  • Parameters

    Returns boolean

  • Parameters

    • type: number

    Returns type is ItemTypeExtra

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Returns void

  • Note: don't print items to the console because the console will hold the item indefinitely

    Parameters

    • allowFixes: boolean
    • container: IContainer
    • Optional loadChildReferences: boolean
    • Optional parentContainer: IContainer

    Returns boolean

  • For entity manager compat

    Returns boolean

  • Returns void

  • Drop items in a 3x3 square around the location. This will ensure all items in the container are removed

    Parameters

    Returns void

  • Returns void

  • Returns void

  • Parameters

    • id: number
    • value: undefined | default

    Returns void

  • Parameters

    Returns void

  • Summons a void dweller based on item worth and chance or provides a hint message.

    Returns

    True or false based on if we get a message or not.

    Parameters

    • item: default

      Item to get the worth of.

    • human: undefined | default<unknown, number, NPC | Player>

      The human that is dropping the item.

    • tile: default

      The tile in which we are dropping the item.

    Returns boolean

  • Parameters

    Returns void

  • Parameters

    • ticks: number
    • item: default
    • isInInventory: boolean
    • skipUiUpdates: boolean = false

    Returns boolean

  • Parameters

    • ticks: number
    • playerIds: Set<number>
    • options: {
          skipHumanItems?: boolean;
          skipUiUpdates?: boolean;
      }
      • Optional skipHumanItems?: boolean
      • Optional skipUiUpdates?: boolean

    Returns boolean

  • Returns Promise<void>

  • Returns void

  • Parameters

    Returns boolean

  • Returns void

  • Returns void

  • Parameters

    Returns number

  • Returns readonly ItemType[]

  • Returns readonly ItemType[]

  • Parameters

    Returns undefined | IRGB

  • Returns ReadonlySet<ActionType>

  • Parameters

    • obj: unknown

    Returns obj is IContainer

  • Returns true if the item type or item is filtered out from inventory/crafting/container dialogs.

    Parameters

    • item: ItemType | default

      The ItemType or Item to check.

    • filterText: string

      The string of text in which to filter for.

    • Optional craftingFilter: boolean

      True if we are filtering the crafting dialog.

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • type: number

    Returns type is ItemTypeExtra

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • itemType: ItemType
    • random: undefined | Random<IRandomGenerator<any>>
    • weightType: WeightType = WeightType.Normal
    • debug: boolean = false
    • depth: number = 0

    Returns number

Generated using TypeDoc