more flexible Ambiental damage thresholds
Wahazar opened this issue ยท 1 comments
I propose to make more immersive body temperature physics, instead of "certain death" current mechanism: damage threshold depending on hunger/thirst bar filling. Full bar more forgivable than empty one, while freeze/burning temperatures settings should be wider - better survivalibity of harsh environment for these well fed :)
Here is code replacement for TemperatureSystem.java:
`// calculate how thirst and hunger bar is filled
float percentThirst = (player.getFoodData() instanceof TFCFoodData data ? data.getThirst() : 0) / TFCFoodData.MAX_THIRST;
float percentFood = (float) player.getFoodData().getFoodLevel() / TFCFoodData.MAX_HUNGER;
//damage threshold between warning screen blend +1 and fixed damage threshold, depend on food/thirst bar:
if(TFCAmbientalConfig.GENERAL.takeDamage) {
if(this.getTemperature() > HOT_THRESHOLD + 1.0 + (BURN_THRESHOLD - HOT_THRESHOLD) * percentThirst) {
player.attackEntityFrom(AmbientalDamage.HEAT, 4f);
}else if (this.getTemperature() < COOL_THRESHOLD -1.0 - (COOL_THRESHOLD - FREEZE_THRESHOLD) * percentFood{
player.attackEntityFrom(AmbientalDamage.COLD, 4f);
}
}`
With such fixture, I would also suggest to change tfcambiental.cfg freeze and burn thresholds to -5 and 35 accordingly,
so killing temperatures would be between -6 ... 2 degC or between 29 ... 36 degC, depending on player hunger/thirst.
Current hot/cool temperatures are both screen blend warning and (with 1 degC margin) killing temperatures for empty food bar, while burn/freeze are ultimate killing temperatures (so should be wider).