Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: more flexible Ambiental damage thresholds #177

Open
Wahazar opened this issue May 24, 2022 · 1 comment
Open

Feature: more flexible Ambiental damage thresholds #177

Wahazar opened this issue May 24, 2022 · 1 comment

Comments

@Wahazar
Copy link

Wahazar commented May 24, 2022

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).

@Gaelmare
Copy link
Collaborator

Gaelmare commented Sep 6, 2022

Can you put that in a PR to the TNFC_Mod? I'd like to look at it a bit more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants