diff options
Diffstat (limited to 'rules.ts')
-rw-r--r-- | rules.ts | 47 |
1 files changed, 45 insertions, 2 deletions
@@ -766,8 +766,12 @@ states.activate_icon = { inactive: 'activate an icon', prompt() { gen_spend_hero_points(); - view.prompt = 'Choose an icon to activate'; const c = cards[game.played_card] as PlayerCard; + + view.prompt = 'Morale Bonus: '; + view.prompt += join_oxford_comma(c.icons.map(get_icon_name), "or"); + view.prompt += '.'; + for (const i of c.icons) { const count = get_icon_count_in_tableau(i); let direction = 0; @@ -1819,7 +1823,7 @@ function set_player_turn_prompt({ } else if (can_spend_hp) { view.prompt = 'Spend Hero Points.'; } else { - view.prompt = 'End turn.'; + view.prompt = 'Player Turn: Done.'; } } @@ -3562,6 +3566,45 @@ function get_player_order_in_game( return order; } +function join_oxford_comma(list: string[], conjunction: string) { + let n = list.length + if (n == 0) + return "nothing"; + if (n == 1) + return list[0]; + if (n == 2) + return list[0] + " " + conjunction + " " + list[1]; + let result = list[0]; + for (let i = 1; i < n; ++i) { + result += ", "; + if (i == n - 1) + result += conjunction + " " + result += list[i]; + } + return result +} + +const icon_names = { + add_to_front: "+1 to Front", + collectivization: "Increase Collectivization", + foreign_aid: "Increase Foreign Aid", + liberty: "Increase Liberty", + soviet_support: "Increase Soviet Support", + government: "Increase Government", + d_collectivization: "Decrease Collectivization", + d_foreign_aid: "Decrease Foreign Aid", + d_government: "Decrease Government", + d_liberty: "Decrease Liberty", + d_soviet_support: "Decrease Soviet Support", + government_to_center: "Move Government to Center", + teamwork_on: "Turn on Teamwork Bonus", + draw_card: "Draw a Card", +} + +function get_icon_name(icon: Icon): string { + return icon_names[icon] +} + function get_source_name(source: EffectSource): string { switch (source) { case 'player_event': |