diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-01-19 01:17:13 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-01-19 01:39:56 +0100 |
commit | 173134273c1e7a8d78be78d7f409e822f4163250 (patch) | |
tree | 741fdf442f6f7f5d7ff3b34ae875cdc3bc2e5ccf /rules.js | |
parent | 9cece5f15be75f7518b1c0c374dd13737d276e47 (diff) | |
download | time-of-crisis-173134273c1e7a8d78be78d7f409e822f4163250.tar.gz |
v3: updated demagogue to place mobs and get votes.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 62 |
1 files changed, 59 insertions, 3 deletions
@@ -1370,6 +1370,7 @@ function goto_start_turn() { game.combat_legacy = 0 if (is_deluxe()) { + game.demagogue = 0 game.umarket = 0 game.uport = 0 } @@ -2657,10 +2658,14 @@ function remove_governor(where, verbose) { function place_governor(where, new_governor) { eliminate_militia(where) - set_mobs(where, 0) remove_quaestor(where) remove_emperor_token(where) + if (is_deluxe() && game.demagogue & (1 << where)) + log(get_mobs(where) + " mobs remain.") + else + set_mobs(where, 0) + let old_governor = get_province_governor(where) if (old_governor >= 0) { log("Replaced " + PLAYER_NAME[old_governor/6|0] + ".") @@ -2733,6 +2738,11 @@ function calc_extra_votes() { // Populace Emperor disadvantage votes if (game.where === ITALIA && is_populace_emperor()) n += 2 + // Demagogue v3 votes from mob + if (is_deluxe()) { + if (game.demagogue & (1 << game.where)) + n += get_mobs(game.where) + } return n } @@ -4121,11 +4131,16 @@ function play_triumph() { // TODO: skip players who have no turn left (auto-select worst card?) function can_play_demagogue() { - return !used_card_event(CARD_P4X) && !used_card_event(CARD_P4X_V2) + if (is_classic()) + return !used_card_event(CARD_P4X) && !used_card_event(CARD_P4X_V2) + return true } function play_demagogue() { - game.state = "demagogue_confirm" + if (is_classic()) + game.state = "demagogue_confirm" + else + goto_demagogue_v3() } states.demagogue_confirm = { @@ -4231,6 +4246,47 @@ function end_demagogue() { resume_take_actions() } +// === DEMAGOGUE (V3) === + +function goto_demagogue_v3() { + game.state = "demagogue_v3" + game.count = 3 +} + +states.demagogue_v3 = { + inactive: "Demagogue", + prompt() { + prompt("Demagogue: Place 1-3 mobs in any province.") + view.color = POPULACE + for (let where = 0; where < 12; ++where) { + if (!is_own_province()) + gen_action_region(where) + } + }, + region(where) { + push_undo() + game.demagogue |= (1 << where) + game.where = where + game.state = "demagogue_v3_mobs" + }, +} + +states.demagogue_v3_mobs = { + inactive: "Demagogue", + prompt() { + prompt("Demagogue: Place 1-3 mobs in " + REGION_NAME[game.where] + ".") + view.selected_region = game.where + view.color = POPULACE + view.actions.mobs = [ 1, 2, 3 ] + }, + mobs(n) { + push_undo() + set_mobs(game.where, get_mobs(game.where) + n) + log("Demagogue " + n + " mobs in %" + game.where + ".") + resume_take_actions() + }, +} + // === COMBAT === function play_flanking_maneuver() { |