Class RepairableItem
Represents an Item that can be repaired and is affected on usage, See DurabilityItems.md
Inheritance
System.Object
RepairableItem
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
public abstract class RepairableItem : DurabilityItem, IItem, ILinkableParameterized<LinkConfig>, ILinkable, IHasIcon, IController, IViewController, IHasUniversalID, INotifyPropertyChanged
Constructors
RepairableItem()
Declaration
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
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
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
RepairItem
Template for the repaired item needed, cost is calculated based on missing durability.
Declaration
public virtual Item RepairItem { get; }
Property Value
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
SkilledRepairCost
The amount needed for to fully repair a broken item.
Declaration
public abstract IDynamicValue SkilledRepairCost { get; }
Property Value
SkillReqs
The Skills required to repair this item.
Declaration
public RepairRequiresSkillAttribute[] SkillReqs { get; }
Property Value
Methods
CanStack(Item)
Declaration
public override bool CanStack(Item other)
Parameters
Type |
Name |
Description |
Item |
other |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
Clone()
Declaration
public override Item Clone()
Returns
Overrides
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
GetQualityGroup()
Declaration
public override int GetQualityGroup()
Returns
Type |
Description |
System.Int32 |
|
Overrides
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
SetDurability(Single)
Declaration
public override void SetDurability(float d)
Parameters
Type |
Name |
Description |
System.Single |
d |
|
Overrides
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
System.ComponentModel.INotifyPropertyChanged
Extension Methods