feat: handle stacking in inventory and show item count and current/max ammo of ranged weapons

This commit is contained in:
Peter Stockings
2026-01-21 14:52:08 +11:00
parent 9196c49976
commit a11f86d23b
3 changed files with 57 additions and 18 deletions

View File

@@ -52,7 +52,12 @@ export function generateWorld(floor: number, runState: RunState): { world: World
items: [
...runState.inventory.items,
// Add starting items for testing if empty
...(runState.inventory.items.length === 0 ? [ITEMS["health_potion"], ITEMS["health_potion"], ITEMS["iron_sword"], ITEMS["throwing_dagger"], ITEMS["throwing_dagger"], ITEMS["throwing_dagger"], ITEMS["pistol"]] : [])
...(runState.inventory.items.length === 0 ? [
{ ...ITEMS["health_potion"], quantity: 2 },
ITEMS["iron_sword"],
{ ...ITEMS["throwing_dagger"], quantity: 3 },
ITEMS["pistol"]
] : [])
]
},
energy: 0