- Joined
- Oct 6, 2013
- Messages
- 1,319
- Reaction score
- 827
- First Language
- English
Hey all. So, in my current project, I reworked "LUCK" into a stat called "POWER" which serves as an indicator of a piece of gear's potential/strength/what-have-you. My question is two-fold:
Any/all help would be appreciated, thank you! ^_^
- How exactly does the default optimize button work? How are stats weighed? Does it just put on the piece with the highest total amount of stats on it, skewing items with higher hp/mp to always be equipped?
- Is there a way to change the way the optimize formula works to be based off one stat instead: LUCK? If so, HOW?
Game_Actor.prototype.bestEquipItem = function(slotId) {
var etypeId = this.equipSlots()[slotId];
var items = $gameParty.equipItems().filter(function(item) {
return item.etypeId === etypeId && this.canEquip(item);
}, this);
var bestItem = null;
var bestPerformance = -1000;
for (var i = 0; i < items.length; i++) {
var performance = this.calcEquipItemPerformance(items);
if (performance > bestPerformance) {
bestPerformance = performance;
bestItem = items;
}
}
return bestItem;
};
Game_Actor.prototype.calcEquipItemPerformance = function(item) {
return item.params.reduce(function(a, b) {
return a + b;
});
};
var etypeId = this.equipSlots()[slotId];
var items = $gameParty.equipItems().filter(function(item) {
return item.etypeId === etypeId && this.canEquip(item);
}, this);
var bestItem = null;
var bestPerformance = -1000;
for (var i = 0; i < items.length; i++) {
var performance = this.calcEquipItemPerformance(items);
if (performance > bestPerformance) {
bestPerformance = performance;
bestItem = items;
}
}
return bestItem;
};
Game_Actor.prototype.calcEquipItemPerformance = function(item) {
return item.params.reduce(function(a, b) {
return a + b;
});
};
Any/all help would be appreciated, thank you! ^_^
Last edited: