Nombreuses corrections sur les maladies et symptomes
All checks were successful
Validation JSON / validate (push) Successful in 24s

This commit is contained in:
2026-03-22 20:41:58 +01:00
parent 8862698262
commit 5f4e0c7ce5
39 changed files with 9796 additions and 35493 deletions

View File

@@ -404,6 +404,22 @@ Hooks.on('ready', () => {
// Patch function for effects
game.wfrp4e.utility.findKey = warhammer.utility.findKey
// Patch postSymptom to handle English symptom names in @Symptom[...] links.
// After i18nInit, config.symptoms values are French strings (e.g. "Fièvre"), so
// findKey("Fever", config.symptoms) fails. We normalize via game.i18n.localize first.
const _origPostSymptom = game.wfrp4e.utility.postSymptom.bind(game.wfrp4e.utility);
game.wfrp4e.utility.postSymptom = async function(symptom) {
const baseName = symptom.split("(")[0].trim();
const symkey = warhammer.utility.findKey(baseName, game.wfrp4e.config.symptoms);
if (!symkey) {
const localizedBase = game.i18n.localize(baseName);
if (localizedBase !== baseName) {
symptom = symptom.replace(baseName, localizedBase);
}
}
return _origPostSymptom(symptom);
};
/** New modifiers */
game.wfrp4e.config.difficultyModifiers = {
"veasy": 60,