diff options
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -2,6 +2,17 @@ /* global data, view, send_action, action_button, player */ +const dice_text_map = { + "1-3": "1/2/3", + "2-4": "2/3/4", + "3-5": "3/4/5", + "4-6": "4/5/6", + "(1-3)": "(1/2/3)", + "(2-4)": "(2/3/4)", + "(3-5)": "(3/4/5)", + "(4-6)": "(4/5/6)", +} + const wing_name = [ "red", "pink", "blue", "dkblue" ] const side_color = [ "red", "red", "blue", "blue" ] const reactions = [ "Screen", "Counterattack", "Absorb" ] @@ -199,9 +210,14 @@ function create_formation_card(id, tip=false) { } if (card.dice) { + let dice_text = dice_text_map[card.dice] || card.dice + dice_text = dice_text.replaceAll("-", " – ") + dice_text = dice_text.replaceAll("/", " / ") + dice_text = dice_text.replace("(", "( ") + dice_text = dice_text.replace(")", " )") if (card.morale === 2) append_div(e, "star", '★') - append_div(e, "dice_area", card.dice) + append_div(e, "dice_area", dice_text) } function create_action(a, ix) { |