/*: * @plugindesc Adds formulas into description boxes of items, equips and skills * @author Poryg * * @help * Simple use. Just use $[formula to eval] in your description box. * */ Window_Help.prototype.convertEscapeCharacters = function(text) { text = text.replace(/\\/g, '\x1b'); text = text.replace(/\x1b\x1b/g, '\\'); text = text.replace(/\x1bV\[(\d+)\]/gi, function() { return $gameVariables.value(parseInt(arguments[1])); }.bind(this)); text = text.replace(/\x1bV\[(\d+)\]/gi, function() { return $gameVariables.value(parseInt(arguments[1])); }.bind(this)); text = text.replace(/\x1bN\[(\d+)\]/gi, function() { return this.actorName(parseInt(arguments[1])); }.bind(this)); text = text.replace(/\x1bP\[(\d+)\]/gi, function() { return this.partyMemberName(parseInt(arguments[1])); }.bind(this)); text = text.replace(/\x1b\$\[([^\]]+)\]/gi, function() { return eval(arguments[1]); }.bind(this)); text = text.replace(/\x1bG/gi, TextManager.currencyUnit); return text; };