Potion counts on the bottom bar and potion stacks in the inventory

- potioncounts.cpp: each potion slot shows how many potions of its kind the
  hero carries (stacks added up)
- potionstack.cpp: potions of one type stack up to 20 per cell; every
  potion entering the hero's grid pours into stacks with room, the sort
  button stacks first, drinking takes one off a stack, counts drawn on the
  cells and saved in the JSON inventories
- game/engine/items.h: potion kinds and grid helpers; ObjectManager and
  DestroyObject in objects.h
- auto-attack: the projectile-weapon target radius is a design value
- docs/potion-stacks.md: measured paths and the design

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-17 01:31:01 +02:00
1 parent b2e886c7f5
commit 13b91cdd3d
13 files changed
+612 -10

No files matched your search

+11 -2
View File
@@ -5,8 +5,8 @@
Saving marks effect objects (cObjectFX) dead; loading keeps the buff but drops
the aura effect (type 842) that follows the hero. `src/mods/aura_restore.cpp`
recreates it after a load for Heldenmut (0x3f7) and Klingenblick (0x3f8). Spell
auras (Steinhaut, Lichtschild, ...) use other effects and are not covered
yet; check them if their visuals go missing too.
auras (Steinhaut, Lichtschild, ...) use other effects; the user confirmed on
2026-10-17 that their visuals are back after loading too.
## Data-driven arts instead of hardcoded art ids
@@ -125,3 +125,12 @@ in-game texts/tooltips that name the old keys):
Globally bound letters (engine `0x618130`, UI manager `0x757120`): A B C E F
H I L M N O P Q R S T W, Space, ^, digits. Individual windows may use more.
## Potion stacks
Asked 2026-10-17 (after the potion counts on the bottom bar,
`src/mods/potioncounts.cpp`): potions of the same type (e.g. minor healing)
stack in one inventory cell, up to 20 per stack (a full stack starts a new
one). Drag, sell and drop move the whole stack, as with any other item. The
counts on the potion slots then add up the stacks. In progress, see
docs/potion-stacks.md (open: sale price per stack, splitting on the ground).