in MV ... there's no RPG::Item equivalent...
we can access the data from $dataItems though...
you can create outside function that pass those item object from $dataItems.
for example inside Game_System (so it can be called anywhere using $gameSystem
example:
Game_System.prototype.phoenix_down = function(item) { comment = item.note; if(comment.match(/<phoenix_down>/im)) return true; return false;};
to use it... you can use this anywhere:
if (DataManager.isItem(item) && $gameSystem.phoenix_down(item)) { //stuff here}hope this help.
How about something like this in particular?
class RPG::Item def volume_of_power return (self.note[/\\maximum([0-9]+?)/] ? [$1.to_i, 1].max : 1) end def percentage_of_power return (self.note[/\\power([0-9]+?)%/] ? [$1.to_i, 1].max : 100) endendWhat is its direct translation?
maybe...
Game_System.prototype.volume_of_power = function(item) { var value = 1; var comment = item.note; if(comment.match(/\\maximum([0-9]+?)/im)) var vol = Number(comment.match(/\\maximum([0-9]+?)/i)[1]); if (vol) value = Math.max(value, vol); return value;};Game_System.prototype.percentage_of_power = function(item) { var value = 100; var comment = item.note; if(comment.match(/\\power([0-9]+?)%/im)) value = Number(comment.match(/\\power([0-9]+?)%/i)[1]); value = Math.max(value, 1); return value;};
didn't test it though. i also use your regexp. but i think it should work fine if ACE version regexp works fine.
what I would do:
$dataItems.forEach(item) { if (item !== null && item.name === 'some name here') { //do some code }}We check if item is null because if you look at $dataItems, the first on seems to be null ...