diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-28 17:05:47 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-28 17:05:47 +0000 |
commit | 990faf9a6d27a795d87e89286ba499fccbd24a4d (patch) | |
tree | fc3aac979222567b97034a6231702dad3cd62c14 | |
parent | b7c261893c9b85a38fdd6cc3bc3210c69c908125 (diff) | |
download | 1989-dawn-of-freedom-990faf9a6d27a795d87e89286ba499fccbd24a4d.tar.gz |
Updates to Table Cards and cleanup
-rw-r--r-- | events.txt | 3 | ||||
-rw-r--r-- | rules.js | 70 |
2 files changed, 60 insertions, 13 deletions
@@ -95,7 +95,6 @@ add_infl_free 3 CARD 13 - Stasi # For the rest this turn the Democratic Player must reveal the card he will play this action round before the Communist plays his card. -permanently_remove stasi @@ -173,7 +172,6 @@ st_nicholas_church CARD 25 - Perestroika # +1 Ops value for cards played by the Communist for the rest of turn. -permanently_remove perestroika @@ -376,7 +374,6 @@ foreign_currency_debt_burden CARD 50 - The Sinatra Doctrine* # +1 Ops value for cards played by the Democratic Player the rest of this turn. -permanently_remove the_sinatra_doctrine @@ -222,6 +222,7 @@ const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, const numberless_cards = [1, 2, 3, 4, 5, 6, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] const auto_resolve_events = [5, 8, 9, 13, 17, 25, 26, 30, 35, 50, 53, 54, 58, 59, 62, 63, 65, 70, 72, 74, 86, 99, 102, 108] const switch_events = [6, 20, 71] +const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] const PC_TACTIC_FAILS = 52 @@ -3752,7 +3753,27 @@ function new_turn() { delete game.selected_space //Remove events that only last one turn - game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) + + for (let e of one_turn_events) { + if (game.persistent_events.includes(e)) { + end_one_turn_event(e) + } + } + if (game.prudence) { + delete game.prudence + log_summary(`C${8}`) + } + if (game.summary.length > 0) { + log('No longer in effect:') + pop_summary_i() + log_br() + } + delete game.stasi_card + delete game.stand_fast + +/* TODO: Add log for events no longer in effect */ + + /*game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) game.persistent_events = game.persistent_events.filter(n => n !== C_THE_SINATRA_DOCTRINE) game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) @@ -3795,12 +3816,18 @@ function new_turn() { discard_from_table(63) permanently_remove(63) } + //Stasi + if (game.persistent_events.includes(C_STASI)) { + game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) + discard_from_table(C_STASI) + log(`C${C_STASI} no longer in effect`) + } //Stand Fast if (game.persistent_events.includes(100)) { game.persistent_events = game.persistent_events.filter(n => n !== 100) delete game.stand_fast log(`C100 no longer in effect`) - } + }*/ if (game.samizdat_card > 0 ) { game.democrat_hand.push(game.samizdat_card) @@ -3857,6 +3884,12 @@ function new_turn() { } } +function end_one_turn_event(event) { + game.persistent_events = game.persistent_events.filter(n => n !== event) + discard_from_table(event) + log_summary(`C${event}`) +} + function next_player() { clear_undo() if (game.active === DEM) @@ -4020,8 +4053,12 @@ function discard_card(hand) { function discard_from_table(card) { let find_card = game.table_cards.indexOf(card) - game.table_cards.splice(find_card, 1) - game.strategy_discard.push(card) + if (find_card !== -1) { + game.table_cards.splice(find_card, 1) + if (cards[card].remove === 1 && !game.strategy_removed.includes(card)) { + game.strategy_removed.push(card) + } else {game.strategy_discard.push(card) } + } } @@ -4214,6 +4251,19 @@ function pop_summary() { game.summary = [] } +function pop_summary_i() { + if (game.summary.length > 0) { + for (let [n, msg] of game.summary) { + if (n > 1) { + logi(msg.replace("£ SP", `${n} SPs`)); + } else { + logi(msg.replace("£ SP", `${n} SP`)); + } + } + } + game.summary = [] +} + function log_summary_place(p) { let from = piece_space(p) if (from !== AVAILABLE) @@ -5556,8 +5606,9 @@ function vm_peasant_parties_revolt() { } function vm_perestroika() { - game.persistent_events.push(25) - log_msg_gap('C25 in effect') + game.persistent_events.push(C_PERESTROIKA) + game.table_cards.push(C_PERESTROIKA) + log_msg_gap(`C${C_PERESTROIKA} in effect`) vm_next() } @@ -5687,6 +5738,7 @@ function vm_st_nicholas_church () { function vm_stasi() { log_msg_gap('C13 in effect') + game.table_cards.push(C_STASI) game.persistent_events.push(C_STASI) vm_next() } @@ -5754,7 +5806,8 @@ function vm_the_monday_demonstrations() { function vm_the_sinatra_doctrine() { game.persistent_events.push(C_THE_SINATRA_DOCTRINE) - log_msg_gap('C50 in effect') + game.table_cards.push(C_THE_SINATRA_DOCTRINE) + log_msg_gap(`C${C_THE_SINATRA_DOCTRINE} in effect`) vm_next() } @@ -8537,7 +8590,6 @@ CODE[12] = [ // Apparatchicks ] CODE[13] = [ // Stasi - [ vm_permanently_remove ], [ vm_stasi ], [ vm_return ], ] @@ -8615,7 +8667,6 @@ CODE[24] = [ // St Nicolas Church ] CODE[25] = [ // Perestroika - [ vm_permanently_remove ], [ vm_perestroika ], [ vm_return ], ] @@ -8818,7 +8869,6 @@ CODE[49] = [ // Foreign Currency Debt Burden* ] CODE[50] = [ // The Sinatra Doctrine* - [ vm_permanently_remove ], [ vm_the_sinatra_doctrine ], [ vm_return ], ] |