Use typed equipped item simulation inputs

This commit is contained in:
Meta Vens 2026-06-14 06:39:23 +01:00
commit 8aa1e15a39
3 changed files with 13 additions and 3 deletions

Binary file not shown.

View file

@ -1262,6 +1262,7 @@ public class EquippedItem
public Behavior[] Behaviors { get; }
public Dictionary<int, BehaviorGroup> BehaviorGroups { get; }
public float Conductivity { get; }
public float MaxDurability { get; }
public float ThermalPerformance { get; private set; }
public float ThermalExponent { get; }
public float DurabilityPerformance { get; private set; }
@ -1371,7 +1372,9 @@ public class EquippedItem
Entity = entity;
EquippableItem = item;
Position = position;
Conductivity = Data.Conductivity;
var typedItem = ItemManager.GetRuntimeItem(item);
Conductivity = typedItem != null ? (float)typedItem.Conductivity : Data.Conductivity;
MaxDurability = typedItem?.Durability > 0 ? (float)typedItem.Durability : Math.Max(item.Durability, 1f);
ThermalExponent = lerp(
ItemManager.GameplaySettings.ThermalQualityMin,
ItemManager.GameplaySettings.ThermalQualityMax,
@ -1442,13 +1445,13 @@ public class EquippedItem
var temp = Temperature;
ThermalPerformance = Data.Performance(temp);
var deltaTemp = math.abs(temp - oldTemperature);
DurabilityPerformance = EquippableItem.Durability / Data.Durability;
DurabilityPerformance = EquippableItem.Durability / MaxDurability;
var performanceThreshold = Entity.Settings.ShutdownPerformance;
Wear = (1 - pow(ThermalPerformance,
(1 - pow(EquippableItem.Quality, ItemManager.GameplaySettings.QualityWearExponent)) *
ItemManager.GameplaySettings.ThermalWearExponent) +
deltaTemp * ItemManager.GameplaySettings.DeltaTempWearExponent
) * Data.Durability / Data.ThermalResilience;
) * MaxDurability / Data.ThermalResilience;
ThermalOnline.Value = ThermalPerformance > performanceThreshold || Entity.OverrideShutdown && EquippableItem.OverrideShutdown;
DurabilityOnline.Value = EquippableItem.Durability > .01f;
oldTemperature = temp;

View file

@ -233,6 +233,10 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
performance stats. `ItemManager.CreateInstance(CraftedItemData, float)`
initializes new equippable runtime durability from the typed runtime item row;
`EquippableItemData.Durability` is only an incomplete-row fallback.
`EquippedItem` also takes conductivity and max durability from the typed
runtime item row for heat conduction, durability performance, and wear
scaling; the legacy equippable DTO still owns thermal curve, thermal
resilience, and audio-stat residue until those surfaces are imported.
Inventory drag preview occupancy now projects typed item shape cells only into
the local `Shape` grid, and final fit/equip acceptance shares the typed
runtime catalog geometry path in `Entity.ItemFits` and `TryEquip`.
@ -764,6 +768,9 @@ First Aetheria surfaces to publish:
- Done: move new equippable instance durability initialization onto typed
runtime item rows; legacy `EquippableItemData.Durability` remains only as
an incomplete-row fallback in the instantiation bridge.
- Done: move `EquippedItem` conductivity and max-durability performance/wear
inputs onto typed runtime item rows; legacy thermal resilience and audio
stats remain explicit DTO residues.
- Done: move `Ship` drag, combat/turret predicted shot height, and thruster
torque geometry onto typed hull facets and typed shape masks.
- Done: delete the console `give` command instead of preserving a debug