ItemPrefab

Barotrauma ItemPrefab class with some additional functions and fields

Barotrauma source code: ItemPrefab.cs

Functions

CanBeBoughtFrom(store, priceInfo)

CanBeBoughtFrom

Parameters

  • store StoreInfo

  • priceInfo PriceInfo&

Returns

  • bool

CanBeBoughtFrom(location)

CanBeBoughtFrom

Parameters

  • location Location

Returns

  • bool

CanCharacterBuy()

CanCharacterBuy

Returns

  • bool

CreateTooltipText()

CreateTooltipText

Returns

  • RichString

DebugCreateInstance()

DebugCreateInstance

Dispose()

Dispose

DrawListLine(spriteBatch, pos, color)

DrawListLine

Parameters

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

  • pos Microsoft.Xna.Framework.Vector2

  • color Microsoft.Xna.Framework.Color

DrawPlacing(spriteBatch, placeRect, scale, rotation, spriteEffects)

DrawPlacing

Parameters

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

  • placeRect Microsoft.Xna.Framework.Rectangle

  • scale number

  • rotation number

  • spriteEffects Microsoft.Xna.Framework.Graphics.SpriteEffects

DrawPlacing(spriteBatch, cam)

DrawPlacing

Parameters

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

  • cam Camera

Equals(obj)

Equals

Parameters

  • obj Object

Returns

  • bool

GetAllowedUpgrades()

GetAllowedUpgrades

Returns

  • IEnumerable

GetBuyPricesUnder(maxCost)

GetBuyPricesUnder

Parameters

  • maxCost number

Returns

  • Collections.Immutable.ImmutableDictionary

GetCommonnessInfo(level)

GetCommonnessInfo

Parameters

  • level Level

Returns

  • optional CommonnessInfo

GetHashCode()

GetHashCode

Returns

  • number

GetHullNameTextId()

GetHullNameTextId

Returns

GetItemNameTextId()

GetItemNameTextId

Returns

GetMaxStackSize(inventory)

GetMaxStackSize

Parameters

  • inventory Inventory

Returns

  • number

GetMinPrice()

GetMinPrice

Returns

  • optional Int32

GetParentModPackageOrThisPackage()

GetParentModPackageOrThisPackage

Returns

GetPriceInfo(store)

GetPriceInfo

Parameters

  • store StoreInfo

Returns

  • PriceInfo

GetSellPricesOver(minCost, sellingImportant)

GetSellPricesOver

Parameters

  • minCost number

  • sellingImportant bool

Returns

  • Collections.Immutable.ImmutableDictionary

GetSkillRequirementHints(character)

GetSkillRequirementHints

Parameters

  • character Character

Returns

  • LocalizedString

GetTooltip(character)

GetTooltip

Parameters

  • character Character

Returns

  • LocalizedString

GetTreatmentSuitability(treatmentIdentifier)

GetTreatmentSuitability

Parameters

Returns

  • number

GetType()

GetType

Returns

  • Type

HasSubCategory(subcategory)

HasSubCategory

Parameters

Returns

  • bool

InheritFrom(parent)

InheritFrom

Parameters

IsContainerPreferred(item, targetContainer, isPreferencesDefined, isSecondary, requireConditionRequirement, checkTransferConditions)

IsContainerPreferred

Parameters

  • item Item

  • targetContainer Items.Components.ItemContainer

  • isPreferencesDefined Boolean&

  • isSecondary Boolean&

  • requireConditionRequirement bool

  • checkTransferConditions bool

Returns

  • bool

IsContainerPreferred(item, identifiersOrTags, isPreferencesDefined, isSecondary)

IsContainerPreferred

Parameters

  • item Item

  • isPreferencesDefined Boolean&

  • isSecondary Boolean&

Returns

  • bool

IsLinkAllowed(target)

IsLinkAllowed

Parameters

  • target MapEntityPrefab

Returns

  • bool

ItemPrefab(element, file)

ItemPrefab

Parameters

  • element ContentXElement

  • file ItemFile

ItemPrefab.AddToSpawnQueue(itemPrefab, position, spawned)

Add ItemPrefab to spawn queue and spawns it at the specified position

Parameters

  • position Vector2

  • spawned function

ItemPrefab.AddToSpawnQueue(itemPrefab, inventory, spawned)

Add ItemPrefab to spawn queue and spawns it inside the specified inventory

Parameters

  • inventory Inventory

  • spawned function

ItemPrefab.Find(name, identifier)

Find

Parameters

Returns

ItemPrefab.GenerateLegacyIdentifier(name)

GenerateLegacyIdentifier

Parameters

Returns

ItemPrefab.GetItemPrefab(itemNameOrId)

GetItemPrefab

Parameters

Returns

ItemPrefab.GetItemPrefab(itemNameOrId)

Get a item prefab via name or id

Parameters

Returns

ItemPrefab.IsContainerPreferred(preferences, c)

IsContainerPreferred

Parameters

  • preferences IEnumerable

  • c Items.Components.ItemContainer

Returns

  • bool

ItemPrefab.IsContainerPreferred(preferences, ids)

IsContainerPreferred

Parameters

  • preferences IEnumerable

  • ids IEnumerable

Returns

  • bool

NameMatches(name, comparisonType)

NameMatches

Parameters

  • comparisonType StringComparison

Returns

  • bool

NameMatches(allowedNames, comparisonType)

NameMatches

Parameters

  • allowedNames IEnumerable

  • comparisonType StringComparison

Returns

  • bool

ToString()

ToString

Returns

UpdatePlacing(cam)

UpdatePlacing

Parameters

  • cam Camera

Fields

AISlowTurretPriority

AISlowTurretPriority, field of type number

  • AISlowTurretPriority

AITurretPriority

AITurretPriority, field of type number

  • AITurretPriority

AITurretTargetingMaxDistance

AITurretTargetingMaxDistance, field of type number

  • AITurretTargetingMaxDistance

AddedPickingSpeedMultiplier

AddedPickingSpeedMultiplier, field of type number

  • AddedPickingSpeedMultiplier

AddedRepairSpeedMultiplier

AddedRepairSpeedMultiplier, field of type number

  • AddedRepairSpeedMultiplier

Aliases

Aliases, field of type Collections.Immutable.ImmutableHashSet

  • Aliases

AllowAsExtraCargo

AllowAsExtraCargo, field of type ?bool

  • AllowAsExtraCargo

AllowDeconstruct

AllowDeconstruct, field of type bool

  • AllowDeconstruct

AllowDeselectWhenIdling

AllowDeselectWhenIdling, field of type bool

  • AllowDeselectWhenIdling

AllowDroppingOnSwap

AllowDroppingOnSwap, field of type bool

  • AllowDroppingOnSwap

AllowDroppingOnSwapWith

AllowDroppingOnSwapWith, field of type Collections.Immutable.ImmutableHashSet

  • AllowDroppingOnSwapWith

AllowRotatingInEditor

AllowRotatingInEditor, field of type bool

  • AllowRotatingInEditor

AllowSellingWhenBroken

AllowSellingWhenBroken, field of type bool

  • AllowSellingWhenBroken

AllowStealingAlways

AllowStealingAlways, field of type bool

  • AllowStealingAlways

AllowStealingContainedItems

AllowStealingContainedItems, field of type bool

  • AllowStealingContainedItems

AllowedUpgrades

AllowedUpgrades, field of type string

  • AllowedUpgrades

BotPriority

BotPriority, field of type number

  • BotPriority

BrokenSprites

BrokenSprites, field of type Collections.Immutable.ImmutableArray

  • BrokenSprites

CanBeBought

CanBeBought, field of type bool

  • CanBeBought

CanBeSold

CanBeSold, field of type bool

  • CanBeSold

CanFlipX

CanFlipX, field of type bool

  • CanFlipX

CanFlipY

CanFlipY, field of type bool

  • CanFlipY

CanSpriteFlipX

CanSpriteFlipX, field of type bool

  • CanSpriteFlipX

CanSpriteFlipY

CanSpriteFlipY, field of type bool

  • CanSpriteFlipY

CannotRepairFail

CannotRepairFail, field of type bool

  • CannotRepairFail

CargoContainerIdentifier

CargoContainerIdentifier, field of type string

  • CargoContainerIdentifier

Category

Category, field of type MapEntityCategory

  • Category

ConfigElement

ConfigElement, field of type ContentXElement

  • ConfigElement

ContainedSprites

ContainedSprites, field of type Collections.Immutable.ImmutableArray

  • ContainedSprites

ContentFile

ContentFile, field of type ContentFile

  • ContentFile

ContentPackage

ContentPackage, field of type ContentPackage

  • ContentPackage

DamagedByContainedItemExplosions

DamagedByContainedItemExplosions, field of type bool

  • DamagedByContainedItemExplosions

DamagedByExplosions

DamagedByExplosions, field of type bool

  • DamagedByExplosions

DamagedByMeleeWeapons

DamagedByMeleeWeapons, field of type bool

  • DamagedByMeleeWeapons

DamagedByMonsters

DamagedByMonsters, field of type bool

  • DamagedByMonsters

DamagedByProjectiles

DamagedByProjectiles, field of type bool

  • DamagedByProjectiles

DamagedByRepairTools

DamagedByRepairTools, field of type bool

  • DamagedByRepairTools

DamagedInfectedSprite

DamagedInfectedSprite, field of type Sprite

  • DamagedInfectedSprite

DeconstructItems

DeconstructItems, field of type Collections.Immutable.ImmutableArray

  • DeconstructItems

DeconstructTime

DeconstructTime, field of type number

  • DeconstructTime

DecorativeSpriteGroups

DecorativeSpriteGroups, field of type Collections.Immutable.ImmutableDictionary>

  • DecorativeSpriteGroups

DecorativeSprites

DecorativeSprites, field of type Collections.Immutable.ImmutableArray

  • DecorativeSprites

DefaultPrice

DefaultPrice, field of type PriceInfo

  • DefaultPrice

Description

Description, field of type LocalizedString

  • Description

DisableCommandMenuWhenSelected

DisableCommandMenuWhenSelected, field of type bool

  • DisableCommandMenuWhenSelected

DisableItemUsageWhenSelected

DisableItemUsageWhenSelected, field of type bool

  • DisableItemUsageWhenSelected

DontTransferBetweenSubs

DontTransferBetweenSubs, field of type bool

  • DontTransferBetweenSubs

EquipConfirmationText

EquipConfirmationText, field of type string

  • EquipConfirmationText

ExplosionDamageMultiplier

ExplosionDamageMultiplier, field of type number

  • ExplosionDamageMultiplier

FabricationRecipes

FabricationRecipes, field of type Collections.Immutable.ImmutableDictionary

  • FabricationRecipes

FilePath

FilePath, field of type ContentPath

  • FilePath

FocusOnSelected

FocusOnSelected, field of type bool

  • FocusOnSelected

GrabWhenSelected

GrabWhenSelected, field of type bool

  • GrabWhenSelected

Health

Health, field of type number

  • Health

HideConditionBar

HideConditionBar, field of type bool

  • HideConditionBar

HideConditionInTooltip

HideConditionInTooltip, field of type bool

  • HideConditionInTooltip

HideInEditors

HideInEditors, field of type bool

  • HideInEditors

HideInMenus

HideInMenus, field of type bool

  • HideInMenus

Identifier

Identifier, field of type Identifier

  • Identifier

Identifier

Identifier, the identifier of the prefab.

ImpactSoundTag

ImpactSoundTag, field of type string

  • ImpactSoundTag

ImpactTolerance

ImpactTolerance, field of type number

  • ImpactTolerance

Indestructible

Indestructible, field of type bool

  • Indestructible

InfectedSprite

InfectedSprite, field of type Sprite

  • InfectedSprite

InteractDistance

InteractDistance, field of type number

  • InteractDistance

InteractPriority

InteractPriority, field of type number

  • InteractPriority

InteractThroughWalls

InteractThroughWalls, field of type bool

  • InteractThroughWalls

InventoryIcon

InventoryIcon, field of type Sprite

  • InventoryIcon

InventoryIconColor

InventoryIconColor, field of type Microsoft.Xna.Framework.Color

  • InventoryIconColor

IsAITurretTarget

IsAITurretTarget, field of type bool

  • IsAITurretTarget

IsDangerous

IsDangerous, field of type bool

  • IsDangerous

IsModded

IsModded, field of type bool

  • IsModded

IsOverride

IsOverride, field of type bool

  • IsOverride

ItemDamageMultiplier

ItemDamageMultiplier, field of type number

  • ItemDamageMultiplier

ItemPrefab.DefaultInteractDistance

ItemPrefab.DefaultInteractDistance, field of type number

ItemPrefab.Prefabs

ItemPrefab.Prefabs, field of type PrefabCollection

LevelQuantity

LevelQuantity, field of type Collections.Immutable.ImmutableDictionary

  • LevelQuantity

Linkable

Linkable, field of type bool

  • Linkable

MaxScale

MaxScale, field of type number

  • MaxScale

MaxStackSize

MaxStackSize, field of type number

  • MaxStackSize

MaxStackSizeCharacterInventory

MaxStackSizeCharacterInventory, field of type number

  • MaxStackSizeCharacterInventory

MaxStackSizeHoldableOrWearableInventory

MaxStackSizeHoldableOrWearableInventory, field of type number

  • MaxStackSizeHoldableOrWearableInventory

MinScale

MinScale, field of type number

  • MinScale

MinimapIcon

MinimapIcon, field of type Sprite

  • MinimapIcon

Name

Name, field of type LocalizedString

  • Name

OffsetOnSelected

OffsetOnSelected, field of type number

  • OffsetOnSelected

OnDamagedThreshold

OnDamagedThreshold, field of type number

  • OnDamagedThreshold

OriginalName

OriginalName, field of type string

  • OriginalName

ParentPrefab

ParentPrefab, field of type ItemPrefab

  • ParentPrefab

PreferredContainers

PreferredContainers, field of type Collections.Immutable.ImmutableArray

  • PreferredContainers

RandomDeconstructionOutput

RandomDeconstructionOutput, field of type bool

  • RandomDeconstructionOutput

RandomDeconstructionOutputAmount

RandomDeconstructionOutputAmount, field of type number

  • RandomDeconstructionOutputAmount

RequireBodyInsideTrigger

RequireBodyInsideTrigger, field of type bool

  • RequireBodyInsideTrigger

RequireCampaignInteract

RequireCampaignInteract, field of type bool

  • RequireCampaignInteract

RequireCursorInsideTrigger

RequireCursorInsideTrigger, field of type bool

  • RequireCursorInsideTrigger

ResizeHorizontal

ResizeHorizontal, field of type bool

  • ResizeHorizontal

ResizeVertical

ResizeVertical, field of type bool

  • ResizeVertical

Scale

Scale, field of type number

  • Scale

ShowContentsInTooltip

ShowContentsInTooltip, field of type bool

  • ShowContentsInTooltip

ShowHealthBar

ShowHealthBar, field of type bool

  • ShowHealthBar

ShowInStatusMonitor

ShowInStatusMonitor, field of type bool

  • ShowInStatusMonitor

ShowNameInHealthBar

ShowNameInHealthBar, field of type bool

  • ShowNameInHealthBar

SignalComponentColor

SignalComponentColor, field of type Microsoft.Xna.Framework.Color

  • SignalComponentColor

Size

Size, field of type Microsoft.Xna.Framework.Vector2

  • Size

SkillRequirementHints

SkillRequirementHints, field of type Collections.Immutable.ImmutableArray

  • SkillRequirementHints

SonarSize

SonarSize, field of type number

  • SonarSize

Sprite

Sprite, field of type Sprite

  • Sprite

SpriteColor

SpriteColor, field of type Microsoft.Xna.Framework.Color

  • SpriteColor

Subcategory

Subcategory, field of type string

  • Subcategory

SwappableItem

SwappableItem, field of type SwappableItem

  • SwappableItem

Tags

Tags, field of type Collections.Immutable.ImmutableHashSet

  • Tags

Triggers

Triggers, field of type Collections.Immutable.ImmutableArray

  • Triggers

UintIdentifier

UintIdentifier, field of type number

  • UintIdentifier

UpgradeOverrideSprites

UpgradeOverrideSprites, field of type Collections.Immutable.ImmutableDictionary>

  • UpgradeOverrideSprites

UpgradePreviewScale

UpgradePreviewScale, field of type number

  • UpgradePreviewScale

UpgradePreviewSprite

UpgradePreviewSprite, field of type Sprite

  • UpgradePreviewSprite

UseContainedInventoryIconColor

UseContainedInventoryIconColor, field of type bool

  • UseContainedInventoryIconColor

UseContainedSpriteColor

UseContainedSpriteColor, field of type bool

  • UseContainedSpriteColor

UseInHealthInterface

UseInHealthInterface, field of type bool

  • UseInHealthInterface

VariantOf

VariantOf, field of type Identifier

  • VariantOf