Megas now have unique placement algorithms for their home sectors PerformanceStats can be marked as simple to hide heat and durability PerformanceStats automatically hide exponents when min and max are the same Some behaviors now have options to spread their effects over time
44 lines
No EOL
1.2 KiB
C#
44 lines
No EOL
1.2 KiB
C#
using System;
|
|
using System.Linq;
|
|
using MessagePack;
|
|
using Newtonsoft.Json;
|
|
|
|
[InspectableField, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
|
public class ResourceScannerData : BehaviorData
|
|
{
|
|
[InspectableField, JsonProperty("range"), Key(1)]
|
|
public PerformanceStat Range = new PerformanceStat();
|
|
|
|
[InspectableField, JsonProperty("minDensity"), Key(2)]
|
|
public PerformanceStat MinimumDensity = new PerformanceStat();
|
|
|
|
public override IBehavior CreateInstance(GameContext context, Entity entity, Gear item)
|
|
{
|
|
return new ResourceScanner(context, this, entity, item);
|
|
}
|
|
}
|
|
|
|
public class ResourceScanner : IBehavior
|
|
{
|
|
private ResourceScannerData _data;
|
|
|
|
private Entity Entity { get; }
|
|
private Gear Item { get; }
|
|
private GameContext Context { get; }
|
|
|
|
public BehaviorData Data => _data;
|
|
|
|
public ResourceScanner(GameContext context, ResourceScannerData data, Entity entity, Gear item)
|
|
{
|
|
_data = data;
|
|
Entity = entity;
|
|
Item = item;
|
|
Context = context;
|
|
}
|
|
|
|
public bool Update(float delta)
|
|
{
|
|
// TODO: Implement resource scanners!
|
|
return true;
|
|
}
|
|
} |