Carry item temperature through daemon state refs
This commit is contained in:
parent
fd3f945341
commit
be9bffab4d
14 changed files with 81 additions and 29 deletions
|
|
@ -4300,6 +4300,7 @@ static void RequireInventoryCargoItemDetailsUseEveSurface(string root)
|
|||
if (!runtimeStateReader.Contains("TryResolveDaemonItemStatRef(", StringComparison.Ordinal) ||
|
||||
!runtimeStateReader.Contains("AetheriaRuntimeDaemonItemStatQueries.TryReadItemStatRef(", StringComparison.Ordinal) ||
|
||||
!runtimeStateReader.Contains("AetheriaRuntimeDaemonItemStatQueries.EvaluatePerformanceStat(", StringComparison.Ordinal) ||
|
||||
!runtimeStateReader.Contains("item.Temperature", StringComparison.Ordinal) ||
|
||||
!runtimeStateReader.Contains("FindDaemonItem(", StringComparison.Ordinal) ||
|
||||
!cargoItemSurfaceBuilder.Contains("AetheriaRuntimeDaemonItemStatQueries.ItemStatRef(", StringComparison.Ordinal) ||
|
||||
source.Contains("ResolveInventorySurfaceStateRef", StringComparison.Ordinal) ||
|
||||
|
|
@ -10756,24 +10757,28 @@ static void RequireDroppedPickupCheckpointState(string root)
|
|||
[Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeSnapshotDocuments.cs")] = new[]
|
||||
{
|
||||
"AetheriaRuntimeDroppedPickupCommit",
|
||||
"DroppedPickups"
|
||||
"DroppedPickups",
|
||||
"public double Temperature { get; set; }"
|
||||
},
|
||||
[Path.Combine(root, "Aetheria.State", "Documents", "AetheriaRuntimeStateDocuments.cs")] = new[]
|
||||
{
|
||||
"AetheriaDroppedPickupSnapshot",
|
||||
"DroppedPickups"
|
||||
"DroppedPickups",
|
||||
"public double Temperature { get; set; }"
|
||||
},
|
||||
[Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeCatalogStore.cs")] = new[]
|
||||
{
|
||||
"ReadZoneStatePayload(record.Key, record.Payload)",
|
||||
"ReadFieldDroppedPickups",
|
||||
"AetheriaRuntimeDroppedPickupSnapshot"
|
||||
"AetheriaRuntimeDroppedPickupSnapshot",
|
||||
"var temperature = ReadFieldDouble(ref reader"
|
||||
},
|
||||
[Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeCatalogSnapshot.cs")] = new[]
|
||||
{
|
||||
"public string RecordKey",
|
||||
"AetheriaRuntimeDroppedPickupSnapshot",
|
||||
"public IReadOnlyList<AetheriaRuntimeDroppedPickupSnapshot> DroppedPickups"
|
||||
"public IReadOnlyList<AetheriaRuntimeDroppedPickupSnapshot> DroppedPickups",
|
||||
"public double Temperature { get; }"
|
||||
},
|
||||
[Path.Combine(root, "Assets", "Scripts", "Gameplay", "ActionGameManager.cs")] = new[]
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ public static class AetheriaRuntimeStateMapper
|
|||
Durability = item.Durability,
|
||||
Quantity = item.Quantity,
|
||||
Enabled = item.Enabled,
|
||||
OverrideShutdown = item.OverrideShutdown
|
||||
OverrideShutdown = item.OverrideShutdown,
|
||||
Temperature = item.Temperature
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -174,6 +174,9 @@ public sealed class AetheriaLoadoutItem
|
|||
|
||||
[Key(5)]
|
||||
public bool OverrideShutdown { get; set; }
|
||||
|
||||
[Key(6)]
|
||||
public double Temperature { get; set; }
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
|
|
@ -639,6 +642,9 @@ public sealed class AetheriaEntityItemSlot
|
|||
|
||||
[Key(6)]
|
||||
public bool OverrideShutdown { get; set; }
|
||||
|
||||
[Key(7)]
|
||||
public double Temperature { get; set; }
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
|
|
|
|||
|
|
@ -334,7 +334,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
slot.Durability,
|
||||
slot.Quantity,
|
||||
slot.Enabled,
|
||||
slot.OverrideShutdown))))
|
||||
slot.OverrideShutdown,
|
||||
slot.Temperature))))
|
||||
.Where(slot => slot.item != null)
|
||||
.ToArray();
|
||||
}
|
||||
|
|
@ -673,7 +674,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
{
|
||||
X = slot.Position.x,
|
||||
Y = slot.Position.y,
|
||||
Item = ProjectLoadoutItem(slot.EquippableItem)
|
||||
Item = ProjectLoadoutItem(slot.EquippableItem, slot.Temperature)
|
||||
})
|
||||
.ToArray() ?? Array.Empty<AetheriaRuntimeLoadoutItemSlotCommit>();
|
||||
}
|
||||
|
|
@ -712,7 +713,9 @@ public class ActionGameManager : MonoBehaviour
|
|||
.ToArray() ?? Array.Empty<AetheriaRuntimeCargoBayLoadoutCommit>();
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeLoadoutItemCommit ProjectLoadoutItem(ItemInstance item)
|
||||
private static AetheriaRuntimeLoadoutItemCommit ProjectLoadoutItem(
|
||||
ItemInstance item,
|
||||
double temperature = 0)
|
||||
{
|
||||
if (item == null)
|
||||
return new AetheriaRuntimeLoadoutItemCommit();
|
||||
|
|
@ -724,7 +727,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
Durability = item is EquippableItem equippable ? equippable.Durability : 1.0,
|
||||
Quantity = item is SimpleCommodity commodity ? commodity.Quantity : 1,
|
||||
Enabled = true,
|
||||
OverrideShutdown = item is EquippableItem overrideable && overrideable.OverrideShutdown
|
||||
OverrideShutdown = item is EquippableItem overrideable && overrideable.OverrideShutdown,
|
||||
Temperature = temperature
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -1157,7 +1161,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
item.Durability,
|
||||
item.Quantity,
|
||||
item.Enabled,
|
||||
item.OverrideShutdown);
|
||||
item.OverrideShutdown,
|
||||
item.Temperature);
|
||||
}
|
||||
|
||||
private static IReadOnlyList<AetheriaRuntimeLoadoutItemSlotSnapshot> CreateRuntimeLoadoutItemSlotSnapshots(
|
||||
|
|
@ -2674,7 +2679,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
slot.Item.Durability,
|
||||
slot.Item.Quantity,
|
||||
slot.Item.Enabled,
|
||||
slot.Item.OverrideShutdown))
|
||||
slot.Item.OverrideShutdown,
|
||||
slot.Item.Temperature))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
|
|
@ -2701,7 +2707,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
slot.Item.Durability,
|
||||
slot.Item.Quantity,
|
||||
slot.Item.Enabled,
|
||||
slot.Item.OverrideShutdown)))
|
||||
slot.Item.OverrideShutdown,
|
||||
slot.Item.Temperature)))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -430,7 +430,8 @@ public class DaemonRuntimeDocumentTests
|
|||
ItemKey = "test-laser",
|
||||
Quality = 0.5,
|
||||
Durability = 1.0,
|
||||
Enabled = true
|
||||
Enabled = true,
|
||||
Temperature = 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -451,7 +452,7 @@ public class DaemonRuntimeDocumentTests
|
|||
{
|
||||
NumberValue(10),
|
||||
NumberValue(20),
|
||||
NumberValue(0),
|
||||
NumberValue(1),
|
||||
NumberValue(0),
|
||||
NumberValue(1),
|
||||
EmptyBehaviorValue("stat-recipe")
|
||||
|
|
@ -479,7 +480,7 @@ public class DaemonRuntimeDocumentTests
|
|||
catalog,
|
||||
AetheriaRuntimeDaemonItemStatQueries.ItemStatRef("test-laser", "Weapon", 2, 7),
|
||||
out var value));
|
||||
Assert.AreEqual("15", value);
|
||||
Assert.AreEqual("12.5", value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
|||
|
|
@ -399,7 +399,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
item?.Quality ?? 1,
|
||||
item?.Durability ?? 1,
|
||||
enabled: true,
|
||||
overrideShutdown: item != null && item.OverrideShutdown);
|
||||
overrideShutdown: item != null && item.OverrideShutdown,
|
||||
temperature: item?.Temperature ?? 0);
|
||||
}
|
||||
|
||||
private static double Mass(AetheriaRuntimeCatalogItem typedItem, int quantity)
|
||||
|
|
|
|||
|
|
@ -713,7 +713,14 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
public sealed class AetheriaRuntimeLoadoutItemSnapshot
|
||||
{
|
||||
public AetheriaRuntimeLoadoutItemSnapshot(string itemKey, double quality, double durability, int quantity, bool enabled, bool overrideShutdown)
|
||||
public AetheriaRuntimeLoadoutItemSnapshot(
|
||||
string itemKey,
|
||||
double quality,
|
||||
double durability,
|
||||
int quantity,
|
||||
bool enabled,
|
||||
bool overrideShutdown,
|
||||
double temperature = 0)
|
||||
{
|
||||
ItemKey = itemKey;
|
||||
Quality = quality;
|
||||
|
|
@ -721,6 +728,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
Quantity = quantity;
|
||||
Enabled = enabled;
|
||||
OverrideShutdown = overrideShutdown;
|
||||
Temperature = temperature;
|
||||
}
|
||||
|
||||
public string ItemKey { get; }
|
||||
|
|
@ -729,6 +737,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
public int Quantity { get; }
|
||||
public bool Enabled { get; }
|
||||
public bool OverrideShutdown { get; }
|
||||
public double Temperature { get; }
|
||||
}
|
||||
|
||||
public sealed class AetheriaRuntimeLoadoutItemSlotSnapshot
|
||||
|
|
@ -1137,7 +1146,16 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
public sealed class AetheriaRuntimeEntityItemSlotSnapshot
|
||||
{
|
||||
public AetheriaRuntimeEntityItemSlotSnapshot(int x, int y, string itemKey, double quality, double durability, int quantity, bool enabled, bool overrideShutdown)
|
||||
public AetheriaRuntimeEntityItemSlotSnapshot(
|
||||
int x,
|
||||
int y,
|
||||
string itemKey,
|
||||
double quality,
|
||||
double durability,
|
||||
int quantity,
|
||||
bool enabled,
|
||||
bool overrideShutdown,
|
||||
double temperature = 0)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
|
|
@ -1147,6 +1165,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
Quantity = quantity;
|
||||
Enabled = enabled;
|
||||
OverrideShutdown = overrideShutdown;
|
||||
Temperature = temperature;
|
||||
}
|
||||
|
||||
public int X { get; }
|
||||
|
|
@ -1157,6 +1176,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
public int Quantity { get; }
|
||||
public bool Enabled { get; }
|
||||
public bool OverrideShutdown { get; }
|
||||
public double Temperature { get; }
|
||||
}
|
||||
|
||||
public sealed class AetheriaRuntimeEntityStatGridSnapshot
|
||||
|
|
|
|||
|
|
@ -1487,7 +1487,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
var quantity = ReadFieldInt32(ref reader, slotFields, 4);
|
||||
var enabled = ReadFieldBool(ref reader, slotFields, 5, true);
|
||||
var overrideShutdown = ReadFieldBool(ref reader, slotFields, 6);
|
||||
SkipRemaining(ref reader, slotFields, 7);
|
||||
var temperature = ReadFieldDouble(ref reader, slotFields, 7);
|
||||
SkipRemaining(ref reader, slotFields, 8);
|
||||
slots[slot] = new AetheriaRuntimeEntityItemSlotSnapshot(
|
||||
position.X,
|
||||
position.Y,
|
||||
|
|
@ -1496,7 +1497,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
durability,
|
||||
quantity <= 0 ? 1 : quantity,
|
||||
enabled,
|
||||
overrideShutdown);
|
||||
overrideShutdown,
|
||||
temperature);
|
||||
}
|
||||
|
||||
return slots;
|
||||
|
|
@ -1963,13 +1965,14 @@ namespace GameCult.Aetheria.State.Verse
|
|||
var quantity = ReadFieldInt32(ref reader, itemFields, 3);
|
||||
var enabled = ReadFieldBool(ref reader, itemFields, 4, true);
|
||||
var overrideShutdown = ReadFieldBool(ref reader, itemFields, 5);
|
||||
SkipRemaining(ref reader, itemFields, 6);
|
||||
return new AetheriaRuntimeLoadoutItemSnapshot(itemKey, quality, durability, quantity, enabled, overrideShutdown);
|
||||
var temperature = ReadFieldDouble(ref reader, itemFields, 6);
|
||||
SkipRemaining(ref reader, itemFields, 7);
|
||||
return new AetheriaRuntimeLoadoutItemSnapshot(itemKey, quality, durability, quantity, enabled, overrideShutdown, temperature);
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeLoadoutItemSnapshot EmptyLoadoutItem()
|
||||
{
|
||||
return new AetheriaRuntimeLoadoutItemSnapshot("", 1, 1, 1, true, false);
|
||||
return new AetheriaRuntimeLoadoutItemSnapshot("", 1, 1, 1, true, false, 0);
|
||||
}
|
||||
|
||||
private static IReadOnlyList<AetheriaRuntimeLoadoutItemSlotSnapshot> ReadFieldLoadoutItemSlots(ref MessagePackReader reader, int fields, int index)
|
||||
|
|
|
|||
|
|
@ -174,7 +174,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
double durability,
|
||||
int quantity = 1,
|
||||
bool enabled = true,
|
||||
bool overrideShutdown = false)
|
||||
bool overrideShutdown = false,
|
||||
double temperature = 0)
|
||||
{
|
||||
return new AetheriaRuntimeLoadoutItemCommit
|
||||
{
|
||||
|
|
@ -183,7 +184,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
Durability = durability,
|
||||
Quantity = quantity,
|
||||
Enabled = enabled,
|
||||
OverrideShutdown = overrideShutdown
|
||||
OverrideShutdown = overrideShutdown,
|
||||
Temperature = temperature
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1793,7 +1793,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
Durability = item?.Durability ?? 1.0,
|
||||
Quantity = item?.Quantity ?? 1,
|
||||
Enabled = item?.Enabled ?? true,
|
||||
OverrideShutdown = item?.OverrideShutdown ?? false
|
||||
OverrideShutdown = item?.OverrideShutdown ?? false,
|
||||
Temperature = item?.Temperature ?? 0
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -535,7 +535,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
item?.Quality ?? 1,
|
||||
item?.Durability ?? 1,
|
||||
enabled: true,
|
||||
overrideShutdown: item != null && item.OverrideShutdown);
|
||||
overrideShutdown: item != null && item.OverrideShutdown,
|
||||
temperature: item?.Temperature ?? 0);
|
||||
}
|
||||
|
||||
private static double MaxDurability(
|
||||
|
|
|
|||
|
|
@ -123,7 +123,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
Durability = item?.Durability ?? 1.0,
|
||||
Quantity = item?.Quantity ?? 1,
|
||||
Enabled = item?.Enabled ?? true,
|
||||
OverrideShutdown = item?.OverrideShutdown ?? false
|
||||
OverrideShutdown = item?.OverrideShutdown ?? false,
|
||||
Temperature = item?.Temperature ?? 0
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,6 +132,9 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
[Key(6)]
|
||||
public bool OverrideShutdown { get; set; }
|
||||
|
||||
[Key(7)]
|
||||
public double Temperature { get; set; }
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
value = AetheriaRuntimeDaemonItemStatQueries.EvaluatePerformanceStat(
|
||||
field.Value,
|
||||
item,
|
||||
heat: 0)
|
||||
item.Temperature)
|
||||
.ToString("0.###", CultureInfo.InvariantCulture);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue