Skip to content

Food was never removed. The drop was never delivered. - #229

Merged
0xward merged 1 commit into
mainfrom
claude/nullstate-onchain-text-q6g2a3
Aug 2, 2026
Merged

Food was never removed. The drop was never delivered.#229
0xward merged 1 commit into
mainfrom
claude/nullstate-onchain-text-q6g2a3

Conversation

@0xward

@0xward 0xward commented Aug 2, 2026

Copy link
Copy Markdown
Owner

The owner asked why food loot had been taken out. Nobody took it out.

applyLoot() in game.js handled hp, xp, relic, goldkey, paper and gshard — and had no item branch at all. Nine breakable props roll item: crate, crystal, tablet, statue, oak_barrel, barrel_stack, hay_pile, plaque_sword, cot. Every one of those rolls fell through every branch, played the pickup sound, and logged "— loot!" because the roll was not 'none'. The player got nothing.

His own screenshot is the proof: "Straw Bedding shattered — loot!" over an inventory that never changed.

Food is the edible ~16% of the same 1,244-icon library (NS_MARKET.FOOD_RANGES, ids 321–515), so a broken item path took food down with it. Interactive containers were unaffected — those hand items over through the container window, which is exactly why chests always felt fine and everything else felt empty.

First, the delivery

applyLoot gains an item/food branch that rolls at the tier the loot table asked for (['item',2,30] means a tier-2 roll — that is how a chest yields better icons than a barrel), adds it to the stash, and names what it was. A stack already at its cap now says so out loud, rather than repeating the silent loss this branch exists to fix.

Then the rate, which is what was actually asked for

Even working, food arrived as a sixth of an item roll — and the props a player smashes most had no item roll at all (vase, pot, bones, rubble were flat zeros). So props that hold provisions now drop food directly, as its own loot kind:

prop food
Stocked Shelf 28.6%
Straw Bedding 27.4%
Supply Crate 27.0%
Barrel Stack 26.3%
Water Pail 26.0%
Oak Barrel 25.4%
Herb Pot 22.1%
Wash Basin 20.3%
Rotten Cot 20.0%
Wooden Pail / Wooden Table 19.8%

Treasure containers keep their old ~5% — a strongbox holds treasure, not lunch. Weight came out of none first and xp second, so the hp/relic/gshard economies are untouched: this adds food, it does not quietly make every prop richer.

rollFoodDrop() draws from the edible range with no rarity re-roll. rollItemDrop biases toward better rarity for richer containers; food heals 3–5% of max HP by rarity, a spread too narrow to be worth the bias, and a legendary apple reads as a joke.

Testing

scripts/test-prop-loot.js drives the real engine — mounts a run, spawns props, smashes them through the same smashDecor() a weapon swing calls, and asserts on the stash, not the log line, because the log line was never what broke.

With the new branch disabled it fails five assertions:

✗ smashing Straw Bedding puts things in the stash (0 items from 400)
✗ smashing a Supply Crate does too              (0 items from 400)
✗ hay_pile yields food at roughly its table's rate    (got 0, ~109 expected)
✗ crate yields food at roughly its table's rate       (got 0, ~108 expected)
✗ bucket_water yields food at roughly its table's rate (got 0, ~104 expected)

It also asserts a Glazed Vase still drops nothing — which is what would fail if the fix had been "make every prop richer".

✓ 9/9 test:proploot (new, npm run test:proploot)
✓ test-floor-traversable unchanged — 0 sealed floors, 1.9 openable containers/floor
✓ audit  ✓ check:market

Separately: the two objects in the doorway

Measured, could not reproduce. Across 60 generated floors and 644 doors: zero opening onto rock, zero with rock on one side, zero reachable-but-not-passable with every prop in place. The circled objects in the screenshot are the doors themselves, and they are all connected and walkable. Left unchanged rather than guessing at placement rules that measure clean.


Generated by Claude Code

OWNER: *"Lootingan food ko skrg kaya gaada ya?? ini serius perlu di bahas
kenapa di hilangkan sebelum2nya entah olehmu atau agent2 sebelumnya."*

Nobody removed it. applyLoot() in game.js handled hp, xp, relic, goldkey, paper
and gshard — and had no `item` branch at all. Nine breakable props roll `item`:
crate, crystal, tablet, statue, oak_barrel, barrel_stack, hay_pile,
plaque_sword, cot. Every one of those rolls fell through every branch, played
the pickup sound, and logged "— loot!" because the roll was not 'none'. The
player got nothing.

His own screenshot is the proof: *"Straw Bedding shattered — loot!"* over an
inventory that never changed.

Food is the edible ~16% of the same 1244-icon library (NS_MARKET.FOOD_RANGES,
ids 321-515), so a broken item path took food down with it. Interactive
containers were unaffected — those hand items over through the container window,
which is why chests always felt fine and everything else felt empty.

FIRST, the delivery. applyLoot gains an `item`/`food` branch that rolls at the
tier the loot table asked for (['item',2,30] means a tier-2 roll — that is how a
chest yields better icons than a barrel), adds it to the stash, and says what it
was. A stack already at its cap now says so out loud rather than repeating the
silent loss this branch exists to fix.

THEN the rate, which is what the owner actually asked for. Even working, food
arrived as a sixth of an item roll, and the props a player smashes most had no
item roll at all — vase, pot, bones, rubble were flat zeros. So the props that
hold PROVISIONS drop food directly now, as its own loot kind:

    Stocked Shelf 28.6%   Straw Bedding 27.4%   Supply Crate 27.0%
    Barrel Stack  26.3%   Water Pail    26.0%   Oak Barrel   25.4%
    Herb Pot      22.1%   Wash Basin    20.3%   Rotten Cot   20.0%
    Wooden Pail   19.8%   Wooden Table  19.8%

Treasure containers keep their old ~5% — a strongbox holds treasure, not lunch.
Weight came out of `none` first and `xp` second, so the hp/relic/gshard
economies are untouched: this adds food, it does not quietly make every prop
richer.

rollFoodDrop() draws from the edible range with no rarity re-roll. rollItemDrop
biases toward better rarity for richer containers; food heals 3-5% of max HP by
rarity, a spread too narrow to be worth the bias, and a legendary apple reads as
a joke.

scripts/test-prop-loot.js drives the real engine — mounts a run, spawns props,
smashes them through the same smashDecor() a weapon swing calls, and asserts on
the STASH rather than the log line, because the log line was never what broke.
With the new branch disabled it fails five assertions with 0 items from 400
smashes. It also checks a Glazed Vase still drops nothing, which is what would
fail if the fix had been "make every prop richer".

Verified: 9/9 test:proploot, test-floor-traversable unchanged (0 sealed floors,
1.9 openable containers per floor), audit and check:market clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017A764RdnwpyWnG7uCNhMiQ
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nullstate Ready Ready Preview Aug 2, 2026 9:18pm

@0xward
0xward merged commit 186d473 into main Aug 2, 2026
5 checks passed
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