https://wiki.factorio.com/index.php?title=Damage
as best as i try to understand what is written in there , i got feeling like a live on the moon where is english exist or english i know is not called english, because i simple understand completely ZERO thing that is written on wiki ,
is it some sort of easter joke ? or chinglish ? but for sure not english i have learning for like 25 years.
so its more like complain about code than a suggestion , because i keep findin things thats are just plain.
example :base_area 100 = means fluid capacity of 1000? (chingrish pliz?)
maybe before u enter weekee of factorio there should be forced pop up telling you
"you enter area where is factoriochinglish is spoken or used..."
----
so now to the topic i wanted to start
im sort of confused (use fac 12.21 32bit on 64bit sys)
ingame i find often resistances there is 2 values and it looks like 0/30%
from normal logic i would understand that it means 0 damage is reduced from 30% possible
or current minimum reduction is 0 % / 30% is maximum (possible to reach , where the way to do so u have find out all by yourself)
from the code i could not rip out much either
so my suggestion is to simplify code a little bit if it possible
to call "flat_damage_reduction"
an: absorbtion
that would mean : damage recived = ( damage done - absorbtion ) with exception rule damage can not be negative
altrough i do not mind negative damage because i could use "undead-element-attack" on zombees and would be able to heal them that way , because usualy "holehhh-elemented-attack" would simply damage by beeszombs....
<undead never dies...>
and : reduction (what so called resistance)
would be : damage recived = (damage done / by percent ) , where resist of 100% would mean....
or simplyfy even futher , call this thing not reduction nor resistance but immunity
immunity of 50% means u take only 1/2 (or half) damage
immunity of 100% means no damage at all
in the code u simply add something like
defensive stats = {type= awesomeness , reduction= 50 , immunity=10%} with a little BUT...t
immunity would be applied first in the formula ,
cap.obvious deals 100 awesome damage to "boredoom"
in the formula it would look like
(100 awesome damage reduced by 10% immunity)-50 absorbtion)= damage recived
which means 40 awesome damage is done to "boredoom"
math:(100-10%)=90
math :90-50=40
its simple , easy to code easy to remember and easy to understand
in case someone ask why use absorbtion and immunity
first reason for it is customisation , it was always fun ! fun games are played no matter how old they are...
example : brick attack a glass , deals 1 hit 200 damage . glass has hp of 190 usualy it would result in 1HITKO
so we add some Pb to the glass and it gets 80% immunity vs bricks .
that would reduce 200 damage to 40
so another example : wild-quick-face-shooter appears , it quick-shoots your tower in the face
and deals 20 hits each 5 damage
your tower has 70 face HP, this would result in your tower dying from a shame
70-100=-30 soo dead tower , soo ashamed
but i have a plan, i add sun-cream-coated sunglases on the tower
lets use 4 pieces each add 1 damage absorbtion= total of 4 damage absorbtion
next time wild-quick-face-shooter appears and shoot my tower in the face...
all his 20 hits each 5 damage would be reduced by 4 damage per hit and this will result in only 20 damage from 100
math :20*(5-4)=20
----------
i read this mulitple times and still do not understand what is what , no, i dont ask for explanation but for more simplistic englishDecrease resistance
It decreases the damage by specified number as long as the result damage wouldn't be less than zero. When the result damage would get less than 0, the extra resistance is used as denominator in the fraction of damage that is going to be dealt
if thing above could be called english anyways...
for me decrese resistance means
target has resistance of XX
decrese resistance means = target resistance - value that decrease = current resistance of act
and that would mean 100% resistance is not absolute anymore , because someone with 100% resistance decrease would do full actions to you instead of any reducement
thats why u would need to call poleez