diff options
-rw-r--r-- | play.js | 4 | ||||
-rw-r--r-- | rules.js | 62 |
2 files changed, 63 insertions, 3 deletions
@@ -1641,6 +1641,10 @@ function on_update() { action_button("pip_to_mip", `<img class="market_button" src="images/px.svg"> \u2192 <img class="market_button" src="images/mx.svg">`) action_button("pip_to_sip", `<img class="market_button" src="images/px.svg"> \u2192 <img class="market_button" src="images/sx.svg">`) + action_button_with_argument("mobs", 1, "Mob x1") + action_button_with_argument("mobs", 2, "Mob x2") + action_button_with_argument("mobs", 3, "Mob x3") + action_button("automatic", "Automatic") action_button("spend_military", "Spend Military") action_button("spend_senate", "Spend Senate") @@ -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() { |