-
Notifications
You must be signed in to change notification settings - Fork 2
Description
create a new item: Infinity Vault Blueprint, with the following description:
"When an Infinity Imp defeats an Infinity Imp, an Infinity Vault Blueprint is created. Don't blame me if it seems arbitrary - I'm just telling you how it is."
it has a use action to construct the vault, following the pattern of existing blueprint items. there is no item cost to build the vault, but there is a money cost of 1,000m.
using the blueprint unlocks the vault for the player. it appears as a new menu item (Shift+Z).
the vault has an open/closed state.
while the vault is closed, its contents are invisible to you. when you visit the vault, if it's closed you may pay for 1 hour of access. the cost is 10m + the number of items in the vault at the time of opening.
while the vault is open, you can see the items in it, and move items in and out of it at will (more on this, below).
items in the vault are not stored as Inventory records in the database. instead they are quantities in a new table. table schema:
- id (guid, auto-generated)
- user id
- item id
- maker id (nullable)
- quantity
- version (via Doctrine attribute)
note: most tables have auto-incrementing ints for primary keys generated by the DB, but all new tables should use app/constructor-generated guids.
with a unique constraint on user id, item id, and maker id.
rows with a quantity of 0 are NOT deleted for this ticket.
when viewing items in the vault, exclude items with quantity of 0. results are paginated. no sorting or filtering for this ticket.
while the vault is open, it's an available "target" for moving items (similar to basement, mantle, library, etc).
when items are moved IN to the vault, they are deleted from the Inventory table, and a row is upserted in the vault inventory table for that user/item/maker.
moving an item OUT of the vault is a more involved process than it seems, and will probably require a dedicated API endpoint:
- a vault record is & quantity of copies to move must be specified & validated, and updated if successfully moved
- because moving an item out will create a new inventory item, ensure that seasonal spices & random item mutation is NOT applied (for example, when new Beans are created, usually they have a small chance to become Magic Beans - this must NOT happen when taking items out of the vault)
- available space & eligibility of item to move to the target location must still be validated (for example, the basement has a max item limit, most items CANNOT be moved into a library, etc).
- the "newly created" inventory item must have the maker from the vault item record