Skip to content

V13.6.0 Captains And Bug Fixes

Choose a tag to compare

@GnollStack GnollStack released this 17 Mar 23:57
· 33 commits to main since this release
bb24387

Squad Combat Initiative v13.6.0

Foundry VTT Compatibility: v13+
D&D 5e System: 5.2.x+

This release introduces per-group initiative calculation modes, a brand-new captain/leader system integrated with the morale module, critical fixes to combatant sorting, and major visual overhauls for the combat tracker.

What's New

Initiative Calculation Modes

Groups can now use different methods to determine their turn order position instead of just relying on averages.

  • 5 Calculation Modes: Choose between Average (default), Highest, Lowest, Median, or Captain.
  • Configuration: Configurable per-group during creation or via the unified Edit Group dialog. You can also set a module-wide default via the new defaultInitiativeMode setting.
  • Auto-Recalculate: Changing the calculation mode on a group that has already rolled immediately recalculates their initiative.
  • Mode Badges: Small icons (arrow up/down, grip lines, crown) now display next to the initiative value in the tracker to indicate non-average modes at a glance.
  • Chat Summaries: Group initiative chat cards now display the active initiative mode and captain name (when applicable) when initiative is finalized.

Captain / Leader System

You can now designate specific combatants as the leaders of their squad.

  • Designation: Assign a captain when creating a group (pick a specific token or choose "Random"), or simply right-click any grouped combatant and select "Set as Captain" / "Remove as Captain".
  • Initiative Integration: When a group's initiative mode is set to "Captain," the squad will use that specific combatant's initiative roll. (Falls back to Average if no captain is set).
  • Visual Indicators: Captains are distinctively marked with a gold crown icon and their name in the group header.
  • Morale Integration: If the morale system is enabled, a captain dropping to 0 HP automatically triggers a group morale check with a dramatic "The Captain Has Fallen!" chat message.
  • Dead Captain Indicator: When a captain is defeated, their name in the group header turns red with a strikethrough, making it immediately obvious that the squad is leaderless.

Visual & UI Improvements

  • Active Group Glow: When it's a grouped combatant's turn, the group header receives a subtle colored glow so you can immediately spot which group is active.
  • Active Combatant Highlight: The specific combatant whose turn it is gets a left border highlight. Note: This now uses the group's color instead of gold, preventing visual clashes with the captain's crown indicator.
  • Initiative Badge Styling: The group initiative value now has a pill/badge background that picks up the group color, making it easier to read.
  • Smoother Member Separators: Borders between group members are lighter and more subtle, with no border at all on the final member.
  • Unified Edit Dialog: The Edit Group dialog now cleanly incorporates initiative mode, captain selection, discipline level, and mob confidence divisor into a single form.

Bug Fixes

  • Critical Sorting Bug #4 : Fixed a massive issue where groups always appeared below ungrouped combatants regardless of initiative. This was resolved by fixing three contributing factors:
    • Removed negative sort property manipulations (-1000) that interfered with Foundry's internal ordering (the dnd5e system relies exclusively on initiative).
    • Negated the group rank offset sign for tiebreaking, ensuring tiebreaker losers correctly appear below the winners when sharing an average initiative.
    • Fixed tracker re-rendering DOM cleanup so grouped combatants are correctly re-inserted at their original initiative-sorted positions instead of appended to the end of the list.
  • Drag-and-Drop Insertion: Fixed insertion sorting applying an extra stagger increment, which could previously push inserted combatants slightly above the group's base initiative.
  • Captain Cleanup: Fixed a bug where captain designation was incorrectly preserved. Captain status is now properly cleared if a combatant is deleted, ungrouped, or dragged to a different group.
  • morale.js — Captain death morale handling logic.
  • styles.css — Styling for the new captain indicators, highlighting, and mode badges.

Acknowledgements

Big thanks to @Rapids00122 for reporting issue #4!