summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js44
1 files changed, 37 insertions, 7 deletions
diff --git a/rules.js b/rules.js
index 5fbc167..c95b1c4 100644
--- a/rules.js
+++ b/rules.js
@@ -948,7 +948,10 @@ states.select_player_with_most_hero_points = {
inactive: 'choose a Player',
prompt() {
const { v } = get_active_node_args();
- view.prompt = v < 0 ? 'Choose player to lose Hero Points' : 'Choose player to gain Hero Points';
+ view.prompt =
+ v < 0
+ ? 'Choose player to lose Hero Points'
+ : 'Choose player to gain Hero Points';
const factions = get_factions_with_most_hero_poins();
for (let faction_id of factions) {
gen_action(faction_player_map[faction_id]);
@@ -1222,10 +1225,36 @@ states.swap_card_tableau_hand = {
}
},
};
+function resolve_take_hero_points(faction) {
+ const { v } = get_active_node_args();
+ const amount = Math.min(v, game.hero_points[faction]);
+ lose_hero_point(faction, amount);
+ gain_hero_points(get_active_faction(), amount);
+ resolve_active_and_proceed();
+}
states.take_hero_points = {
inactive: 'take Hero Points',
prompt() {
- view.prompt = 'Choose a player to take Hero Points from';
+ const { v } = get_active_node_args();
+ view.prompt =
+ v === 1
+ ? 'Choose a player to take a Hero Point from'
+ : `Choose a player to take ${v} Hero Points from`;
+ const active_faction = get_active_faction();
+ for (const faction of role_ids) {
+ if (faction !== active_faction) {
+ gen_action(faction_player_map[faction]);
+ }
+ }
+ },
+ Anarchist() {
+ resolve_take_hero_points(data_1.ANARCHISTS_ID);
+ },
+ Communist() {
+ resolve_take_hero_points(data_1.COMMUNISTS_ID);
+ },
+ Moderate() {
+ resolve_take_hero_points(data_1.MODERATES_ID);
},
};
states.use_organization_medallion = {
@@ -1487,14 +1516,15 @@ function gain_hero_points_in_player_order(factions, value) {
}
}
}
-function gain_hero_points(faction_id, value) {
+function gain_hero_points(faction_id, value, skip_abilities = false) {
if (game.hero_points.pool === 0) {
return;
}
- if ((faction_id === data_1.ANARCHISTS_ID &&
- (game.active_abilities || []).includes(data_1.ANARCHIST_EXTRA_HERO_POINT)) ||
- (faction_id === data_1.COMMUNISTS_ID &&
- (game.active_abilities || []).includes(data_1.COMMUNIST_EXTRA_HERO_POINT))) {
+ if (!skip_abilities &&
+ ((faction_id === data_1.ANARCHISTS_ID &&
+ (game.active_abilities || []).includes(data_1.ANARCHIST_EXTRA_HERO_POINT)) ||
+ (faction_id === data_1.COMMUNISTS_ID &&
+ (game.active_abilities || []).includes(data_1.COMMUNIST_EXTRA_HERO_POINT)))) {
value++;
}
const gain = Math.min(game.hero_points.pool, value);