From b33bccea4529ca368c0af3ed31c58726a6a61c6b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 02:05:26 +0100 Subject: [PATCH] Use typed durability for presentation --- .voidbot/state/aetheria.cc | Bin 58549 -> 59803 bytes Aetheria.State.Verify/Program.cs | 15 +++++++++++++++ Assets/Scripts/Gameplay/ShipInstance.cs | 2 +- Assets/Scripts/UI/HUD/SchematicDisplay.cs | 2 +- Assets/Scripts/UI/Menu/InventoryPanel.cs | 2 +- .../UI/Properties Panel/PropertiesPanel.cs | 2 +- docs/aetheria-perfect-machine-map.md | 15 ++++++++------- 7 files changed, 27 insertions(+), 11 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 50262821ac127be9cf86c13d9aadb570072d1f75..90f2b9735c591a1e59a6b43d95744fe803aea23a 100644 GIT binary patch delta 2784 zcmcJR-)me&6vxdEOMbLil@cov$I>XY$!=11lTFeHVwA2lTJobxr0DFubN3F;ow=Qv zyUB{M57LJ`_@D#66hyEh6dx*!f)66C_Q794&<8h&e}JGbKKUSc?%iLr?Z!|`9{29d znKR#WzMnIne$#jPr@m`fdJj&`O=jj!O{Qk1GwW~n95FY0w}x8ZX3X_pMvUm&Y%iP1 zCd&r;AL*^VT79Db+S=I4VkB{aGOEicltdA(v8I9}mv9kKjj2x^n6UF$t6PCP^U{@heilCWPy_!B@Ah$|=5=Rp}AB2oTh&b1;7X`?w z5fmQ^NKjsrU=gCHY+*s{0(M?gs1j?umQO=9Y~@r6-}n?2oW2}_vWcP7%C%a8wf~Eg_nPmwhYx++H2Xx!+cfDLZ;dTmO=y>@qxa0q zUmdGhC$_Nkd1npw3rlem4BvvKij{abEUhLuYP#6!jsy|0NfMB?*@QNH!kea^N0d7P zOiVP1ZSp#i!p1j6A zZ^z^Y!68hLP7(vw>TS@b-yN9m z^sIHMy@_QWduG~*Ll56E_}{xUdUwdZ&R$&jU&Ep~ZTAh@Gqvd!v^#*kOY1akT7B>b z*3*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?v#)%|2pUnpMj=?A@`+KfHlzw_YM JsiETB&VRT50+0Xz 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