A single change (delta) applied to a ValueModifier — an operator plus a value, tagged with source labels for auditability.

The op selects how apply combines this delta with a running value (add, multiply, floor, ceiling, override, or custom). Boolean-like values ("true" / "false") are supported for flag-style modifiers; every other operator requires a numeric value.

Hierarchy (View Summary)

Constructors

Properties

Accessors

Methods

Constructors

Properties

abbrev: string

Short abbreviation for the delta's source (used to find or replace it).

name: string

Name of the delta's source as a localization key; localize for display via label.

The operator selecting how this delta combines with the running value.

value: string

The delta's value as a string — numeric, or "true"/"false" for flags.

Accessors

  • get kind(): string
  • The serialization discriminator for this instance — the concrete class's static Kind. Written into the JSON by toJSON under the kind key and read back by sohl.utils.defaultFromJSON to select the constructor. Derived from the class, never stored per-instance.

    Returns string

  • get label(): string
  • The delta's source name localized for display.

    name is a localization key by convention across the system (SOHL.ValueDelta.INFO.*, SOHL.MOD.*, SOHL.MysticalAbility.*, …), so anything surfacing it to a human must localize it here rather than emitting the raw key (#1127) — the same treatment sohl.entity.modifier.ValueModifier.disabledReason got in #948. Idempotent on already-plain text: an unknown key localizes to itself, so an ad-hoc delta named with prose passes through unchanged.

    Returns string

  • get parent(): SohlLogic<any>
  • The Logic that owns this entity. Always present (the constructor rejects a missing parent) and transient — it is not serialized and is re-supplied when the entity is revived or cloned.

    Returns SohlLogic<any>

Methods

  • Apply this delta to a base value according to its op.

    Parameters

    • base: number

      The running value to modify.

    Returns number

    The resulting value.

    TypeError if op is not a valid operator.