flackr/dungeon

Implement tracking of turn progression in combat.

Opened this issue · 0 comments

Summary

Currently, there is no tracking of whose turn it is. Though computerizing the combat alleviates much of the mayhem of players simultaneously announcing their plans, ordering still plays an important role in the game mechanics. In particular, turn order plays an important role in determining when ongoing damage is applied and when effects end, not to mention who draws first blood.

Implementation

Combatants should appear on the combat overview page. The DM can trigger the start of combat, which automatically computes initiative and resorts the combatants into the correct order. New characters dragged onto the map during combat can have their initiative automatically assigned so that they fall into the right order. Groups of monsters of the same type will have the same initiative. In the event of a tie, initiative order can be resolved with a roll off.

When implementing order tracking, it may be best to err on the side of leniency, rather than strictly enforcing game mechanics. A player's start of turn can be denoted by issuing their first order. At this point, any ongoing effects are applied, and if they prevent the order from being completed (e.g. character drops below 0 HP), then the order is cancelled. Given that a player may choose not to move, or to move less then their full allowance, an end of turn button is likely required. Pressing "end of turn" would test for conditions that end, triggering saving throws as needed. For groups of monsters, the "end of turn" could apply to the group, thereby reducing the number of mouse clicks required.

Once a player denotes the end of their turn, powers and moves for their character can be disabled until the start of the next turn. The strictness for enabling and disabling of controls can be made adjustable. The strictest setting would require each player to act in turn. A more lenient approach would allow players to swap positions in the initiative order without involving the game engine. A possible restriction is to divide into hero and monster groups and restrict free initiative swapping to players that are not separated in initiative order by monsters. The leniency allows decisive player B to move while player A is thinking provided player B's action does not impact player A. A wait button may be useful for shifting down in the initiative order.

In any event, the next player in the initiative order can be shown in the combat log even if not strictly adhered to in practice. Additional feedback could be provided on the combat map, possibly with a pointer next to the character whose turn it is. For the DM, the appropriate monster could be auto-selected.