Fix typo in healthDrunkOfLife method and enhance health change logic in FalukantService; refactor health measures localization structure in English and German JSON files for better organization.

This commit is contained in:
Torsten Schulz (local)
2025-12-02 13:05:39 +01:00
parent 08e2c87de8
commit e57de7f983
3 changed files with 28 additions and 13 deletions

View File

@@ -213,7 +213,7 @@ class FalukantService extends BaseService {
{ tr: "doctor", method: "healthDoctor", cost: 50 },
{ tr: "witch", method: "healthWitch", cost: 500 },
{ tr: "pill", method: "healthPill", cost: 5000 },
{ tr: "drunkOfLife", method: "healthDruckOfLife", cost: 5000000 }
{ tr: "drunkOfLife", method: "healthDrunkOfLife", cost: 5000000 }
];
static RECURSIVE_REGION_SEARCH = `
@@ -3189,8 +3189,19 @@ class FalukantService extends BaseService {
}
async healthDrunkOfLife(user) {
const raw = Math.floor(Math.random() * 26);
return this.healthChange(user, raw);
// Erfolgschance: 90%
const success = Math.random() < 0.9;
let delta;
if (success) {
// Bei Erfolg: Gesundheit um 5-35% verbessern
delta = Math.floor(Math.random() * 31) + 5; // 5-35
} else {
// Bei Misserfolg: Gesundheit um 1-10% verschlechtern
delta = -(Math.floor(Math.random() * 10) + 1); // -1 bis -10
}
return this.healthChange(user, delta);
}
async getPoliticsOverview(hashedUserId) {