public static class ItemAffixesTurns an instance's seed back into the affixes it rolled.
Remarks
Regenerated, never stored. Doc 28 § Items: rolled affixes are (affixDefId, roll) pairs regenerated from the seed. That is what keeps an instance at sixteen bytes, and it is also what makes a client's tooltip and a realm's damage calculation agree while the wire carries a definition id and a seed.
⚠ Therefore the roll is a pure function of (template, seed) and nothing else — no clock, no player, no ambient random. Everything it consumes is either the seed or content both ends already agreed on, and TheSameSeedRollsTheSameAffixes is the test that keeps it that way.
⚠ An item whose pool changed re-rolls, and there is no way around that. The pool a seed picks from is part of what the seed means, so adding an affix to a pool changes what every existing instance of every item using it has rolled. That is a content decision with a visible consequence — a player's sword changes — and the honest place to say so is here and in ContentDiff, not in a migration that pretends otherwise.
Fields and properties (1)
public const int MaximumHow many affixes one instance can carry. A bound, so a roll can use the stack.
Methods (2)
public static int Roll(ItemTemplate item, uint seed, Span<RolledAffix> into)Rolls an instance's affixes.
public static RolledAffix[] Roll(ItemTemplate item, uint seed)Rolls an instance's affixes into a new array. For an editor and a test, not a frame.
Used by (2)
- ItemAffixTestsVixen.Gameplay.Items.Tests
- ItemStatsVixen.Gameplay.Items