buttonmen-dev/buttonmen — pull request #1049 by cgolubi1 (2014-06-25 03:34:20+00:00)
Title: draft UI for fire skill

This implements the UI component for #258, a die-table style page which can be used to turn down Fire dice. I believe accepting this pull should be harmless, since it responds to a game state, ADJUST_FIRE_DICE, which the backend never produces.

A couple of comments about implementation decisions i made here:
* The `adjustFire` API call takes arguments very similar to `reactToInitiative`, because i patterned the Fire stuff off Focus. So it needs an action argument, which is either `turndown` or `cancel`, and, if it's `turndown`, the additional arguments are `dieIdxArray` and `dieValueArray`
* I didn't modify the frontend to expect die->min, because i just wound up taking advantage of the existing `Game.dieValidTurndownValues()` function which i had written for Focus. Once die->min is available, that function should be rewritten to use die->min, but, until it's available, no point breaking Focus turndown.
* I realised the UI will need some properties to identify the dice which are participating in the attack which is in progress. (I called those properties `IsAttacker` and `IsAttackTarget`, but rename them if you don't like those.) At a minimum, these are needed because, if a Fire die is participating in the skill attack as an ordinary skill die, then it cannot also be turned down as a Fire die, and the UI needs to know that and not offer the option. (In fact, this is the situation in my example game 22 --- Adam Spam is attacking, and is doing a skill attack using F(6) and (6) which fall short of the necessary value. So Adam Spam's F(4) can be used in the Fire turndown, but the F(6) can't.) It's also useful to have the information so it can be shown to the player, which i believe i do by highlighting the involved dice, and by telling the player how many sides they need to turn down.

Jenkins: http://jenkins.buttonweavers.com:8080/job/buttonmen-cgolubi1/301/