#77 Gestion alchimie

This commit is contained in:
sladecraven 2021-01-07 22:29:43 +01:00
parent f4dc42743a
commit 69b2907078
2 changed files with 11 additions and 9 deletions

View File

@ -10,14 +10,16 @@ export class RdDAlchimie {
let manip = duplicate(recette.data.manipulation);
let reg1 = new RegExp(/@(\w*){([\w\-]+)}/ig);
let matchArray = manip.match( reg1 );
for( let matchStr of matchArray) {
let reg2 = new RegExp(/@(\w*){([\w\-]+)}/i);
let result = matchStr.match(reg2);
//console.log("RESULT ", result);
if ( result[1] && result[2]) {
let commande = Misc.upperFirst( result[1] );
let replacement = this[`_alchimie${commande}`](recette, result[2], actorId);
manip = manip.replace( result[0], replacement);
if ( matchArray ) {
for( let matchStr of matchArray) {
let reg2 = new RegExp(/@(\w*){([\w\-]+)}/i);
let result = matchStr.match(reg2);
//console.log("RESULT ", result);
if ( result[1] && result[2]) {
let commande = Misc.upperFirst( result[1] );
let replacement = this[`_alchimie${commande}`](recette, result[2], actorId);
manip = manip.replace( result[0], replacement);
}
}
}
recette.data.manipulation_update = manip;

View File

@ -2,7 +2,7 @@
"name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"description": "Rêve de Dragon RPG for FoundryVTT",
"version": "1.2.4",
"version": "1.2.5",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.8",
"templateVersion": 80,