Damage is dealt directly. Improve Combat's damage logic to account for target Armor and Resistance.
Armor is a flat value that must be integrated into the damage calculation
Resistances are % values and can be applied last.
Proposed damage formula:
Final Damage Value = (Ability_Damage - (Armor * 0.1) * MAX((1.0 - SUM(TAG_RESIST_ARR[])), 0)
Armor provides a flat damage reduction equal to 10% of the armor value
All valid resistance tags are summed, and the final damage value is reduced by the a percentage equal to the sum. For example, two valid tags of a: 0.1 and b: 0.2 would provide a reduction of 0.3 and the final damage value would be multiplied by 0.7.
Alternatively, overlapping resistances can be multiplied against eachother to provide a diminishing-return.
Consider the following pseudo-code:
resistances: list = [0.1, 0.3, 0.2]
sort(resistances, descending=True)
res = resistances[0]
for resistance in resistances:
if index == 0:
continue
res = res * (1 + resistance)
Starting with the largest resistance, cumulatively scale it up by each other resistance in descending order. This allows the engine to avoid trivially giving Entities 100% resistance to an Ability when the player equips multiple Effects each providing large resistance values (for example, 3 pieces of equipment each providing 35% resistance to different tags, each of which is applied to the attacker's Ability).
Damage is dealt directly. Improve Combat's damage logic to account for target Armor and Resistance.
Proposed damage formula:
Final Damage Value = (Ability_Damage - (Armor * 0.1) * MAX((1.0 - SUM(TAG_RESIST_ARR[])), 0)
a: 0.1
andb: 0.2
would provide a reduction of0.3
and the final damage value would be multiplied by0.7
.Alternatively, overlapping resistances can be multiplied against eachother to provide a diminishing-return.
Consider the following pseudo-code:
Starting with the largest resistance, cumulatively scale it up by each other resistance in descending order. This allows the engine to avoid trivially giving Entities
100%
resistance to an Ability when the player equips multiple Effects each providing large resistance values (for example, 3 pieces of equipment each providing 35% resistance to different tags, each of which is applied to the attacker's Ability).