Nombreuses corrections sur les maladies et symptomes
All checks were successful
Validation JSON / validate (push) Successful in 24s
All checks were successful
Validation JSON / validate (push) Successful in 24s
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user