Module artifacts

Source
Expand description

Artifacts — the container a player wears, its six sockets, and the stones that sit in them.

This is the data half of the feature (plan part A). Nothing here fires anything: the ownership stat bonus, the World Law and the Aspect rules read exactly these types plus [configs::artifacts], and live in overlord_event_system.

An artifact is its own collection: it is never an crate::items::Item, never occupies a gear slot, and never rolls attributes.

Four facts shape everything below:

  • One instance per catalog entry, plus a stock of raw copies. Like Trigger/Effect Stones, an artifact is identified by its template. A duplicate drop banks a copy, including after the artifact reaches its maximum level. An explicit upgrade spends the configured rung; grants never change a level by themselves.
  • Exactly one artifact is worn; every owned artifact pays. The ownership stat bonus sums over the whole collection (ArtifactCollection::artifacts), while the World Law is read from ArtifactCollection::equipped only.
  • The sockets belong to the player, not to the artifact. The six ArtifactSocketSlots and the stones in them live on the collection, so “stones transfer when the artifact is swapped” is true by construction: swapping only rewrites ArtifactCollection::equipped and cannot touch a stone.
  • Sockets are typed and non-interchangeable. Which socket a stone fits is a property of its catalog entry, so a Law stone can never enter an Aspect socket and vice versa. The right-hand (Law) column exists structurally here even though its catalog ships empty — its stones need the cores/laws vertical, which is a separate branch.

Structs§

Artifact
The player’s one instance of an artifact template, plus the copies banked against it.
ArtifactCollection
Everything a character owns in the artifact system.
ArtifactSocketColumnIter
An iterator over the variants of ArtifactSocketColumn
ArtifactSocketSlotIter
An iterator over the variants of ArtifactSocketSlot
ArtifactStone
One artifact stone the player owns, and the socket it currently sits in.

Enums§

ArtifactError
Why an artifact operation was refused. Every variant is a rule from the design doc.
ArtifactSocketColumn
Which half of the artifact a socket belongs to.
ArtifactSocketSlot
One of the artifact’s six sockets.

Type Aliases§

ArtifactStoneTemplateId
ArtifactTemplateId