Per-Sim leistung_pct: alle 14 Sims senden das eine Leistungs-% (0-100)
Jede Sim liefert jetzt selbst leistung_pct in GGS_LIVE_STATE UND im Submit (Fundament fuer das einheitliche %-System) — kein Rueckrechnen aus Sternen mehr, keine 0-3-Sonderfaelle. Formeln je Sim wie vereinbart: - klima/fluss/kofferdetektiv/heli: = vorhandener 0-100-score - weltkueche: richtige/(richtige+falsche)*100 (Fehler in %) - busfahrt/fluggesellschaft: topoPunkte/(Auftraege*3)*100 - farmer: gewichteter totalScore; energiemanager: ausgegl./gesamt -15/Blackout - eu-werkstatt: firstTry/Schritte -5/Muelleimer; sonnensystem: Erstversuch-Quote - tourismustal: Ziele+Zufriedenheit+Natur gewichtet; tourismusregion: gewichteter score - logistik: Kontostand->% (sendet erstmals eine Kennzahl, auch an /api/assessment) Teacher _leistungPct + live.php extractScore bevorzugen bereits diesen Wert. Additive Aenderungen, bestehende Logik/Sterne unveraendert; alle 15 Dateien syntaktisch geprueft. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -501,6 +501,18 @@ window.GGS_LIVE_STATE = function () {
|
||||
if (!parts.length) return null;
|
||||
return Math.round(parts.reduce(function(a,b){return a+b;},0)/parts.length);
|
||||
})(),
|
||||
// Gleicher Wert wie score (0–100), als vereinheitlichte Leistungs-Kennzahl.
|
||||
leistung_pct: (function(){
|
||||
if (!phase || phase === 'mission' || phase === 'briefing') return null;
|
||||
if (landingDone && game.totalStars != null) return Math.round(Math.max(0,Math.min(5,game.totalStars))/5*100);
|
||||
var parts = [];
|
||||
var clicks = (game.planCorrect||0) + (game.planAttempts||0);
|
||||
if (clicks > 0) parts.push(Math.round((game.planCorrect||0) / clicks * 100));
|
||||
if (startDone && game.startScore != null) parts.push(Math.max(0,Math.min(5,game.startScore))/5*100);
|
||||
if (landingDone && game.landingScore != null) parts.push(Math.max(0,Math.min(5,game.landingScore))/5*100);
|
||||
if (!parts.length) return null;
|
||||
return Math.round(parts.reduce(function(a,b){return a+b;},0)/parts.length);
|
||||
})(),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -786,6 +798,7 @@ function submitHeliMission() {
|
||||
level: window.HELI_FORCED_LEVEL || null,
|
||||
stars: stars,
|
||||
score: score,
|
||||
leistung_pct: Math.max(0, Math.min(100, Math.round(score))),
|
||||
duration_ms: dt,
|
||||
completed: !game.missionFailed,
|
||||
results: {
|
||||
|
||||
Reference in New Issue
Block a user