Resistance System

before subtracting the damage amount, multiply it by a float variable, which you can clamp between -1 and 2. this float variable will represent whether the character is immune to that damage type. depending on the value, it can do double damage, normal damage, miss, or heal the character.

if you want to input the value in percent of immunity, instead of a simple damage multiplier, you could try this:

health = health - (Percent * -0.01 + 1) * Damage
1 Like