X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=blobdiff_plain;f=empathy%2Fempathy.jsx;h=001dcd5eeeb5ac3f943d368f971f8a78d19981d3;hp=570e585b3076bda4117842acc009a209a357215b;hb=49a7e9338a8160363ede955ae0d036abc360a359;hpb=da31560cbb4678376e32af417a1c9ee47f031330 diff --git a/empathy/empathy.jsx b/empathy/empathy.jsx index 570e585..001dcd5 100644 --- a/empathy/empathy.jsx +++ b/empathy/empathy.jsx @@ -433,14 +433,14 @@ const PromptOptions = React.memo(props => { const LetsPlay = React.memo(props => { - const quorum = Math.round((props.num_players + 1) / 2); + const quorum = Math.max(0, props.num_players - props.prompts.length); const max_votes = props.prompts.reduce( (max_so_far, v) => Math.max(max_so_far, v.votes.length), 0); if (max_votes < quorum) return null; - const candidates = props.prompts.filter(p => p.votes.length >= quorum); + const candidates = props.prompts.filter(p => p.votes.length >= max_votes); const index = Math.floor(Math.random() * candidates.length); const winner = candidates[index]; @@ -1227,7 +1227,9 @@ class Game extends React.PureComponent { } return (
  • - {score.players.join("/")}: {score.score} {perfect} {quirkster} + {score.players.join("/")}: {score.score} + {score.kudos ? `, ${'★'.repeat(score.kudos)}` : ""} + {perfect} {quirkster}
  • ); })} @@ -1237,7 +1239,9 @@ class Game extends React.PureComponent { {state.scores.words.map(word => { return (
  • - {word.word} ({word.players.length}): {word.players.join(', ')} + {word.word} ({word.players.length} + {word.kudos.length ? `, ${'★'.repeat(word.kudos.length)}` : ""} + ): {word.players.join(', ')}
  • ); })} @@ -1306,15 +1310,15 @@ class Game extends React.PureComponent { , - , , + ]; }