Skip to content

Feature: add flag "shops limited inventory" (-sli)#153

Open
HansGR wants to merge 4 commits into
ff6wc:devfrom
HansGR:feature/shops-limited-inventory
Open

Feature: add flag "shops limited inventory" (-sli)#153
HansGR wants to merge 4 commits into
ff6wc:devfrom
HansGR:feature/shops-limited-inventory

Conversation

@HansGR

@HansGR HansGR commented Jun 4, 2026

Copy link
Copy Markdown

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.

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)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread data/shops.py Outdated
Comment thread data/shops.py Outdated
Comment thread data/shops.py Outdated

@wrjones104 wrjones104 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All gemini-code-assist comments are valid and should be applied

HansGR and others added 3 commits June 13, 2026 10:04
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>
@HansGR

HansGR commented Jun 13, 2026

Copy link
Copy Markdown
Author

All gemini-code-assist comments are valid and should be applied

Done.

@HansGR HansGR requested a review from wrjones104 June 13, 2026 14:08
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.

2 participants