Skip to content

Subsystem 6c: Durability (raid-cost) calculator (/durability + in-game, schema v3) - #30

Merged
HandyS11 merged 9 commits into
developfrom
feat/item-database-3
Jun 28, 2026
Merged

Subsystem 6c: Durability (raid-cost) calculator (/durability + in-game, schema v3)#30
HandyS11 merged 9 commits into
developfrom
feat/item-database-3

Conversation

@HandyS11

Copy link
Copy Markdown
Owner

Third slice of the Item Database subsystem (after 6a #28, 6b #29). Ships the durability calculator — in practice a raid-cost calculator: given a target (deployable item, building block, or vehicle), it lists the explosives needed to destroy it with quantity, sulfur, and time. Surfaces: in-game !durability <target> and Discord /durability <target>.

What it does

  • /durability stone wallTimed Explosive Charge ×2 — 4400 sulfur (11.5s), Satchel Charge ×10 — 4800 sulfur (22.5s), Rocket ×4 — 5600 sulfur (18s), … (cheapest-by-sulfur first; soft/hard side annotated for building blocks).
  • Resolves items, building blocks (walls/doors/floors), and vehicles by name; deployables also by id.

Design (locked in brainstorming)

  • Dedicated RaidTargets table on the embedded dataset (Approach A) — ItemRecord untouched — because the core raid targets (walls/doors) are name-keyed building grades, not item-DB items. 416 targets: 299 items + 100 building blocks + 17 vehicles.
  • The upstream RustLabs durability source is ~19 MB; the generator trims it to the explosive tool group only (drops guns/melee/throw/torpedo/turret) → ~1 MB projection. Never bundled raw.
  • ItemLookup's matcher generalized into a shared NameMatcher (with a per-type tiebreak comparer) and reused by a new RaidLookup — behavior of the existing item lookup preserved (its tests are the safety net).
  • Schema v2 → v3 (atomic cutover: generator emits v3 + real RaidTargets, loader expects v3, bundle regenerated together). New DurabilityAsOf provenance date.
  • Command name kept /durability for roadmap continuity; internal types named Raid*. quantityTypeId/HP dropped (unpopulated for explosives).
  • Smelting and /cctv explicitly deferred to their own later slices.

Validation & safety

  • Generator validator gains a raid-target floor (≥300), unknown-tool-id, and non-positive-quantity checks — fails loud, never clobbers a good bundle. 0 orphan / 0 dup.
  • No new EF entities/migrations/events/options/services (read-only static data). Features.ItemData stays a leaf.

Gates

  • Full suite 642 tests / 16 assemblies, all green (-maxcpucount:1).
  • jb cleanupcode --profile=ReformatAndReorder clean (zero diff); build -warnaserror.
  • Bundle regenerated: schemaVersion: 3, 416 raid targets.
  • EN/FR localization parity (241 keys); /help rows + drift guards.

Built subagent-driven (8 tasks, per-task spec+quality review). The final whole-branch review (opus) caught one cross-task bug the per-task reviews structurally couldn't see — sub-minute raid times rendering as (0m) because the shared DurationFormat.Compact floors to whole minutes — fixed locally in DurabilityLine (seconds for <60s, Xm Ys above) with a regression test, leaving the shared helper untouched.

🤖 Generated with Claude Code

HandyS11 and others added 9 commits June 28, 2026 17:44
…raid targets)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds DurabilityAsync slash command to ItemCommandModule with a parallel
RespondForRaidAsync helper (ResolveRaidTarget + DurabilityLine.Format +
DurabilityAsOf footer). Adds help.slash.durability resx key (EN+FR) and
Slash catalog entry; bumps parity count assertion 240→241.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…EADME

- Add /durability to the calculators list in the opening sentence
- Add rustlabsDurabilityData.json row to the source-files table
- Extend validation description to mention raid-target count floor and
  per-cost quantity/tool-id checks
- Add DurabilityAsOf to the provenance section constant list
- Note durability is trimmed to the explosive group and projected into
  RaidTargets (item/building-block/vehicle); raw source ~19 MB never bundled
- Fix CommandHelpCatalogTests HandlerNames doc-comment: 19 → 20
- Apply cleanupcode ReformatAndReorder (method params, collection literals,
  raw-string indent)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@HandyS11
HandyS11 merged commit fc9fcbd into develop Jun 28, 2026
3 checks passed
@HandyS11
HandyS11 deleted the feat/item-database-3 branch June 28, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant