Page 1 of 1
[solved] resistances: what does `decrease` mean?
Posted: Fri Sep 30, 2016 2:28 am
by aubergine18
When defining resistances, a `percentage` and/or a `decrease` can be defined. The `percentage` is fairly self-explanatory (0 = normal, >0 = resist, <0 = susceptible), but I have no clue what the `decrease` means - does it decrease the resistance (if so, why not just decrease the percentage)?
Re: resistances: what does `decrease` mean?
Posted: Fri Sep 30, 2016 3:01 am
by Mooncat
aubergine18 wrote:When defining resistances, a `percentage` and/or a `decrease` can be defined. The `percentage` is fairly self-explanatory (0 = normal, >0 = resist, <0 = susceptible), but I have no clue what the `decrease` means - does it decrease the resistance (if so, why not just decrease the percentage)?
Percentage = based on the damage amount
Decrease = fixed amount
I guess.
Re: resistances: what does `decrease` mean?
Posted: Fri Sep 30, 2016 4:19 am
by aubergine18
But both of them can be used together - why would you increase the percentage (percentage > 0) and at the same time decrease the value (decrease > 0)?
Re: resistances: what does `decrease` mean?
Posted: Fri Sep 30, 2016 4:36 am
by Rseding91
aubergine18 wrote:But both of them can be used together - why would you increase the percentage (percentage > 0) and at the same time decrease the value (decrease > 0)?
For things like cars: if the car moves at a low speed and hits something it takes no damage (fixed value resistance) but at higher speeds it still has a % resistance.
Re: resistances: what does `decrease` mean?
Posted: Fri Sep 30, 2016 6:21 am
by Mooncat
So we now know "decrease" is calculated before "percentage":
taken damage = math.max(0, (damage - resistance.decrease) * (resistance.percentage * 0.01))
More generically:
decrease = the lower the damage amount, the higher efficiency the resistance will be
e.g. decrease = 50: if damage < 50, 100% of it will be reduced; if damage = 100, it will be reduced by 50%.
percentage = the higher the damage amount, the higher efficiency the resistance will be
e.g. percentage = 50: if damage = 50, 25 damage will be reduced; if damage = 100, 50 damage will be reduced.
Edit: corrected the formula.