difficultés

This commit is contained in:
François-Xavier Guillois
2023-08-25 16:15:04 +02:00
parent c57c355066
commit 9f760deee0
5 changed files with 48 additions and 7 deletions
+8
View File
@@ -14,6 +14,14 @@ VERMINE.SkillLevels = {
5:{ "label":"VERMINE.skill_level.legend", "dicePool":3, "reroll":2}
}
VERMINE.DifficultyLevels = {
1:{ "label":"DIFFICULTY_LEVELS.obvious", "difficulty":3},
2:{ "label":"DIFFICULTY_LEVELS.easy", "difficulty":5},
3:{ "label":"DIFFICULTY_LEVELS.hard", "difficulty":7},
4:{ "label":"DIFFICULTY_LEVELS.very_hard", "difficulty":9},
5:{ "label":"DIFFICULTY_LEVELS.impossible", "difficulty":10}
},
VERMINE.Instincts = {
1:{ "key":"architect"},
2:{ "key":"sword"},
+2 -2
View File
@@ -38,11 +38,11 @@
export const getRollBox = async function(data) {
let html = await renderTemplate('systems/vermine2047/templates/roll.hbs', data);
let ui = new Dialog({
title: game.i18n.localize("VERMINE.roll_tool"),
title: game.i18n.localize("ROLLS.tool"),
content: html,
buttons: {
roll: {
label: game.i18n.localize('VERMINE.roll_dice'),
label: game.i18n.localize('ROLLS.roll_dice'),
callback: (html) => {
let form = html.find('#dice-pool-form');
if (!form[0].checkValidity()) {
+13 -1
View File
@@ -51,10 +51,22 @@ export const registerHandlebarsHelpers = function () {
if (level < 1 || level > 5)
return "";
let levelData = CONFIG.VERMINE.SkillLevels[level];
return (levelData !== undefined) ? levelData[property] : "";
});
// return diff level information
Handlebars.registerHelper('diffLevel', function (property, level, options) {
if (level < 1 || level > 5)
return "";
let levelData = CONFIG.VERMINE.DifficultyLevels[level];
if (property == 'label'){
return (levelData !== undefined) ? game.i18n.localize(levelData[property]) : "";
} else {
return (levelData !== undefined) ? levelData[property] : "";
}
});
Handlebars.registerHelper('getCombatTrackerColor', function (isPlayer, isNpc) {
if (isPlayer) return "player";
if (isNpc) return "npc";