Kirk Trombley %!s(int64=4) %!d(string=hai) anos
pai
achega
423e76a5ad
Modificáronse 2 ficheiros con 5 adicións e 2 borrados
  1. 4 1
      client/src/components/screens/Lobby/Lobby.jsx
  2. 1 1
      server/app/scoring.py

+ 4 - 1
client/src/components/screens/Lobby/Lobby.jsx

@@ -8,7 +8,7 @@ import Loading from '../../util/Loading';
 import JoinForm from './JoinForm';
 import styles from './Lobby.module.css';
 import StartGame from './StartGame';
-import { NORMAL, TIME_BANK, FROZEN } from '../../../domain/ruleSets';
+import { NORMAL, TIME_BANK, FROZEN, COUNTRY_RACE } from '../../../domain/ruleSets';
 
 const GameInfo = () => {
   const { rounds, timer, countryLock, ruleSet } = useGameConfig();
@@ -19,6 +19,9 @@ const GameInfo = () => {
 
   let explanation;
   switch (ruleSet) {
+    case COUNTRY_RACE:
+      explanation = `${rounds !== 1 ? ", each": ""} with a ${ms(timer * 1000)} time limit, where you must be the fastest to select the right country`;
+      break
     case FROZEN:
       explanation = `${rounds !== 1 ? ", each" : ""} with a ${ms(timer * 1000)} time limit, and you will not be able to adjust your view`;
       break;

+ 1 - 1
server/app/scoring.py

@@ -77,4 +77,4 @@ def score_country_race(target: str, guess: str, time_remaining: int, time_total:
         return 5000
     
     # TODO make this into an interesting curve but for now linear is fine
-    return 5000 * (time_remaining / time_total)
+    return int(5000 * (time_remaining / time_total))