- 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>
20 lines
552 B
C++
20 lines
552 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
namespace mods::potionstack {
|
|
|
|
// Potions of one type in the stack held by item `id` (1 for any other item).
|
|
unsigned StackCount(uint32_t id);
|
|
|
|
// Sets the stack size of item `id` (1 or less: no stack). Used when loading.
|
|
void SetStackCount(uint32_t id, unsigned count);
|
|
|
|
// cInventoryEntry::ReplaceItemId: the stack follows its item to the new id.
|
|
void OnItemIdReplaced(uint32_t oldId, uint32_t newId);
|
|
|
|
// Forgets all stacks (a save game is about to be loaded).
|
|
void ResetStacks();
|
|
|
|
} // namespace mods::potionstack
|