Reworked radiation math with the reacher equipped

This change makes reachers reduce incoming radiation that is under 1 RAD/tick.
This commit is contained in:
TehTemmie 2021-10-18 19:07:54 +08:00 committed by GitHub
parent b9ca43d578
commit 4d38e301d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,7 @@ public class HazardTypeRadiation extends HazardTypeBase {
float rad = level / 20F;
if(reacher)
rad = (float) Math.min(Math.sqrt(rad), rad); //to prevent radiation from going up when being <1
rad = (float) Math.sqrt(rad + 1F / ((rad + 2F) * (rad + 2F))) - 1F / (rad + 2F); //Reworked radiation function: sqrt(x+1/(x+2)^2)-1/(x+2)
ContaminationUtil.contaminate(target, HazardType.RADIATION, ContaminationType.CREATIVE, rad);
}