7class EnvironmentSnapshotData
87 bool m_DebugLogDryWet =
false;
88 bool m_DebugLogItemHeat =
false;
299 return parent.IsAnyInherited(typenames);
324 if (car && car.EngineIsOn())
348 vector hitPosition, hitNormal;
350 vector to = from +
"0 25 0";
371 g_Game.SurfaceUnderObjectByBoneCorrectedLiquid(
m_Player, SurfaceAnimationBone.RightFrontLimb, surfType, liquidType);
396 g_Game.SurfaceUnderObjectExCorrectedLiquid(
m_Player, surfType, impact, liquidType);
406 pWaterLevel =
m_Player.GetCurrentWaterLevel();
446 temperature = waterBodyTemperature -
m_WorldData.m_WaterContactTemperatureModifier;
453 temperature +=
m_WorldData.m_TemperatureInsideBuildingsModifier;
516 if (weatherEffect <= 0)
593 int playerAttachmentCount =
m_Player.GetInventory().AttachmentCount();
596 for (
int attIdx = 0; attIdx < playerAttachmentCount; ++attIdx)
598 attachment =
m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
599 if (attachment.IsItemBase())
601 int attachmentSlotsCount = attachment.GetInventory().GetSlotIdCount();
602 for (
int attachmentSlotId = 0; attachmentSlotId < attachmentSlotsCount; ++attachmentSlotId)
604 int attachmentSlot = attachment.GetInventory().GetSlotId(attachmentSlotId);
605 for (
int i = 0; i < pSlotIds.Count(); ++i)
607 if (attachmentSlot == pSlotIds.Get(i))
629 int attCount =
m_Player.GetInventory().AttachmentCount();
632 EnvironmentDrynessData drynessData =
new EnvironmentDrynessData();
638 distance =
Math.
Max(distance, 0.1);
639 drynessData.m_TemperatureSourceDistance = distance;
643 for (
int attIdx = 0; attIdx < attCount; ++attIdx)
645 attachment =
m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
646 if (attachment && attachment.IsItemBase())
667 bool isParentWet =
false;
668 bool parentContainsLiquid =
false;
671 if (pItem.GetInventory().GetCurrentInventoryLocation(iLoc))
682 if ((parentItem.GetLiquidType() != 0) && (parentItem.GetQuantity() > 0))
683 parentContainsLiquid =
true;
693 if (isParentWet || parentContainsLiquid)
695 float soakingCoef = 0;
696 if (parentContainsLiquid)
698 soakingCoef = pItem.GetSoakingIncrement(
"parentWithLiquid");
701 else if (isParentWet && parentItem)
703 if (pItem.GetWet() < parentItem.GetWet())
714 pItem.AddWet(soakingCoef);
716 if (pItem.GetInventory().GetCargo())
718 int inItemCount = pItem.GetInventory().GetCargo().GetItemCount();
719 for (
int i = 0; i < inItemCount; ++i)
722 if (
Class.
CastTo(inItem, pItem.GetInventory().GetCargo().GetItem(i)))
727 int attCount = pItem.GetInventory().AttachmentCount();
730 for (
int attIdx = 0; attIdx < attCount; ++attIdx)
732 EntityAI attachment = pItem.GetInventory().GetAttachmentFromIndex(attIdx);
744 EnvironmentDrynessData drynessData =
new EnvironmentDrynessData();
752 float dryingIncrement = pItem.GetDryingIncrement(
"player");
753 if (pDrynessData.m_UseTemperatureSources)
754 dryingIncrement = pItem.GetDryingIncrement(
"playerHeatSource");
757 bool isParentWet =
false;
758 bool parentContainsLiquid =
false;
761 if (pItem.GetInventory().GetCurrentInventoryLocation(iLoc))
772 if ((parentItem.GetLiquidType() != 0) && (parentItem.GetQuantity() > 0))
773 parentContainsLiquid =
true;
781 float dryingCoef = 0;
783 if (!isParentWet && !parentContainsLiquid)
790 pItem.AddWet(dryingCoef);
793 if (pItem.GetInventory().GetCargo())
795 int inItemCount = pItem.GetInventory().GetCargo().GetItemCount();
796 for (
int i = 0; i < inItemCount; ++i)
799 if (
Class.
CastTo(inItem, pItem.GetInventory().GetCargo().GetItem(i)))
804 int attCount = pItem.GetInventory().AttachmentCount();
807 for (
int attIdx = 0; attIdx < attCount; ++attIdx)
809 EntityAI attachment = pItem.GetInventory().GetAttachmentFromIndex(attIdx);
811 if (
ItemBase.CastTo(itemAtt, attachment))
817 if (parentContainsLiquid)
822 pItem.AddWet(dryingCoef);
830 pItem.AddWet(dryingCoef);
842 float hcBodyPartTotal, hcBodyPart;
843 float hBodyPartTotal, hBodyPart;
845 float heatComfortSum = 0.0;
846 float heatItems = 0.0;
850 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
852 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
854 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
856 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
858 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
860 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
862 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
864 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
866 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
875 heatItems = hBodyPartTotal;
876 heatComfortSum = hcBodyPartTotal;
877 heatComfortSum += hcPenaltyTotal;
881 if (
m_Player.GetStomach().GetStomachVolume() > 0.0)
883 float stomachContentTemperature =
m_Player.GetStomach().GetStomachTemperature();
891 stomachContentTemperature,
901 stomachContentTemperature,
905 stomachContentTemperature = 0.0;
919 targetHeatComfort =
Math.
Clamp(targetHeatComfort, 0.0,
m_Player.GetStatHeatComfort().GetMax());
921 targetHeatComfort =
Math.
Clamp(targetHeatComfort,
m_Player.GetStatHeatComfort().GetMin(),
m_Player.GetStatHeatComfort().GetMax());
923 targetHeatComfort =
Math.
Round(targetHeatComfort * 100) * 0.01;
925 float dynamicHeatComfort;
928 float direction = 1.0;
929 if (targetHeatComfort < 0.0)
938 dynamicHeatComfort =
Math.
Round(dynamicHeatComfort * 100) * 0.01;
955 float targetHeatComfort = 0.0;
961 m_Player.GetStatHeatComfort().Set(dynamicHeatComfort);
974 m_Player.SetHeatBufferDynamicMax(heatBufferMax);
980 m_Player.GetStatHeatBuffer().Add(-heatBufferValueCorrection);
984 float increaseRate = 0.0;
985 float decreaseRate = 0.0;
991 float decreaseRateByHeatBufferStageCoef = 1;
996 switch (
m_Player.GetHeatBufferStage())
999 decreaseRateByHeatBufferStageCoef =
Math.
Lerp(
1002 heatBufferMaxInversed,
1006 decreaseRateByHeatBufferStageCoef =
Math.
Lerp(
1009 heatBufferMaxInversed,
1019 decreaseRate *= decreaseRateByHeatBufferStageCoef;
1030 m_Player.GetStatHeatBuffer().Add(-decreaseRate);
1037 if (applicableHeatbuffer > 0.0)
1038 m_Player.GetStatHeatBuffer().Add(-decreaseRate);
1039 else if (applicableHeatbuffer != 0.0 && !
m_Player.GetModifiersManager().IsModifierActive(
eModifiers.MDF_HEATBUFFER))
1040 m_Player.GetStatHeatBuffer().Set(0.0);
1047 if (applicableHeatbuffer < heatBufferMax)
1049 m_Player.GetStatHeatBuffer().Add(increaseRate);
1053 else if (applicableHeatbuffer > 0.0)
1054 m_Player.GetStatHeatBuffer().Add(-decreaseRate);
1055 else if (applicableHeatbuffer != 0.0 && !
m_Player.GetModifiersManager().IsModifierActive(
eModifiers.MDF_HEATBUFFER))
1056 m_Player.GetStatHeatBuffer().Set(0.0);
1065 float applicableHeatbuffer =
Math.
Round((
m_Player.GetStatHeatBuffer().Get() /
m_Player.GetStatHeatBuffer().GetMax()) * 1000) * 0.001;
1066 return applicableHeatbuffer;
1075 int attCount =
m_Player.GetInventory().AttachmentCount();
1076 for (
int attIdx = 0; attIdx < attCount; ++attIdx)
1078 attachment =
m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
1080 int attachmentSlot = attachment.GetInventory().GetSlotId(0);
1083 for (
int i = 0; i < pBodyPartIds.Count(); ++i)
1085 if (attachmentSlot == pBodyPartIds[i])
1087 float heatPermCoef = item.GetHeatPermeabilityCoef();
1103 float heatPermCoef = item.GetHeatPermeabilityCoef();
1114 float heatPermCoef = heatPermeabilityCoef;
1117 int inventoryAttCount = item.GetInventory().AttachmentCount();
1118 if (inventoryAttCount > 0)
1121 for (
int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
1123 if (
Class.
CastTo(attachmentItem,item.GetInventory().GetAttachmentFromIndex(inAttIdx)))
1125 heatPermCoef = heatPermeabilityCoef;
1126 heatPermCoef *= attachmentItem.GetHeatPermeabilityCoef();
1138 if (item.GetInventory().GetCargo())
1140 int inventoryItemCount = item.GetInventory().GetCargo().GetItemCount();
1141 if (inventoryItemCount > 0)
1144 for (
int j = 0; j < inventoryItemCount; ++j)
1146 if (
Class.
CastTo(inventoryItem,item.GetInventory().GetCargo().GetItem(j)))
1148 heatPermCoef = heatPermeabilityCoef;
1149 heatPermCoef *= inventoryItem.GetHeatPermeabilityCoef();
1166 bool globalCooling =
true;
1171 globalCooling =
false;
1174 if (item.GetTemperature() != targetTemperature || !item.IsFreezeThawProgressFinished())
1176 TemperatureDataInterpolated temperatureData =
new TemperatureDataInterpolated(
1181 heatPermeabilityCoef,
1183 temperatureData.m_UseGlobalCooling = globalCooling;
1185 item.SetTemperatureEx(temperatureData);
1200 int attCount =
m_Player.GetInventory().AttachmentCount();
1201 for (
int attIdx = 0; attIdx < attCount; ++attIdx)
1203 EntityAI attachment =
m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
1204 if (attachment.IsClothing())
1207 int attachmentSlot = attachment.GetInventory().GetSlotId(0);
1209 if (attachmentSlot == pBodyPartId)
1213 float itemHeatcomfort = 0;
1214 float itemTemperature = 0;
1217 int inventoryAttCount = item.GetInventory().AttachmentCount();
1218 if (inventoryAttCount > 0)
1220 LogItemHeat(
string.Format(
"attachments:"),
false);
1221 for (
int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
1223 EntityAI inAttachment = item.GetInventory().GetAttachmentFromIndex(inAttIdx);
1225 if (attachmentItem && attachmentItem.CanHaveTemperature())
1227 itemTemperature = attachmentItem.GetTemperature();
1230 itemHeatcomfort =
NormalizedTemperature(itemTemperature) * attachmentItem.GetQuantityNormalizedScripted() * attachmentItem.GetTemperaturePerQuantityWeight();
1231 LogItemHeat(
string.Format(
"%1: temperature=%2 heat=%3", attachmentItem, itemTemperature, pHeat),
true);
1232 pHeat += itemHeatcomfort;
1237 if (item.GetInventory().GetCargo())
1239 int inventoryItemCount = item.GetInventory().GetCargo().GetItemCount();
1241 if (inventoryItemCount > 0)
1244 for (
int j = 0; j < inventoryItemCount; ++j)
1246 ItemBase inventoryItem =
ItemBase.Cast(item.GetInventory().GetCargo().GetItem(j));
1247 if (inventoryItem && inventoryItem.CanHaveTemperature())
1249 itemTemperature = inventoryItem.GetTemperature();
1252 itemHeatcomfort =
NormalizedTemperature(itemTemperature) * inventoryItem.GetQuantityNormalizedScripted() * inventoryItem.GetTemperaturePerQuantityWeight();
1253 LogItemHeat(
string.Format(
"%1: temperature=%2 heat=%3", inventoryItem, itemTemperature, itemHeatcomfort),
true);
1254 pHeat += itemHeatcomfort;
1261 pHeatComfort = MiscGameplayFunctions.GetCurrentItemHeatIsolation(item) * pCoef;
1263 LogItemHeat(
string.Format(
"overall heat from items=%1 (coef applied)", pHeat));
1274 float penalty = 0.0;
1295 foreach (
Object nearestObject : nearestObjects)
1298 if (ent && ent.IsUniversalTemperatureSource() && ent !=
m_Player)
1305 if (ent.GetUniversalTemperatureSource().GetLambda().AffectsPlayer())
1310 if (
m_Player.GetItemInHands() &&
m_Player.GetItemInHands().IsUniversalTemperatureSource())
1336 float itemCoefAverage = 0.0;
1340 itemCoefAverage += tempSource.GetTemperatureItemCoef();
1342 itemCoefAverage /= UTScount;
1345 float min = MiscGameplayFunctions.GetMinValue(utsTemperatures);
1346 float max = MiscGameplayFunctions.GetMaxValue(utsTemperatures);
1348 if (max > 0 && min < 0)
1375 distance =
Math.
Max(distance, 0.1);
1376 float temperature = 0;
1379 if (distance > uts.GetFullRange())
1381 float distFactor =
Math.
InverseLerp(uts.GetMaxRange(), uts.GetFullRange(), distance);
1382 temperature = uts.GetTemperatureCap() * distFactor;
1386 temperature = uts.GetTemperatureCap();
1393#ifdef DIAG_DEVELOPER
1394 EnvDebugData GetEnvDebugData()
1396 EnvDebugData data =
new EnvDebugData();
1401 void ShowEnvDebugPlayerInfo(
bool enabled)
1403 EnvDebugData data = GetEnvDebugData();
1404 DisplayEnvDebugPlayerInfo(enabled, data);
1407 static void DisplayEnvDebugPlayerInfo(
bool enabled, EnvDebugData data)
1417 DbgUI.Text(
string.Format(
"Heat comfort(target): %1", data.m_PlayerData.m_HeatComfortTarget));
1418 DbgUI.Text(
string.Format(
"Heat comfort(dynamic): %1", data.m_PlayerData.m_HeatComfortDynamic));
1419 DbgUI.Text(
string.Format(
"Inside: %1 (%2)", data.m_PlayerData.m_Inside, data.m_PlayerData.m_Surface));
1420 DbgUI.Text(
string.Format(
"Under roof: %1 (%2)", data.m_PlayerData.m_UnderRoof, data.m_PlayerData.m_UnderRoofTimer));
1421 if ( data.m_PlayerData.m_WaterLevel > 0 )
1423 DbgUI.Text(
string.Format(
"Water Level: %1", data.m_PlayerData.m_WaterLevel));
1432 DbgUI.Text(
string.Format(
"Env temperature (base): %1", data.m_MiscData.m_TemperatureBase));
1433 DbgUI.Text(
string.Format(
"Env temperature (height corrected): %1", data.m_MiscData.m_HeightCorrectedTemperature));
1434 DbgUI.Text(
string.Format(
"Env temperature (modfied): %1", data.m_MiscData.m_TemperatureModified));
1435 DbgUI.Text(
string.Format(
"Wind magnitude(surface mult): %1 (x%2)", data.m_WeatherData.m_Wind, data.m_WeatherData.m_WindModifier));
1436 DbgUI.Text(
string.Format(
"Rain: %1", data.m_WeatherData.m_Rain));
1437 DbgUI.Text(
string.Format(
"Snow: %1", data.m_WeatherData.m_Snowfall));
1438 DbgUI.Text(
string.Format(
"Datetime: %1", WorldDataDaytime.ToString(
g_Game.GetMission().GetWorldData().GetDaytime())));
1439 DbgUI.Text(
string.Format(
"Fog: %1", data.m_WeatherData.m_Fog));
1440 DbgUI.Text(
string.Format(
"Clouds: %1", data.m_WeatherData.m_Clouds));
1441 DbgUI.Text(
string.Format(
"Wet delta: %1", data.m_MiscData.m_WetDelta));
1446 void FillDebugWeatherData(EnvDebugWeatherData data)
1460 message +=
"Player stats";
1462 message +=
"\nHeat comfort(dynamic): " +
m_HeatComfort.ToString();
1465 string impact, surfaceType;
1466 g_Game.SurfaceUnderObjectExCorrectedLiquid(
m_Player, surfaceType, impact, liquidType);
1469 message +=
"\nSurface: " + surfaceType;
1470 message +=
"\nLiquid: " + liquidType;
1477 message +=
"\n\nWeather stats";
1478 message +=
"\nEnv temperature (base): " +
m_WorldData.GetBaseEnvTemperature().ToString();
1479 message +=
"\nEnv temperature (height corrected): " +
m_WorldData.GetBaseEnvTemperatureAtObject(
m_Player);
1482 message +=
"\nRain: " +
m_Rain.ToString();
1483 message +=
"\nSnow: " +
m_Snowfall.ToString();
1485 message +=
"\nFog: " +
m_Fog.ToString();
1486 message +=
"\nClouds: " +
m_Clouds.ToString();
1509 if (temperature >= lowerLimit && temperature <= upperLimit)
1532 #ifdef DIAG_DEVELOPER
1533 if (m_DebugLogDryWet)
1535 string indentation =
"";
1537 indentation =
"|--";
1539 Debug.
Log(
string.Format(
"%1 %2", indentation, message));
1546 #ifdef DIAG_DEVELOPER
1547 if (m_DebugLogItemHeat)
1549 string indentation =
"";
1551 indentation =
"|--";
1553 Debug.
Log(
string.Format(
"%1 %2", indentation, message));
1586 return temperature_reduction;
1595 if (pBodyPartIds.Count() > 0)
1599 int attCount =
m_Player.GetInventory().AttachmentCount();
1600 for (
int attIdx = 0; attIdx < attCount; ++attIdx)
1602 EntityAI attachment =
m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
1603 if (attachment.IsClothing())
1606 int attachmentSlot = attachment.GetInventory().GetSlotId(0);
1609 for (
int i = 0; i < pBodyPartIds.Count(); ++i)
1611 if (attachmentSlot == pBodyPartIds[i])
1613 float heatIsoMult = 1.0;
1619 pHeatComfort += heatIsoMult * MiscGameplayFunctions.GetCurrentItemHeatIsolation(item);
1621 float itemHeatcomfort = 0;
1622 float itemTemperature = 0;
1625 int inventoryAttCount = item.GetInventory().AttachmentCount();
1626 if (inventoryAttCount > 0)
1628 LogItemHeat(
string.Format(
"attachments:"),
false);
1629 for (
int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
1631 EntityAI inAttachment = item.GetInventory().GetAttachmentFromIndex(inAttIdx);
1633 if (attachmentItem && attachmentItem.CanHaveTemperature())
1635 itemTemperature = attachmentItem.GetTemperature();
1638 itemHeatcomfort =
NormalizedTemperature(itemTemperature) * attachmentItem.GetQuantityNormalizedScripted() * attachmentItem.GetTemperaturePerQuantityWeight();
1639 LogItemHeat(
string.Format(
"%1: temperature=%2 heat=%3", attachmentItem, itemTemperature, pHeat),
true);
1640 pHeat += itemHeatcomfort;
1645 if (item.GetInventory().GetCargo())
1647 int inventoryItemCount = item.GetInventory().GetCargo().GetItemCount();
1649 if (inventoryItemCount > 0)
1652 for (
int j = 0; j < inventoryItemCount; ++j)
1654 ItemBase inventoryItem =
ItemBase.Cast(item.GetInventory().GetCargo().GetItem(j));
1655 if (inventoryItem && inventoryItem.CanHaveTemperature())
1657 itemTemperature = inventoryItem.GetTemperature();
1660 itemHeatcomfort =
NormalizedTemperature(itemTemperature) * inventoryItem.GetQuantityNormalizedScripted() * inventoryItem.GetTemperaturePerQuantityWeight();
1661 LogItemHeat(
string.Format(
"%1: temperature=%2 heat=%3", inventoryItem, itemTemperature, itemHeatcomfort),
true);
1662 pHeat += itemHeatcomfort;
1673 pHeatComfort += (pHeatComfort / pBodyPartIds.Count()) * pCoef;
1675 LogItemHeat(
string.Format(
"overall heat from items=%1 (coef applied)", pHeat));
1682 EnvironmentSnapshotData data =
new EnvironmentSnapshotData();
1714class EnvironmentDrynessData
1720#ifdef DIAG_DEVELOPER
1721class EnvDebugPlayerData :
Param
1723 float m_HeatComfortDynamic;
1724 float m_HeatComfortTarget;
1728 int m_UnderRoofTimer;
1731 void Synch(Environment env, PlayerBase player)
1734 m_HeatComfortDynamic = player.GetStatHeatComfort().Get();
1750 return ctx.
Write(m_HeatComfortTarget) && ctx.
Read(m_HeatComfortDynamic) && ctx.
Read(m_Inside) && ctx.
Read(
m_Surface) && ctx.
Read(m_UnderRoof) && ctx.
Read(m_UnderRoofTimer) && ctx.
Read(m_WaterLevel);
1754class EnvDebugMiscData :
Param
1756 float m_TemperatureBase;
1757 float m_TemperatureModified;
1758 float m_HeightCorrectedTemperature;
1761 void Synch(Environment env)
1763 m_TemperatureBase =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperature();
1771 return ctx.
Write(m_TemperatureBase) && ctx.
Write(m_TemperatureModified) && ctx.
Write(m_HeightCorrectedTemperature) && ctx.
Write(m_WetDelta);
1776 return ctx.
Read(m_TemperatureBase) && ctx.
Read(m_TemperatureModified) && ctx.
Read(m_HeightCorrectedTemperature) && ctx.
Read(m_WetDelta);
1780class EnvDebugWeatherData :
Param
1783 float m_WindModifier;
1789 void Synch(Environment env)
1791 env.FillDebugWeatherData(
this);
1801 return ctx.
Read(m_Wind) && ctx.
Read(m_WindModifier) && ctx.
Read(m_Rain) && ctx.
Read(m_Snowfall) && ctx.
Read(m_Fog) && ctx.
Read(m_Clouds);
1805class EnvDebugData :
Param
1807 ref EnvDebugPlayerData m_PlayerData =
new EnvDebugPlayerData();
1808 ref EnvDebugMiscData m_MiscData =
new EnvDebugMiscData();
1809 ref EnvDebugWeatherData m_WeatherData =
new EnvDebugWeatherData();
1811 void Synch(Environment env, PlayerBase player)
1813 m_PlayerData.Synch(env, player);
1814 m_MiscData.Synch(env);
1815 m_WeatherData.Synch(env);
1820 return m_PlayerData.Serialize(ctx) && m_MiscData.Serialize(ctx) && m_WeatherData.Serialize(ctx);
1825 return m_PlayerData.Deserializer(ctx) && m_MiscData.Deserializer(ctx) && m_WeatherData.Deserializer(ctx);
EEnvironmentTemperatureComponent
float m_TemperatureSourceDistance
enum EEnvironmentHeatcomfortBehaviorCategory m_ClothingHeatComfort
class Environment m_UseTemperatureSources
EEnvironmentHeatcomfortBehaviorCategory
float m_TargetHeatComfort
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
void Synch(EntityAI victim)
keeping "step" here for consistency only
proto native void GetObjectsAtPosition(vector pos, float radius, out array< Object > objects, out array< CargoBase > proxyCargos)
Returns list of all objects in circle "radius" around position "pos".
Super root of all classes in Enforce script.
static proto bool RayCastBullet(vector begPos, vector endPos, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction)
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
void ProcessItemsWetness(array< int > pSlotIds)
void CollectAndSetEnvironmentData()
ref SimpleMovingAverage< float > m_WindAverageBuffer
float GetPlayerHeat()
Returns heat player generated based on player's movement speed (for now)
void ApplyDrynessToItemEx(ItemBase pItem, EnvironmentDrynessData pDrynessData)
ref array< int > m_SlotIdsBottom
float m_RoofCheckTimer
keeps wetness of most wet item in player's possesion
void ProcessItemsInHandsTemperature()
ref array< int > m_SlotIdsComplete
void SetEnvironmentSnapshotData()
float m_PlayerTemperature
const float RAIN_LIMIT_LOW
ref array< int > m_SlotIdsLower
void CollectAndSetPlayerData()
bool IsChildOfType(array< typename > typenames)
const float SNOWFALL_LIMIT_LOW
void CheckWaterContact(out float pWaterLevel)
float GetUniversalSourcesTemperageAverage()
void OnTemperatureSourcesLeft()
float NakedBodyPartHeatComfortPenalty(int pBodyPartSlotId, float pCoef)
void ProcessHeatBuffer(float heatComfortCloths)
backward compatibility [<1.27]
float m_ItemTemperatureCoef
void Init(PlayerBase pPlayer)
used for calculations before the data modification
ref SimpleMovingAverage< float > m_UTSAverageTemperatureBuffer
ref array< int > m_SlotIdsUpper
const float WATER_LEVEL_HIGH
int m_HeatComfortBehaviorCategory
float NormalizedTemperature(float temperature, float lowerLimit=GameConstants.ENVIRO_LOW_TEMP_LIMIT, float upperLimit=GameConstants.ENVIRO_HIGH_TEMP_LIMIT)
void SetProcessedItemTemperature(ItemBase item, float heatPermeabilityCoef=1.0)
void ProcessWetnessByWaterLevel(float pWaterLevel)
process attachments by water depth
ref array< UTemperatureSource > m_UTemperatureSources
void LogItemHeat(string message, bool indented=false)
float GetApplicableHeatbuffer()
ref array< int > m_BodyParts
float m_EnvironmentTemperature
bool m_HasTemperatureSources
void AddToEnvironmentTemperature(float pTemperature)
void ProcessTemperatureSources()
float EnvTempToCoef(float pTemp)
float m_UTSAverageTemperature
void ApplyDrynessToItem(ItemBase pItem)
float GetEnvironmentTemperature()
ref SimpleMovingAverage< float > m_AverageHeatComfortBuffer
float WindEffectTemperatureValue(float temperatureInput)
backward compatibility [<1.28]
void Environment(PlayerBase pPlayer)
const float SNOWFALL_WIND_COMBINED_THRESHOLD
void CheckUnderRoof()
Checks whether Player is sheltered.
void SetHeatcomfortDirectly()
ref EnvironmentSnapshotData m_EnvironmentSnapshot
float m_HeatBufferCapPrevious
reused as state toggle
float GetTemperatureHeightCorrection()
void ProcessItemsTemperature(array< int > pBodyPartIds)
go through all items in player's possession cool/warm them to neutral temperature
bool IsUnderRoofBuilding()
void ProcessWetnessByRain()
ref array< int > m_FeetParts
float m_Rain
target value of heatcomfort (non-buffered)
void BodyPartHeatProperties(int pBodyPartId, float pCoef, out float pHeatComfort, out float pHeat)
returns enhanced heat comfort for given body part
const float WATER_LEVEL_NONE
bool DetermineHeatcomfortBehavior()
void Update(float pDelta)
const float WATER_LEVEL_MID
void GatherTemperatureSources()
float m_TargetHeatComfort
player's heatcomfort (buffered, stored in player stats)
void SetTargetHeatComfort(float value)
void ProcessItemsDryness()
void SetItemHeatingCoef(float val)
bool m_IsUnderRoofBuilding
bool OverridenHeatComfort(out float value)
void ApplyWetnessToItem(ItemBase pItem)
void BodyPartHeatProperties(array< int > pBodyPartIds, float pCoef, out float pHeatComfort, out float pHeat)
returns weighted avg heat comfort for bodypart
float GetWindModifierPerSurface()
void SetAreaGenericColdness()
Determines whether player is in cold area which restricts use of some actions (digging)
bool IsNeutralTemperature(float temperature, float lowerLimit=GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT, float upperLimit=GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT)
void ProcessHeatBuffer(EnvironmentSnapshotData data)
float CalcTemperatureFromTemperatureSource(notnull UTemperatureSource uts)
void ProcessHeatComfort()
Calculates and process player's heatcomfort related to body parts.
ref array< int > m_HeadParts
string GetDebugMessage()
debug
void OnTemperatureSourcesEnter()
float GetTargetHeatComfort()
const float WATER_LEVEL_LOW
void ProcessItemHierarchyRecursive(ItemBase item, float heatPermeabilityCoef=1.0)
void LogDryWetProcess(string message, bool indented=false)
float m_HeatSourceTemp
DEPRECATED.
void SetEnvironmentTemperature()
const float STAGE_THRESHOLDS[NUMBER_OF_STAGES]
proto native float GetCurrentMovementSpeed()
0,1,2..3 idle, walk, run, sprint
int m_iMovement
current stance (DayZPlayerConstants.STANCEIDX_ERECT, ...), only if the command has a stance
proto native EntityAI GetParent()
returns parent of current inventory location
provides access to slot configuration
override bool IsSelfAdjustingTemperature()
bool Deserializer(Serializer ctx)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
static const float THRESHOLD_HEAT_COMFORT_MINUS_WARNING
proto bool Write(void value_out)
proto bool Read(void value_in)
Base native class for all motorized wheeled vehicles.
proto native Fog GetFog()
Returns a fog phenomenon object.
proto native WindMagnitude GetWindMagnitude()
Returns a wind magnitude phenomenon object.
proto native Snowfall GetSnowfall()
Returns a snowfall phenomenon object.
proto native Rain GetRain()
Returns a rain phenomenon object.
proto native Overcast GetOvercast()
Returns an overcast phenomenon object.
proto native float GetActual()
static string ToString(int value)
Keeps information about currently loaded world, like temperature.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool simple=true)
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
const float ENVIRO_HEATISOLATION_VEST_WEIGHT
weight of back for the sum of heat isolation
const float ENVIRO_HEATISOLATION_BACK_WEIGHT
how much this feet parts (clothing) affects final heatcomfort
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const float TEMP_COEF_INVENTORY
const float TEMP_COEF_SWIMMING
const float ENVIRO_WIND_CHILL_LIMIT
Affects the slope of calculation.
const float ENVIRO_NAKED_BODY_PENALTY_SNOWFALL_MIN_VALUE
how intensive a rain should be to enable rain penalty on naked body
const float ENVIRO_TEMPERATURE_UNDERROOF_COEF
increases temp inside vehicles
const float ENVIRO_TEMP_EFFECT_ON_PLAYER
comfort temperature of environment for the player
static const float ENVIRO_HEATCOMFORT_VEST_WEIGHT
const float ENVIRO_HIGH_TEMP_LIMIT
lowest temperature(deg Celsius) where the player gets lowest possible heat comfort (-1)
const float ENVIRO_HEATCOMFORT_MAX_STEP_SIZE
when is sun highest on sky
static const float ENVIRO_HEATCOMFORT_HIPS_WEIGHT
const float ENVIRO_FOG_DRY_EFFECT
how many % of ENVIRO_SUN_INCREMENT is reduced by cloudy sky
const float COLD_AREA_TEMPERATURE_THRESHOLD
const float ENVIRO_DRY_INCREMENT
amount of wetness added to items wet value each tick if is raining
const float ENVIRO_ISOLATION_WETFACTOR_DRENCHED
const float ENVIRO_CLOUD_DRY_EFFECT
how much is the generic temp effect increased when player is next to a fireplace
const float ENVIRO_PLAYER_HEATBUFFER_CAPACITY_MIN
How much heat buffer change rates are affected by temperature.
const float ENVIRO_WET_INCREMENT
in secs. how often we should check if player is under the roof (raycast)
const float ENVIRO_PLAYER_HEATBUFFER_WATEREFFECT
impact of enviro temperature on player (lower value = higher, cannot be zero or below!...
const float ENVIRO_STOMACH_WEIGHT
const float ENVIRO_TICKS_TO_WETNESS_CALCULATION
in secs. how often should enviro effet process
static const float ENVIRO_HEATCOMFORT_LEGS_WEIGHT
static const float ENVIRO_HEATCOMFORT_WEIGHT_SUMMARY
don't forget to update the weights from above if you are adding/removing them
const float ENVIRO_PLAYER_HEATBUFFER_DECREASE
impact of water contact on player's heatbuffer
const float ENVIRO_PLAYER_HEATBUFFER_TEMP_AFFECT
How much heat buffer increases per one enviro tick.
static const float ENVIRO_HEATCOMFORT_GLOVES_WEIGHT
static const float ENVIRO_HEATCOMFORT_FEET_WEIGHT
const float ENVIRO_TICK_ROOF_RC_CHECK
each X (ticks) is processed wetness on items on player
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT
const float ENVIRO_TEMPERATURE_INSIDE_VEHICLE_COEF
heat entity generates if not moving
const float ENVIRO_TEMP_SOURCES_LOOKUP_RADIUS
const float ENVIRO_WIND_EFFECT
windchill effect on base temperature
const float ENVIRO_WIND_EFFECT_SLOPE
time modifier, how much longer it takes to dig up worms while in a cold area
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT
damage per second dealt to attachment by fire
const float ENVIRO_TICK_RATE
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
static const float ENVIRO_HEATCOMFORT_BODY_WEIGHT
const float ENVIRO_PLAYER_COMFORT_TEMP
highest temperature(deg Celsius) where the player gets highest possible heat comfort (1)
const float ENVIRO_PLAYER_HEATBUFFER_INCREASE
How much heat buffer decreases per one enviro tick.
static const float ENVIRO_HEATCOMFORT_BACK_WEIGHT
static const float ENVIRO_HEATCOMFORT_HEADGEAR_WEIGHT
max step of dynamic heatcomfort change (applies if diff between target and dynamic HC is bigger than ...
const float ENVIRO_DEFAULT_ENTITY_HEAT
how many times slower is wetting/drying items in backpacks
const float ENVIRO_SNOW_WET_COEF
Above this value, the wind effect increases the modified temperature.
const float ENVIRO_NAKED_BODY_PENALTY_RAIN_MIN_VALUE
const float ENVIRO_LOW_TEMP_LIMIT
how much stomach content affects final heatcomfort
static const float ENVIRO_HEATCOMFORT_MASK_WEIGHT
how much this body part affects final heatcomfort
static ref array< ref TFloatArray > ENVIRO_PLAYER_HEATBUFFER_STAGE_RATELIMIT
Minimal heatbuffer capacity of naked character.
const float STATE_SOAKING_WET
const int LIQUID_STILLWATER
const int LIQUID_HOTWATER
const int LIQUID_FRESHWATER
const int LIQUID_RIVERWATER
const int LIQUID_SALTWATER
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float SqrFloat(float f)
Returns squared value.
static proto float Round(float f)
Returns mathematical round of value.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static float Remap(float inputMin, float inputMax, float outputMin, float outputMax, float inputValue, bool clampedOutput=true)
Returns given value remaped from input range into output range.
static proto float AbsFloat(float f)
Returns absolute value.
class JsonUndergroundAreaTriggerData GetPosition