summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js87
1 files changed, 14 insertions, 73 deletions
diff --git a/rules.js b/rules.js
index 84f5dfa..bfc3847 100644
--- a/rules.js
+++ b/rules.js
@@ -4131,10 +4131,7 @@ function play_demagogue() {
states.demagogue_confirm = {
inactive: "Demagogue",
prompt() {
- if (is_classic())
- prompt("Demagogue: Force all other players to reveal and return a card.")
- else
- prompt("Demagogue: Force all other players to discard a card.")
+ prompt("Demagogue: Force all other players to reveal and return a card.")
view.actions.confirm = 1
},
confirm() {
@@ -4142,32 +4139,11 @@ states.demagogue_confirm = {
log_h3("Demagogue.")
game.demagogue = new Array(get_player_count()).fill(-1)
game.count = game.current
- if (is_classic())
- game.state = "demagogue"
- else
- game.state = "demagogue_v2"
- goto_next_demagogue()
+ game.state = "demagogue"
+ game.current = next_player()
},
}
-function goto_next_demagogue() {
- game.current = next_player()
- if (game.current === game.count) {
- goto_demagogue_reveal()
- return
- }
-
- if (!is_classic()) {
- let limit = 5
- /* TODO: exception for Frumentarii?
- if (game.frumentarii & (1 << game.current))
- limit = 3
- */
- if (current_hand().length < limit)
- goto_next_demagogue()
- }
-}
-
states.demagogue = {
inactive: "Demagogue",
demagogue: true,
@@ -4185,33 +4161,6 @@ states.demagogue = {
},
}
-states.demagogue_v2 = {
- inactive: "Demagogue",
- demagogue: true,
- prompt() {
- prompt("Demagogue: Choose a card to discard (of value 2 or higher if possible).")
- let only_ones = true
- for (let c of current_hand()) {
- if (card_value(c) > 1) {
- only_ones = false
- gen_action_card(c)
- }
- }
- if (only_ones) {
- for (let c of current_hand())
- if (card_value(c) === 1)
- gen_action_card(c)
- }
- },
- card(c) {
- push_undo()
- set_delete(current_hand(), c)
- set_add(current_discard(), c)
- game.demagogue[game.current] = c
- game.state = "demagogue_done"
- },
-}
-
states.demagogue_done = {
inactive: "Demagogue",
demagogue: true,
@@ -4221,11 +4170,10 @@ states.demagogue_done = {
},
done() {
clear_undo()
- if (is_classic())
- game.state = "demagogue"
- else
- game.state = "demagogue_v2"
- goto_next_demagogue()
+ game.state = "demagogue"
+ game.current = next_player()
+ if (game.current === game.count)
+ goto_demagogue_reveal()
},
}
@@ -4234,22 +4182,15 @@ function goto_demagogue_reveal() {
for (let p = 0; p < get_player_count(); ++p) {
if (p !== game.current) {
let c = game.demagogue[p]
- if (c < 0) {
- log(PLAYER_NAME[p] + " unaffected.")
- } else {
- if (is_classic())
- log(PLAYER_NAME[p] + " revealed " + card_name(c) + ".")
- else
- log(PLAYER_NAME[p] + " discarded " + card_name(c) + ".")
- // TODO: skip players who reveal a 1 but govern no provinces
- if (card_value(c) === 1)
- mobs = true
- else
- game.demagogue[p] = -1
- }
+ log(PLAYER_NAME[p] + " revealed " + card_name(c) + ".")
+ // TODO: skip players who reveal a 1 but govern no provinces
+ if (card_value(c) === 1)
+ mobs = true
+ else
+ game.demagogue[p] = -1
}
}
- if (is_classic() && mobs)
+ if (mobs)
game.state = "demagogue_mobs"
else
end_demagogue()