#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 manip = duplicate(recette.data.manipulation);
let reg1 = new RegExp(/@(\w*){([\w\-]+)}/ig); let reg1 = new RegExp(/@(\w*){([\w\-]+)}/ig);
let matchArray = manip.match( reg1 ); let matchArray = manip.match( reg1 );
for( let matchStr of matchArray) { if ( matchArray ) {
let reg2 = new RegExp(/@(\w*){([\w\-]+)}/i); for( let matchStr of matchArray) {
let result = matchStr.match(reg2); let reg2 = new RegExp(/@(\w*){([\w\-]+)}/i);
//console.log("RESULT ", result); let result = matchStr.match(reg2);
if ( result[1] && result[2]) { //console.log("RESULT ", result);
let commande = Misc.upperFirst( result[1] ); if ( result[1] && result[2]) {
let replacement = this[`_alchimie${commande}`](recette, result[2], actorId); let commande = Misc.upperFirst( result[1] );
manip = manip.replace( result[0], replacement); let replacement = this[`_alchimie${commande}`](recette, result[2], actorId);
manip = manip.replace( result[0], replacement);
}
} }
} }
recette.data.manipulation_update = manip; recette.data.manipulation_update = manip;

View File

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