Skip to content

ResolveBattleRound

Resolve one battle round: one declaration per living, able party member.

Full documentation: ResolveBattleRound. Wire type: resolve_battle_round.

Legal session modes: battle

JSON Schema

{
  "$defs": {
    "BattleDeclaration": {
      "description": "One party member's declared action for a battle round.\n\n`attack` names a target group and optionally a wielded weapon (`None` is\nunarmed); `cast` names the spell, mode, form, and targets; `move` is the\nrange-track intent; `use_item` covers thrown splash items against a group.\nTurn undead resolves in the magic phase but is never disruptable \u2014 turning is\na class ability, not a spell.",
      "properties": {
        "character_id": {
          "title": "Character Id",
          "type": "string"
        },
        "action": {
          "enum": [
            "attack",
            "cast",
            "turn_undead",
            "move",
            "use_item",
            "hold"
          ],
          "title": "Action",
          "type": "string"
        },
        "target_group_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Target Group Id"
        },
        "weapon_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Weapon Id"
        },
        "spell_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Spell Id"
        },
        "spell_mode": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Spell Mode"
        },
        "reversed": {
          "default": false,
          "title": "Reversed",
          "type": "boolean"
        },
        "targets": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Targets",
          "type": "array"
        },
        "move": {
          "anyOf": [
            {
              "enum": [
                "close",
                "withdraw",
                "fighting_withdrawal",
                "retreat"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Move"
        },
        "item_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Item Id"
        }
      },
      "required": [
        "character_id",
        "action"
      ],
      "title": "BattleDeclaration",
      "type": "object"
    }
  },
  "description": "Resolve one battle round: one declaration per living, able party member.\n\nA battle must be underway (see\n[`EngageBattle`][osrlib.crawl.commands.EngageBattle]). Validation is the pure\npre-phase: every declaration validates or the whole command rejects listing\nevery rejection \u2014 partial acceptance would tangle the replay contract.\n\nModes:\n    `battle`\n\nRejections:\n    - `session.command.wrong_mode` \u2014 no battle is underway.\n    - `battle.none_active` \u2014 defensive twin of the mode gate; not reachable\n      through normal play.\n    - `battle.declaration.roster_mismatch` \u2014 the declarations do not name\n      exactly the living, able members.\n    - `battle.declaration.unknown_action` \u2014 an unrecognized `action`.\n    - Move declarations: `battle.declaration.missing_move`,\n      `battle.declaration.unknown_group`, `battle.declaration.cannot_move`.\n    - Attack declarations: `battle.declaration.unknown_group`,\n      `battle.declaration.no_target`, `battle.declaration.weapon_not_wielded`,\n      `battle.declaration.not_in_front_rank`, and the kernel attack checks \u2014\n      `combat.attack.out_of_reach`, `combat.attack.out_of_range`,\n      `combat.attack.reload`, `combat.attack.attacker_incapacitated`,\n      `combat.attack.attacker_blind`.\n    - Cast declarations: `battle.declaration.missing_spell`,\n      `battle.declaration.unknown_group`,\n      `battle.declaration.invisible_target`, and the cast checks \u2014\n      `magic.cast.unknown_spell`, `magic.cast.silenced_area`,\n      `magic.cast.unknown_mode`, `magic.cast.unknown_target`,\n      `magic.cast.not_memorized`, `magic.cast.caster_incapacitated`,\n      `magic.cast.caster_restrained`, `magic.cast.anti_magic_shell`,\n      `magic.cast.not_reversible`, `magic.cast.target_count`,\n      `magic.cast.out_of_range`.\n    - Turn-undead declarations: `magic.turning.not_a_turner`,\n      `magic.turning.caster_incapacitated`.\n    - Item declarations: `battle.declaration.item_unusable`,\n      `battle.declaration.unknown_group`, `battle.declaration.no_target`,\n      `items.use.not_usable`, `items.device.inert`, `items.scroll.spent`,\n      `items.scroll.no_such_spell`, `items.scroll.wrong_caster`,\n      `exploration.action.requires_light`, `combat.attack.out_of_reach`.\n\nEvents:\n    [`BattleRoundEvent`][osrlib.crawl.events.BattleRoundEvent] opens the round;\n    declared casts post as\n    [`SpellDeclaredEvent`][osrlib.crawl.events.SpellDeclaredEvent]s;\n    [`InitiativeRolledEvent`][osrlib.core.events.InitiativeRolledEvent] orders\n    the sides. The phases then report themselves \u2014 movement, missiles, magic,\n    melee: attack and damage rolls, saving throws, casts and disruptions,\n    morale checks, routs and defeats \u2014 each its own event. A terminal round\n    appends [`BattleEndedEvent`][osrlib.crawl.events.BattleEndedEvent] and the\n    encounter's conclusion, or\n    [`GameOverEvent`][osrlib.crawl.events.GameOverEvent] on a party wipe.",
  "properties": {
    "command_type": {
      "const": "resolve_battle_round",
      "default": "resolve_battle_round",
      "title": "Command Type",
      "type": "string"
    },
    "declarations": {
      "default": [],
      "items": {
        "$ref": "#/$defs/BattleDeclaration"
      },
      "title": "Declarations",
      "type": "array"
    }
  },
  "title": "ResolveBattleRound",
  "type": "object"
}