12 override bool ActivateCondition(
PlayerBase player)
17 override bool DeactivateCondition(
PlayerBase player)
27 override string GetDebugText()
29 return m_Player.GetStatHeatComfort().Get().ToString();
32 override string GetDebugTextSimple()
34 return m_Player.GetStatHeatComfort().Get().ToString();
38 override void OnTick(
PlayerBase player,
float deltaT)
40 float heat_comfort = player.GetStatHeatComfort().Get();
42 float value_normalized;
47 value_normalized =
Math.Clamp(value_normalized, 0, 1);
49 player.GetStatWater().Add(-water_loss);
53 value_normalized =
Math.Lerp(
PlayerConstants.WATER_LOSS_THRESHOLD_HC_PLUS_HIGH, 1.0, heat_comfort);
54 value_normalized =
Math.Clamp(value_normalized, 0, 1);
61 value_normalized =
Math.Clamp(value_normalized, 0, 1);
63 player.GetStatEnergy().Add(-energy_loss);
65 if( heat_comfort <
PlayerConstants.ENERGY_LOSS_THRESHOLD_HC_MINUS_HIGH )
67 value_normalized =
Math.InverseLerp(
PlayerConstants.ENERGY_LOSS_THRESHOLD_HC_MINUS_HIGH, -1.0, heat_comfort);
68 value_normalized =
Math.Clamp(value_normalized, 0, 1);
73 if( health_loss != 0 )
75 player.AddHealth(
"",
"",-health_loss);