diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 50262821a..90f2b9735 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index a1d8dd0c7..100bfd737 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -66,6 +66,10 @@ var weaponItems = items.Count(item => !string.IsNullOrWhiteSpace(item.WeaponType) && !string.IsNullOrWhiteSpace(item.WeaponRange) && !string.IsNullOrWhiteSpace(item.WeaponCaliber)); +var maxDurabilityItems = items + .Where(item => !string.IsNullOrWhiteSpace(item.HullType) || !string.IsNullOrWhiteSpace(item.WeaponType)) + .ToArray(); +var durableMaxDurabilityItems = maxDurabilityItems.Count(item => item.Durability > 0); var describedCorporations = corporations.Count(corporation => !string.IsNullOrWhiteSpace(corporation.Description)); var corporationNameLinks = corporations.Count(corporation => !string.IsNullOrWhiteSpace(corporation.GeonameFileLegacyId)); var corporationAllegianceEdges = corporations.Sum(corporation => corporation.Allegiances.Length); @@ -130,6 +134,16 @@ if (hardpointHostItems == 0 || hardpointCount == 0) throw new InvalidOperationException("Typed item definitions did not import any hull hardpoints."); } +var missingMaxDurability = maxDurabilityItems + .Where(item => item.Durability <= 0) + .Select(item => item.Name) + .ToArray(); +if (missingMaxDurability.Length > 0) +{ + throw new InvalidOperationException( + $"Typed hull/weapon max durability missing for: {string.Join(", ", missingMaxDurability)}."); +} + foreach (var item in items.Where(item => item.Hardpoints.Length > 0)) { foreach (var hardpoint in item.Hardpoints) @@ -299,6 +313,7 @@ Console.WriteLine($"Shape masks: {shapedMaskItems}"); Console.WriteLine($"Interior masks/hardpoint hosts/hardpoints: {interiorShapeItems}/{hardpointHostItems}/{hardpointCount}"); Console.WriteLine($"Behavior payload items/payloads/fields/legacy refs: {behaviorPayloadItems}/{behaviorPayloadCount}/{behaviorFieldCount}/{behaviorLegacyRefCount}"); Console.WriteLine($"Behavior/hardpoint/hull/weapon items: {behaviorItems}/{hardpointItems}/{hullItems}/{weaponItems}"); +Console.WriteLine($"Durable hull/weapon items: {durableMaxDurabilityItems}/{maxDurabilityItems.Length}"); Console.WriteLine($"Typed catalog trade items: {tradeItems.Length}"); Console.WriteLine($"Eve catalog surface: {surface.Surface.Id} ({surface.Surface.Root.Children.Length} root children)"); Console.WriteLine($"Corporations: {corporations.Length}"); diff --git a/Assets/Scripts/Gameplay/ShipInstance.cs b/Assets/Scripts/Gameplay/ShipInstance.cs index 778b8b69d..8b05f0e56 100644 --- a/Assets/Scripts/Gameplay/ShipInstance.cs +++ b/Assets/Scripts/Gameplay/ShipInstance.cs @@ -143,7 +143,7 @@ public class ShipInstance : EntityInstance if (typedItem != null && typedItem.Durability > 0) return (float)typedItem.Durability; - return Entity.ItemManager.GetData(item).Durability; + return Math.Max(item.Durability, 1f); } private static AetheriaRuntimeCatalogItem FindTypedItem(ItemInstance item) diff --git a/Assets/Scripts/UI/HUD/SchematicDisplay.cs b/Assets/Scripts/UI/HUD/SchematicDisplay.cs index 30ab22d42..e4903cdc0 100644 --- a/Assets/Scripts/UI/HUD/SchematicDisplay.cs +++ b/Assets/Scripts/UI/HUD/SchematicDisplay.cs @@ -259,7 +259,7 @@ public class SchematicDisplay : MonoBehaviour if (typedItem != null && typedItem.Durability > 0) return (float)typedItem.Durability; - return _entity.ItemManager.GetData(item).Durability; + return Math.Max(item.Durability, 1f); } private static AetheriaRuntimeCatalogItem FindTypedItem(ItemInstance item) diff --git a/Assets/Scripts/UI/Menu/InventoryPanel.cs b/Assets/Scripts/UI/Menu/InventoryPanel.cs index 6971c3d8e..d00b32d20 100644 --- a/Assets/Scripts/UI/Menu/InventoryPanel.cs +++ b/Assets/Scripts/UI/Menu/InventoryPanel.cs @@ -874,7 +874,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler if (typedItem != null && typedItem.Durability > 0) return (float)typedItem.Durability; - return _displayedEntity.ItemManager.GetData(item).Durability; + return Math.Max(item.Durability, 1f); } private Shape GetItemShape(ItemInstance item) diff --git a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs index 6eba1b9a2..da194bd51 100644 --- a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs +++ b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs @@ -405,7 +405,7 @@ public class PropertiesPanel : MonoBehaviour if (typedItem != null && typedItem.Durability > 0) return (float)typedItem.Durability; - return GameManager.ItemManager.GetData(item).Durability; + return Math.Max(item.Durability, 1f); } private static AetheriaRuntimeCatalogItem FindTypedPropertyItem(ItemInstance item) diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 609ee303e..d4f852003 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -91,13 +91,13 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. - The combat schematic HUD uses typed runtime catalog weapon facets for its static weapon icon strip; missing typed weapon facets no longer fall back to legacy `WeaponItemData`. - Hull and item durability percentages use typed max durability before falling - back to legacy `ItemData.Durability`. - Ship thruster VFX emission scaling also uses typed max durability before - falling back to legacy `ItemData.Durability`. + Hull and item durability percentages use typed max durability only; incomplete + typed rows use current runtime durability as the generic denominator instead + of falling back to legacy `ItemData.Durability`. + Ship thruster VFX emission scaling also uses typed max durability only. Runtime weapon behavior still owns ammo counts, active range, cooldowns, - temperature, and durability display until those session facts have typed - runtime surfaces. + temperature, and current durability values until those session facts have + typed runtime surfaces. - `Aetheria.State` now exposes typed node put/get ports for run state, zone state, and entity snapshots. The state smoke writes a run referencing a zone, a zone referencing an entity snapshot, and an entity snapshot carrying @@ -162,7 +162,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. Inventory cargo cell tint now uses typed hardpoint facets only; incomplete typed rows receive the generic tint instead of falling back to legacy `EquippableItemData.HardpointType`. Inventory HUD durability tint uses typed - max durability before falling back to legacy `ItemData.Durability`. + max durability only, with current runtime durability as the generic + denominator for incomplete typed rows. Inventory drag preview occupancy now projects typed item shape cells only into the local `Shape` grid; final fit and equip acceptance still belong to `ItemFits`, `TryEquip`, and inventory mutation paths until those simulation