Skip to content

Combat, Initiative & Stealth ​

Elthoria owns initiative order, round numbers, the current actor, action/resource expenditure, adjudicated combat commands, and hidden-NPC stealth state machines. A tracker is always campaign-scoped and never leaks across campaigns.

TIP

Looking for how the combat rules engine, square geometry, and stealth state machine work? Read Combat, Rules Engine & Stealth Runtime Deep Dive (Developers) or How Combat, Movement & Stealth Work (Game Masters).


Initiative & encounter lifecycle (CombatMcpTools) ​

ToolPurpose
start_combatStart a campaign-scoped combat encounter with optional PCs and NPCs
end_combatEnd the active encounter and clear the initiative tracker
add_combatantAdd exactly one character, NPC, or custom-named combatant
remove_combatantRemove a combatant by exactly one of entry ID, entity ID, or name
roll_initiativeRoll initiative for one combatant (by entry ID, entity ID, or name)
reroll_initiativeReroll initiative for all combatants and re-sort turn order
set_initiativeSet a combatant's initiative explicitly (either total initiative or raw roll)
list_combatantsList all combatants in sorted initiative order
get_combat_statusReturn active round, turn order, and current acting combatant
show_initiative_trackerRead-only display descriptor for the campaign's active initiative tracker
next_turn / previous_turnAdvance or step back through the turn order (triggers round-advance listeners and timed effect ticks)
apply_buff / remove_buff / toggle_buff / list_active_buffsCombat-shortcut buff management

Combat actions, spells & resource pools (CombatActionMcpTools) ​

ToolPurpose
recommend_combat_actionRank legal combat actions using explainable QE (Quadratic-Energy) nested QBAF tactical reasoning (CombatTacticalDecisionService)
roll_weapon_attackRoll an attack with a specific equipped weapon including all active bonuses
roll_damageRoll damage for a weapon attack (including strength, enhancement, and bonus effects)
get_attack_bonus_breakdownInspect every modifier contributing to an attack roll
cast_spellCast a spell and consume the corresponding spell slot or prepared copy
use_spell_slot / get_spell_slots_remaining / reset_spell_slotsTrack and reset daily spell slots (e.g., on long rest)
use_resource / restore_resource / get_resource_status / get_all_resource_statusSpend, restore, or inspect class resource pools (ki points, rage rounds, bardic performance, channel energy, etc.)
reset_resource / reset_all_resourcesReset one or all resource pools after rest
list_resource_pools / get_resource_pool / create_resource_pool / update_resource_pool / delete_resource_poolDefine and manage custom class resource pools with level progression

Adjudicated combat commands (GM-only, idempotent) ​

For strict, receipt-backed tactical adjudication on an activated battle board, use the trusted-local GM combat command pair in CombatMcpTools:

ToolPurpose
get_combat_command_stateRead persisted trusted-local GM combat command state with explicit campaign/tracker IDs (not player-safe)
execute_combat_commandExecute an explicit adjudicated combat command with idempotency receipts: HP adjustments, prepared-spell expenditure, single-strike adjudicate_npc_melee, and rules-checked ground movement (adjudicate_npc_move, adjudicate_pc_move)

WARNING

GM-only visibility & movement boundaries. get_combat_command_state and execute_combat_command are not player-safe — never dump raw GM tactical snapshots directly into player-facing panels. For ordinary ground movement on a tactical board, configure movement first via apply_tactical_board_command (configure-movement with square-single-cell-ground.v1 or .v2), then execute legal combat moves via execute_combat_command (adjudicate_npc_move / adjudicate_pc_move). Board-editor moves via apply_tactical_board_command are GM placement edits, not legal combat movement.


AI Stealth NPC runtime (StealthNpcMcpTools) ​

Elthoria includes a dedicated Pathfinder 1e stealth state machine (elthoria-gameplay-runtime — StealthRuntime, SquarePerceptionGeometry) so hidden foes can stalk the party without the GM leaking their location in prose:

ToolPurpose
initialize_stealth_npcInitialize an AI-controlled stealthed NPC for a campaign and generate its opening queued plan
plan_stealth_movesQueue additional tactical stealth moves (queued only — nothing executes yet)
execute_stealth_moveExecute the next queued move and apply Pathfinder 1e stealth posture effects
get_stealth_npcInspect a stealthed NPC's persisted visibility (hidden, visible, invisible, greater_invis), active Stealth check result, and queued moves
set_stealth_visibilityUpdate physical visibility or trigger rehide: true
stealth_perception_checkRun a character's Perception check against the NPC's active Stealth result using square perception geometry
dismiss_stealth_npcCleanly remove the NPC's stealth state when combat ends or the NPC withdraws

  • Resources: combat://current, combat://encounters
  • Prompts: combat_tactics, describe_attack, describe_spell, run_combat_encounter, generate_encounter, generate_treasure

Follow Walkthrough 2: Tactical Combat, Initiative & Stealth for a complete multi-round encounter from board activation to stealthed ambush and combat teardown.

Built on the upstream Kompile harness. Released under the MIT License.