Feature: add flag "shops limited inventory" (-sli)#153
Conversation
add args/shops.py entries for -sli add junk items and junk armor to constants/items.py data/shops.py: - add pack size tracking to free space - map shop bytes to SRAM free bytes - edit menu asm to display items compactly add menus/buy.py (modified buy menu used by -sli)
There was a problem hiding this comment.
Code Review
This pull request introduces a 'Shop Limited Inventory' feature (-sli), allowing shops to sell items in limited packs with tracking stored in SRAM. It adds command-line arguments, defines categories for junk equipment, and implements extensive assembly hooks in the buy menu to handle pack sizes, price inflation, affordability checks, and UI rendering. The review feedback highlights a few improvement opportunities, including replacing an identity comparison ('is') with equality ('==') for item IDs, correcting an inaccurate count in a warning message when duplicate shop IDs are present, and removing an unused import.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
wrjones104
left a comment
There was a problem hiding this comment.
All gemini-code-assist comments are valid and should be applied
Switch from "is" comparison (identity) to "==" comparison (value) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Code rigor update in printed warning. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Code cleanup, delete unused import Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Done. |
Introduces a new flag to the shops section (-sli, --shops-limited-inventory). When called, all accessible shops in the game sell items in packs, and sell each pack only once. For example, a shop may sell a pack of Fenix Down x4; once the player buys it, it is no longer available from that shop. If the shop sells out its stock of items, the player may sell items there but the buy menu is inaccessible. This introduces a new type of challenge for resource management.
Item pack sizes are defined in data/shops.py in the method get_pack_sizes(). Every item has by default a pack size of 1, except the following: shurikens, other throwables, junk weapons, junk armor, non-special relics, basic restoratives, high healing, and assorted consumables. Cost for the pack is calculated as (Cost of item)*(pack size).
When active, this flag makes use of 86 free bytes in the save RAM to store the status of each shop (1 byte per shop), so that the shop inventory state is persistent in each save file.
This flag is compatible with all Worlds Collide flags.