Log inGet started
World

Banana 2077

Branchmain
Branchesmain
Commit49a1306fab

README.md

game.shops.Shops

Banana 2077's shops slice. The scene entrypoint attaches it to the mount_shops entity when play starts. It needs no sibling components; everything it touches goes through game.rules.

What it does

  • Vendors. Calls catalog.defineAll(), which runs R.defineVendor for Noodle Nana's, Doc Kumquat, Peel & Steel, Misty's Charms and Byte's Bits, plus a few extra items. When the story slice has not set a cast position, it hints one with R.setCastPosition(cast, catalog.standPosition(v)), which is the spot behind each counter.
  • Stalls. Builds the five stalls (game.shops.stalls) under mount_shops, one per frame. They are culled by distance at 4 Hz (hidden past 110 m, light off past 48 m) and destroyed in onDestroy. A hot reload replaces them by name and never doubles them.
  • Talk. R.addTalkProvider(cast, 10, …) gives each vendor a short in-character greeting with three choices: Browse wares opens the BUY tab, Sell junk opens the SELL tab, Just looking does nothing. The shop opens once the dialogue lets go of focus.
  • Interactables. Each counter gets shop_<vendor> (verb SHOP, radius 2.4), which calls R.openShop(vendor).
  • Shop (layer 155, confirm on 157). Opens on shopRequested and takes focus "shop"; it refuses if focus is taken. It has BUY / SELL tabs and kind-coloured rows with price, level lock, can't-afford state and owned count. A detail card shows stat mods and the difference against the item equipped in that slot. Purchases and sales go through a confirm dialog, then R.buy / R.sell, with the vendor's line on success.
  • Quick heal. H / right-stick press / touch HEAL calls R.bestHeal() → R.useItem, only when R.canControl(). When V carries no heals, it notifies her where to buy them.

V's menu (inventory, character, perks, skills on I) is a separate component, game.rpg.Character, on the same mount.

Controls

keyboard / mousegamepadtouch
quick healHright-stick pressHEAL
move in the shoparrows / WASDd-padtap a row
switch tabQ / E / Tab, ← →LB / RBtap a tab
confirm (buy, sell)Enter / Space, or click the selected rowsouthtap the selected row / button
back / closeEsc / Backspaceeast✕

The shop releases the mouse pointer while open (and re-locks it if it was locked), claims the platform Back, and activates shopnav.inputMap, which suppresses the HUD, combat, player and quest-HUD groups. shops.inputMap (HEAL) is live only while the run is playing.

Cost

Per frame it does nothing beyond a dirty-flag check and a 4 Hz distance cull of five stalls. The shop is rebuilt only on input or on a rules event (eddies, items, equip, attributes, xp) while it is open.