summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-10-25 13:14:16 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-10-25 13:14:16 +0100
commita8874fde796f8fa563a8a80aa429f3a7c40eec44 (patch)
treee37331f91de4a6d43a0236afa121e2d38435d702 /rules.js
parent7b2084f413b19f3d2bcea32261d29a766ff49b70 (diff)
download1989-dawn-of-freedom-a8874fde796f8fa563a8a80aa429f3a7c40eec44.tar.gz
Added power_card action
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/rules.js b/rules.js
index 44bbef6..0d0dcc3 100644
--- a/rules.js
+++ b/rules.js
@@ -290,6 +290,10 @@ function gen_action_card(card){
gen_action("card", card)
}
+function gen_action_power_card(card){
+ gen_action("power_card", card)
+}
+
function gen_action_sc(space){
gen_action("sc", space)
}
@@ -1280,11 +1284,11 @@ states.raise_stakes_1 = {
gen_action('pass')
}
for (let card of game.valid_cards) {
- gen_action_card(card)
+ gen_action_power_card(card)
}
}
},
- card(card) {
+ power_card(card) {
push_undo()
if (numberless_cards.includes(card)) {
log(`Discarded: P${card}`)
@@ -1343,11 +1347,11 @@ states.raise_stakes_2 = {
gen_action('pass')
}
for (let card of game.valid_cards) {
- gen_action_card(card)
+ gen_action_power_card(card)
}
}
},
- card(card) {
+ power_card(card) {
push_undo()
if (numberless_cards.includes(card)) {
log(`Discarded: P${card}`)
@@ -1401,7 +1405,7 @@ states.power_struggle = {
if (game.valid_cards.length > 0) {
view.prompt = "Play a card."
for (let card of game.valid_cards) {
- gen_action_card(card)
+ gen_action_power_card(card)
}
} else if ( game.valid_cards.length === 0) {
view.prompt = 'No valid cards. You must concede.'
@@ -1413,7 +1417,7 @@ states.power_struggle = {
view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.`
gen_action('concede')
for (let card of game.valid_cards) {
- gen_action_card(card)
+ gen_action_power_card(card)
}
} else if (game.valid_cards.length === 0) {
view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.`
@@ -1432,7 +1436,7 @@ states.power_struggle = {
if (game.tactics_fails !== "Petition") {gen_action('petition')}
}
},
- card(card) {
+ power_card(card) {
push_undo()
discard(card)
game.valid_cards=[]