diff options
| author | historia <[not public]> | 2026-07-01 16:37:45 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-01 16:37:45 -0400 |
| commit | e6b4cb9f5816c6ee239233bc85f74ee446a161c2 (patch) | |
| tree | 1c3bf71c8b7f095baae989afe5e33183a7ed3929 /AGENTS.md | |
| parent | 649ef4b7416ce7053145878841fc9b0bff2f5fec (diff) | |
| download | thehouseoficarus-e6b4cb9f5816c6ee239233bc85f74ee446a161c2.tar.gz | |
feat: shop system overhauled, gui conversation tree editor overhauled
Diffstat (limited to 'AGENTS.md')
| -rw-r--r-- | AGENTS.md | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -90,6 +90,10 @@ Used by exits, talk options, on-enter, use_interactions: `flag` (world), `player `DropDespawnTicks = 1000`. `ReserveTicks = 100` (mob loot reserved for killer). Same-ID items NOT merged. Spawn items respawn with merge. Despawn/reserve visible via options. +## Shop System (`cmd_shop.go`) + +Root-level `shop:` on a MobDef (`behavior.ShopConfig`) — NOT part of the talk tree. Traded via plain `StateGame` commands: `list`, `buy <item>`, `sell <item>`, with `list <mob>` / `buy <item> from <mob>` / `sell <item> to <mob>` to disambiguate when a room has multiple shop mobs (else "Which shop?"). No bespoke shop CLI/session state. **Prices derive from item `value:`** — shops sell at 100% of value; buy back via OSRS formula `value×max(10, buy_percentage−stock×change_percentage)/100` (defaults `buy_percentage: 40`, `change_percentage: 3`, floor 10%). Per-item `stock` (target+starting); buying depletes (out of stock at 0), selling raises it (lowering next sell price). Restock moves current stock toward target one step per `restock_ticks` (item override → shop default → `ShopDefaultRestock=100`) in **both** directions; dynamic (unlisted) items decay to 0. `buys_anything` (default true) lets specialty shops refuse unlisted items. **Live stock is per-MobInstance, in-memory only** (`ShopStock`/`ShopRestock` maps), mutated only under `MobStore.mu` via `ShopTake`/`ShopAdd`/`ShopStockOf`; restock runs in `MobStore.Tick()`. + ## Combat System `attack_type` (stab/slash/crush/ranged/science) selects attack/defense bonuses. Ranged consumes 1 ammo/attack. Aggressive mobs auto-attack if `playerLevel <= mobLevel * 2`. Movement during combat = flee attempt (mob hits abort). Death: drop credits + keep 3 most valuable items, respawn at room 1, deactivate techs. Equipment `requirements` checked before equipping. Formulas and XP splits in `combat/tracker.go`. @@ -123,7 +127,7 @@ Minigame interface: 3 games at terminals (levels 1/20/40). Interface in `game/ha ## Session States -20 states in `net/server.go` covering login flow, game, NPC talk, menus (bank/shop/recipe/confirm), and hacking. +States in `net/server.go` covering login flow, game, NPC talk, menus (bank/recipe/confirm), and hacking. (Shops are command-driven in `StateGame` — no dedicated shop state.) ## ItemDef Fields |
