summaryrefslogtreecommitdiff
path: root/rules.ts
diff options
context:
space:
mode:
Diffstat (limited to 'rules.ts')
-rw-r--r--rules.ts40
1 files changed, 24 insertions, 16 deletions
diff --git a/rules.ts b/rules.ts
index 2e386a1..bb64184 100644
--- a/rules.ts
+++ b/rules.ts
@@ -1509,30 +1509,38 @@ states.draw_card = {
},
};
+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);
},