For the last year, I've been convinced that the element resistances in my game stack additively. I know the multiplicative way is the norm in the engine, but I found a snippet to change the system and it all seemed to work suddenly. I tested many different pieces of gear with elemental resistances, and they stacked the resistance additively as planned.
Now, after about a year of using the system... it suddenly doesn't seem to work on one occasion.
I'd rather explain the entire mess with images, so here goes.
This character here has got 2 perks increasing Air Defence. 5% and 15%.
In this image, you can see how it correctly adds up to 20%.
This character also has 2 perks for Air Defence- 65% and 5%.
And this is the godforsaken result.
65 +15 = 71, according to this system. Where does the 1 come from? It wouldn't make sense even in the default system. The character doesn't have any initial resistance changes on her, and it clearly says on the states descriptions, to increase the rates for 95% and 35% (which reverses as 5% and 65%.
This is the snippet I used to change the multiplicative stacking to additive. It has worked before this, although I haven't tested it extensively.
class Game_BattlerBase
def element_rate(element_id)
features_with_id(FEATURE_ELEMENT_RATE, element_id).inject(1.0) {|r, ft| r += ft.value - 1 }
end
end
Any help would be appreciated enormously. This is the one part I'm afraid might greatly dumb down the system in my game if I can't find a solution.
Now, after about a year of using the system... it suddenly doesn't seem to work on one occasion.
I'd rather explain the entire mess with images, so here goes.
This character here has got 2 perks increasing Air Defence. 5% and 15%.
In this image, you can see how it correctly adds up to 20%.
This character also has 2 perks for Air Defence- 65% and 5%.
And this is the godforsaken result.
65 +15 = 71, according to this system. Where does the 1 come from? It wouldn't make sense even in the default system. The character doesn't have any initial resistance changes on her, and it clearly says on the states descriptions, to increase the rates for 95% and 35% (which reverses as 5% and 65%.
This is the snippet I used to change the multiplicative stacking to additive. It has worked before this, although I haven't tested it extensively.
class Game_BattlerBase
def element_rate(element_id)
features_with_id(FEATURE_ELEMENT_RATE, element_id).inject(1.0) {|r, ft| r += ft.value - 1 }
end
end
Any help would be appreciated enormously. This is the one part I'm afraid might greatly dumb down the system in my game if I can't find a solution.