Element Rates Addition instead of Multiplication.

First of all, sorry for bad english 😛

As you may know, when a monster or character have two element rates for one element, they multiply.

For example, if a character has a shield that gives Fire Rate 80% and a helm that gives Fire Rate 90%, then 0.8 * 0.9 = 0.72, which means the character has a "total" Fire Rate of 72%.

Is there a way to change this, so instead of multiplying the element rates, they get added?

Using the same example, I would like that a character that has Fire Rates of 80% and 90% would get a "total" Fire Rate of 170% (0.8 + 0.9).

I know it doesn't seem to make much sense because two "resistances" suddenly become a "weakness", but within the proyect I'm working on, that's what I need.

I hope this can be done, and thanks in advance.
If you're willing to dive directly into the script, just change this:

Game_BattlerBase.prototype.elementRate = function(elementId) {
    return this.traitsPi(Game_BattlerBase.TRAIT_ELEMENT_RATE, elementId);
};
to this:

Game_BattlerBase.prototype.elementRate = function(elementId) {
    return this.traitsSum(Game_BattlerBase.TRAIT_ELEMENT_RATE, elementId);
};
Thanks a lot! 😀

I tried it in an new project and it seems to work just as I needed.

The only think that bothers me a little now is if this will either affect how some plugins work, or if some plugins may overwrite this change.

I guess I will just have to test it.

Once again, thank you.
1) It can have side effects and cause incompatibilities, because there are reasons why the multiplication was used.


The most problematic of those affects is that now it is impossible to have a guaranteed zero (absolute immunity) - if a state adds element rate now, it can override any zero (with multiplication, any multiplication with zero remains zero but adding to zero will increase the damage)


2) In the case of an override, just make sure that your plugin is executed last. Then it cannot be overwritten, but the risk for incompatibilities is higher.
Thanks for the comments.

1) I do have a workaround to deal with immunities, but the incompatibilities are still a worry. I still haven't had the time to check if there is any though.

2) Thanks for the advice. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/element-rates-addition-instead-of-multiplication.54822/