summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js29
1 files changed, 18 insertions, 11 deletions
diff --git a/rules.js b/rules.js
index b1714dc..e44b8e0 100644
--- a/rules.js
+++ b/rules.js
@@ -1213,25 +1213,32 @@ states.draw_card = {
resolve_active_and_proceed(true);
},
};
+function draw_glory_from_bag() {
+ const index = random(game.bag_of_glory.length);
+ const faction = game.bag_of_glory[index];
+ game.glory.push(faction);
+ game.glory_current_year = game.glory_current_year = [
+ false,
+ false,
+ false,
+ ];
+ game.glory_current_year[faction] = true;
+ array_remove(game.bag_of_glory, index);
+ logi(`Pulled T${faction} from the Bag`);
+}
states.draw_glory = {
inactive: 'draw from the Bag of Glory',
+ auto_resolve() {
+ draw_glory_from_bag();
+ return true;
+ },
prompt() {
gen_spend_hero_points();
view.prompt = 'Draw from the Bag of Glory.';
gen_action('draw_glory');
},
draw_glory() {
- const index = random(game.bag_of_glory.length);
- const faction = game.bag_of_glory[index];
- game.glory.push(faction);
- game.glory_current_year = game.glory_current_year = [
- false,
- false,
- false,
- ];
- game.glory_current_year[faction] = true;
- array_remove(game.bag_of_glory, index);
- logi(`Pulled T${faction} from the Bag`);
+ draw_glory_from_bag();
resolve_active_and_proceed(true);
},
};