id
id: (ShopItem) -> numberThe item's id.
shop:item(…)| Method | Returns | Description |
|---|---|---|
id() | number | The item's id. |
stock() | number | How many the shop has. |
slot() | number | Which shop slot it sits in. |
name() | string? | The item's name. |
actions() | { string } | Every menu option this shop slot exposes. |
buyOptions() | { number } | Which buy quantities this row actually offers, in menu order. |
buy1() | boolean | Buy one. |
buy5() | boolean | Buy five. |
buy10() | boolean | Buy ten. |
buy50() | boolean | Buy fifty. The game truncates to available stock, so this buys twelve when twelve are stocked. |
| Method | Returns | Description |
|---|---|---|
Shop.item | ShopItem? | The row stocking an item, resolved live. |
Shop.items | { ShopItem } | Everything the shop has in stock; empty when it is shut. |
idid: (ShopItem) -> numberThe item's id.
stockstock: (ShopItem) -> numberHow many the shop has.
slotslot: (ShopItem) -> numberWhich shop slot it sits in.
namename: (ShopItem) -> string?The item's name.
nil when the id has no definition.actionsactions: (ShopItem) -> { string }Every menu option this shop slot exposes.
buyOptionsbuyOptions: (ShopItem) -> { number }Which buy quantities this row actually offers, in menu order.
Usually {1, 5, 10, 50}, but not always -- some shops have no Buy 50. Read this rather than assuming the full four.
buy1buy1: (ShopItem) -> booleanBuy one.
buy5buy5: (ShopItem) -> booleanBuy five.
buy10buy10: (ShopItem) -> booleanBuy ten.
buy50buy50: (ShopItem) -> booleanBuy fifty. The game truncates to available stock, so this buys twelve when twelve are stocked.