DEPRECATED.
332{
334 {
335 float distanceToTemperatureSource;
336
337 foreach (
Object nearestObject : nearestObjects)
338 {
340
342 if (nearestItem && nearestItem.HasWetness() && nearestItem != pSettings.
m_Parent && !nearestItem.IsInherited(Man) && !nearestItem.IsUniversalTemperatureSource())
343 {
344 distanceToTemperatureSource =
vector.
Distance(nearestItem.GetPosition(), position);
345 distanceToTemperatureSource =
Math.
Max(distanceToTemperatureSource, 0.3);
346
347 float dryModifier = 0;
348
350 {
351 dryModifier = (-1 * m_ExecuteInterval * nearestItem.GetDryingIncrement("groundHeatSource")) / distanceToTemperatureSource;
352 Math.
Clamp(dryModifier, nearestItem.GetWetMin(), nearestItem.GetWetMax());
353 nearestItem.AddWet(dryModifier);
354 }
355
358 foreach (
EntityAI cargoEntity : cargoEntities)
359 {
361 if (cargoItem)
362 {
363 dryModifier = 0;
365 {
366 dryModifier = (-1 * m_ExecuteInterval * cargoItem.GetDryingIncrement("groundHeatSource")) / distanceToTemperatureSource;
367 Math.
Clamp(dryModifier, cargoItem.GetWetMin(), cargoItem.GetWetMax());
368 cargoItem.AddWet(dryModifier);
369 }
370 }
371 }
372 }
373 }
374 }
375
377 {
378 float distanceToTemperatureSource;
381
382 foreach (
Object nearestObject : nearestObjects)
383 {
384 if (
Class.
CastTo(nearestEntity,nearestObject) && nearestEntity != pSettings.
m_Parent && !nearestEntity.IsSelfAdjustingTemperature())
385 {
386 float temperatureDifference = tempTarget - nearestEntity.GetTemperature();
387
388 distanceToTemperatureSource =
vector.
Distance(nearestEntity.GetPosition(), position);
389 distanceToTemperatureSource =
Math.
Max(distanceToTemperatureSource, 0.1);
390
391 float time = m_ExecuteInterval;
392 if (m_ExecuteInterval == -1)
393 time = 1;
394
395 float distFactor = 1;
397 {
399 distFactor =
Math.
Max(distFactor, 0.0);
400 }
401
403
404 if (nearestEntity.GetInventory())
405 {
407 }
408 else if (nearestEntity.CanHaveTemperature() && !nearestEntity.IsSelfAdjustingTemperature())
409 {
410 dta.m_HeatPermeabilityCoef = nearestEntity.GetHeatPermeabilityCoef();
411
413 nearestEntity.SetTemperatureEx(dta);
414 else
415 nearestEntity.RefreshTemperatureAccess(dta);
416 }
417 }
418 }
419 }
420
422 {
423 float heatPermCoef = heatPermeabilityCoef;
424 heatPermCoef *= ent.GetHeatPermeabilityCoef();
426
427
428 if (ent.CanHaveTemperature() && !ent.IsSelfAdjustingTemperature())
429 {
432 ent.SetTemperatureEx(dta);
433 else
434 ent.RefreshTemperatureAccess(dta);
435 }
436
437
438 int inventoryAttCount = ent.GetInventory().AttachmentCount();
439 if (inventoryAttCount > 0)
440 {
442 for (int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
443 {
444 if (
Class.
CastTo(attachmentEnt,ent.GetInventory().GetAttachmentFromIndex(inAttIdx)))
445 {
447 }
448 }
449 }
450
451 if (ent.GetInventory().GetCargo())
452 {
453 int inventoryItemCount = ent.GetInventory().GetCargo().GetItemCount();
454 if (inventoryItemCount > 0)
455 {
457 for (int j = 0; j < inventoryItemCount; ++j)
458 {
459 if (
Class.
CastTo(cargoEnt,ent.GetInventory().GetCargo().GetItem(j)))
460 {
462 }
463 }
464 }
465 }
466 }
467
469 {
472
474
477 pos = pSettings.
m_Parent.GetPosition();
478
480 if (nearestObjects.Count() > 0)
481 {
484 }
485 }
486
489 {
491
494 pos = pSettings.
m_Parent.GetPosition();
495
497
499 }
500}
501
504{
506 {
507 m_AffectsPlayer = false;
508 }
509}
510
override void DryItemsInVicinity(UniversalTemperatureSourceSettings pSettings, vector position, out notnull array< Object > nearestObjects)
void UpdateVicinityTemperatureRecursive(EntityAI ent, TemperatureData dta, float heatPermeabilityCoef=1.0)
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
override void Execute(UniversalTemperatureSourceSettings pSettings, UniversalTemperatureSourceResult resultValues)
override void WarmAndCoolItemsInVicinity(UniversalTemperatureSourceSettings pSettings, vector position, out notnull array< Object > nearestObjects)
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.
float m_HeatPermeabilityCoef
vector m_Position
if the stats can be overriden by coefficient/variables from WorldData (currently TemperatureCap only)
float m_RangeFull
temperature cap that will limit the return value from GetTemperature method
float m_TemperatureCap
used to determine speed of temperature change, and some temperature subsystems
float m_TemperatureItemCoef
max temperature 'non-IsSelfAdjustingTemperature' entity in vicinity will get per update (cap);
float m_RangeMax
range where the full temperature is given to receiver
float m_TemperatureItemCap
how often the Update is ticking
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static const float TEMPERATURE_SENSITIVITY_THRESHOLD
static proto float Max(float x, float y)
Returns bigger of two given values.
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 proto float AbsFloat(float f)
Returns absolute value.