Show / Hide Table of Contents

Class RepairableItem

Represents an Item that can be repaired and is affected on usage, See DurabilityItems.md

Inheritance
System.Object
ItemLinkable
ItemRepresentation
Item
DurabilityItem
RepairableItem
PartItem
ToolItem
VehicleToolItem
Implements
IItem
ILinkableParameterized<LinkConfig>
ILinkable
IHasIcon
IController
IViewController
IHasUniversalID
System.ComponentModel.INotifyPropertyChanged
Inherited Members
DurabilityItem.RepresentsItem(Item)
DurabilityItem.Merge(Item, Int32, Int32, Boolean)
DurabilityItem.OriginalMaxDurability
DurabilityItem.Decays
DurabilityItem.DisplayDurability
DurabilityItem.Broken
DurabilityItem.IsStackable
DurabilityItem.StackingHash
DurabilityItem.BrokenDescription
DurabilityItem.DefaultMinRequiredDurabilityInTradeOffers
DurabilityItem.PropertyChanged
Item.ItemsInitialized
Item.RepresentsItemType(Type)
Item.OnLinkClicked(TooltipOrigin, TooltipClickContext, User)
Item.ClearMaxStackSizeCache()
Item.GetMaxStackSize(Type)
Item.Destroy(Int32)
Item.ToString()
Item.UnsubscribeUnique()
Item.OnUsed(Player, ItemStack)
Item.OnLeftClicked(Player, ItemStack)
Item.OnSelected(Player)
Item.OnDeselected(Player)
Item.Get(IRepresentsItem)
Item.Get(Int32)
Item.Get<T>()
Item.Get(Type)
Item.Get(String)
Item.ShowName(Type, Single)
Item.ShowName(Type, Int32)
Item.ShowName<T>(Int32)
Item.NameAndNum(Type, Int32)
Item.GetSkillbookForSkillType(Type)
Item.CreatingItem(Type)
Item.GetCreatedObj(Type)
Item.TypeIsUnique(Type)
Item.GetNonUniqueOrClone(Int32)
Item.GetNonUniqueOrClone(Type)
Item.NameAndNum(Type, Single)
Item.Initialize()
Item.GetItemByString(User, String)
Item.GetID(Item)
Item.GetID(Type)
Item.HasID(Type)
Item.GetID<T>()
Item.GetType(Int32)
Item.GetType(String)
Item.Create<T>(Int32)
Item.Create(Type, Int32)
Item.Create<T>()
Item.Create(Type)
Item.IconName
Item.IconComment
Item.TypeID
Item.Type
Item.DisplayName
Item.Name
Item.IsUnique
Item.Fuel
Item.IsFuel
Item.WeightWithoutModifiers
Item.Weight
Item.HasWeight
Item.IsCarried
Item.IgnoreAuth
Item.Yield
Item.HasYield
Item.HasCrop
Item.CanBeCurrency
Item.MakesRoads
Item.Compostable
Item.ResourcePile
Item.CanAirInteraction
Item.Category
Item.Hidden
Item.Group
Item.MaxStackSize
Item.IsWasteProduct
Item.GetDescription
Item.HandOrigin
Item.CanBeHeld
Item.IsTool
Item.CustomHighlight
Item.AllItemsIncludingHidden
Item.AllItemsExceptHidden
Item.RandomItem
ItemRepresentation.RepresentsItemType(Item)
ItemLinkable.ShowName(Single)
ItemLinkable.ShowName(Int32)
ItemLinkable.UILinkAndNumber(Single)
ItemLinkable.UILinkAndNumber(Int32)
ItemLinkable.UILinkAndNumber(Int32, String)
ItemLinkable.UILinkAndNumberAndTier(Int32, Int32)
ItemLinkable.UILinkAndNumberAndTierPrepend(Int32, Int32, String)
ItemLinkable.UILinkAndNumberNoText(Int32)
ItemLinkable.UILinkContent()
ItemLinkable.UILinkContent(Boolean)
ItemLinkable.NameAndNum(Int32)
ItemLinkable.UILinkAndStyledNumber(Int32)
ItemLinkable.UILinkContent(LocString)
ItemLinkable.UILinkNoNumber(Int32)
ItemLinkable.UILinkContent(LinkConfig)
ItemLinkable.ItemIconUILink(LocString)
ItemLinkable.DisplayNamePlural
ItemLinkable.MarkedUpName
ItemLinkable.ControllerID
Namespace: Eco.Gameplay.Items
Assembly: Eco.Gameplay.dll
Syntax
public abstract class RepairableItem : DurabilityItem, IItem, ILinkableParameterized<LinkConfig>, ILinkable, IHasIcon, IController, IViewController, IHasUniversalID, INotifyPropertyChanged

Constructors

RepairableItem()

Declaration
public RepairableItem()

Properties

CanBeRepaired

Declaration
public bool CanBeRepaired { get; }
Property Value
Type Description
System.Boolean

DefaultMinRequiredIntegrityInTradeOffers

Declaration
public virtual float DefaultMinRequiredIntegrityInTradeOffers { get; }
Property Value
Type Description
System.Single

Durability

Durability for RepairableItem uses a value from 0 to OriginalMaxDurability and is based on Eco.Gameplay.Items.RepairableItem.durability

Declaration
public float Durability { get; set; }
Property Value
Type Description
System.Single

DurabilityPercent

Declaration
public override float DurabilityPercent { get; }
Property Value
Type Description
System.Single
Overrides
DurabilityItem.DurabilityPercent

FullRepairAmount

Declaration
public virtual int FullRepairAmount { get; }
Property Value
Type Description
System.Int32

IntegrityAmount

The current max durability, which may have been reduced from previous repairs.

Declaration
public float IntegrityAmount { get; set; }
Property Value
Type Description
System.Single

IntegrityPercent

Determines how much the max durability has been reduced, due to past repairs.

Declaration
public float IntegrityPercent { get; }
Property Value
Type Description
System.Single

PercentBrokenFromOriginal

Declaration
public override float PercentBrokenFromOriginal { get; }
Property Value
Type Description
System.Single
Overrides
DurabilityItem.PercentBrokenFromOriginal

RepairItem

Template for the repaired item needed, cost is calculated based on missing durability.

Declaration
public virtual Item RepairItem { get; }
Property Value
Type Description
Item

RepairItems

For objects that can have multiple items repair them, return them all here.

Declaration
public virtual IEnumerable<RepairingItem> RepairItems { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<RepairingItem>

RepairPenaltyToDurability

When an item is repaired, its max durability is reduced by this many percentage points (the reduction is prorated based on how much repair was applied, so you dont need to wait till its almost broken to apply). This will be summed with the repair penalty of the repairing item as well (so either can be negative to give a reduction).

Declaration
public virtual float RepairPenaltyToDurability { get; }
Property Value
Type Description
System.Single

RepairTag

The repair tag needed, used if RepairItem is null, this is for cases where multiple items can repair this item.

Declaration
public virtual Tag RepairTag { get; }
Property Value
Type Description
Tag

SkilledRepairCost

The amount needed for to fully repair a broken item.

Declaration
public abstract IDynamicValue SkilledRepairCost { get; }
Property Value
Type Description
IDynamicValue

SkillReqs

The Skills required to repair this item.

Declaration
public RepairRequiresSkillAttribute[] SkillReqs { get; }
Property Value
Type Description
RepairRequiresSkillAttribute[]

Methods

CanStack(Item)

Declaration
public override bool CanStack(Item other)
Parameters
Type Name Description
Item other
Returns
Type Description
System.Boolean
Overrides
DurabilityItem.CanStack(Item)

Clone()

Declaration
public override Item Clone()
Returns
Type Description
Item
Overrides
DurabilityItem.Clone()

DescribeRepairCost(User, Boolean)

Show Proper UI Link for the cost needed to repair this item.

Declaration
public string DescribeRepairCost(User user, bool shortText)
Parameters
Type Name Description
User user
System.Boolean shortText
Returns
Type Description
System.String

GetDurability()

Get the current durability of the item.

Declaration
public override float GetDurability()
Returns
Type Description
System.Single
Overrides
DurabilityItem.GetDurability()

GetQualityGroup()

Declaration
public override int GetQualityGroup()
Returns
Type Description
System.Int32
Overrides
DurabilityItem.GetQualityGroup()

MaterialRepairsItem(Type)

Declaration
public bool MaterialRepairsItem(Type itemType)
Parameters
Type Name Description
System.Type itemType
Returns
Type Description
System.Boolean

RepairCost(User, Single)

Calculates the repair cost for the item based on DurabilityPercent>

Declaration
public int RepairCost(User user, float materialMult = 1F)
Parameters
Type Name Description
User user
System.Single materialMult
Returns
Type Description
System.Int32

RepresentativeHash()

Declaration
public override int RepresentativeHash()
Returns
Type Description
System.Int32
Overrides
DurabilityItem.RepresentativeHash()

SetDurability(Single)

Declaration
public override void SetDurability(float d)
Parameters
Type Name Description
System.Single d
Overrides
DurabilityItem.SetDurability(Single)

UseDurability(Single, Player, Boolean)

Applies durability changes when the item is used.

Declaration
public virtual void UseDurability(float amountToConsume, Player player, bool notify = true)
Parameters
Type Name Description
System.Single amountToConsume
Player player
System.Boolean notify

Implements

IItem
ILinkableParameterized<T>
ILinkable
IHasIcon
IController
IViewController
IHasUniversalID
System.ComponentModel.INotifyPropertyChanged

Extension Methods

ItemStackExtensions.NameAndNum(ItemRepresentation, Int32)
ItemUtils.CanItemExistInInventories(Item)
ItemUtils.CloneIfNeeded(Item)
TagUtils.Tags(Item)
TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
MarketplaceExtensions.IsPaidItem(Item)
TypeTooltipExtensions.UILinkGeneric(Object)
DurabilityItemTooltipLibrary.TooltipDurability(RepairableItem, User)
EconomyTooltipLibrary.BuyItTooltip(Item, User, TooltipOrigin)
EconomyTooltipLibrary.SellItTooltip(Item, User, TooltipOrigin)
ILinkableTooltipLibrary.ItemLinkClicked(Item, TooltipOrigin)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾