diff options
-rw-r--r-- | data.js | 106 | ||||
-rw-r--r-- | events.txt | 16 | ||||
-rw-r--r-- | play.css | 4 | ||||
-rw-r--r-- | play.js | 6 | ||||
-rw-r--r-- | rules.js | 79 |
5 files changed, 113 insertions, 98 deletions
@@ -1391,60 +1391,58 @@ const cards = [ const power_cards = [ null, -{number: 1, name: 'Strike', value: 6, socio: 0, url: 'ps2'}, -{number: 2, name: 'Strike', value: 6, socio: 0, url: 'ps2'}, -{number: 3, name: 'Strike', value: 5, socio: 0, url: 'ps3'}, -{number: 4, name: 'Strike', value: 5, socio: 0, url: 'ps3'}, -{number: 5, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 6, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 7, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 8, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 9, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 10, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 11, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 12, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 13, name: 'March', value: 6, socio: 0, url: 'ps6'}, -{number: 14, name: 'March', value: 6, socio: 0, url: 'ps6'}, -{number: 15, name: 'March', value: 5, socio: 0, url: 'ps7'}, -{number: 16, name: 'March', value: 5, socio: 0, url: 'ps7'}, -{number: 17, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 18, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 19, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 20, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 21, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 22, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 23, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 24, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 25, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 26, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 27, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 28, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 29, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 30, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 31, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 32, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 33, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 34, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 35, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 36, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 37, name: 'Elite Leader', value: 3, socio: 1, url: 'ps16'}, -{number: 38, name: 'Elite Leader', value: 3, socio: 1, url: 'ps17'}, -{number: 39, name: 'Elite Leader', value: 3, socio: 1, url: 'ps18'}, -{number: 40, name: 'Elite Leader', value: 3, socio: 1, url: 'ps19'}, -{number: 41, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps12'}, -{number: 42, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps13'}, -{number: 43, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps14'}, -{number: 44, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps15'}, -{number: 45, name: 'Worker Leader', value: 3, socio: 4, url: 'ps20'}, -{number: 46, name: 'Worker Leader', value: 3, socio: 4, url: 'ps21'}, -{number: 47, name: 'Church Leader', value: 3, socio: 7, url: 'ps23'}, -{number: 48, name: 'Student Leader', value: 3, socio: 6, url: 'ps22'}, -{number: 49, name: 'Scare Tactics', value: '', socio: 0, url: 'ps26'}, -{number: 50, name: 'Support Surges', value: '', socio: 0, url: 'ps25'}, -{number: 51, name: 'Support Falters', value: '', socio: 0, url: 'ps24'}, -{number: 52, name: 'Tactic Fails', value: '', socio: 0, url: 'ps27'}, -{number: 53, name: 'Rally in the Square', value: 3, socio: 0, url: 'ps1'}, -{number: 54, name: 'Petition', value: 3, socio: 0, url: 'ps10'}, +{number: 1, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 2, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 3, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 4, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 5, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 6, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 7, name: 'Strike', value: 6, socio: 0}, +{number: 8, name: 'Strike', value: 6, socio: 0}, +{number: 9, name: 'Strike', value: 5, socio: 0}, +{number: 10, name: 'Strike', value: 5, socio: 0}, +{number: 11, name: 'Strike', value: 4, socio: 0}, +{number: 12, name: 'Strike', value: 4, socio: 0}, +{number: 13, name: 'Strike', value: 4, socio: 0}, +{number: 14, name: 'Strike', value: 3, socio: 0}, +{number: 15, name: 'Strike', value: 3, socio: 0}, +{number: 16, name: 'Strike', value: 3, socio: 0}, +{number: 17, name: 'Strike', value: 3, socio: 0}, +{number: 18, name: 'Strike', value: 4, socio: 0}, +{number: 19, name: 'March', value: 6, socio: 0}, +{number: 20, name: 'March', value: 6, socio: 0}, +{number: 21, name: 'March', value: 5, socio: 0}, +{number: 22, name: 'March', value: 5, socio: 0}, +{number: 23, name: 'March', value: 4, socio: 0}, +{number: 24, name: 'March', value: 4, socio: 0}, +{number: 25, name: 'March', value: 4, socio: 0}, +{number: 26, name: 'March', value: 4, socio: 0}, +{number: 27, name: 'March', value: 3, socio: 0}, +{number: 28, name: 'March', value: 3, socio: 0}, +{number: 29, name: 'March', value: 3, socio: 0}, +{number: 30, name: 'March', value: 3, socio: 0}, +{number: 31, name: 'Petition', value: 6, socio: 0}, +{number: 32, name: 'Petition', value: 6, socio: 0}, +{number: 33, name: 'Petition', value: 6, socio: 0}, +{number: 34, name: 'Petition', value: 5, socio: 0}, +{number: 35, name: 'Petition', value: 5, socio: 0}, +{number: 36, name: 'Petition', value: 5, socio: 0}, +{number: 37, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 38, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 39, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 40, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 41, name: 'Elite Leader', value: 3, socio: 1}, +{number: 42, name: 'Elite Leader', value: 3, socio: 1}, +{number: 43, name: 'Elite Leader', value: 3, socio: 1}, +{number: 44, name: 'Elite Leader', value: 3, socio: 1}, +{number: 45, name: 'Worker Leader', value: 3, socio: 4}, +{number: 46, name: 'Worker Leader', value: 3, socio: 4}, +{number: 47, name: 'Student Leader', value: 3, socio: 6}, +{number: 48, name: 'Church Leader', value: 3, socio: 7}, +{number: 49, name: 'Support Falters', value: '', socio: 0}, +{number: 50, name: 'Support Surges', value: '', socio: 0}, +{number: 51, name: 'Scare Tactics', value: '', socio: 0}, +{number: 52, name: 'Tactic Fails', value: '', socio: 0}, ] if (typeof module !== 'undefined') module.exports = { spaces, cards, power_cards } @@ -880,15 +880,15 @@ tst_8 #// ============= POWER STRUGGLE WILDCARDS ========================= -CARD 349 - Scare Tactics -scare_tactics -valid_spaces_country_opp -prompt ()=>` from ${country_name(game.vm_active_country)}` -remove_opp_infl 1 + +CARD 349 - Support Falters +support_falters CARD 350 - Support Surges support_surges -CARD 351 - Support Falters -support_falters - +CARD 351 - Scare Tactics +scare_tactics +valid_spaces_country_opp +prompt ()=>` from ${country_name(game.vm_active_country)}` +remove_opp_infl 1
\ No newline at end of file @@ -391,11 +391,11 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } .card.power_11 { background-image: url(cards100/power_11.webp) } .card.power_12 { background-image: url(cards100/power_12.webp) } .card.power_13 { background-image: url(cards100/power_13.webp) } -.card.power_14 { background-image: url(cards100/power_14.webp) } +.card.power_14 { background-image: url(cards100/power_18.webp) } .card.power_15 { background-image: url(cards100/power_15.webp) } .card.power_16 { background-image: url(cards100/power_16.webp) } .card.power_17 { background-image: url(cards100/power_17.webp) } -.card.power_18 { background-image: url(cards100/power_18.webp) } +.card.power_18 { background-image: url(cards100/power_14.webp) } .card.power_19 { background-image: url(cards100/power_19.webp) } .card.power_20 { background-image: url(cards100/power_20.webp) } .card.power_21 { background-image: url(cards100/power_21.webp) } @@ -20,7 +20,7 @@ function on_click_action(evt) { const last_space = 74 const last_card = 110 -const last_power_card = 52 +const last_power_card = 54 const countries = [ "Poland", "Hungary", "East_Germany", "Bulgaria", "Czechoslovakia", "Romania" ] const board_events = [ 2, 9, 69, 97 ] @@ -273,9 +273,9 @@ function layout_country(id) { for (let i = 0; i < 6; i++) { // TODO: what number to display? if (view.revolutions[id]) - ui.countries[id].className = "marker comInfl ctl v" + view.times_held[id] - else if (view.times_held[id] > 0) ui.countries[id].className = "marker demInfl ctl v" + view.times_held[id] + else if (view.times_held[id] > 0) + ui.countries[id].className = "marker comInfl ctl v" + view.times_held[id] else ui.countries[id].className = "marker hide" } @@ -18,9 +18,9 @@ const leaders = [1, 4, 5, 6, 7] const support_loss_roll = [0, 0, 1, 1, 2, 2, 3, 4] const vp_roll = [0, 0, 1, 1, 2, 2, 3, 4] const countries = ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania'] -const elite_spaces = [12, 15, 27, 43, 51, 69] +const elite_spaces = [11, 14, 26, 42, 50, 68] const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] -const numberless_cards = [25, 26, 27, 28, 29, 30, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52] +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] @@ -194,9 +194,9 @@ exports.view = function(state, player) { if (game.is_pwr_struggle) { view.power_struggle_discard = game.power_struggle_discard view.played_power_card = game.played_power_card - } else { - view.strategy_discard = game.strategy_discard - } + } + view.strategy_discard = game.strategy_discard + if (player === game.active && game.vm && game.vm.draw) view.drawn = game.vm.draw @@ -1276,7 +1276,7 @@ states.raise_stakes_1 = { inactive: 'raise the stakes.', prompt () { - // console.log('raise stakes 1 - valid cards', game.valid_cards) + console.log('raise stakes 1 - com hand', game.com_pwr_hand, 'dem hand', game.dem_pwr_hand) // console.log('raise the stakes: game.played_power_card', game.played_power_card, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { view.prompt = 'Raise the stakes: you must pass.' @@ -1421,13 +1421,21 @@ states.power_struggle = { } if (game.phase === 1) { if (game.valid_cards.length > 0) { - view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` - gen_action('concede') + if (leader_cards.includes(game.played_power_card)) { + view.prompt = `${power_cards[game.played_power_card].name} played as a ${game.proxy_power_card}. You must match or concede.` + } else { + view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` + } + gen_action('concede') for (let card of game.valid_cards) { gen_action_power_card(card) } } else if (game.valid_cards.length === 0) { - view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` + if (leader_cards.includes(game.played_power_card)) { + view.prompt = `${power_cards[game.played_power_card].name} played as a ${game.proxy_power_card}. You must concede.` + } else { + view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` + } gen_action('concede') } } @@ -1448,6 +1456,7 @@ states.power_struggle = { discard(card) game.valid_cards=[] game.return_state = 'power_struggle' + if (game.phase === 0) {delete game.proxy_power_card} if (card === 52) { log_gap(`Played P52: P${power_cards[game.played_power_card].number} no longer playable`) @@ -1463,9 +1472,9 @@ states.power_struggle = { if (card >= 37 && card <= 48) { /*When a leader is played */ game.played_power_card = card game.phase = 3 - } else if (card === 49){ /*Scare Tactics */ + } else if (card === 51){ /*Scare Tactics */ game.return = '' - goto_vm(349) /*Can I combine these 3 into a single stage where you goto_vm(300 + card) ? */ + goto_vm(351) /*Can I combine these 3 into a single stage where you goto_vm(300 + card) ? */ } else if (card === 50) { /*Support Surges */ if (game.active === DEM) { game.return = COM @@ -1473,9 +1482,9 @@ states.power_struggle = { game.return = DEM } goto_vm(350) - } else if (game.phase === 0 && card === 51) { /*Support Falters */ + } else if (game.phase === 0 && card === 49) { /*Support Falters */ next_player() - goto_vm(351) + goto_vm(349) } else { game.played_power_card = card game.phase = 1 @@ -1527,28 +1536,28 @@ states.power_struggle = { }, strike () { log(`Played: P${power_cards[game.played_power_card].number} as a Strike`) - game.played_power_card = 9 + game.proxy_power_card = 'Strike' game.phase = 1 next_player() do_valid_cards() }, march () { log(`Played: P${power_cards[game.played_power_card].number} as a March`) - game.played_power_card = 21 + game.proxy_power_card = 'March' game.phase = 1 next_player() do_valid_cards() }, rally () { log(`Played: P${power_cards[game.played_power_card].number} as a Rally in the Square`) - game.played_power_card = 53 + game.proxy_power_card = 'Rally in the Square' game.phase = 1 next_player() do_valid_cards() }, petition () { log(`Played: P${power_cards[game.played_power_card].number} as a Petition`) - game.played_power_card = 54 + game.proxy_power_card = 'Petition' game.phase = 1 next_player() do_valid_cards() @@ -1629,8 +1638,8 @@ states.support_loss ={ let rally_win = 0 let petition_win = 0 log(`Roll: D${roll}`) - if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) { rally_win = 2} - if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.played_power_card === 54) { petition_win = 2} + if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} + if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.proxy_power_card === 'Petition') { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win // Roll modifiers @@ -1647,7 +1656,7 @@ states.support_loss ={ log(`+${game.raised_stakes} from Raising the Stakes`) } if (rally_win !== 0) { - log('+2 from winning on a P25') + log('+2 from winning on a P1') } if (petition_win !== 0) { log('-2 from winning on a P31') @@ -1715,8 +1724,8 @@ states.vp_roll = { log(`Roll: D${roll}`) let rally_win = 0 let petition_win = 0 - if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) {rally_win = 2} - if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.played_power_card === 54) {petition_win = 2} + if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} + if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.proxy_power_card === 'Petition') { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win if (game.active === DEM && game.persistent_events.includes(62)) { log('+1 from C62') @@ -1729,7 +1738,7 @@ states.vp_roll = { log(`+${game.raised_stakes} from Raising the Stakes`) } if (rally_win !== 0) { - log('+2 from winning on a P25') + log('+2 from winning on a P1') } if (petition_win !== 0) { log('-2 from winning on a P31') @@ -2810,9 +2819,13 @@ function valid_cards(player_hand, presence) { } else if (game.phase === 1) { for (let c of player_hand) { let card = power_cards.find(card => card && card.number === c); + console.log('card', card, ) if (card.name === power_cards[game.played_power_card].name) { valid_cards_set.add(card.number); - } else if (leaders.includes(card.socio) && presence[card.socio]) { + } else if (card.name === game.proxy_power_card) { + valid_cards_set.add(card.number) + } + else if (leaders.includes(card.socio) && presence[card.socio]) { valid_cards_set.add(card.number); } else if (card.number === 52) {valid_cards_set.add(card.number)} } @@ -9911,11 +9924,8 @@ CODE[208] = [ // Tiananmen Square space 8 event [ vm_return ], ] -CODE[349] = [ // Scare Tactics - [ vm_scare_tactics ], - [ vm_valid_spaces_country_opp ], - [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], - [ vm_remove_opp_infl, 1 ], +CODE[349] = [ // Support Falters + [ vm_support_falters ], [ vm_return ], ] @@ -9924,9 +9934,16 @@ CODE[350] = [ // Support Surges [ vm_return ], ] -CODE[351] = [ // Support Falters - [ vm_support_falters ], +CODE[351] = [ // Scare Tactics + [ vm_scare_tactics ], + [ vm_valid_spaces_country_opp ], + [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], + [ vm_remove_opp_infl, 1 ], [ vm_return ], ] + + + + // #endregion |