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
42 lines
No EOL
1 KiB
C#
42 lines
No EOL
1 KiB
C#
using MessagePack;
|
|
using Newtonsoft.Json;
|
|
|
|
[InspectableField, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
|
public class HitscanData : WeaponData
|
|
{
|
|
[InspectableField, JsonProperty("perSecond"), Key(6)]
|
|
public bool PerSecond;
|
|
|
|
public override IBehavior CreateInstance(GameContext context, Entity entity, Gear item)
|
|
{
|
|
return new Hitscan(context, this, entity, item);
|
|
}
|
|
}
|
|
|
|
public class Hitscan : IBehavior
|
|
{
|
|
private bool _firing;
|
|
private float _cooldown; // normalized
|
|
private HitscanData _data;
|
|
private Entity Entity { get; }
|
|
private Gear Item { get; }
|
|
private GameContext Context { get; }
|
|
private float _firingVisibility;
|
|
|
|
public BehaviorData Data => _data;
|
|
|
|
public Hitscan(GameContext context, HitscanData c, Entity entity, Gear item)
|
|
{
|
|
Context = context;
|
|
_data = c;
|
|
Entity = entity;
|
|
Item = item;
|
|
}
|
|
|
|
public bool Update(float delta)
|
|
{
|
|
// TODO: Implement hitscan weapons!
|
|
return true;
|
|
}
|
|
|
|
} |