A ValueModifier specialized for damage/impact calculation — the amount of harm delivered by an attack or effect before defenses and resistances are applied.

An impact has three parts:

  • Dice — a SimpleRoll defining the random component (e.g., 2d6 for a broadsword). Access via numDice and die.
  • Modifier — the ValueModifier base + deltas (strength bonus, weapon quality, situational effects).
  • Aspect — the damage type (ImpactAspect): blunt, edged, piercing, or fire. Determines which protection values defend against this impact.
  • diceFormula — human-readable formula string, e.g. "2d6+3"
  • label — formula with aspect suffix, e.g. "2d6+3e" (edged)
  • evaluate — rolls the dice (if not already rolled) and returns the total impact value (dice + effective modifier)

Automatically disabled when both dice and effective modifier are zero, meaning the strike deals no damage. Can also be explicitly disabled via the inherited disabled property.

Created from strike mode data during combat resolution. The base modifier comes from the weapon/technique's impact base, and deltas are added for strength, quality, and situational factors before evaluate is called.

Hierarchy (View Summary)

Constructors

Properties

baseValue?: number

The base value before deltas (undefined until set; treated as 0 by base).

customFunction?: Function

Handler invoked by a CUSTOM delta to compute a value, when one is used.

The list of ValueDelta modifiers applied on top of the base.

disabledReason: string

Reason the value is disabled as an i18n key; empty string means enabled. Localize for display via disabledLabel. See disabled.

Accessors

  • get chatHtml(): string
  • Render the deltas as an HTML breakdown (name + adjustment per row) for chat cards and tooltips; when disabled, renders the localized disabled reason instead.

    Returns string

  • get deltaLabel(): string
  • A compact, human-readable summary of how the value is derived: the base contribution followed by each applied delta (e.g. Base +30, SSMod +25), or the disabled marker (Dsbl) when disabled. An unmodified value still summarizes as Base +N, so the summary is never empty for an enabled value.

    Named deltaLabel — not shortcode — because a ValueModifier's derivation summary is unrelated to the document system.shortcode identity key used across the rest of the system.

    Returns string

  • get disabled(): string
  • Beyond the inherited disabled reason, an impact is disabled automatically when it would deal no damage — both the dice and the effective modifier are zero.

    Returns string

  • get disabledLabel(): string
  • The disabled reason localized for display, or "" when enabled.

    disabledReason always stores an i18n key (never localized prose), so callers that surface the reason to a human must localize it here rather than emitting the raw key (#948). Idempotent on already-plain text.

    Returns string

  • get effective(): number
  • The computed effective value — the base with all deltas applied (always 0 when disabled). Recomputed lazily on access.

    Returns number

  • 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 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

  • Fold another modifier into this one, preserving the full auditable derivation: every labeled delta from other (its name, abbrev, operator, and value) is replayed onto this modifier, so the merged result keeps each source justification in its tooltip and this modifier can then layer its own deltas on top.

    Deltas are additiveother's are appended to whatever this modifier already carries (each replayed through the internal _oper, so same-abbrev replacement and OVERRIDE semantics apply, and the clones are re-parented to this modifier). The base is not additive — a modifier has exactly one base — so other's base is adopted only when includeBase is set, and it replaces any existing base rather than adding to it. Omit includeBase to take other's modifiers while keeping this modifier's own base.

    Parameters

    • other: sohl.entity.modifier.ValueModifier

      The modifier to merge from.

    • options: { includeBase?: boolean } = {}

      Merge options.

      • OptionalincludeBase?: boolean

        When set, replace this modifier's base with other's base.

    Returns sohl.entity.modifier.ValueModifier

    this, for chaining.

  • Roll the impact (dice plus effective modifier) once and return the total.

    Returns number

    The total impact. If already rolled, the existing total is returned rather than re-rolling.

  • Whether a delta with the given abbrev is present.

    Parameters

    • abbrev: string

      The delta abbrev to test for.

    Returns boolean

    true if a matching delta exists.

    TypeError if abbrev is not a string.

  • Format the dice term of an impact — "", "d6", or "2d6" — applying the shared convention that a single die drops its redundant count (d6, not 1d6) and that a count of zero (or an absent die size) yields no dice term at all. Shared by diceFormula and the strike-mode sheet's Impact column so both render identically.

    Parameters

    • numDice: number

      The number of dice.

    • die: null | number

      The die size (faces), or null/0 when there is no die.

    Returns string

    The dice term, or an empty string when there are no dice.