Purge Newtonsoft state annotations

This commit is contained in:
Meta Vens 2026-06-13 04:56:50 +01:00
commit b0d2aa1156
92 changed files with 891 additions and 1684 deletions

View file

@ -6,31 +6,30 @@ using System;
using System.Collections.Generic;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;
using UniRx;
using Unity.Mathematics;
using static Unity.Mathematics.math;
[Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn), RuntimeInspectable]
[Inspectable, MessagePackObject, RuntimeInspectable]
public class ReactorData : BehaviorData
{
[Inspectable, JsonProperty("charge"), Key(1), RuntimeInspectable]
[Inspectable, Key(1), RuntimeInspectable]
public PerformanceStat Charge = new PerformanceStat();
[Inspectable, JsonProperty("efficiency"), Key(2), RuntimeInspectable]
[Inspectable, Key(2), RuntimeInspectable]
public PerformanceStat Efficiency = new PerformanceStat();
[Inspectable, JsonProperty("overload"), Key(3), RuntimeInspectable]
[Inspectable, Key(3), RuntimeInspectable]
public PerformanceStat OverloadEfficiency = new PerformanceStat();
[Inspectable, JsonProperty("underload"), Key(4), RuntimeInspectable]
[Inspectable, Key(4), RuntimeInspectable]
public PerformanceStat ThrottlingFactor = new PerformanceStat();
public override Behavior CreateInstance(EquippedItem item)
{
return new Reactor(this, item);
}
public override Behavior CreateInstance(ConsumableItemEffect item)
{
return new Reactor(this, item);
@ -42,7 +41,7 @@ public class Reactor : Behavior, IOrderedBehavior, IDisposable
private ReactorData _data;
public float Draw { get; private set; }
public float CurrentLoadRatio { get; private set; }
public int Order => 100;
@ -91,7 +90,7 @@ public class Reactor : Behavior, IOrderedBehavior, IDisposable
// Subtract the baseline charge from draw
Draw -= charge;
// Generate heat using baseline efficiency
var heat = charge / efficiency;
@ -100,10 +99,10 @@ public class Reactor : Behavior, IOrderedBehavior, IDisposable
{
CurrentLoadRatio = (Draw + charge) / max(charge, .01f);
var overloadEfficiency = Evaluate(_data.OverloadEfficiency);
// Generate heat using overload efficiency, usually much less efficient!
heat += Draw / overloadEfficiency;
// Overload power will always neutralize the energy deficit
Draw = 0;
}
@ -139,9 +138,9 @@ public class Reactor : Behavior, IOrderedBehavior, IDisposable
{
CurrentLoadRatio = 1;
}
Item.SetAudioParameter(SpecialAudioParameter.Intensity, max(.25f, 1 - 1 / CurrentLoadRatio));
AddHeat(heat);
return true;
}