Skip to Content

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 / EnsureReceiptsRootdo 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 idKind
REQUEST_SHOP_CREATERequest
FACT_SHOP_CREATEDFact
REQUEST_SHOP_REROLLRequest
FACT_SHOP_REROLLEDFact
REQUEST_SHOP_REROLL_PAYMENTRequest
FACT_SHOP_REROLL_PAYMENTFact
REQUEST_SHOP_PRICERequest
FACT_SHOP_PRICE_APPLIEDFact
REQUEST_SHOP_PURCHASERequest
FACT_SHOP_PURCHASEDFact
REQUEST_SHOP_RESET_REROLL_COSTRequest
FACT_SHOP_RESET_REROLL_COSTFact

Functions

FunctionParameters (summary)
CreateShopshopId, sources[] (weights, target inventory, purchase/sell invocation routing, optional pricing overrides), slots, reroll cost fields
GetShopshopId
ListShops
GetShopListshopId
CanRerollShopshopId
RerollShopshopId, optional isFree
ResetRerollCostshopId
CanPurchaseItemshopId, index
PurchaseItemshopId, index, optional isFree
GetSellPriceitemId, targetInventory
SellItemitemId, targetInventory
ClearShopshopId
RemoveShopshopId
AddShopSlotsDeltashopId, 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.

Last updated on