Ok, so you're all saying that it's multiplicative, but Bale's posted code is additive, which is why I keep asking questions about stacking.
So do I understand correctly that reduced damage due to +ML happens, then monster resistances/vulnerabilities, then soft/hard damage caps? If so, Bale's code is incorrect.
Consider a monster vulnerable to cold which has +50 ML (20% reduction). The posted (additive) code would change the cold resistance from -1 to -0.8, resulting in 180% of the original damage. If they are applied sequentially, however, first the ML-reduced damage is 80% of the original, which when doubled by the vulnerability would be 160%.
To apply them sequentially we need both multiplication and addition:
Code:
if (numeric_modifier("Monster Level") > 25) {
float ml_res = min(numeric_modifier("Monster Level") * .004, .5);
foreach res,amt in mres
mres[res] = ml_res + amt - (ml_res * amt);
}
Based on the information posted so far I believe this is correct.
@lost: Thanks. So the place for this is not in
act() but rather
set_monster().