Growlith1223 / ArsMagica2

Ars Magica 2 Bug Tracker
65 stars 32 forks source link

Rewriting magic resist #297

Open ProfHugo opened 7 years ago

ProfHugo commented 7 years ago

I don't know who came up with the idea to just tweak magic damage the component (mana blast, arcane guardian, and other magic damage sources would completely bypass magic resist). For now I would just leave the code in potionhandler to not have another listener running, and have it work smoothly with things like mana shield and magic shield. Oh yea, it also works on a pretty ridiculous log scale.

Current formula: y = e^(x/0.32845873875) - 1

where x is the total level of magic resist of all equipped armor, and y is the percent reduction granted.

Example: at 20 total levels (full MR 5 armor set), y would be 1, or 100% damage reduction. Here's a table with a few level values:

Total Magic Resist Level | Percent Reduction Granted -----------1---------------------------22.8% -----------3---------------------------45.6% -----------4---------------------------53.9% -----------5---------------------------58.9% -----------8---------------------------72.2% ----------12---------------------------84.3% ----------16---------------------------93.1% ----------20---------------------------100.0%

Note: Dragon Breath is also affected, as it's pretty close to being magic damage in my opinion, and I put a linear scaling formula right next to the log one (5% per level) if you want to use that one instead. I also felt like that the actual code could be put in the entityhandler, but somehow I can't get that to work.