diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-05-11 19:52:29 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:31:29 +0100 |
commit | d2633b9918751dc9fb3f44f842dc80dd19b995f6 (patch) | |
tree | f1625bedd037f5f168e968316c3d8a4480eae9ad | |
parent | d0eb4841014cab1927847e2fafae3772a3c74e4e (diff) | |
download | pax-pamir-d2633b9918751dc9fb3f44f842dc80dd19b995f6.tar.gz |
Fix lint warnings.
-rw-r--r-- | rules.js | 24 |
1 files changed, 10 insertions, 14 deletions
@@ -209,10 +209,6 @@ function a_coalition(s) { } } -function the_card(c) { - return `#${c}`; -} - function logbr() { if (game.log.length > 0 && game.log[game.log.length-1] !== "") game.log.push(""); @@ -307,7 +303,7 @@ function player_has_citadel_in_kabul(p) { return player_has_court_card(p, 17); } function player_has_citadel_in_transcaspia(p) { return player_has_court_card(p, 97); } function player_has_safe_house(p) { return player_has_court_card(p, 41) || player_has_court_card(p, 72); } -function which_player_has_insurrection(p) { return which_player_has_court_card(3); } +function which_player_has_insurrection() { return which_player_has_court_card(3); } function player_has_citadel(p, r) { if (r === Kabul) return player_has_citadel_in_kabul(p); @@ -463,6 +459,7 @@ function is_favored_suit(c) { return true; if (c === 91) return true; // Savvy Operator if (c === 99) return true; // Irregulars + return false; } function rightmost_card(row, i) { @@ -1903,13 +1900,13 @@ states.battle = { prompt() { if (game.where <= 0) { view.prompt = `Start a battle in a single region or on a court card.`; - for (let p = 0; p < game.players.length; ++p) { - let court = game.players[p].court; - for (let i = 0; i < court.length; ++i) { - if (is_battle_card(court[i])) - gen_action('card', court[i]); + for (let p = 0; p < game.players.length; ++p) { + let court = game.players[p].court; + for (let i = 0; i < court.length; ++i) { + if (is_battle_card(court[i])) + gen_action('card', court[i]); + } } - } for (let r = first_region; r <= last_region; ++r) { if (is_battle_region(r)) gen_action('space', r); @@ -2146,7 +2143,7 @@ states.insurrection = { push_undo(); game.selected = x; }, - space(s) { + space() { push_undo(); logi(`Afghan army to Kabul.`); game.pieces[game.selected] = Kabul; @@ -2730,7 +2727,6 @@ function do_dominance_check(reason) { if (final) log(`Final Dominance Check.`); let list = []; - let msg = "Ranking:"; for (let p = 0; p < game.players.length; ++p) { score[p] = count_cylinders_in_play(p); if (score[p] !== 1) @@ -2753,7 +2749,7 @@ function do_dominance_check(reason) { } // Check instant victory - let vps = game.players.map((pp,i) => pp.vp).sort((a,b)=>b-a); + let vps = game.players.map(pp => pp.vp).sort((a,b)=>b-a); if (vps[0] >= vps[1] + 4) return goto_game_over(); |