Repository navigation
RPG R4: stacking items, equipment slots, statuses; dungeon-crawl 1.1 - #72
Conversation
Items with stack: true have a count (<id>_n): give(item, n), take(item, n) (gives back how many it took), inv_count(item); the item is in the inventory while its count is above 0. A character's counts: set starting counts. slots: and an item's slot: make equip(item)/unequip(item) on the equipped list; such an item's modifiers count only while equipped. statuses: (name, desc, modifiers, rest) are kept in one store (src/game/statuses.ts, pure) read and written by bound EXTERNALs: add_status(who, id, turns), has_status, status_turns, clear_status, tick_statuses, rest_statuses; who is an entity or member id, or "me". The HUD shows counts, what is worn and each one's statuses; the character's own statuses add their modifiers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vdVgYTb9jm7MRdePSgs8B
…eon-crawl 1.1 Panel: a stack's count (×n), a worn item marked (◆, its slot in the tooltip), statuses as tags on the character's row, party cards and entity cards. The web page writes the same in its status lines. Random runs (check-ink --random, api.simulate) spread each stack's count at the end like a resource and count how often each status was put on and in how many runs. dungeon-crawl 1.1: arrows (a ranged hero spends one a shot, -2 without), venomous foes (cave spiders, ghouls) poison whom they wound for 3 turns (-1 life a turn); a battle round and a room are each a turn; a shrine and a potion cure poison. Fixed-strategy bot: 63% wins (was 68%). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vdVgYTb9jm7MRdePSgs8B
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vdVgYTb9jm7MRdePSgs8B
A generated function the story never calls (unequip, say) was reported as a place never reached. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vdVgYTb9jm7MRdePSgs8B
|
Review (read the status/stack/slot code, i18n and config validation; I did not run the tests or lint or check the pack balance numbers). No blocking problems found. The new problem codes ( Minor:
I would merge once CI is green and the vault check is done. |
despawn, and set_stat when the kind's remove stat takes the entity out, clear its statuses (only in games with statuses), so the store does not keep the dead. Review follow-up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015vdVgYTb9jm7MRdePSgs8B
|
Review of RPG R4 (stacks, slots, statuses). I read the source diff; I did not run the tests or lint. I found no blocking bugs. The status store functions are pure and bound lookahead-safe, and the config problems and UI strings all have zh and en. Two minor points, neither blocking:
I would merge as is, provided CI passes. |
RPG R4 (
docs/rpg-engine-prd.md§4.2–4.3): counted items, equipment slots and statuses.Engine
stack: trueitems have a count in<id>_n.give(arrow, 3),take(arrow, 1)(returns how many it took) andinv_count(arrow)take list items as arguments, so a misspelt name is a compile error. An item is ininvwhile its count is above 0. A character's starting counts are writtencounts: { arrow: 12 }.slots:lists the slots and an item names one withslot:.equip(item)swaps out the other item of that slot;unequip(item)takes it off; the worn items are inVAR equipped. A slotted item's modifiers count only while it is equipped. Slots are for the character only for now.statuses:(name, desc, modifiers,rest). They are kept in one store,who|id|turns;…, read and written by pure bound EXTERNALs (src/game/statuses.ts). The wrappers areadd_status(who, id, turns),has_status,status_turns,clear_status,tick_statuses,rest_statuses.whois an entity or member id, or"me"for the character. Without the engine nothing takes hold. The character's own statuses add their modifiers.itemSlot,statusSkill,countItem. The new ink names are reserved only when the game uses them.Display and checks
check-ink --randomreports each stack's count at the end and how often each status was put on.unequip).dungeon-crawl 1.1
Verified in Obsidian
dev:errorsis clean.api.simulate200 runs, no errors). The 10.3 example's engine was regenerated on pack 1.1 (200 runs, no errors). 目录 and the vault CLAUDE.md are updated.Tests: 591 pass; lint is clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_015vdVgYTb9jm7MRdePSgs8B