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:
hyperion51 2020-04-09 07:48:45 +01:00
commit fd92c80876
58 changed files with 1399 additions and 855 deletions

View file

@ -0,0 +1,52 @@
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;
using static Unity.Mathematics.math;
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class ShieldBehaviorData : IItemBehaviorData
{
[InspectableField, JsonProperty("efficiency"), Key(0)]
public PerformanceStat Efficiency = new PerformanceStat();
[InspectableField, JsonProperty("shielding"), Key(1)]
public PerformanceStat Shielding = new PerformanceStat();
public IItemBehavior CreateInstance(GameContext context, Ship ship, Gear item)
{
return new ShieldBehavior(context, this, ship, item);
}
}
public class ShieldBehavior : IItemBehavior
{
public Ship Ship { get; }
public Gear Item { get; }
public GameContext Context { get; }
public IItemBehaviorData Data => _data;
private ShieldBehaviorData _data;
public ShieldBehavior(GameContext context, ShieldBehaviorData data, Ship ship, Gear item)
{
Context = context;
_data = data;
Ship = ship;
Item = item;
// TODO: Detect hits on Ship, keep a list of callbacks that modify the hit by reference
}
public void FixedUpdate(float delta)
{
}
public void Initialize()
{
}
public void Update(float delta)
{
}
}