Blueprints & Resources
Added the ability to associate simple commodities with resource maps Added resource placement to zone generator Added crafting blueprints and stat addressing system Refactored Thrusters and Shields into Behaviors Fixed server losing database connection Updated icons
This commit is contained in:
parent
bd824cc2e6
commit
fd92c80876
58 changed files with 1399 additions and 855 deletions
|
|
@ -6,27 +6,25 @@ using MessagePack;
|
|||
using Newtonsoft.Json;
|
||||
using Unity.Mathematics;
|
||||
|
||||
[MessagePackObject]
|
||||
[Union(0, typeof(SimpleCommodityData))]
|
||||
[Union(1, typeof(CompoundCommodityData))]
|
||||
[Union(2, typeof(GearData))]
|
||||
[Union(3, typeof(HullData))]
|
||||
[Union(4, typeof(ShieldData))]
|
||||
[Union(5, typeof(ThrusterData))]
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
[JsonConverter(typeof(JsonKnownTypesConverter<ItemData>))]
|
||||
[MessagePackObject,
|
||||
Union(0, typeof(SimpleCommodityData)),
|
||||
Union(1, typeof(CompoundCommodityData)),
|
||||
Union(2, typeof(GearData)),
|
||||
Union(3, typeof(HullData)),
|
||||
JsonObject(MemberSerialization.OptIn), JsonConverter(typeof(JsonKnownTypesConverter<ItemData>))]
|
||||
public abstract class ItemData : DatabaseEntry, INamedEntry
|
||||
{
|
||||
[InspectableField] [JsonProperty("name")] [Key(1)]
|
||||
[InspectableField, JsonProperty("name"), Key(1)]
|
||||
public string Name;
|
||||
|
||||
[InspectableField] [JsonProperty("mass")] [Key(2)]
|
||||
[InspectableField, JsonProperty("mass"), Key(2)]
|
||||
public float Mass;
|
||||
|
||||
[InspectableField] [JsonProperty("size")] [Key(3)]
|
||||
[InspectableField, JsonProperty("size"), Key(3)]
|
||||
public float Size;
|
||||
|
||||
[InspectableField] [JsonProperty("specificHeat")] [Key(4)]
|
||||
// Heat needed to change temperature of 1 gram by 1 degree
|
||||
[InspectableField, JsonProperty("specificHeat"), Key(4)]
|
||||
public float SpecificHeat;
|
||||
|
||||
[IgnoreMember] public string EntryName
|
||||
|
|
@ -36,61 +34,66 @@ public abstract class ItemData : DatabaseEntry, INamedEntry
|
|||
}
|
||||
}
|
||||
|
||||
[RethinkTable("Items")]
|
||||
[Inspectable]
|
||||
[MessagePackObject]
|
||||
public class SimpleCommodityData : ItemData {}
|
||||
|
||||
[MessagePackObject]
|
||||
[Union(0, typeof(CompoundCommodityData))]
|
||||
[Union(1, typeof(GearData))]
|
||||
[Union(2, typeof(HullData))]
|
||||
[Union(3, typeof(ShieldData))]
|
||||
[Union(4, typeof(ThrusterData))]
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
[JsonConverter(typeof(JsonKnownTypesConverter<CraftedItemData>))]
|
||||
public abstract class CraftedItemData : ItemData
|
||||
[RethinkTable("Items"), Inspectable, MessagePackObject]
|
||||
public class SimpleCommodityData : ItemData
|
||||
{
|
||||
[InspectableField] [JsonProperty("ingredients")] [Key(5)]
|
||||
public Dictionary<Guid, int> Ingredients = new Dictionary<Guid, int>();
|
||||
// Types of body where this resource can be found
|
||||
[InspectableField, JsonProperty("resourceBodyType"), Key(5)]
|
||||
public BodyType ResourceBodyType;
|
||||
|
||||
// Link to map(s) controlling density of resource, multiplied together when more than one
|
||||
[InspectableDatabaseLink(typeof(GalaxyMapLayerData)), JsonProperty("resourceDensity"), Key(6)]
|
||||
public List<Guid> ResourceDensity = new List<Guid>();
|
||||
|
||||
// Controls the bias power variable during resource placement
|
||||
[InspectableField, JsonProperty("resourceDensityBiasPower"), Key(7)]
|
||||
public float ResourceDensityBiasPower = 5;
|
||||
|
||||
// Minimum amount of resources needed for presence to register
|
||||
[InspectableField, JsonProperty("resourceFloor"), Key(8)]
|
||||
public float ResourceFloor = 10f;
|
||||
}
|
||||
|
||||
[RethinkTable("Items")]
|
||||
[Inspectable]
|
||||
[MessagePackObject]
|
||||
[MessagePackObject,
|
||||
Union(0, typeof(CompoundCommodityData)),
|
||||
Union(1, typeof(GearData)),
|
||||
Union(2, typeof(HullData)),
|
||||
JsonObject(MemberSerialization.OptIn),
|
||||
JsonConverter(typeof(JsonKnownTypesConverter<CraftedItemData>))]
|
||||
public abstract class CraftedItemData : ItemData
|
||||
{
|
||||
}
|
||||
|
||||
[RethinkTable("Items"), Inspectable, MessagePackObject]
|
||||
public class CompoundCommodityData : CraftedItemData {}
|
||||
|
||||
[Union(0, typeof(GearData))]
|
||||
[Union(1, typeof(HullData))]
|
||||
[Union(2, typeof(ShieldData))]
|
||||
[Union(3, typeof(ThrusterData))]
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
[JsonConverter(typeof(JsonKnownTypesConverter<EquippableItemData>))]
|
||||
[Union(0, typeof(GearData)),
|
||||
Union(1, typeof(HullData)),
|
||||
JsonObject(MemberSerialization.OptIn), JsonConverter(typeof(JsonKnownTypesConverter<EquippableItemData>))]
|
||||
public abstract class EquippableItemData : CraftedItemData
|
||||
{
|
||||
[InspectableField, JsonProperty("draw"), Key(6)]
|
||||
public PerformanceStat EnergyDraw = new PerformanceStat();
|
||||
|
||||
[InspectableField] [JsonProperty("draw")] [Key(6)]
|
||||
public PerformanceStat EnergyDraw;
|
||||
|
||||
[InspectableAnimationCurve] [JsonProperty("performanceCurve")] [Key(7)]
|
||||
[InspectableAnimationCurve, JsonProperty("performanceCurve"), Key(7)]
|
||||
public float4[] HeatPerformanceCurve;
|
||||
|
||||
[TemperatureInspectable] [JsonProperty("minTemp")] [Key(8)]
|
||||
|
||||
[TemperatureInspectable, JsonProperty("minTemp"), Key(8)]
|
||||
public float MinimumTemperature;
|
||||
|
||||
[TemperatureInspectable] [JsonProperty("maxTemp")] [Key(9)]
|
||||
|
||||
[TemperatureInspectable, JsonProperty("maxTemp"), Key(9)]
|
||||
public float MaximumTemperature;
|
||||
|
||||
[InspectableField] [JsonProperty("durability")] [Key(10)]
|
||||
|
||||
[InspectableField, JsonProperty("durability"), Key(10)]
|
||||
public float Durability;
|
||||
|
||||
[InspectableField] [JsonProperty("durabilityExponent")] [Key(11)]
|
||||
public PerformanceStat DurabilityExponent;
|
||||
[InspectableField, JsonProperty("durabilityExponent"), Key(11)]
|
||||
public PerformanceStat DurabilityExponent = new PerformanceStat();
|
||||
|
||||
[InspectableField] [JsonProperty("heatExponent")] [Key(12)]
|
||||
public PerformanceStat HeatExponent;
|
||||
|
||||
[InspectableField] [JsonProperty("behaviors")] [Key(13)]
|
||||
[InspectableField, JsonProperty("heatExponent"), Key(12)]
|
||||
public PerformanceStat HeatExponent = new PerformanceStat();
|
||||
|
||||
[InspectableField, JsonProperty("behaviors"), Key(13)]
|
||||
public List<IItemBehaviorData> Behaviors = new List<IItemBehaviorData>();
|
||||
|
||||
[IgnoreMember]
|
||||
|
|
@ -125,117 +128,70 @@ public abstract class EquippableItemData : CraftedItemData
|
|||
}
|
||||
}
|
||||
|
||||
[RethinkTable("Items")]
|
||||
[Inspectable]
|
||||
[MessagePackObject]
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
[RethinkTable("Items"), Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
public class GearData : EquippableItemData
|
||||
{
|
||||
[InspectableField] [JsonProperty("hardpointType")] [Key(14)] public HardpointType Hardpoint;
|
||||
[InspectableField, JsonProperty("hardpointType"), Key(14)]
|
||||
public HardpointType Hardpoint;
|
||||
|
||||
[IgnoreMember] public override HardpointType HardpointType => Hardpoint;
|
||||
}
|
||||
|
||||
[RethinkTable("Items")]
|
||||
[Inspectable]
|
||||
[MessagePackObject]
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
[RethinkTable("Items"), Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
public class HullData : EquippableItemData
|
||||
{
|
||||
[InspectableField] [JsonProperty("hullCapacity")] [Key(14)]
|
||||
public PerformanceStat Capacity;
|
||||
[InspectableField, JsonProperty("hullCapacity"), Key(14)]
|
||||
public PerformanceStat Capacity = new PerformanceStat();
|
||||
|
||||
[InspectableField] [JsonProperty("traction")] [Key(15)]
|
||||
public PerformanceStat Traction;
|
||||
[InspectableField, JsonProperty("traction"), Key(15)]
|
||||
public PerformanceStat Traction = new PerformanceStat();
|
||||
|
||||
[InspectableField] [JsonProperty("topSpeed")] [Key(16)]
|
||||
public PerformanceStat TopSpeed;
|
||||
[InspectableField, JsonProperty("topSpeed"), Key(16)]
|
||||
public PerformanceStat TopSpeed = new PerformanceStat();
|
||||
|
||||
[InspectableField] [JsonProperty("emissivity")] [Key(17)]
|
||||
public PerformanceStat Emissivity;
|
||||
[InspectableField, JsonProperty("emissivity"), Key(17)]
|
||||
public PerformanceStat Emissivity = new PerformanceStat();
|
||||
|
||||
[InspectableField] [JsonProperty("crossSection")] [Key(18)]
|
||||
public PerformanceStat CrossSection;
|
||||
[InspectableField, JsonProperty("crossSection"), Key(18)]
|
||||
public PerformanceStat CrossSection = new PerformanceStat();
|
||||
|
||||
[InspectableField] [JsonProperty("hardpoints")] [Key(19)]
|
||||
[InspectableField, JsonProperty("hardpoints"), Key(19)]
|
||||
public List<HardpointData> Hardpoints = new List<HardpointData>();
|
||||
|
||||
[InspectableAnimationCurve] [JsonProperty("visibility")] [Key(20)]
|
||||
[InspectableAnimationCurve, JsonProperty("visibility"), Key(20)]
|
||||
public float4[] VisibilityCurve;
|
||||
|
||||
[InspectablePrefab] [JsonProperty("prefab")] [Key(21)]
|
||||
[InspectablePrefab, JsonProperty("prefab"), Key(21)]
|
||||
public string Prefab;
|
||||
|
||||
[IgnoreMember] public override HardpointType HardpointType => HardpointType.Hull;
|
||||
}
|
||||
|
||||
[RethinkTable("Items")]
|
||||
[InspectableField]
|
||||
[MessagePackObject]
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
[RethinkTable("Items"), InspectableField, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
public class HardpointData
|
||||
{
|
||||
[JsonProperty("type")] [Key(0)]
|
||||
public HardpointType Type;
|
||||
[JsonProperty("type"), Key(0)] public HardpointType Type;
|
||||
}
|
||||
|
||||
[RethinkTable("Items")]
|
||||
[Inspectable]
|
||||
[MessagePackObject]
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class ShieldData : EquippableItemData
|
||||
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
public class PerformanceStat
|
||||
{
|
||||
[InspectableField] [JsonProperty("efficiency")] [Key(14)]
|
||||
public PerformanceStat Efficiency;
|
||||
[JsonProperty("min"), Key(0)] public float Min;
|
||||
|
||||
[InspectableField] [JsonProperty("shielding")] [Key(15)]
|
||||
public PerformanceStat Shielding;
|
||||
[JsonProperty("max"), Key(1)] public float Max;
|
||||
|
||||
[IgnoreMember] public override HardpointType HardpointType => HardpointType.Shield;
|
||||
}
|
||||
|
||||
[RethinkTable("Items")]
|
||||
[Inspectable]
|
||||
[MessagePackObject]
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class ThrusterData : EquippableItemData
|
||||
{
|
||||
[InspectableField] [JsonProperty("thrust")] [Key(14)]
|
||||
public PerformanceStat Thrust;
|
||||
|
||||
[InspectableField] [JsonProperty("torque")] [Key(15)]
|
||||
public PerformanceStat Torque;
|
||||
|
||||
[InspectableField] [JsonProperty("visibility")] [Key(16)]
|
||||
public PerformanceStat Visibility;
|
||||
|
||||
[InspectableField] [JsonProperty("thrusterHeat")] [Key(17)]
|
||||
public PerformanceStat Heat;
|
||||
|
||||
[IgnoreMember] public override HardpointType HardpointType => HardpointType.Thruster;
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public struct PerformanceStat
|
||||
{
|
||||
[JsonProperty("min")] [Key(0)]
|
||||
public float Min;
|
||||
|
||||
[JsonProperty("max")] [Key(1)]
|
||||
public float Max;
|
||||
|
||||
[JsonProperty("durabilityDependent")] [Key(2)]
|
||||
[JsonProperty("durabilityDependent"), Key(2)]
|
||||
public bool DurabilityDependent;
|
||||
|
||||
[JsonProperty("heatDependent")] [Key(3)]
|
||||
|
||||
[JsonProperty("heatDependent"), Key(3)]
|
||||
public bool HeatDependent;
|
||||
|
||||
[JsonProperty("qualityExponent")] [Key(4)]
|
||||
|
||||
[JsonProperty("qualityExponent"), Key(4)]
|
||||
public float QualityExponent;
|
||||
|
||||
[JsonProperty("ingredient")] [Key(5)]
|
||||
public Guid? Ingredient;
|
||||
//[JsonProperty("id"), Key(5)] public Guid ID = Guid.NewGuid();
|
||||
|
||||
// [JsonProperty("ingredient"), Key(5)] public Guid? Ingredient;
|
||||
|
||||
[IgnoreMember] private Dictionary<Ship,Dictionary<IItemBehavior,float>> _scaleModifiers;
|
||||
[IgnoreMember] private Dictionary<Ship,Dictionary<IItemBehavior,float>> _constantModifiers;
|
||||
|
|
|
|||
Loading…
Reference in a new issue