Shop
Multi-shop run service: definitions, generated offer lists, reroll costs, purchase/sell through configurable target services (e.g. Money + Boon/Upgrade/Consumable).
Code: GnosisShopService.cs + many *.partial.cs (pricing, stock, reroll, serialization, …).
State (Ephemeral)
Structured under internal roots created by EnsureShopsRoot / EnsureReceiptsRoot — do not hard-code paths without reading Shop partials. Conceptually:
- Per-
shopId: definition (sources, slots, reroll costs, generated list) - Receipts for sell-price lookup
Events
String ids are in GnosisShopEvents (Runtime/GnosisEngine/Source/Services/Ephemeral/Services/ShopService/). REQUEST_* are interceptable; FACT_* follow successful shop operations.
| Event id | Kind |
|---|---|
REQUEST_SHOP_CREATE | Request |
FACT_SHOP_CREATED | Fact |
REQUEST_SHOP_REROLL | Request |
FACT_SHOP_REROLLED | Fact |
REQUEST_SHOP_REROLL_PAYMENT | Request |
FACT_SHOP_REROLL_PAYMENT | Fact |
REQUEST_SHOP_PRICE | Request |
FACT_SHOP_PRICE_APPLIED | Fact |
REQUEST_SHOP_PURCHASE | Request |
FACT_SHOP_PURCHASED | Fact |
REQUEST_SHOP_RESET_REROLL_COST | Request |
FACT_SHOP_RESET_REROLL_COST | Fact |
Functions
| Function | Parameters (summary) |
|---|---|
CreateShop | shopId, sources[] (weights, target inventory, purchase/sell invocation routing, optional pricing overrides), slots, reroll cost fields |
GetShop | shopId |
ListShops | — |
GetShopList | shopId |
CanRerollShop | shopId |
RerollShop | shopId, optional isFree |
ResetRerollCost | shopId |
CanPurchaseItem | shopId, index |
PurchaseItem | shopId, index, optional isFree |
GetSellPrice | itemId, targetInventory |
SellItem | itemId, targetInventory |
ClearShop | shopId |
RemoveShop | shopId |
AddShopSlotsDelta | shopId, delta, optional maxSlots |
Full descriptor text in GnosisShopService.cs (ShopFunctions).
Statistics
None.
When to read source
Purchase/sell wiring, reroll math, and stock generation are split across partials — start at InvokeFunction switch, then jump to the handler method.