summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js69
1 files changed, 68 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index 8dc2b2e..5a5445b 100644
--- a/rules.js
+++ b/rules.js
@@ -348,7 +348,62 @@ states.activate_icon = {
inactive: 'activate an icon',
prompt() {
view.prompt = 'Choose an icon to activate';
- }
+ const c = cards[game.chosen_cards[get_active_faction_id()]];
+ for (const i of c.icons) {
+ gen_action(i);
+ }
+ },
+ add_to_front() {
+ resolve_active_and_proceed();
+ },
+ collectivization() {
+ move_track(data_1.COLLECTIVIZATION, get_icon_count_in_tableau('collectivization'));
+ resolve_active_and_proceed();
+ },
+ d_collectivization() {
+ move_track(data_1.COLLECTIVIZATION, -1 * get_icon_count_in_tableau('d_collectivization'));
+ resolve_active_and_proceed();
+ },
+ d_foreign_aid() {
+ move_track(data_1.FOREIGN_AID, -1 * get_icon_count_in_tableau('d_foreign_aid'));
+ resolve_active_and_proceed();
+ },
+ d_government() {
+ move_track(data_1.GOVERNMENT, -1 * get_icon_count_in_tableau('d_government'));
+ resolve_active_and_proceed();
+ },
+ d_liberty() {
+ move_track(data_1.LIBERTY, -1 * get_icon_count_in_tableau('d_liberty'));
+ resolve_active_and_proceed();
+ },
+ d_soviet_support() {
+ move_track(data_1.SOVIET_SUPPORT, -1 * get_icon_count_in_tableau('d_soviet_support'));
+ resolve_active_and_proceed();
+ },
+ draw_card() {
+ resolve_active_and_proceed();
+ },
+ foreign_aid() {
+ move_track(data_1.FOREIGN_AID, get_icon_count_in_tableau('foreign_aid'));
+ resolve_active_and_proceed();
+ },
+ government() {
+ move_track(data_1.GOVERNMENT, get_icon_count_in_tableau('government'));
+ resolve_active_and_proceed();
+ },
+ government_to_center() { },
+ liberty() {
+ move_track(data_1.LIBERTY, get_icon_count_in_tableau('liberty'));
+ resolve_active_and_proceed();
+ },
+ soviet_support() {
+ move_track(data_1.SOVIET_SUPPORT, get_icon_count_in_tableau('soviet_support'));
+ resolve_active_and_proceed();
+ },
+ teamwork_on() {
+ game.bonuses[data_1.TEAMWORK_BONUS] = data_1.ON;
+ resolve_active_and_proceed();
+ },
};
states.add_glory = {
inactive: 'add tokens to the Bag of Glory',
@@ -820,6 +875,18 @@ function get_active_faction_id() {
function get_faction_id(player) {
return player_faction_map[player];
}
+function get_icon_count_in_tableau(icon, faction = get_active_faction_id()) {
+ let count = 0;
+ for (const c of game.tableaus[faction]) {
+ const card = cards[c];
+ for (const i of card.icons) {
+ if (i === icon) {
+ ++count;
+ }
+ }
+ }
+ return count;
+}
function get_player(faction_id) {
return faction_player_map[faction_id];
}