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: "doctor", method: "healthDoctor", cost: 50 },
{ tr: "witch", method: "healthWitch", cost: 500 }, { tr: "witch", method: "healthWitch", cost: 500 },
{ tr: "pill", method: "healthPill", cost: 5000 }, { tr: "pill", method: "healthPill", cost: 5000 },
{ tr: "drunkOfLife", method: "healthDruckOfLife", cost: 5000000 } { tr: "drunkOfLife", method: "healthDrunkOfLife", cost: 5000000 }
]; ];
static RECURSIVE_REGION_SEARCH = ` static RECURSIVE_REGION_SEARCH = `
@@ -3189,8 +3189,19 @@ class FalukantService extends BaseService {
} }
async healthDrunkOfLife(user) { async healthDrunkOfLife(user) {
const raw = Math.floor(Math.random() * 26); // Erfolgschance: 90%
return this.healthChange(user, raw); 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) { async getPoliticsOverview(hashedUserId) {

View File

@@ -439,11 +439,13 @@
"new nobility title": "Neuer Adelstitel", "new nobility title": "Neuer Adelstitel",
"partyOrder": "Fest bestellt", "partyOrder": "Fest bestellt",
"renovation_all": "Haus komplett renoviert", "renovation_all": "Haus komplett renoviert",
"health.pill": "Gesundheitsmaßnahme: Tablette", "health": {
"health.doctor": "Gesundheitsmaßnahme: Arztbesuch", "pill": "Gesundheitsmaßnahme: Tablette",
"health.witch": "Gesundheitsmaßnahme: Hexe", "doctor": "Gesundheitsmaßnahme: Arztbesuch",
"health.drunkOfLife": "Gesundheitsmaßnahme: Trunk des Lebens", "witch": "Gesundheitsmaßnahme: Hexe",
"health.barber": "Gesundheitsmaßnahme: Barbier" "drunkOfLife": "Gesundheitsmaßnahme: Trunk des Lebens",
"barber": "Gesundheitsmaßnahme: Barbier"
}
} }
}, },
"newdirector": { "newdirector": {

View File

@@ -71,11 +71,13 @@
"new nobility title": "New title of nobility", "new nobility title": "New title of nobility",
"partyOrder": "Party ordered", "partyOrder": "Party ordered",
"renovation_all": "House fully renovated", "renovation_all": "House fully renovated",
"health.pill": "Health measure: pill", "health": {
"health.doctor": "Health measure: doctor", "pill": "Health measure: pill",
"health.witch": "Health measure: witch", "doctor": "Health measure: doctor",
"health.drunkOfLife": "Health measure: elixir of life", "witch": "Health measure: witch",
"health.barber": "Health measure: barber" "drunkOfLife": "Health measure: elixir of life",
"barber": "Health measure: barber"
}
} }
}, },
"newdirector": { "newdirector": {