Commit 2434d546 authored by baktov's avatar baktov
Browse files

correctifs calcul déplacement version 0.99

Première màj suite à la montée de version 0.99 : calcul des déplacements corrigé afin de permettre l'ouverture des compendiums de monstre SRD.
parent 8655afe8
Pipeline #213138331 passed with stages
in 41 seconds
......@@ -123,7 +123,7 @@ Hooks.once('init', () => {
"undead (shapechanger)":"Mort-vivant (métamorphe)",
"undead":"Mort-vivant"
};
/** deprecated
function rempl(chaine) {
var regexp = /([0-9]+)/gi; // recherche des valeurs numériques
if (chaine.includes('ft')) {
......@@ -139,7 +139,7 @@ Hooks.once('init', () => {
console.log("non transco =>" + chaine + "<<");
return chaine;
}
*/
function remplSens(chaine) {
var regexp = /([0-9]+)/gi; // recherche des valeurs numériques
chaine = chaine.replace(/ft/gi, 'm'); // toutes les occurences en ft
......@@ -235,6 +235,30 @@ Hooks.once('init', () => {
return range;
}
},
"movement": (movement) => {
console.log(movement.units);
if(movement) {
if(movement.units === 'ft') {
for (var i in movement) {
if(movement[i] === 'ft') {
movement[i] = 'm'
} else {
movement[i] = movement[i]*0.3
}
}
}
if(movement.units === 'mi') {
for (var i in movement) {
if(movement[i] === 'mi') {
movement[i] = 'km'
} else {
movement[i] = movement[i]*1.5
}
}
}
return movement;
}
},
"alignement": (alignement) => {
return typeAlignement[alignement.toLowerCase()];
},
......@@ -244,6 +268,7 @@ Hooks.once('init', () => {
"type": (typeC) => {
return typeCreature[typeC.toLowerCase()];
},
/** deprecated
"speed": (testV) => {
//console.log(JSON.parse(JSON.stringify(testV))); //{value: "Fly 80 ft.", special: "Walk 10 ft."}
if (testV.special) {
......@@ -265,6 +290,7 @@ Hooks.once('init', () => {
);
return mergeObject(testV, { value: vitesse });
},
*/
"senses": (sens) => {
if (sens != null ) {
//console.log(JSON.parse(JSON.stringify(sens)));
......
{
"label": "Prétirés",
"mapping": {
"speed": {
"path": "data.attributes.speed",
"converter": "speed"
},
"movement": {
"path": "data.attributes.movement",
"converter":"movement"
},
"race": "data.details.race",
"background": "data.details.background",
"alignment": {
......
......@@ -13,9 +13,9 @@
"path": "data.traits.senses",
"converter": "senses"
},
"speed": {
"path": "data.attributes.speed",
"converter":"speed"
"movement": {
"path": "data.attributes.movement",
"converter":"movement"
},
"languages": {
"path": "data.traits.languages.custom",
......@@ -2,7 +2,7 @@
"name": "dnd5e_fr-FR",
"title": "fr-FR - DND5 System",
"description": "<p>Traduction du system DD5 [Atropos]. L'installation du module Babele est nécessaire pour les compendiums [texte du SRD : site aidedd.org]</p><p> *** Rejoignez la communauté Discord FR :<a href='https://discord.gg/pPSDNJk'> https://discord.gg/pPSDNJk </a></p>",
"version": "0.98.4",
"version": "0.99.0",
"systems": ["dnd5e"],
"minimumCoreVersion" : "0.7.5",
"compatibleCoreVersion": "0.7.6",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment