Use typed thermal resilience for equipped items
This commit is contained in:
parent
feae643dfe
commit
d55eb38a3a
160 changed files with 293 additions and 269 deletions
Binary file not shown.
|
|
@ -414,6 +414,7 @@ internal static class LegacyCatalogReader
|
|||
MinimumTemperature = unionKey is 2 or 3 or 29 or 30 or 31 ? GetDouble(payload, 13) : 0,
|
||||
MaximumTemperature = unionKey is 2 or 3 or 29 or 30 or 31 ? GetDouble(payload, 14) : 0,
|
||||
ThermalPerformanceCurveKeys = unionKey is 2 or 3 or 29 or 30 or 31 ? ReadCurveKeys(payload, 17) : [],
|
||||
ThermalResilience = unionKey is 2 or 3 or 29 or 30 or 31 ? GetPositiveDoubleOrDefault(payload, 18, 1) : 1,
|
||||
HullPrefab = unionKey == 3 ? GetString(payload, 24) : "",
|
||||
HullGridOffset = unionKey == 3 ? GetDouble(payload, 26) : 0,
|
||||
HullArmor = unionKey == 3 ? GetDouble(payload, 27) : 0,
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ internal static class AetheriaRuntimeCatalogSnapshotMapper
|
|||
item.MaximumTemperature,
|
||||
item.ThermalPerformanceCurveKeys.Select(FromState).ToArray(),
|
||||
item.HullPrefab,
|
||||
item.ThermalResilience,
|
||||
item.HullGridOffset,
|
||||
item.HullArmor,
|
||||
item.HullDrag,
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ var maxDurabilityItems = items
|
|||
var durableMaxDurabilityItems = maxDurabilityItems.Count(item => item.Durability > 0);
|
||||
var importedThermalRangeItems = items.Count(item => item.MaximumTemperature > item.MinimumTemperature);
|
||||
var importedThermalCurveItems = items.Count(item => item.ThermalPerformanceCurveKeys.Length > 0);
|
||||
var thermalResilienceItems = items.Count(item => item.ThermalResilience > 0);
|
||||
var actionBarIconItems = items.Count(item => !string.IsNullOrWhiteSpace(item.ActionBarIcon));
|
||||
var dockingBayItems = items.Count(item => item.Category == "DockingBayData");
|
||||
var dockingBayMaxSizeItems = items.Count(item =>
|
||||
|
|
@ -115,6 +116,12 @@ if (conductiveItems != items.Length)
|
|||
$"Typed item definitions did not import positive conductivity for every item: {conductiveItems}/{items.Length}.");
|
||||
}
|
||||
|
||||
if (thermalResilienceItems != items.Length)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
$"Typed item definitions did not import positive thermal resilience for every item: {thermalResilienceItems}/{items.Length}.");
|
||||
}
|
||||
|
||||
if (shapedItems == 0)
|
||||
{
|
||||
throw new InvalidOperationException("Typed item definitions did not import any shape dimensions.");
|
||||
|
|
@ -385,6 +392,7 @@ Console.WriteLine($"Aetheria typed state verify passed: {statePath}");
|
|||
Console.WriteLine($"Catalog fingerprint: {quarantine.CatalogFingerprint}");
|
||||
Console.WriteLine($"Item definitions: {items.Length}");
|
||||
Console.WriteLine($"Priced/manufactured/specific-heat/conductive/shaped items: {pricedItems}/{manufacturedItems}/{specificHeatItems}/{conductiveItems}/{shapedItems}");
|
||||
Console.WriteLine($"Thermal resilience items: {thermalResilienceItems}");
|
||||
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}");
|
||||
|
|
|
|||
|
|
@ -153,6 +153,9 @@ public sealed class AetheriaItemDefinition
|
|||
|
||||
[Key(46)]
|
||||
public string ActionBarIcon { get; set; } = "";
|
||||
|
||||
[Key(47)]
|
||||
public double ThermalResilience { get; set; } = 1;
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemProjectionReader
|
|||
{
|
||||
equippable.Durability = (float)item.Durability;
|
||||
equippable.ActionBarIcon = item.ActionBarIcon;
|
||||
equippable.ThermalResilience = (float)item.ThermalResilience;
|
||||
equippable.Behaviors = ProjectBehaviors(item).ToList();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1263,6 +1263,7 @@ public class EquippedItem
|
|||
public Dictionary<int, BehaviorGroup> BehaviorGroups { get; }
|
||||
public float Conductivity { get; }
|
||||
public float MaxDurability { get; }
|
||||
public float ThermalResilience { get; }
|
||||
public float ThermalPerformance { get; private set; }
|
||||
public float ThermalExponent { get; }
|
||||
public float DurabilityPerformance { get; private set; }
|
||||
|
|
@ -1377,6 +1378,7 @@ public class EquippedItem
|
|||
RuntimeItem = ItemManager.GetRuntimeItem(item);
|
||||
Conductivity = RuntimeItem != null ? (float)RuntimeItem.Conductivity : Data.Conductivity;
|
||||
MaxDurability = RuntimeItem?.Durability > 0 ? (float)RuntimeItem.Durability : Math.Max(item.Durability, 1f);
|
||||
ThermalResilience = RuntimeItem?.ThermalResilience > 0 ? (float)RuntimeItem.ThermalResilience : Data.ThermalResilience;
|
||||
_thermalPerformanceCurve = CreateThermalPerformanceCurve(RuntimeItem);
|
||||
ThermalExponent = lerp(
|
||||
ItemManager.GameplaySettings.ThermalQualityMin,
|
||||
|
|
@ -1454,7 +1456,7 @@ public class EquippedItem
|
|||
(1 - pow(EquippableItem.Quality, ItemManager.GameplaySettings.QualityWearExponent)) *
|
||||
ItemManager.GameplaySettings.ThermalWearExponent) +
|
||||
deltaTemp * ItemManager.GameplaySettings.DeltaTempWearExponent
|
||||
) * MaxDurability / Data.ThermalResilience;
|
||||
) * MaxDurability / ThermalResilience;
|
||||
ThermalOnline.Value = ThermalPerformance > performanceThreshold || Entity.OverrideShutdown && EquippableItem.OverrideShutdown;
|
||||
DurabilityOnline.Value = EquippableItem.Durability > .01f;
|
||||
oldTemperature = temp;
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue