Banana 2077
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 runsR.defineVendorfor 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 withR.setCastPosition(cast, catalog.standPosition(v)), which is the spot behind each counter. - Stalls. Builds the five stalls (
game.shops.stalls) undermount_shops, one per frame. They are culled by distance at 4 Hz (hidden past 110 m, light off past 48 m) and destroyed inonDestroy. 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>(verbSHOP, radius 2.4), which callsR.openShop(vendor). - Shop (layer 155, confirm on 157). Opens on
shopRequestedand 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, thenR.buy/R.sell, with the vendor's line on success. - Quick heal.
H/ right-stick press / touch HEAL callsR.bestHeal()→R.useItem, only whenR.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 / mouse | gamepad | touch | |
|---|---|---|---|
| quick heal | H | right-stick press | HEAL |
| move in the shop | arrows / WASD | d-pad | tap a row |
| switch tab | Q / E / Tab, ← → | LB / RB | tap a tab |
| confirm (buy, sell) | Enter / Space, or click the selected row | south | tap the selected row / button |
| back / close | Esc / Backspace | east | ✕ |
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.