Demote entity blueprints to construction
This commit is contained in:
parent
dab29839a2
commit
7b605f049c
17 changed files with 73 additions and 96 deletions
|
|
@ -283,7 +283,7 @@ public class SchematicDisplay : MonoBehaviour
|
|||
if (typedItem != null && typedItem.Durability > 0)
|
||||
return (float)typedItem.Durability;
|
||||
|
||||
return Math.Max(item.Durability, 1f);
|
||||
return item is EquippableItem equippable ? Math.Max(equippable.Durability, 1f) : 1f;
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeCatalogItem FindTypedItem(ItemInstance item)
|
||||
|
|
|
|||
|
|
@ -75,6 +75,12 @@ public class SchematicListElement : MonoBehaviour
|
|||
out WeaponFireType fireTypes,
|
||||
out WeaponModifiers modifiers)
|
||||
{
|
||||
caliber = default;
|
||||
range = default;
|
||||
type = default;
|
||||
fireTypes = default;
|
||||
modifiers = default;
|
||||
|
||||
return
|
||||
Enum.TryParse(weapon.WeaponCaliber, out caliber) &&
|
||||
Enum.TryParse(weapon.WeaponRange, out range) &&
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
ContextMenu.AddOption("Save Loadout",
|
||||
() =>
|
||||
{
|
||||
GameManager.QueueRuntimeLoadoutTemplateCommit(RuntimeEntityBlueprintProjector.CaptureBlueprint(_displayedEntity));
|
||||
GameManager.QueueRuntimeLoadoutTemplateCommit(EntityConstructionBlueprintProjector.CaptureBlueprint(_displayedEntity));
|
||||
});
|
||||
|
||||
if (GameManager.LoadoutTemplates.Any())
|
||||
|
|
@ -189,14 +189,14 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
|
||||
private (string text, Action action, bool enabled) LoadoutOption(AetheriaRuntimeLoadoutTemplateSnapshot template)
|
||||
{
|
||||
var blueprint = GameManager.CreateRuntimeBlueprint(template);
|
||||
var blueprint = GameManager.CreateEntityConstructionBlueprint(template);
|
||||
if (blueprint == null)
|
||||
return ($"{template.Name} - unavailable", () => { }, false);
|
||||
|
||||
var price = blueprint.Price(GameManager.ItemManager);
|
||||
return ($"{template.Name} - {price:n0}", () =>
|
||||
{
|
||||
var entity = RuntimeEntityBlueprintProjector.InstantiateFromBlueprint(GameManager.ItemManager, GameManager.Zone, blueprint, true);
|
||||
var entity = EntityConstructionBlueprintProjector.InstantiateFromBlueprint(GameManager.ItemManager, GameManager.Zone, blueprint, true);
|
||||
entity.SetParent(GameManager.DockedEntity);
|
||||
GameManager.Credits -= price;
|
||||
GameManager.CurrentEntity = entity;
|
||||
|
|
@ -885,7 +885,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
if (typedItem != null && typedItem.Durability > 0)
|
||||
return (float)typedItem.Durability;
|
||||
|
||||
return Math.Max(item.Durability, 1f);
|
||||
return item is EquippableItem equippable ? Math.Max(equippable.Durability, 1f) : 1f;
|
||||
}
|
||||
|
||||
private Shape GetItemShape(ItemInstance item)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using GameCult.Aetheria.State.Unity;
|
||||
using TMPro;
|
||||
using UniRx;
|
||||
|
|
@ -378,7 +379,7 @@ public class PropertiesPanel : MonoBehaviour
|
|||
if (typedItem != null && typedItem.Durability > 0)
|
||||
return (float)typedItem.Durability;
|
||||
|
||||
return Math.Max(item.Durability, 1f);
|
||||
return item is EquippableItem equippable ? Math.Max(equippable.Durability, 1f) : 1f;
|
||||
}
|
||||
|
||||
private static (float minimum, float maximum) GetThermalRange(AetheriaRuntimeCatalogItem typedItem)
|
||||
|
|
|
|||
Loading…
Reference in a new issue