feat: API 6, loot tables, crates and the corpse's start and time (stage 7)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 8s

A profile's `loot` block (D290-D301):

- the corpse's start: Rust's scientist loot (the default), the kit it
  carried, or nothing at all, clothes included (D290, D300);
- a table of rows that always roll, each with its chance and amount,
  and a pool that draws at most `pick` rows by weight, with a "nothing"
  weight, so a kill never pays out more than the cap (D291);
- the table into Rust's wooden box, military crate, elite crate or
  hackable locked crate instead of the corpse, with Rust's loot and
  refresh off; it stays until emptied (D292, D301);
- a locked crate's hack time, through its starting count (D297);
- the corpse's time: Rust's own, seconds, or none (D294);
- `dropTable`, for an event step that switches the table off (D296).

The corpse is filled in OnCorpsePopulate, which answers with the corpse
for a kit or empty start so Rust's ApplyLoot is skipped: ApplyLoot is
protected on Oxide and public on Carbon, so no one override fits both.
A kit start takes the items as the NPC dies, because Rust has emptied
its inventory by the time the corpse is filled.

The harness's s7 group (25 checks): refusals, about 100 kills read back
against the always-rows, the chance, the pool's weights and its cap,
each start, both crates and the locked crate's timer, the corpse's time
and the event switch. 25/25 on both rigs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
2026-10-05 22:35:42 -05:00
parent 9a00919614
commit f9ebc5f25b
4 changed files with 543 additions and 8 deletions

View File

@@ -28,10 +28,12 @@
# OnRunicNpcPlacementChanged hook.
# 4 was stage 5: RunicNpc_Factions, _SetFactions, _Escort, _Ally, _Tether, the profile's stage 5
# fields, a placement's tether, and the OnRunicNpcEscortEnded hook.
# Current: 5 — stage 6: the profile's `boss` and `use` blocks and the passive role, the hooks
# OnRunicNpcBossSpawned, _BossPhase, _BossDied and OnRunicNpcUsed, and `role` and `boss` in
# RunicNpc_List, documented in docs/runicnpc/API.md.
api = 5
# 5 was stage 6: the profile's `boss` and `use` blocks and the passive role, the hooks
# OnRunicNpcBossSpawned, _BossPhase, _BossDied and OnRunicNpcUsed, and `role` and `boss` in RunicNpc_List.
# Current: 6 — stage 7: the profile's `loot` block (the corpse's start, a table of always-rows and a capped
# pool, a crate, a locked crate's hack time, the corpse's time, and `dropTable` for one spawn's override),
# documented in docs/runicnpc/API.md.
api = 6
# ── Framework floors ─────────────────────────────────────────────────────────
#