This *might* be solvable without JS, BUT whatever. I already have some x-params connected to my Luck stat with some JS. E.g. Luck also increases evasion. But what if like your elemental resistance could be increased by certain stats as well? I am using the VisuStella engine, if it matters. How could I accomplish this?
MZ Can I connect elemental resistance to stat growth?
Javascript/Plugin SupportThe function that returns state rate is:
You can copy that into a *.js file and include it as a plugin with the math modified however you like. For example, you could do
to make 10% of the luck be elemental resistance. Of course, you want to be careful with your numbers. And if you have any VisuStella plugins that already mess with elements, this might not work properly.
Code:
Game_BattlerBase.prototype.stateRate = function(stateId) {
return this.traitsPi(Game_BattlerBase.TRAIT_STATE_RATE, stateId);
};
You can copy that into a *.js file and include it as a plugin with the math modified however you like. For example, you could do
Code:
return this.traitsPi(Game_BattlerBase.TRAIT_STATE_RATE, stateId)-this.luk/100;
to make 10% of the luck be elemental resistance. Of course, you want to be careful with your numbers. And if you have any VisuStella plugins that already mess with elements, this might not work properly.
so you are subtracting "this.luk/100" from the element rate? I just want to know I am reading things correctly.
Yes.
Ok, sweet. I will toy with your code and see what I can do.
Original thread: https://forums.rpgmakerweb.com/threads/can-i-connect-elemental-resistance-to-stat-growth.153941/