tModLoader v2024.09
A mod to make and play Terraria mods
|
Inherits AbstractNPCShop.
Classes | |
class | Entry |
Public Member Functions | |
NPCShop (int npcType, string name="Shop") | |
NPCShop | Add (int item, params Condition[] condition) |
Adds the specified item with the provided conditions to this shop. If all of the conditions are satisfied, the item will be available in the shop. | |
NPCShop | Add (Item item, params Condition[] condition) |
This overload takes an Item instance instead of just an item type. This Item can be customized prior to being registered. This is commonly used to provide a custom shop price or currency for this shop entry: More... | |
NPCShop | Add (params Entry[] entries) |
NPCShop | Add< T > (params Condition[] condition) |
NPCShop | AllowFillingLastSlot () |
override void | FillShop (ICollection< Item > items, NPC npc) |
Unbounded variant of FillShop(Item[], NPC, out bool), for future forwards compatibility with tabbed or scrolling shops. More... | |
override void | FillShop (Item[] items, NPC npc, out bool overflow) |
Fills a shop array with the contents of this shop, evaluating conditions and running callbacks. Does not fill the entire array if there are insufficient entries. The last slot will be kept empty (null) if FillLastSlot is false More... | |
override void | FinishSetup () |
Entry | GetEntry (int item) |
NPCShop | InsertAfter (Entry targetEntry, Item item, params Condition[] condition) |
NPCShop | InsertAfter (int targetItem, int item, params Condition[] condition) |
NPCShop | InsertAfter (int targetItem, Item item, params Condition[] condition) |
NPCShop | InsertBefore (Entry targetEntry, Item item, params Condition[] condition) |
NPCShop | InsertBefore (int targetItem, int item, params Condition[] condition) |
NPCShop | InsertBefore (int targetItem, Item item, params Condition[] condition) |
bool | TryGetEntry (int item, out Entry entry) |
Public Member Functions inherited from AbstractNPCShop | |
AbstractNPCShop (int npcType, string name="Shop") | |
abstract void | FillShop (ICollection< Item > items, NPC npc) |
Unbounded variant of FillShop(Item[], NPC, out bool), for future forwards compatibility with tabbed or scrolling shops. More... | |
abstract void | FillShop (Item[] items, NPC npc, out bool overflow) |
Fills a shop array with the contents of this shop, evaluating conditions and running callbacks. More... | |
virtual void | FinishSetup () |
void | Register () |
Properties | |
override IEnumerable< Entry > | ActiveEntries [get] |
IReadOnlyList< Entry > | Entries [get] |
bool | FillLastSlot [get] |
Properties inherited from AbstractNPCShop | |
abstract IEnumerable< Entry > | ActiveEntries [get] |
string | FullName [get] |
string | Name [get] |
int | NpcType [get] |
This overload takes an Item instance instead of just an item type. This Item can be customized prior to being registered. This is commonly used to provide a custom shop price or currency for this shop entry:
npcShop.Add(new Item(ItemID.MagicDagger) { shopCustomPrice = 2, shopSpecialCurrency = ExampleMod.ExampleCustomCurrencyId }, Condition.RemixWorld);
NPCShop NPCShop.Add< T > | ( | params Condition[] | condition | ) |
T | : | ModItem | |
T | : | Add | |
T | : | ModContent.ItemType<T>() | |
T | : | condition |
Unbounded variant of FillShop(Item[], NPC, out bool), for future forwards compatibility with tabbed or scrolling shops.
items | The collection to be filled |
npc | The NPC the player is talking to |
Implements AbstractNPCShop.
Fills a shop array with the contents of this shop, evaluating conditions and running callbacks.
Does not fill the entire array if there are insufficient entries.
The last slot will be kept empty (null) if FillLastSlot is false
items | Array to be filled. |
npc | The NPC the player is talking to, for Entry.OnShopOpen(Item, NPC) calls. |
overflow | True if some items were unable to fit in the provided array. |
Implements AbstractNPCShop.
|
virtual |
Reimplemented from AbstractNPCShop.