feat: API 6, loot tables, crates and the corpse's start and time (stage 7) #12

Merged
whitlocktech merged 1 commits from feat/stage-7 into edge 2026-10-06 07:16:35 +00:00
Member

What

Stage 7 (D290–D301): a profile's own loot, in a new loot block.

  • The corpse's start: Rust's scientist loot (the default), the kit it carried, or nothing at all (D290, D300).
  • The table: rows that always roll with their own chance, plus a pool capped at its picks, with a "nothing" weight (D291).
  • A crate instead of the corpse: wooden box, military, elite, or a locked crate with its own hack time (D292, D297). A crate stays until it is emptied (D301).
  • The corpse's time: Rust's 10 minutes, a number of seconds, or none (D294).
  • dropTable for an event: a spawn's overrides can switch the table off (D296).

The corpse is filled in OnCorpsePopulate. A kit or empty start answers the hook with the corpse, so Rust's ApplyLoot is skipped. The kit's belt and main items are taken in OnDied, before Rust empties them. API 6.

Stacked on spike/stage-7 (#11). Merge #11 first and this diff is the build alone.

Tested

Builds: Rust 2634.289.1 (buildid 25681086), Oxide 2.0.7801, Carbon 2.0.262, each checked as the latest first.

  • Harness: the s7 group passed 25/25 on both rigs (100-kill chance checks at 3.5σ, each start, each crate, the locked timer, corpse time, the event override). rnt.run all passed 270/270 on both rigs.
  • Walk: walked on both rigs through the site, signed in as an admin. A loot profile was made on the form, pushed and placed from the map. The probe's kills were read back: each start, the 120 s corpse, the military crate, and a 17-minute locked crate that unlocked on time. An event with "drop loot" off dropped nothing.
  • Not walked: what a player's screen shows for a locked crate set longer than 15 minutes. That waits for the in-game walk.

Checklist

  • I have read CONTRIBUTING.md.
  • AI tools were used. Tool(s): Claude Code (Claude Opus 5.5). The commit carries the Co-Authored-By trailer.
  • I agree that my contribution is licensed under GPL-3.0-or-later.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY

## What Stage 7 (D290–D301): a profile's own loot, in a new `loot` block. - **The corpse's start:** Rust's scientist loot (the default), the kit it carried, or nothing at all (D290, D300). - **The table:** rows that always roll with their own chance, plus a pool capped at its picks, with a "nothing" weight (D291). - **A crate instead of the corpse:** wooden box, military, elite, or a locked crate with its own hack time (D292, D297). A crate stays until it is emptied (D301). - **The corpse's time:** Rust's 10 minutes, a number of seconds, or none (D294). - **`dropTable` for an event:** a spawn's overrides can switch the table off (D296). The corpse is filled in `OnCorpsePopulate`. A kit or empty start answers the hook with the corpse, so Rust's `ApplyLoot` is skipped. The kit's belt and main items are taken in `OnDied`, before Rust empties them. API 6. **Stacked on `spike/stage-7` (#11).** Merge #11 first and this diff is the build alone. ## Tested Builds: Rust 2634.289.1 (buildid 25681086), Oxide 2.0.7801, Carbon 2.0.262, each checked as the latest first. - **Harness:** the `s7` group passed 25/25 on both rigs (100-kill chance checks at 3.5σ, each start, each crate, the locked timer, corpse time, the event override). `rnt.run all` passed 270/270 on both rigs. - **Walk:** walked on both rigs through the site, signed in as an admin. A loot profile was made on the form, pushed and placed from the map. The probe's kills were read back: each start, the 120 s corpse, the military crate, and a 17-minute locked crate that unlocked on time. An event with "drop loot" off dropped nothing. - **Not walked:** what a player's screen shows for a locked crate set longer than 15 minutes. That waits for the in-game walk. ## Checklist - [x] I have read CONTRIBUTING.md. - [x] AI tools were used. Tool(s): `Claude Code (Claude Opus 5.5)`. The commit carries the `Co-Authored-By` trailer. - [x] I agree that my contribution is licensed under GPL-3.0-or-later. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
wtclaude added 2 commits 2026-10-06 06:43:58 +00:00
test(harness): stage 7 spike, rnt.spike7 (D299)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 7s
9a00919614
The corpse (Rust's loot, OnCorpsePopulate, whether ApplyLoot and
CopyInventoryToCorpse can be overridden, emptying and filling), Rust's
four crates with their loot off, a locked crate's per-crate timer
through its starting count, and removing a corpse. 13 of 14 on both
rigs; the kit start cannot be switched from outside the NPC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
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
f9ebc5f25b
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
whitlocktech merged commit d5c9f04f2f into edge 2026-10-06 07:16:35 +00:00
whitlocktech deleted branch feat/stage-7 2026-10-06 07:16:36 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/runicnpc-rust#12
No description provided.