summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js123
1 files changed, 27 insertions, 96 deletions
diff --git a/rules.js b/rules.js
index 6b3b7d8..82a98a3 100644
--- a/rules.js
+++ b/rules.js
@@ -250,6 +250,7 @@ exports.setup = function (seed, scenario, options) {
summary: [],
active: null,
state: 'place_starting_infl',
+ state: 'place_starting_infl',
return: '',
vm: null,
vm_event: 0,
@@ -316,6 +317,8 @@ function start_game() {
//Set starting placement ops
game.starting_infl = [2, 3, 3, 4, 2]
game.temp = 0
+ game.starting_infl = [2, 3, 3, 4, 2]
+ game.temp = 0
// Set variable event cards where event is playable at start of game
@@ -324,6 +327,7 @@ function start_game() {
draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit)
valid_spaces_setup()
+ valid_spaces_setup()
game.available_ops = 2
log_h1("Place starting Support Points")
log_side()
@@ -382,6 +386,7 @@ exports.view = function(state, player) {
}
view.strategy_discard = game.strategy_discard
+
if (player === game.active && game.vm && game.vm.draw)
view.drawn = game.vm.draw
@@ -410,7 +415,7 @@ exports.view = function(state, player) {
if (game.state === "game_over") {
view.prompt = game.victory
- } else if (game.active !== player) {
+ } else if (player === "Observer" || (game.active !== player && game.active !== "Both")) {
if (states[game.state]) {
let inactive = states[game.state].inactive
if (typeof inactive === "function")
@@ -488,6 +493,7 @@ states.place_starting_infl = {
gen_action("done");
return;
} else if (game.temp > 2) {
+ } else if (game.temp > 2) {
view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.`
} else {
view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.`
@@ -505,10 +511,17 @@ states.place_starting_infl = {
game.available_ops = game.starting_infl[game.temp]
next_player()
valid_spaces_setup()
+ do_log_summary()
+ game.temp ++
+ game.available_ops = game.starting_infl[game.temp]
+ next_player()
+ valid_spaces_setup()
},
start() {
do_log_summary()
delete game.starting_infl
+ do_log_summary()
+ delete game.starting_infl
new_turn()
clear_undo()
game.state = 'choose_card'
@@ -622,6 +635,7 @@ states.play_card ={
push_undo()
log_gap(`Played C${game.played_card} for the event`)
//game.phase = 1 /*Do I still need this?*/
+ //game.phase = 1 /*Do I still need this?*/
game.vm_infl_to_do = true
game.return = game.active
game.vm_event = game.played_card
@@ -649,6 +663,9 @@ states.play_card ={
if (check_vp()) {
return
}
+ if (check_vp()) {
+ return
+ }
}
// Check if card is opponent card with event that needs to be resolved
@@ -734,12 +751,14 @@ states.resolve_opponent_event = {
game.austria_hungary_border_reopened_tracker = true
}
game.state = 'add_influence'
+ game.state = 'add_influence'
valid_spaces_infl()
},
support_check() {
push_undo()
game.available_ops = 2
game.state = 'support_check_prep'
+ game.state = 'support_check_prep'
valid_spaces_sc()
},
opp_event() {
@@ -792,14 +811,17 @@ states.add_influence = {
},
space(space) {
add_infl(space, 'available_ops')
+ add_infl(space, 'available_ops')
},
end_round() {
push_undo()
do_log_summary()
+ do_log_summary()
end_round()
},
done() {
do_log_summary()
+ do_log_summary()
reset_austria_hungary_border_reopened()
game.state = 'resolve_opponent_event'
}
@@ -896,6 +918,7 @@ states.tst_goddess_draw = {
draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length +1)
}
end_goddess()
+ end_goddess()
}
}
@@ -2306,10 +2329,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}
-<<<<<<< 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}
@@ -2355,6 +2374,7 @@ function valid_spaces_infl() {
let space = spaces[i]
let player_influence = game.active === COM ? game.comInfl[i] : game.demInfl[i];
+
// If the piece has the player's influence, add it and its adjacent spaces to the set
if (player_influence > 0) {
valid_spaces_set.add(space.space_id);
@@ -2372,6 +2392,7 @@ function valid_spaces_infl() {
valid_spaces_set.add(adj_piece.space_id)
}
+
// Otherwise, only add the adjacent space if the available_ops >= 2 or the space is not controlled by the opponent
if (ops >= 2 || !opponent_control) {
valid_spaces_set.add(adj_piece.space_id)
@@ -2398,6 +2419,7 @@ function valid_cards(player_hand, presence) {
continue
}
+
if (card.socio === 0) {
valid_cards_set.add(c)
} else if (leaders.includes(card.socio) && presence[card.socio]) {
@@ -2842,11 +2864,7 @@ 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) {
@@ -3035,15 +3053,7 @@ 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}`)
@@ -3165,11 +3175,7 @@ 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}
@@ -3459,13 +3465,6 @@ 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)
}
@@ -4493,19 +4492,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)
-<<<<<<< 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()
}
@@ -4576,10 +4569,6 @@ 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 {
@@ -4642,19 +4631,13 @@ 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()
}
@@ -4715,28 +4698,19 @@ 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()
}
@@ -4771,10 +4745,7 @@ 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()
}
@@ -4797,19 +4768,13 @@ 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)) {
@@ -4890,10 +4855,7 @@ 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'
}
@@ -5097,20 +5059,14 @@ 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()
}
@@ -5166,10 +5122,7 @@ 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()
}
@@ -5192,10 +5145,7 @@ 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()
}
@@ -5208,10 +5158,7 @@ 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()
}
@@ -5244,10 +5191,7 @@ 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()
}
@@ -5267,10 +5211,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)
-<<<<<<< HEAD
logi(`The Communist may no longer make Support Checks in Leipzig`)
-=======
->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187
if (!game.vm_influence_added) {
game.vm_influence_added = {};
}
@@ -5302,10 +5243,7 @@ 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()
}
@@ -7186,11 +7124,7 @@ 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()
},
}
@@ -8723,7 +8657,4 @@ CODE[351] = [ // Scare Tactics
[ vm_return ],
]
// #endregion
-<<<<<<< HEAD
-=======
->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187