tsiemens/pathfinder-toolkit

Allow manual initiative roll input

Closed this issue · 6 comments

Rolling for initiative is fun for a lot of users.
We should allow for manual input of initiative rolls in the initiative tracker.

How to work this into the UI is undetermined thus far.

Related to this: readied actions can change the ordering of characters' initiative ( http://www.d20pfsrd.com/gamemastering/combat#TOC-Ready ).

Allowing manual editing of initiatives would allow players to insert a character into the correct position in the initiative ordering, as a response to a readied action being triggered.

UI implications may be that editing should be quick-and-easy, and certainly should still be accessible without resetting the encounter.

Yes, this is probably also a good addition. I'm not exactly sure how this relates to the actual roll values themselves though. ie. If you move a player with a lower initiative roll higher than a character with a higher one, should the roll value be automatically adjusted to be higher (or equal)? If not, it could be more difficult to implement, but either way is fine by me.

For the UI, I'd say drag and drop would be the best.

As for the entering of the value itself, maybe we want to just use a dialog.

The rules for delaying an action based on a trigger say:

If the triggered action is part of another character's activities, you interrupt the other character. Assuming he is still capable of doing so, he continues his actions once you complete your readied action. Your initiative result changes. For the rest of the encounter, your initiative result is the count on which you took the readied action, and you act immediately ahead of the character whose action triggered your readied action.

Which seems nice and explicit. However they are talking about updating the number because the ordering wont necessarily be visual. It would be quite feasible for a visual list such as this to keep the original initiative number (which is kind of nice to have, though I don't think it's needed for anything, once combat begins) and track the turn order purely through the visual ordering of characters. The list would be initially sorted by initiative (upon the rolling), and be considered unsorted after that.

Drag and drop sounds good.

Mixed entry rolls should also be possible: When 'Roll initiative!' button is pressed, characters who have not been given a manually entered initiative roll (since the last reset) should then be given a randomly rolled initiative score (just as they currently are all the time). These random rolls, along with the manually entered rolls, can then both be used to determine turn order for their respective characters.

If all characters have manually entered initiative rolls then 'Roll initiative!' should probably be replaced with 'Begin combat!' or something similar.

Initiative is calculated as 1d20+DexMod+MiscellaneousEffects and as a dexterity mod can be negative then valid initiative scores can also be zero or even negative.

Initiative scores that have not been manually entered or rolled should therefore probably display something other than '0'. Perhaps a hyphen '-' to indicate that it has not been filled.

In this case, I would say that we should change the roll value in the data model to an Integer, so it can be null in those cases.

So I did some refactoring with the party model (see fb4e584), which should make some things easier, and in #19. Sorting is now maintained externally, preferably using Collections. I also made a few changes to the list adapter, so it is more clear what is happening.