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
52
Assets/Scripts/ServerShared/ItemBehaviors/Shield.cs
Normal file
52
Assets/Scripts/ServerShared/ItemBehaviors/Shield.cs
Normal 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)
|
||||
{
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue