First, I'd like to thank everyone for helping me get to this point. I have wanted to create my own custom combat system for literally 15+ years and it's finally becoming a reality, so thank you very much.
I have successfully created my custom @HitTry and @Hit, and I'm very satisfied with them.
Logically, next is doing my @GetHit for calculating armor.
Since my server would be considered a customized T2A or pre-T2a, all I need to do is calculate how much damage is done in melee and spells in regards to one value, the AR value (or I guess in modern terms, physical AR).
I have my pseudocode completely fleshed out, and I have tested all the calculations on a dynamic spreadsheet. There is only one snag I've hit.
My core calculation in my pseudocode is
Code:
damage * (100 - ARMOR) / 100
I've tried my absolute best to do my homework at each step, and I'm 100% convinced all my code works with this base formula, but of course, there is a snag in the 'Vision'.
With this formula, any AR value greater than or equal to 100 technically negates any value of damage dealt. That's easy to fix by using percentages to guarantee damage at the end of the calculation, but I'm wanting a little more flexibility in my custom armors that I'm planning on making, so I'd like to use AR values up to 200.
I've messed around with this formula for like 4 hours straight on a spreadsheet and never found one that works. Let me paint 2 scenarios:
Scenario 1:
Armor Calculation is currently 'damage * (100 - ARMOR) / 100'.
20damage * (100 - 50AR) / 100
So that would be:
20 * (50) / 100 = 10 damage
Does anyone have any good ideas on how to implement a similar equation, but with 200AR as the 'max'?
Obviously, this doesn't work:
Scenario 2:
Armor Calculation is currently 'damage * (200 - ARMOR) / 100'.
20damage * (200 - 50AR) / 100
So that would be:
20 * (150) / 100 = 30 damage
It was immediately clear to me this is no good. But I tried for 4 hours to find another algorithm that worked and I just don't think I'm creative enough to figure it out. Has anyone else seen/heard/used a good algorithm for my server idea?
I'd appreciate any input, and thanks again for all the help. I really appreciate it.
-Murmur