Show / Hide Table of Contents

Class AbstractItem

The base class for all items.

Inheritance
System.Object
TaggableObject
AbstractItem
AddGeoItem
BoolItem
CharmItem
CustomSkillItem
DirtmouthStagItem
DreamerItem
EssenceItem
GeoRockItem
GrubItem
IntItem
JournalEntryItem
LifebloodItem
LoreItem
MapItem
MapMarkerItem
MapPinItem
MaskShardItem
MimicItem
MultiBoolItem
NailUpgradeItem
RelicItem
SoulItem
SpawnGeoItem
SpawnLumafliesItem
SpellItem
StagItem
VesselFragmentItem
VoidItem
WhiteFragmentItem
Inherited Members
TaggableObject.tags
TaggableObject.LoadTags()
TaggableObject.UnloadTags()
TaggableObject.AddTag<T>()
TaggableObject.AddTag(Tag)
TaggableObject.AddTags(IEnumerable<Tag>)
TaggableObject.GetTag<T>()
TaggableObject.GetTag<T>(T)
TaggableObject.GetTags<T>()
TaggableObject.GetOrAddTag<T>()
TaggableObject.HasTag<T>()
TaggableObject.RemoveTags<T>()
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: ItemChanger
Assembly: ItemChanger.dll
Syntax
public abstract class AbstractItem : TaggableObject

Fields

| Improve this Doc View Source

name

The name of the item. Item names are not guaranteed to be unique.

Declaration
public string name
Field Value
Type Description
System.String
| Improve this Doc View Source

UIDef

The UIDef associated to an item. GetResolvedUIDef() is preferred in most cases, since it accounts for the hooks which may modify the item.

Declaration
public UIDef UIDef
Field Value
Type Description
UIDef

Methods

| Improve this Doc View Source

Clone()

Returns a deep clone of the current item.

Declaration
public virtual AbstractItem Clone()
Returns
Type Description
AbstractItem
| Improve this Doc View Source

GetPreferredContainer()

Used by some placements to decide what container to use for the item. A value of "Unknown" is ignored, and usually leads to a shiny item by default.

Declaration
public virtual string GetPreferredContainer()
Returns
Type Description
System.String
| Improve this Doc View Source

GetPreviewName(AbstractPlacement)

Declaration
public string GetPreviewName(AbstractPlacement placement = null)
Parameters
Type Name Description
AbstractPlacement placement
Returns
Type Description
System.String
| Improve this Doc View Source

GetPreviewSprite(AbstractPlacement)

Declaration
public Sprite? GetPreviewSprite(AbstractPlacement placement = null)
Parameters
Type Name Description
AbstractPlacement placement
Returns
Type Description
System.Nullable<Sprite>
| Improve this Doc View Source

GetResolvedUIDef(AbstractPlacement)

Returns the UIDef of the item yielded after all of the events for modifying items.

Declaration
public UIDef GetResolvedUIDef(AbstractPlacement placement = null)
Parameters
Type Name Description
AbstractPlacement placement
Returns
Type Description
UIDef
| Improve this Doc View Source

Give(AbstractPlacement, GiveInfo)

The method called to give an item.

Declaration
public void Give(AbstractPlacement placement, GiveInfo info)
Parameters
Type Name Description
AbstractPlacement placement
GiveInfo info
| Improve this Doc View Source

GiveEarly(String)

Indicates that the item can be given early in a special way from the given container.
For example, SpawnGeoItem can be given early from Container.Chest by flinging geo directly from the chest.

Declaration
public virtual bool GiveEarly(string containerType)
Parameters
Type Name Description
System.String containerType
Returns
Type Description
System.Boolean
| Improve this Doc View Source

GiveImmediate(GiveInfo)

Specifies the effect of giving a particular item.

Declaration
public abstract void GiveImmediate(GiveInfo info)
Parameters
Type Name Description
GiveInfo info
| Improve this Doc View Source

IsObtained()

Returns whether the item is currently obtained. A value of true indicates the item is not eligible to be given.

Declaration
public bool IsObtained()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Load()

Called on each item tied to a placement when the save is created or resumed.
Execution order is (modules load -> placement tags load -> items load -> placements load)

Declaration
public void Load()
| Improve this Doc View Source

OnLoad()

Method allowing derived item classes to initialize and place hooks.

Declaration
protected virtual void OnLoad()
| Improve this Doc View Source

OnUnload()

Method allowing derived item classes to dispose hooks.

Declaration
protected virtual void OnUnload()
| Improve this Doc View Source

Redundant()

Method used to determine if a unique item should be replaced (i.e. duplicates, etc). No relation to ObtainState.

Declaration
public virtual bool Redundant()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

RefreshObtained()

Marks the item as available to be given again. Used, for example, with persistent and semipersistent items.

Declaration
public void RefreshObtained()
| Improve this Doc View Source

ResolveItem(GiveEventArgs)

Determines the item yielded after all of the events for modifying items, by acting in place on the GiveEventArgs.

Declaration
public virtual void ResolveItem(GiveEventArgs args)
Parameters
Type Name Description
GiveEventArgs args
| Improve this Doc View Source

SetObtained()

Marks the item as obtained and no longer eligible to be given. Called by Give().

Declaration
public void SetObtained()
| Improve this Doc View Source

Unload()

Called on each item tied to a placement upon returning to the main menu.
Execution order is (modules unload -> placement tags unload -> items unload -> placements unload)

Declaration
public void Unload()
| Improve this Doc View Source

WasEverObtained()

Returns whether the item has ever been obtained, regardless of whether it is currently refreshed.

Declaration
public bool WasEverObtained()
Returns
Type Description
System.Boolean

Events

| Improve this Doc View Source

AfterGive

Event invoked by this item just after GiveImmediate(), giving access to the final give parameters.

Declaration
public event Action<ReadOnlyGiveEventArgs>? AfterGive
Event Type
Type Description
System.Nullable<Action<ReadOnlyGiveEventArgs>>
| Improve this Doc View Source

AfterGiveGlobal

Event invoked by each item just after GiveImmediate(), giving access to the final give parameters.

Declaration
public static event Action<ReadOnlyGiveEventArgs>? AfterGiveGlobal
Event Type
Type Description
System.Nullable<Action<ReadOnlyGiveEventArgs>>
| Improve this Doc View Source

BeforeGive

Event invoked by this item at the start of Give(), giving access to the initial give parameters.

Declaration
public event Action<ReadOnlyGiveEventArgs>? BeforeGive
Event Type
Type Description
System.Nullable<Action<ReadOnlyGiveEventArgs>>
| Improve this Doc View Source

BeforeGiveGlobal

Event invoked by each item at the start of Give(), giving access to the initial give parameters.

Declaration
public static event Action<ReadOnlyGiveEventArgs>? BeforeGiveGlobal
Event Type
Type Description
System.Nullable<Action<ReadOnlyGiveEventArgs>>
| Improve this Doc View Source

ModifyItem

Event invoked by this item during Give() to allow modification of any of the give parameters, including the item given.

Declaration
public event Action<GiveEventArgs>? ModifyItem
Event Type
Type Description
System.Nullable<Action<GiveEventArgs>>
| Improve this Doc View Source

ModifyItemGlobal

Event invoked by each item during Give() to allow modification of any of the give parameters, including the item given.

Declaration
public static event Action<GiveEventArgs>? ModifyItemGlobal
Event Type
Type Description
System.Nullable<Action<GiveEventArgs>>
| Improve this Doc View Source

ModifyRedundantItem

Event invoked by this item after the ModifyItem events, if the resulting item is null or redundant.

Declaration
public event Action<GiveEventArgs>? ModifyRedundantItem
Event Type
Type Description
System.Nullable<Action<GiveEventArgs>>
| Improve this Doc View Source

ModifyRedundantItemGlobal

Event invoked by each item after the ModifyItem events, if the resulting item is null or redundant.

Declaration
public static event Action<GiveEventArgs>? ModifyRedundantItemGlobal
Event Type
Type Description
System.Nullable<Action<GiveEventArgs>>
| Improve this Doc View Source

OnGive

Event invoked by this item just before GiveImmediate(), giving access to the final give parameters.

Declaration
public event Action<ReadOnlyGiveEventArgs>? OnGive
Event Type
Type Description
System.Nullable<Action<ReadOnlyGiveEventArgs>>
| Improve this Doc View Source

OnGiveGlobal

Event invoked by each item just before GiveImmediate(), giving access to the final give parameters.

Declaration
public static event Action<ReadOnlyGiveEventArgs>? OnGiveGlobal
Event Type
Type Description
System.Nullable<Action<ReadOnlyGiveEventArgs>>

Extension Methods

Extensions.Yield<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX