summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-11-02 19:22:45 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-11-02 19:22:45 +0000
commit7e5158ecaf5cb53c9bed95e58d197a06201f5d9d (patch)
tree4ab492bf1f40ff012bc3d3cc671ac5396311309c
parent28afa9183690236d77f5526a9ddc3ebed9637491 (diff)
download1989-dawn-of-freedom-7e5158ecaf5cb53c9bed95e58d197a06201f5d9d.tar.gz
Verbose logs
-rw-r--r--events.txt2
-rw-r--r--rules.js69
2 files changed, 44 insertions, 27 deletions
diff --git a/events.txt b/events.txt
index 4176519..84bfe37 100644
--- a/events.txt
+++ b/events.txt
@@ -362,6 +362,7 @@ we_are_the_people
CARD 49 - Foreign Currency Debt Burden*
# The Democrat designates 1 country in Eastern Europe. For the rest of this turn the Communist has a -2 modifier for support checks in this country.
foreign_currency_debt_burden
+logi `Communist cannot make Support Checks in ${country_name(game.foreign_currency_debt_burden)} for the rest of the turn`
CARD 50 - The Sinatra Doctrine*
@@ -660,6 +661,7 @@ domino_theory
CARD 90 - Civic Forum*
# +1 VP. Place 4 SPs in Czechoslovakia. The Democratic Player may make Support Checks in Czechoslovakia using the Ops value of this card if the Czech Writers space is Democratically controlled.
+permanently_remove
valid_spaces_country 'Czechoslovakia'
prompt 'Czechoslovakia'
add_infl_free 4
diff --git a/rules.js b/rules.js
index dff42c5..2ee3e8a 100644
--- a/rules.js
+++ b/rules.js
@@ -306,7 +306,6 @@ exports.setup = function (seed, scenario, options) {
function start_game() {
// Draw cards
game.strategy_deck = draw_deck()
- reset_power()
//Set starting influence
spaces.forEach((space, index) => {
@@ -2318,7 +2317,6 @@ function valid_spaces_sc() {
if (infl !== 0 ) {
// Check Events that block support checks in a given space
if (game.persistent_events.includes(C_SOLIDARITY_LEGALIZED) && space.space_id === S_GDANSK) {continue}
- if (game.persistent_events.includes(C_CIVIC_FORUM) && space.space_id === S_CHARLES_UNIVERSITY) {continue}
if (game.persistent_events.includes(C_WE_ARE_THE_PEOPLE) && space.space_id === S_LEIPZIG) {continue}
if (game.persistent_events.includes(C_FOREIGN_CURRENCY_DEBT_BURDEN) && space.country === game.foreign_currency_debt_burden) {continue}
@@ -2851,7 +2849,7 @@ function get_aftermath_roll() {
function add_to_persistent_events(card) {
game.persistent_events.push(card)
remove_from_discard(card)
- log(`C${card} in effect`)
+ log(`C${card} in effect:`)
}
function permanently_remove(card) {
@@ -3024,15 +3022,10 @@ function event_is_playable(card) {
else if (game.com_tst_position === 8 && card === C_THE_CHINESE_SOLUTION) {
return true
}
-
- //Check for Gorbachev Charms the West after Breakaway Baltic Republics
- else if (card === C_GORBACHEV_CHARMS_THE_WEST && !game.playable_cards.includes(C_GORBACHEV_CHARMS_THE_WEST)) {
- return false
- }
//Then check normally
- else if (cards[card].playable) {
+ else if (game.playable_cards.includes(card)) {
return true
- } else if (game.playable_cards.includes(card)) {
+ } else if (cards[card].playable) {
return true
} else {
return false
@@ -3040,11 +3033,7 @@ function event_is_playable(card) {
}
function get_card_ops(card) {
- let ops = 0
-
- if (card) {
- ops = cards[card].ops
- }
+ let ops = cards[card].ops
if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) {
if(game.state === 'choose_card' || game.state === 'stasi_play_card') {
log(`+1 op from C${C_PERESTROIKA}`)
@@ -3166,7 +3155,7 @@ function finish_the_wall() {
// =========== MOVING THROUGH TURNS ============
function end_round() {
- //Check if the game is over!
+ //Check if the game is over! WHY IS THIS NEEDED?
if (game.state === 'game_over') {
return}
@@ -3288,7 +3277,6 @@ function end_round() {
next_player()
} else {
log_h3('Democratic Action Round')
-
}
if (game.democrat_hand.includes(game.stasi_card)) {
log_h3('C13')
@@ -3457,10 +3445,6 @@ function roll_d6() {
return random(6) + 1
}
-function find_space_index(name_unique) {
- return spaces.findIndex(space => space && space.name_unique === name_unique)
-}
-
function find_country_index(country) {
return countries.indexOf(country)
}
@@ -3869,6 +3853,11 @@ function vm_next() {
vm_exec();
}
+function vm_logi(){
+ logi(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")
@@ -4483,11 +4472,13 @@ function vm_army_backs_revolution() {
game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE)
game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE)
add_to_persistent_events(C_ARMY_BACKS_REVOLUTION)
+ logi(`${C_SECURITATE} no longer has any effect`)
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`)
game.austria_hungary_border_reopened_tracker = false
vm_next()
}
@@ -4495,7 +4486,6 @@ function vm_austria_hungary_border_reopened() {
function vm_betrayal() {
if (game.demInfl[S_ORTHODOX_CHURCH_ROMANIA] > 0 ) { game.valid_spaces.push(S_ORTHODOX_CHURCH_ROMANIA) }
if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] >0 ) { game.valid_spaces.push(S_ORTHODOX_CHURCH_BULGARIA) }
- game.vm_available_ops = Math.max(game.demInfl[S_ORTHODOX_CHURCH_ROMANIA], game.demInfl[S_ORTHODOX_CHURCH_BULGARIA])
game.state = 'vm_switch_infl'
}
@@ -4559,7 +4549,6 @@ function vm_civic_forum() {
if (check_vp()) {
return
}
- add_to_persistent_events(C_CIVIC_FORUM)
if (check_dem_control(S_CZECH_WRITERS)) {
vm_next()
} else {
@@ -4622,11 +4611,13 @@ function vm_domino_theory() {
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`)
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`)
vm_next()
}
@@ -4687,16 +4678,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`)
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`)
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`)
vm_next()
}
@@ -4731,6 +4725,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`)
vm_next()
}
@@ -4753,11 +4748,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`)
vm_next()
}
function vm_honecker() {
add_to_persistent_events(C_HONECKER)
+ logi(`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)) {
@@ -4838,6 +4835,7 @@ function vm_kremlin_coup() {
function vm_laszlo_tokes() {
add_to_persistent_events(C_LASZLO_TOKES)
+ logi(`Allows play of C${C_MASSACRE_IN_TIMISOARA}`)
game.playable_cards.push(C_MASSACRE_IN_TIMISOARA)
game.state = 'vm_laszlo_tokes'
}
@@ -5041,20 +5039,25 @@ function vm_solidarity_legalised() {
function vm_st_nicholas_church () {
add_to_persistent_events(C_ST_NICHOLAS_CHURCH)
+ logi(`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 he will play this Action Round before the Communist player plays his 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`)
game.stand_fast = DEM
- } else {game.stand_fast = COM}
+ } else {
+ logi(`-1 Modifier to Support Checks in Communist controlled spaces for the rest of this turn`)
+ game.stand_fast = COM}
vm_next()
}
@@ -5099,6 +5102,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`)
vm_next()
}
@@ -5121,6 +5125,7 @@ function vm_the_chinese_solution() {
function vm_the_crowd_turns_against_ceausescu() {
add_to_persistent_events(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)
+ logi(`After the players draw cards for the next Power Struggle in Romania, the Democrat draws 15 Power Struggle cards and takes 1 Action Round using Ops equal to 3 times the number of Rally cards drawn. Allows play of C${C_THE_TYRANT_IS_GONE}`)
game.playable_cards.push(C_THE_TYRANT_IS_GONE)
vm_next()
}
@@ -5133,6 +5138,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`)
vm_next()
}
@@ -5165,6 +5171,7 @@ function vm_tyrant_block() {
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`)
vm_next()
}
@@ -5184,6 +5191,7 @@ function vm_warsaw_pact_summit() {
function vm_we_are_the_people() {
if (game.demInfl[S_LUTHERAN_CHURCH] > 0) {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`)
if (!game.vm_influence_added) {
game.vm_influence_added = {};
}
@@ -5215,6 +5223,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 he wins the next Power Struggle`)
vm_next()
}
@@ -6675,6 +6684,9 @@ states.vm_switch_infl = {
},
space(space) {
push_undo()
+ if (game.vm_event === C_BETRAYAL) {
+ game.vm_available_ops = game.demInfl[space]
+ }
vm_switch_infl(space)
if (game.vm_available_ops === 0) {
game.valid_spaces = []
@@ -7092,7 +7104,7 @@ states.vm_systematization = {
vm_eliminate(space)
game.valid_spaces = []
game.systematization = space
- game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/
+ //game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/
vm_next()
},
}
@@ -8105,6 +8117,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_return ],
]
@@ -8400,6 +8413,7 @@ CODE[89] = [ // Domino Theory*
]
CODE[90] = [ // Civic Forum*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country, 'Czechoslovakia' ],
[ vm_prompt, 'Czechoslovakia' ],
[ vm_add_infl_free, 4 ],
@@ -8463,8 +8477,8 @@ CODE[96] = [ // The Chinese Solution*
]
CODE[97] = [ // The Tyrant is Gone*
- [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ],
- [ vm_valid_spaces_com, 'Cluj-Napoca' ],
+ [ vm_if, ()=>game.persistent_events.includes(54) ],
+ [ vm_valid_spaces, 'Cluj-Napoca' ],
[ vm_prompt, 'the Romanian Elite Space' ],
[ vm_remove_x_opp_infl, 4 ],
[ vm_the_tyrant_is_gone ],
@@ -8624,3 +8638,4 @@ CODE[351] = [ // Scare Tactics
[ vm_return ],
]
// #endregion
+