From 85ee58c56d25ab91e6816bd7aa530a039f24e542 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 22 Aug 2026 12:41:39 +0200 Subject: [PATCH] Farmer: "Braucht Hilfe" auch bei schlechter Trefferquote (nicht nur cash<0) Ben spielt bewusst schlecht (hit_rate ~10%), Konto aber wieder im Plus -> blinkte nicht. needsHelp (teacher.html client + live.php server) jetzt: cash<0 ODER (attempts>=6 UND hit_rate<30). Faengt dauerhaft falsche Boden/Klima-Wahl; Clara (hit 75, 3 Krankheiten) bleibt bewusst ruhig. Co-Authored-By: Claude Opus 4.8 --- App/php/api/live.php | 5 ++++- App/teacher.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/App/php/api/live.php b/App/php/api/live.php index 26c7782..222b22b 100644 --- a/App/php/api/live.php +++ b/App/php/api/live.php @@ -710,7 +710,10 @@ if ($method === 'GET') { case 'weltkueche': return ($state['mistakesInDish'] ?? 0) >= 12; case 'farmer': - return ($state['cash'] ?? 1000) < 0; + // Konto im Minus ODER dauerhaft schlechte Trefferquote (falsche + // Boden/Klima-Wahl) — auch wenn das Konto (noch) im Plus ist. + return ($state['cash'] ?? 1000) < 0 + || (($state['attempts'] ?? 0) >= 6 && isset($state['hit_rate']) && $state['hit_rate'] < 30); case 'logistik': return ($state['balance'] ?? 1000) < 0; case 'eu-werkstatt': diff --git a/App/teacher.html b/App/teacher.html index 0ab1d73..f06dc78 100644 --- a/App/teacher.html +++ b/App/teacher.html @@ -1251,7 +1251,7 @@ function _liveNeedsHelp(simId, s) { case 'heli': return (s.planAttempts||0) >= 10; case 'klima': case 'klima-3d': return (s.budget||0) < 0; case 'weltkueche': return (s.mistakesInDish||0) >= 12; - case 'farmer': return (s.cash==null?1000:s.cash) < 0; + case 'farmer': return (s.cash==null?1000:s.cash) < 0 || ((s.attempts||0) >= 6 && s.hit_rate != null && s.hit_rate < 30); case 'logistik': return (s.balance==null?1000:s.balance) < 0; case 'eu-werkstatt': return (s.attemptsThisStep||0) >= 6; case 'tourismustal': return (s.money==null?1:s.money) < 0 || (s.lossStreak||0) >= 8;