aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


commit 5cb799cc22cd1d82c20c88c179d390cc62e0d853
parent 1ead79ea3263e62f0971a7eec9ea88b5ea3006b5
Author: anon <anon@example.com>
Date:   Sun,  8 Nov 2026 19:25:55 +0000

Expose loot-source catalog filtering and record acquisition coverage

Diffstat:
MTODO.md | 4++++
Mdocs/shop-stock-expansion.md | 30+++++++++++++++++++++++++++---
Mserver/item_pages.go | 5+++--
Mserver/item_sources_test.go | 25+++++++++++++++++++++++++
4 files changed, 59 insertions(+), 5 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -179,6 +179,10 @@ research separately. More screenshots and test cases do not count as new gamepla location links without general map controls or live player/NPC feeds. Server regressions cover entrance routing and unchanged outdoor vendors; Chromium verifies link clicks center the entrance marker and general map controls work. + The catalog also filters items available as loot, including items sold in + shops. The [acquisition audit](docs/shop-stock-expansion.md) confirms six + configured loot families versus 3,363 shop families; the filter exposes + existing drops and does not expand loot tables or change probabilities. November 5: [the finite terminal inventory](docs/early-shop-stock.md) lists all 190 placements in training grounds 950/952/954 and basic shops 1180/1183/1186. The four empty training terminals now carry seven original QL1 diff --git a/docs/shop-stock-expansion.md b/docs/shop-stock-expansion.md @@ -137,16 +137,40 @@ pickup-box visual while an NPC catalog is open also remains unchanged. ## Read-only acquisition browsing and provisional restocking The admin item catalog shows family-level acquisition sources and filters for -items sold in shops, items not sold in shops, and items without a known source. +items sold in shops, items not sold in shops, items available as loot, and items +without a known source. Loot filtering includes items also sold by vendors. Opening a template shows offered QLs, shop restrictions, monster drop chances and supported spawn levels, recipes, mission rewards/objectives, starting -items and world pickups. Its map marks seller and monster spawn positions; -interior sources use the corresponding playfield view. Shop links show the +items and world pickups. Location links open the map at seller entrances or +monster spawn positions; indoor sellers resolve to outdoor shop entrances. +Shop links show the embedded stock pool and its locations. These are read-only views: stock and merchant bindings are still maintained in embedded YAML and require a rebuild. An absent mapping is not proof that an item is impossible to obtain, and a family source does not establish availability at every quality level. +The November 8 acquisition audit found 3,363 families with shop sources and six +with configured NPC drops, using the catalog's reviewed family grouping: + +| Item | Implemented drop sources | Chance per row | +| --- | --- | --- | +| Monster Parts | Admitted biological creatures, including Leets | 50% | +| Robot Junk | Admitted Androids | 50% | +| Rustic Shirt | Five admitted training human groups | 50% | +| Uniform Shirt | Fresh Clan Functionary | 50% | +| Worn Metaplast Armor Gloves | The three training bosses | 50% | +| Rusty OT M-10 Flechette Pistol | The three training bosses | 25% | + +These are provisional configured probabilities, not recovered historical rates. +The catalog's `Loot: N` counts NPC groups, not percentage chance; the item detail +page gives chances and QL ranges. Shop and loot coverage overlap. Of 82,264 +catalog family keys, 78,859 have no indexed acquisition source; this includes +internal/NPC equipment and unreviewed definitions, not just missing player loot. +Future placement work should first identify usable early-game items and verify +their effects, then assign appropriate vendors or creature/boss pools with +explicit QL ranges and probabilities. The unknown-source filter alone does not +justify adding every record to the economy. + Original item icons are read directly from resource type 1010008 in the shipped archive. The catalog, template and instance pages, inventory/equipment, bank, reclaim, containers, recipes and shop stock share the same icon rendering. diff --git a/server/item_pages.go b/server/item_pages.go @@ -124,7 +124,8 @@ func (server *server) itemCatalogPage(w http.ResponseWriter, r *http.Request) { if definition.Quality != nil && (catalog == "" || strings.Contains(strings.ToLower(adminName(definition.Name)), catalog) || strconv.FormatUint(uint64(definition.ID), 10) == catalog) { available := sources[itemFamily(definition.ID)] buyable := slices.ContainsFunc(available, func(source itemSource) bool { return source.kind == "Shop" }) - if sourceFilter == "shops" && !buyable || sourceFilter == "no-shops" && buyable || sourceFilter == "unknown" && len(available) != 0 { + lootable := slices.ContainsFunc(available, func(source itemSource) bool { return source.kind == "Loot" }) + if sourceFilter == "shops" && !buyable || sourceFilter == "no-shops" && buyable || sourceFilter == "loot" && !lootable || sourceFilter == "unknown" && len(available) != 0 { continue } matches = append(matches, definition) @@ -143,7 +144,7 @@ func (server *server) itemCatalogPage(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "<h1>Item catalog</h1><form method='get' action='admin/items/catalog'><label>Filter by name or template ID <input name='catalog' value='%s'></label>", html.EscapeString(r.FormValue("catalog"))) adminSortFields(w, r) fmt.Fprint(w, "<label>Sources <select name='source'>") - for _, option := range []struct{ value, label string }{{"", "All"}, {"shops", "Buyable in shops"}, {"no-shops", "Not sold in shops"}, {"unknown", "No known acquisition source"}} { + for _, option := range []struct{ value, label string }{{"", "All"}, {"shops", "Buyable in shops"}, {"no-shops", "Not sold in shops"}, {"loot", "Available as loot"}, {"unknown", "No known acquisition source"}} { selected := "" if sourceFilter == option.value { selected = " selected" diff --git a/server/item_sources_test.go b/server/item_sources_test.go @@ -64,6 +64,31 @@ func TestItemSourcePagesAreReadOnlyAndFilterFamilies(t *testing.T) { } } +func TestItemCatalogLootFilterIncludesShopAndLootOnlyFamilies(t *testing.T) { + world := newTestServer(t) + handler := adminTestHandler(world) + for _, scenario := range []struct { + template string + found bool + }{ + {"42640", true}, // Monster Parts are loot-only. + {"85595", true}, // The high endpoint shares the gloves' shops and boss drops. + {"95577", false}, // Lock Picks are sold, but have no configured drops. + {"209491", false}, // Take me to the Shop! has no configured source. + } { + page := httptest.NewRecorder() + handler.ServeHTTP(page, httptest.NewRequest("GET", "/admin/items/catalog?source=loot&catalog="+scenario.template, nil)) + + found := strings.Contains(page.Body.String(), "value='"+scenario.template+"'>Create") + if page.Code != 200 || found != scenario.found || !strings.Contains(page.Body.String(), "<option value='loot' selected>Available as loot</option>") { + t.Fatal("loot filter returned the wrong family or lost its selection", scenario.template, page.Code) + } + if found && !strings.Contains(page.Body.String(), "Loot:") { + t.Fatal("catalog row omitted its loot source", scenario.template) + } + } +} + func TestShopSourceMapUsesOutdoorEntrancesAndLocationLinks(t *testing.T) { world := newTestServer(t) machines := gamedata.ShopMachines