Module stones

Source
Expand description

Trigger/Effect Stones — what a player owns, where it sits, how it levels.

The data half of the feature — nothing here fires anything. Trigger evaluation, the global cooldown and effect execution live in overlord_event_system::logic::stones, which reads these types plus configs::stones.

Three facts shape everything below:

  • One instance per catalog entry, plus a stock of raw copies. A stone is identified by its Stone::template_id and carries a Stone::copies count, not N interchangeable rows. Template ids are unique across both catalogs (GameConfig::validate_stones). The consequence: one instance means one socket, so a second insert of the same template is refused with StoneError::AlreadySocketed.
  • Triggers and Effects are separate collections. Never socketable into each other’s sockets and never sharing copies, so two Vecs keyed by StoneKind rather than one list with a flag.
  • A socketed stone never leaves the inventory. Inserting sets Stone::socket, removing clears it — there is no second home for a stone to be lost in.

Structs§

Stone
The one instance a player owns of a catalog entry, plus its stock of raw copies.
StoneInventory
Everything a character owns in the stone system: the two collections, kept apart, plus the socket assignments carried by the stones themselves.
StoneKindIter
An iterator over the variants of StoneKind
StoneSocketKey
Where one socketed stone sits: which equipment slot, which of its three sockets.
StoneSocketSlotIter
An iterator over the variants of StoneSocketSlot
StoneTierIter
An iterator over the variants of StoneTier
UpgradedStonesMap
What one UpgradeAllStones call actually changed: template id -> (from, to) level. Modelled on UpgradedAbilitiesMap and used the same way — the client shows the result window from this, and quests read it for progress.

Enums§

StoneError
Why an insert/remove/upgrade was refused. Every variant is a rule from the design doc, so the caller can report the actual reason instead of a generic failure.
StoneKind
Which of the two collections a stone belongs to.
StoneSocketSlot
One of the three sockets a two-sided equipment slot carries.
StoneTier
Rarity tier of a stone.

Type Aliases§

StoneTemplateId