This commit is contained in:
2021-07-26 23:54:21 +02:00
parent e6e1cbd073
commit 69551f3499
4 changed files with 41 additions and 4 deletions

View File

@@ -34,9 +34,35 @@ Hooks.once('init', () => {
vo_conditions: vo_conditions }
game.wfrp4e.apps.StatBlockParser.parseStatBlock = async function( statString, type = "npc") {
return statParserFR( statString, type);
return statParserFR( statString, type);
}
/*---------------------------------------------------------------------*/
game.wfrp4e.utility.handleConditionClick = function(event) {
let cond = $(event.currentTarget).attr("data-cond")
if (!cond)
cond = event.target.text;
cond = cond.trim();
let condkey
// En vo, les noms d'états sont égaux aux clés en minuscules
if ( game.wfrp4e.config.conditions[cond.toLowerCase()] ) {
condkey = cond.toLowerCase();
} else {
try {
condkey = game.wfrp4e.utility.findKey(cond.toLowerCase(), game.wfrp4e.config.conditions, {caseInsensitive: true});
}
catch {
ui.notifications.error("L'état est inconnu : " + cond);
}
}
let condName = game.wfrp4e.config.conditions[condkey];
let condDescr = game.wfrp4e.config.conditionDescriptions[condkey];
let messageContent = `<b>${condName}</b><br>${condDescr}`
let chatData = game.wfrp4e.utility.chatDataSetup(messageContent)
ChatMessage.create(chatData);
}
/*---------------------------------------------------------------------*/
game.wfrp4e.entities.ItemWfrp4e.prototype.computeSpellDamage = function(formula, isMagicMissile) {
try {