Skip to content

MoraleCheckedEvent

A morale check: referee visibility — players learn the outcome from behavior.

Full documentation: MoraleCheckedEvent. Wire type: morale_checked.

Default visibility: referee

Message codes: combat.morale.broke, combat.morale.exempt, combat.morale.held

JSON Schema

{
  "$defs": {
    "Visibility": {
      "description": "Who may see an event.\n\nThe wire values are `\"player\"` and `\"referee\"` \u2014 lowercase, serialized into every\nevent; changing them is a `schema_version` bump.",
      "enum": [
        "player",
        "referee"
      ],
      "title": "Visibility",
      "type": "string"
    }
  },
  "description": "A morale check: referee visibility \u2014 players learn the outcome from behavior.\n\nEmitted by [`check_morale`][osrlib.core.combat.check_morale]. `code` is\n`combat.morale.held` or `combat.morale.broke` for a rolled check, or\n`combat.morale.exempt` when the score is 2 (never fights) or 12 (never checks)\nand no roll is made.",
  "properties": {
    "code": {
      "title": "Code",
      "type": "string"
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "referee"
    },
    "event_type": {
      "const": "morale_checked",
      "default": "morale_checked",
      "title": "Event Type",
      "type": "string"
    },
    "subject": {
      "title": "Subject",
      "type": "string"
    },
    "score": {
      "title": "Score",
      "type": "integer"
    },
    "roll": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Roll"
    },
    "modifier": {
      "default": 0,
      "title": "Modifier",
      "type": "integer"
    }
  },
  "required": [
    "code",
    "subject",
    "score"
  ],
  "title": "MoraleCheckedEvent",
  "type": "object"
}