diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-30 00:30:46 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-30 00:30:46 +0000 |
commit | bd8d211275b20c375a23d2925e613a9cf994240f (patch) | |
tree | 13b058019bbdf2d20d3431525fd71c7f4b47aa6a /rules.js | |
parent | 113786308489c94706e89979dc7580c13de9834c (diff) | |
download | 1989-dawn-of-freedom-bd8d211275b20c375a23d2925e613a9cf994240f.tar.gz |
Improve log
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 90 |
1 files changed, 50 insertions, 40 deletions
@@ -4172,6 +4172,11 @@ function log_msg_gap(msg) { log_br() } +function logi_msg_gap(msg) { + game.log.push(">" + msg) + log_br() +} + function log_side() { if (game.active === DEM) log(".d") @@ -4326,6 +4331,11 @@ function vm_logi() { vm_next() } +function vm_logi_msg_gap() { + logi_msg_gap(vm_operand(1)) + vm_next() +} + function vm_operand(a) { let x = CODE[game.vm.fp][game.vm.ip][a] if (a > 0 && typeof x === "function") @@ -4950,19 +4960,19 @@ function vm_army_backs_revolution() { permanently_remove(C_SECURITATE) } add_to_persistent_events(C_ARMY_BACKS_REVOLUTION) - logi(`C${C_SECURITATE} no longer has any effect`) + logi_msg_gap(`C${C_SECURITATE} no longer has any effect`) vm_next() } function vm_army_block() { permanently_remove(C_SECURITATE) - logi(`Has no effect after C${C_ARMY_BACKS_REVOLUTION}`) + logi_msg_gap(`Has no effect after C${C_ARMY_BACKS_REVOLUTION}`) vm_next() } function vm_austria_hungary_border_reopened() { add_to_persistent_events(C_AUSTRIA_HUNGARY_BORDER_REOPENED) - logi(`For the remainder of the turn, cards played by the Democrat have +1 Ops value if all Operations Points are used in East Germany`) + logi_msg_gap(`For the remainder of the turn, cards played by the Democrat have +1 Ops value if all Operations Points are used in East Germany`) game.austria_hungary_border_reopened_tracker = false vm_next() } @@ -5130,22 +5140,22 @@ function vm_domino_theory() { function vm_domino_theory_pass() { if (game.revolutions.filter(value => value === true).length < 2) { - logi('Democrat holds power in fewer than 2 countries') + logi_msg_gap('Democrat holds power in fewer than 2 countries') } else if (!scoring_cards.some(card => game.strategy_discard.includes(card))) { - logi('No scoring cards in discard') + logi_msg_gap('No scoring cards in discard') } vm_next() } function vm_eco_glasnost() { add_to_persistent_events(C_ECO_GLASNOST) - logi(`+1 VP for Communist Support Checks in Ruse for the rest of the game`) + logi_msg_gap(`+1 VP for Communist Support Checks in Ruse for the rest of the game`) vm_next() } function vm_elena() { add_to_persistent_events(C_ELENA) - logi(`-1 modifier to Democratic Support Checks in Romania for the rest of this turn`) + logi_msg_gap(`-1 modifier to Democratic Support Checks in Romania for the rest of this turn`) vm_next() } @@ -5208,19 +5218,19 @@ function vm_foreign_television() { } function vm_frg_embassies() { add_to_persistent_events(C_FRG_EMBASSIES) - logi(`+1 modifier for Democratic Support Checks in Eastern Europe for the rest of this turn`) + logi_msg_gap(`+1 modifier for Democratic Support Checks in Eastern Europe for the rest of this turn`) vm_next() } function vm_general_strike() { add_to_persistent_events(C_GENERAL_STRIKE) - logi(`Each Action Round the Communist must instead discard a card and roll a die until the modified die roll exceeds 5`) + logi_msg_gap(`Each Action Round the Communist must instead discard a card and roll a die until the modified die roll exceeds 5`) vm_next() } function vm_genscher() { add_to_persistent_events(C_GENSCHER) - logi(`Cancels +1 Ops cost to place Democratic SPs in Communist controlled spaces in East Germany for the rest of the turn`) + logi_msg_gap(`Cancels +1 Ops cost to place Democratic SPs in Communist controlled spaces in East Germany for the rest of the turn`) vm_next() } @@ -5255,7 +5265,7 @@ function vm_government_resigns() { function vm_grenztruppen() { add_to_persistent_events(C_GRENZTRUPPEN) - logi(`-1 modifier for Democratic Support Checks in East Germany for the rest of this turn`) + logi_msg_gap(`-1 modifier for Democratic Support Checks in East Germany for the rest of this turn`) vm_next() } @@ -5281,13 +5291,13 @@ function vm_heal_our_bleeding_wounds() { function vm_helsinki_final_act() { add_to_persistent_events(C_HELSINKI_FINAL_ACT) - logi(`+1 VP for every Support Check by the Communist Player in Student or Intellectual spaces for the rest of the game`) + logi_msg_gap(`+1 VP for every Support Check by the Communist Player in Student or Intellectual spaces for the rest of the game`) vm_next() } function vm_honecker() { add_to_persistent_events(C_HONECKER) - logi(`The Communist may take one extra Action Round this turn`) + logi_msg_gap(`The Communist may take one extra Action Round this turn`) game.valid_cards = [] for (let c of game.strategy_discard) { if (scoring_cards.includes(c)) { @@ -5368,7 +5378,7 @@ function vm_kremlin_coup() { function vm_laszlo_tokes_prep() { add_to_persistent_events(C_LASZLO_TOKES) - logi(`Allows play of C${C_MASSACRE_IN_TIMISOARA}`) + logi_msg_gap(`Allows play of C${C_MASSACRE_IN_TIMISOARA}`) game.playable_cards.push(C_MASSACRE_IN_TIMISOARA) vm_next() } @@ -5394,13 +5404,13 @@ function vm_legacy_of_1968() { function vm_li_peng() { add_to_persistent_events(C_LI_PENG) - logi(`+1 modifier to all Communist Tiananmen Square Attempts for the rest of the game`) + logi_msg_gap(`+1 modifier to all Communist Tiananmen Square Attempts for the rest of the game`) vm_next() } function vm_ligachev() { add_to_persistent_events(C_LIGACHEV) - logi(`-3VPs if the Democrat does not play C${C_GORBACHEV_CHARMS_THE_WEST} next Action Round`) + logi_msg_gap(`-3VPs if the Democrat does not play C${C_GORBACHEV_CHARMS_THE_WEST} next Action Round`) vm_next() } @@ -5417,7 +5427,7 @@ function vm_massacre_in_timisoara() { function vm_modrow() { game.playable_cards = game.playable_cards.filter(n => n !== C_HONECKER) add_to_persistent_events(C_MODROW) - logi(`Prevents play of C${C_HONECKER} for the event`) + logi_msg_gap(`Prevents play of C${C_HONECKER} for the event`) game.state = 'vm_modrow' } @@ -5430,7 +5440,7 @@ function vm_nagy_reburied() { function vm_national_salvation_front() { add_to_persistent_events(C_NATIONAL_SALVATION_FRONT) - logi(`In the next Power Struggle in the Balkans, the Communist draws 2 random Power Struggle cards from the Democrat hand`) + logi_msg_gap(`In the next Power Struggle in the Balkans, the Communist draws 2 random Power Struggle cards from the Democrat hand`) vm_next() } @@ -5459,13 +5469,13 @@ function vm_normalization() { function vm_peasant_parties_revolt() { add_to_persistent_events(C_PEASANT_PARTIES_REVOLT) - logi(`In the next Power Stuggle, if the Democrat controls a Farmer space draw 1 Power Struggle card at random from the Communist hand`) + logi_msg_gap(`In the next Power Stuggle, if the Democrat controls a Farmer space draw 1 Power Struggle card at random from the Communist hand`) vm_next() } function vm_perestroika() { add_to_persistent_events(C_PERESTROIKA) - logi(`+1 Ops value for cards played by the Communist for the rest of this turn`) + logi_msg_gap(`+1 Ops value for cards played by the Communist for the rest of this turn`) vm_next() } @@ -5500,7 +5510,7 @@ function vm_power_struggle() { function vm_presidential_visit() { add_to_persistent_events(C_PRESIDENTIAL_VISIT) - logi(`Communist hand size is reduced to 7 next turn`) + logi_msg_gap(`Communist hand size is reduced to 7 next turn`) vm_next() } @@ -5546,7 +5556,7 @@ function vm_reformer_rehabilitated() { function vm_roundtable_talks() { add_to_persistent_events(C_ROUNDTABLE_TALKS) - logi(`In the next Power Struggle the Democrat draws 2 random Power Struggle cards from the Communist hand`) + logi_msg_gap(`In the next Power Struggle the Democrat draws 2 random Power Struggle cards from the Communist hand`) vm_next() } @@ -5578,7 +5588,7 @@ function vm_samizdat() { function vm_securitate() { add_to_persistent_events(C_SECURITATE) - logi(`The Democrat must reveal their Power Struggle cards at the start of Power Struggles in Romania`) + logi_msg_gap(`The Democrat must reveal their Power Struggle cards at the start of Power Struggles in Romania`) vm_next() } @@ -5593,7 +5603,7 @@ function vm_social_democratic_platform_adopted() { function vm_solidarity_legalised() { game.playable_cards.push(C_WALESA) add_to_persistent_events(C_SOLIDARITY_LEGALIZED) - logi(`Allows play of C${C_WALESA}`) + logi_msg_gap(`Allows play of C${C_WALESA}`) vm_next() } @@ -5604,24 +5614,24 @@ function vm_solidarity_legalised_spaces() { function vm_st_nicholas_church() { add_to_persistent_events(C_ST_NICHOLAS_CHURCH) - logi(`Allows play of C${C_THE_MONDAY_DEMONSTRATIONS}`) + logi_msg_gap(`Allows play of C${C_THE_MONDAY_DEMONSTRATIONS}`) game.playable_cards.push(C_THE_MONDAY_DEMONSTRATIONS) vm_next() } function vm_stasi() { add_to_persistent_events(C_STASI) - logi(`For the rest of this turn the Democrat must reveal the card they will play this Action Round before the Communist player plays a card`) + logi_msg_gap(`For the rest of this turn the Democrat must reveal the card they will play this Action Round before the Communist player plays a card`) vm_next() } function vm_stand_fast() { add_to_persistent_events(C_STAND_FAST) if (game.active === DEM) { - logi(`-1 Modifier to Support Checks in Democratic controlled spaces for the rest of this turn`) + logi_msg_gap(`-1 Modifier to Support Checks in Democratic controlled spaces for the rest of this turn`) game.stand_fast = DEM } else { - logi(`-1 Modifier to Support Checks in Communist controlled spaces for the rest of this turn`) + logi_msg_gap(`-1 Modifier to Support Checks in Communist controlled spaces for the rest of this turn`) game.stand_fast = COM } vm_next() @@ -5671,7 +5681,7 @@ function vm_tank_column() { function vm_tear_gas() { add_to_persistent_events(C_TEAR_GAS) - logi(`+1 modifier to the next Communist Support Check in a Student space`) + logi_msg_gap(`+1 modifier to the next Communist Support Check in a Student space`) vm_next() } @@ -5703,7 +5713,7 @@ function vm_the_chinese_solution() { function vm_the_crowd_turns_against_ceausescu() { add_to_persistent_events(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) - logi(`Power Struggle: Romania. Democrat draws 15 Power Struggle cards and takes 1 Action Round using Ops 3 times the number of Rallies. Allows play of C${C_THE_TYRANT_IS_GONE}.`) + logi_msg_gap(`Power Struggle: Romania. Democrat draws 15 Power Struggle cards and takes 1 Action Round using Ops 3 times the number of Rallies. Allows play of C${C_THE_TYRANT_IS_GONE}.`) game.playable_cards.push(C_THE_TYRANT_IS_GONE) vm_next() } @@ -5720,7 +5730,7 @@ function vm_the_monday_demonstrations() { function vm_the_sinatra_doctrine() { add_to_persistent_events(C_THE_SINATRA_DOCTRINE) - logi(`+1 Ops value for cards played by the Democrat for the rest of this turn`) + logi_msg_gap(`+1 Ops value for cards played by the Democrat for the rest of this turn`) vm_next() } @@ -5751,18 +5761,18 @@ function vm_the_tyrant_is_gone() { function vm_the_tyrant_is_gone_prep() { add_to_persistent_events(C_THE_TYRANT_IS_GONE) - logi(`After C${C_THE_CROWD_TURNS_AGAINST_CEAUSESCU} occurs, remove 4 Commuist SPs from the Romanian Elite space. The Democrats choose where the Ceausescus flee to`) + logi_msg_gap(`After C${C_THE_CROWD_TURNS_AGAINST_CEAUSESCU} occurs, remove 4 Commuist SPs from the Romanian Elite space. The Democrats choose where the Ceausescus flee to`) vm_next() } function vm_tyrant_block() { - logi(`Has no effect after C${C_THE_TYRANT_IS_GONE}`) + logi_msg_gap(`Has no effect after C${C_THE_TYRANT_IS_GONE}`) vm_next() } function vm_the_wall() { add_to_persistent_events(C_THE_WALL) - logi(`Cancels the modifier for any Democratic controlled spaces for the next Communist Support Check in East Germany`) + logi_msg_gap(`Cancels the modifier for any Democratic controlled spaces for the next Communist Support Check in East Germany`) vm_next() } @@ -5784,7 +5794,7 @@ function vm_we_are_the_people() { game.valid_spaces = [ S_LUTHERAN_CHURCH ] } add_to_persistent_events(C_WE_ARE_THE_PEOPLE) - logi(`The Communist may no longer make Support Checks in Leipzig`) + logi_msg_gap(`The Communist may no longer make Support Checks in Leipzig`) if (!game.vm_influence_added) { game.vm_influence_added = {} } @@ -5814,7 +5824,7 @@ function vm_workers_revolt() { function vm_yakovlev_counsels_gorbachev() { add_to_persistent_events(C_YAKOVLEV_COUNSELS_GORBACHEV) - logi(`The Democrat receives a +1 modifier to the Support Loss and Victory Point die rolls if they wins the next Power Struggle`) + logi_msg_gap(`The Democrat receives a +1 modifier to the Support Loss and Victory Point die rolls if they wins the next Power Struggle`) vm_next() } @@ -6430,7 +6440,7 @@ states.vm_brought_in_for_questioning = { log(`C${game.vm_event}:`) goto_vm(game.vm_event) } else { - logi('Event does not occur') + logi_msg_gap('Event does not occur') game.return = DEM vm_return() } @@ -7696,7 +7706,7 @@ states.vm_the_chinese_solution = { }, pass() { push_undo() - logi(`Chose not to conduct Support Checks`) + logi_msg_gap(`Chose not to conduct Support Checks`) permanently_remove(C_THE_CHINESE_SOLUTION) vm_return() }, @@ -8684,7 +8694,7 @@ CODE[48] = [ // We are the People!* CODE[49] = [ // Foreign Currency Debt Burden* [ vm_foreign_currency_debt_burden ], - [ vm_logi, ()=>`Communist cannot make Support Checks in ${country_name(game.foreign_currency_debt_burden)} for the rest of the turn` ], + [ vm_logi_msg_gap, ()=>`Communist cannot make Support Checks in ${country_name(game.foreign_currency_debt_burden)} for the rest of the turn` ], [ vm_return ], ] @@ -8983,7 +8993,7 @@ CODE[87] = [ // Kohl Proposes Reunification* [ vm_if, ()=>!is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) ], [ vm_kohl_proposes_reunification ], [ vm_else ], - [ vm_logi, ()=>`C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` ], + [ vm_logi_msg_gap, ()=>`C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` ], [ vm_endif ], [ vm_return ], ] |