Abstract base class for all test results in the combat resolution pipeline.

Every test in SoHL — skill checks, opposed contests, attacks, defenses — produces a result object that captures the outcome, the speaker identity for chat messages, and a reference back to the Logic that initiated the test.

TestResult (abstract)
├── SuccessTestResultd100 roll-under mastery level test
│ ├── AttackResultattacker's roll, with impact dice and aim
│ └── DefendResultdefender's roll with situational modifiers
└── OpposedTestResulttwo competing SuccessTestResults
└── CombatResultattack vs. defense with full combat resolution
  1. Created by a test method (e.g., sohl.entity.modifier.MasteryLevelModifier.successTest).
  2. evaluate is called to resolve the outcome (roll dice, compute success level, etc.). Returns true if the result should be displayed.
  3. Result is posted to chat and/or consumed by the next stage of the pipeline (e.g., an AttackResult feeds into a CombatResult).

Results are not persisted to the database — they exist transiently during resolution and are displayed via chat cards.

Hierarchy (View Summary)

Constructors

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

  • Resolve the test outcome. The base implementation is a no-op that returns true; subclasses override it to roll dice, compute success levels, and apply mishaps.

    Returns Promise<boolean>

    true if the result should be displayed (e.g. posted to chat); false if the test was cancelled or is not allowed to proceed.

  • Serialize this result to a plain, persistable object. Results are not stored in the database, but this is used to pass a result between clients (e.g. embedding an evaluated AttackResult in a chat card so the defender's client can reconstruct it).

    Returns PlainObject

    A plain object representation of this result.