The attacker's side of a combat exchange — a SuccessTestResult with attack-specific data (the impact formula and the targeted body part).

  • impact — the impact (damage) formula/capability for this attack (e.g. 2d6+5 edged). It is not rolled here: when the blow actually lands, CombatResult produces an ImpactResult from this modifier (the roll happens then). Final damage is determined downstream by impact resolution against the target's armor/body location.
  • aimBodyPartCode — the targeted body part shortcode, carried through to the defense resume and the injury card.

evaluate performs the attack roll, determines success/failure, and checks for attack-specific mishaps (stumble, fumble, missile misfire). On a self-miss it disables impact; it does not roll impact (that is done when the blow lands).

Hierarchy (View Summary)

Constructors

Properties

The attacking combatant's logic, resolved in the constructor from the persisted data.combatantUuid (a uuid on the wire, the live logic in memory).

The impact (damage) formula/capability for this attack, e.g. 2d6+5 edged. Not rolled here — CombatResult produces an ImpactResult from it only when the blow lands. evaluate disables it on a miss.

label: string

The label for the weapon or form of attack result (shown on card).

The live strike mode for this attack (pointer-on-wire, live-in-memory). undefined when the weapon is not present on the current client (e.g. the defending client during cross-client combat resolution).

rollMode: string

Foundry roll mode (public / private GM / blind / self) used when posting to chat.

Accessors

  • get aimBodyPartCode(): string
  • The body part shortcode this attack aims at (empty when unaimed). Read-through to impact — the single source of truth.

    Returns string

  • get canFate(): boolean
  • Whether a Fate Point may be spent on this test — true only when the owning item has an eligible, charged Fate Mystery (availableFate) and the test permits it. Fate is a post-roll success-level bump, never a re-roll: a spend raises this result's stored successLevel (#854).

    Returns boolean

  • get critAllowed(): boolean
  • Whether criticals are possible — i.e. the modifier defines any critical success or failure digits.

    Returns boolean

  • get description(): string
  • Human-readable description shown on the result's chat card.

    Returns string

  • get fateSkillCode(): null | string
  • The shortcode of the skill an attack's Fate is rolled against — the melee skill behind this strike mode (its assocSkillCode), not the weapon item itself. A caller resolves it against the actor (e.g. with sohl.document.item.logic.resolveAssocSkill) to reach that skill's fateMasteryLevel and availableFate, then runs its fateTest with this result as context.scope.priorTestResult (#854). null when the mode names no skill (an untrained/innate strike).

    Returns null | string

  • get isCapped(): boolean
  • Whether the effective mastery level was constrained (capped) below its raw effective value.

    Returns boolean

  • get isCritical(): boolean
  • Whether this result is a critical (success or failure). Always false when critAllowed is false — except a forced auto-Critical-Failure (#568), which is always critical.

    Returns boolean

  • get isSuccessValue(): boolean
  • Whether this is a Success Value test (#848) — its roll is graded into a Success Value and Success Stars rather than a plain pass/fail. Drives the card's Success Value / Success Stars rows.

    Returns boolean

  • 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 lastDigit(): number
  • The ones digit of the roll total, tested against the modifier's critical digit lists.

    Returns number

  • get mishaps(): Set<string>
  • Set of mishap codes flagged for this result (e.g. fumble, stumble); lazily initialized.

    Returns Set<string>

  • get name(): string
  • Internal identifier for this result (distinct from the display title).

    Returns string

  • get normSuccessLevel(): number
  • Success level normalized to the canonical four-point scale (−1/0/1/2) from isSuccess and isCritical. Opposed and combat resolution compare two results by this value.

    Returns number

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

  • get rawSuccessLevel(): number
  • Success level before the four-point clamp — the stored level with every successLevelMod folded in, so it can sit outside −1…2 (a Critical Failure pushed down by −1 reads −2).

    Returns number

    Opposed resolution compares this rather than successLevel because a contest's victory margin has no ceiling: each step between the two levels is one Victory Star, and a modifier that shifts a level widens the margin accordingly. Everything that asks "did it succeed, and how well?" wants the clamped successLevel / normSuccessLevel instead.

  • get resultDesc(): string
  • Longer result description for the chat card, derived on read from the description table (empty when no table is supplied). Never stored — see successStars.

    Returns string

  • get resultText(): string
  • Short result label for the chat card, derived on read from the description table (empty when no table is supplied). Never stored — see successStars.

    Returns string

  • get successLevel(): number
  • Success level clamped to the four-point scale: critical failure (−1), marginal failure (0), marginal success (1), or critical success (2). The raw internal level (which successLevelMod can push beyond this range) is normalized here.

    Returns number

  • get successStars(): number
  • Number of success "stars" (quality grade), derived on read from the description table. Never stored (issue #205) — recomputed from the table plus the evaluated success level / target value / roll last-digit.

    Returns number

  • get targetValue(): number
  • The test's target value — targetValueFunc(successLevel). For a plain success test this is just the success level; success-value tests map it to a quality/quantity outcome used to index the description table.

    Returns number

Methods

  • Raise this result's stored success level by delta — the post-roll Fate bump (#854). This mutates the already-settled outcome: it does not re-roll and does not re-evaluate. Because the outcome text/stars are derived on read (see resultText / successStars), re-posting the card after a bump re-resolves the description table against the new level automatically.

    Fate is defined as successLevel += delta on the original result's stored level; the successLevel getter re-clamps to the four-point scale on read (e.g. a marginal failure bumped by +2 reads as a critical success).

    Parameters

    • delta: number

      Success levels to add (Fate contributes +1 or +2).

    Returns this

    This result, for chaining.

  • Roll the attack and apply attack-specific outcomes on top of the base SuccessTestResult.evaluate.

    Returns Promise<boolean>

    false if the base evaluation disallows the result; otherwise true.

    On a failed roll this flags mishaps from a critical failure — for melee, fumble (last digit 0) or stumble (last digit 5); for missile, fumble (0) or misfire (5) — and disables impact ("Attack missed"). Impact is never rolled here; that happens in CombatResult when the blow lands.

  • Extend the base test dialog with an impact situational modifier: the value entered in the dialog is added to impact (as a PLAYER delta) before the supplied callback is chained.

    Parameters

    • data: PlainObject = {}

      Base dialog data; this override injects impact.

    • callback: (formData: StrictObject<string | number>) => void

      Invoked with the submitted form data after the impact modifier is applied.

    Returns Promise<any>

    The dialog result from the base SuccessTestResult.testDialog.

  • Serialize to a plain object satisfying AttackResult.Data: the inherited SuccessTestResult fields plus the combatant reference, strike-mode pointer, impact modifier, aim, spread, and label.

    Returns PlainObject

    The plain-object representation.

    The combatant is persisted by combatantUuid (resolved back in the constructor). situationalModifier is deliberately not emitted — it was folded into masteryLevelModifier as a PLAYER delta at construction and is already carried by that modifier's serialized deltas; re-emitting it would double-apply on revival.