ajout du handicap de rareté

This commit is contained in:
rwanoux
2024-11-20 12:08:03 +01:00
parent 6568eb067f
commit 80277f822f
14 changed files with 160 additions and 83 deletions
+20
View File
@@ -41,6 +41,8 @@ export const preloadHandlebarsTemplates = async function () {
//items partials
"systems/vermine2047/templates/item/partials/damages.html",
"systems/vermine2047/templates/item/partials/traits.html",
"systems/vermine2047/templates/item/partials/header.hbs",
"systems/vermine2047/templates/item/partials/physicalItems.hbs",
]);
};
@@ -84,6 +86,24 @@ export const registerHandlebarsHelpers = function () {
Handlebars.registerHelper('toLowerCase', function (str) {
return str.toLowerCase();
});
Handlebars.registerHelper('romanNumber', function (numb) {
switch (numb) {
case 0:
return '';
case 1:
return 'I';
case 2:
return 'II';
case 3:
return 'III';
case 4:
return 'IV';
case 5:
return 'V';
default:
throw new Error('Le handicap rareté doit être comprise entre 0 et 5');
}
});
// search translation with variables
Handlebars.registerHelper('smarttl', function (arrayLabel, objectLabel, options) {