summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js126
1 files changed, 120 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index 3e4a867..6b3b7d8 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) => {
@@ -2307,7 +2306,10 @@ 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}
+<<<<<<< HEAD
+=======
if (game.persistent_events.includes(C_CIVIC_FORUM) && space.space_id === S_CHARLES_UNIVERSITY) {continue}
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
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}
@@ -2840,7 +2842,11 @@ function get_aftermath_roll() {
function add_to_persistent_events(card) {
game.persistent_events.push(card)
remove_from_discard(card)
+<<<<<<< HEAD
+ log(`C${card} in effect:`)
+=======
log(`C${card} in effect`)
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
}
function permanently_remove(card) {
@@ -3019,9 +3025,9 @@ function event_is_playable(card) {
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
@@ -3029,11 +3035,15 @@ function event_is_playable(card) {
}
function get_card_ops(card) {
+<<<<<<< HEAD
+ let ops = cards[card].ops
+=======
let ops = 0
if (card) {
ops = cards[card].ops
}
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
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}`)
@@ -3155,7 +3165,11 @@ function finish_the_wall() {
// =========== MOVING THROUGH TURNS ============
function end_round() {
+<<<<<<< HEAD
+ //Check if the game is over! WHY IS THIS NEEDED?
+=======
//Check if the game is over!
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
if (game.state === 'game_over') {
return}
@@ -3277,7 +3291,6 @@ function end_round() {
next_player()
} else {
log_h3('Democratic Action Round')
-
}
if (game.democrat_hand.includes(game.stasi_card)) {
log_h3('C13')
@@ -3446,10 +3459,13 @@ function roll_d6() {
return random(6) + 1
}
+<<<<<<< HEAD
+=======
function find_space_index(name_unique) {
return spaces.findIndex(space => space && space.name_unique === name_unique)
}
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
function find_country_index(country) {
return countries.indexOf(country)
}
@@ -3858,6 +3874,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")
@@ -4472,11 +4493,19 @@ 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)
+<<<<<<< HEAD
+ logi(`${C_SECURITATE} no longer has any effect`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
function vm_austria_hungary_border_reopened() {
add_to_persistent_events(C_AUSTRIA_HUNGARY_BORDER_REOPENED)
+<<<<<<< HEAD
+ 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`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
game.austria_hungary_border_reopened_tracker = false
vm_next()
}
@@ -4484,7 +4513,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'
}
@@ -4548,7 +4576,10 @@ function vm_civic_forum() {
if (check_vp()) {
return
}
+<<<<<<< HEAD
+=======
add_to_persistent_events(C_CIVIC_FORUM)
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
if (check_dem_control(S_CZECH_WRITERS)) {
vm_next()
} else {
@@ -4611,11 +4642,19 @@ function vm_domino_theory() {
function vm_eco_glasnost() {
add_to_persistent_events(C_ECO_GLASNOST)
+<<<<<<< HEAD
+ logi(`+1 VP for Communist support checks in Ruse for the rest of the game`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
function vm_elena(){
add_to_persistent_events(C_ELENA)
+<<<<<<< HEAD
+ logi(`-1 modifier to Democratic Support checks in Romania for the rest of this turn`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
@@ -4676,16 +4715,28 @@ function vm_foreign_television() {
}
function vm_frg_embassies() {
add_to_persistent_events(C_FRG_EMBASSIES)
+<<<<<<< HEAD
+ logi(`+1 modifier for Democratic Support Checks in Eastern Europe for the rest of this turn`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
function vm_general_strike() {
add_to_persistent_events(C_GENERAL_STRIKE)
+<<<<<<< HEAD
+ logi(`Each Action Round the Communist must instead discard a card and roll a die until the modified die roll exceeds 5`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
function vm_genscher() {
add_to_persistent_events(C_GENSCHER)
+<<<<<<< HEAD
+ logi(`Cancels +1 Ops cost to place Democratic SPs in Communist controlled spaces in East Germany for the rest of the turn`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
@@ -4720,6 +4771,10 @@ function vm_government_resigns() {
function vm_grenztruppen() {
add_to_persistent_events(C_GRENZTRUPPEN)
+<<<<<<< HEAD
+ logi(`-1 modifier for Democratic Support Checks in East Germany for the rest of this turn`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
@@ -4742,11 +4797,19 @@ function vm_heal_our_bleeding_wounds() {
function vm_helsinki_final_act() {
add_to_persistent_events(C_HELSINKI_FINAL_ACT)
+<<<<<<< HEAD
+ logi(`+1 VP for every Support Check by the Communist Player in Student or Intellectual spaces for the rest of the game`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
function vm_honecker() {
add_to_persistent_events(C_HONECKER)
+<<<<<<< HEAD
+ logi(`The Communist may take one extra Action Round this turn`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
game.valid_cards = []
for (let c of game.strategy_discard) {
if (scoring_cards.includes(c)) {
@@ -4827,6 +4890,10 @@ function vm_kremlin_coup() {
function vm_laszlo_tokes() {
add_to_persistent_events(C_LASZLO_TOKES)
+<<<<<<< HEAD
+ logi(`Allows play of C${C_MASSACRE_IN_TIMISOARA}`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
game.playable_cards.push(C_MASSACRE_IN_TIMISOARA)
game.state = 'vm_laszlo_tokes'
}
@@ -5030,20 +5097,31 @@ function vm_solidarity_legalised() {
function vm_st_nicholas_church () {
add_to_persistent_events(C_ST_NICHOLAS_CHURCH)
+<<<<<<< HEAD
+ logi(`Allows play of C${C_THE_MONDAY_DEMONSTRATIONS}`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
game.playable_cards.push(C_THE_MONDAY_DEMONSTRATIONS)
vm_next()
}
function vm_stasi() {
add_to_persistent_events(C_STASI)
+<<<<<<< HEAD
+ 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`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
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()
}
@@ -5088,6 +5166,10 @@ function vm_tank_column() {
function vm_tear_gas () {
add_to_persistent_events(C_TEAR_GAS)
+<<<<<<< HEAD
+ logi(`+1 modifier to the next Communist Support Check in a Student space`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
@@ -5110,6 +5192,10 @@ function vm_the_chinese_solution() {
function vm_the_crowd_turns_against_ceausescu() {
add_to_persistent_events(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)
+<<<<<<< HEAD
+ 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}`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
game.playable_cards.push(C_THE_TYRANT_IS_GONE)
vm_next()
}
@@ -5122,6 +5208,10 @@ function vm_the_monday_demonstrations() {
function vm_the_sinatra_doctrine() {
add_to_persistent_events(C_THE_SINATRA_DOCTRINE)
+<<<<<<< HEAD
+ logi(`+1 Ops value for cards played by the Democrat for the rest of this turn`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
@@ -5154,6 +5244,10 @@ function vm_tyrant_block() {
function vm_the_wall () {
add_to_persistent_events(C_THE_WALL)
+<<<<<<< HEAD
+ logi(`Cancels the modifier for any Democratic controlled spaces for the next Communist Support Check in East Germany`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
@@ -5173,6 +5267,10 @@ 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)
+<<<<<<< HEAD
+ logi(`The Communist may no longer make Support Checks in Leipzig`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
if (!game.vm_influence_added) {
game.vm_influence_added = {};
}
@@ -5204,6 +5302,10 @@ function vm_workers_revolt() {
function vm_yakovlev_counsels_gorbachev() {
add_to_persistent_events(C_YAKOVLEV_COUNSELS_GORBACHEV)
+<<<<<<< HEAD
+ logi(`The Democrat receives a +1 modifier to the Support Loss and Victory Point die rolls if he wins the next Power Struggle`)
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
}
@@ -6664,6 +6766,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 = []
@@ -7081,7 +7186,11 @@ states.vm_systematization = {
vm_eliminate(space)
game.valid_spaces = []
game.systematization = space
+<<<<<<< HEAD
+ //game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/
+=======
game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
vm_next()
},
}
@@ -8094,6 +8203,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 ],
]
@@ -8613,3 +8723,7 @@ CODE[351] = [ // Scare Tactics
[ vm_return ],
]
// #endregion
+<<<<<<< HEAD
+
+=======
+>>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187