Thermal Performance Threshold & Thermal Override

Items will switch themselves off below a customizable threshold to avoid damage
Player can toggle thermal override to disable safety shutdown
Selecting an item allows player to select whether the item will override
Clicking on the background of an inventory panel will display general ship settings (including thermal shutdown threshold)
Performance Stat evaluation has been moved to EquippedItem, slight performance improvement
Item online and active status are now reactive properties
Created player settings file to store e.g. shutdown threshold
Fixed crash when entering wormhole while enemies are visible
This commit is contained in:
Reinier Vens 2021-03-07 01:10:31 +00:00
commit 1092159063
66 changed files with 756 additions and 206 deletions

View file

@ -74,8 +74,8 @@ public class Reactor : IBehavior, IOrderedBehavior
public bool Execute(float delta)
{
var charge = Context.Evaluate(_data.Charge, Item) * delta;
var efficiency = Context.Evaluate(_data.Efficiency, Item);
var charge = Item.Evaluate(_data.Charge) * delta;
var efficiency = Item.Evaluate(_data.Efficiency);
// This behavior executes last, so any components drawing power have already done so
@ -88,7 +88,7 @@ public class Reactor : IBehavior, IOrderedBehavior
// We have an energy deficit, have to overload the reactor
if (Draw > .01f)
{
var overloadEfficiency = Context.Evaluate(_data.OverloadEfficiency, Item);
var overloadEfficiency = Item.Evaluate(_data.OverloadEfficiency);
// Generate heat using overload efficiency, usually much less efficient!
heat += Draw / overloadEfficiency;
@ -120,7 +120,7 @@ public class Reactor : IBehavior, IOrderedBehavior
// We still have an energy surplus, try to throttle the reactor to reduce heat generation
if (Draw < -.01f)
{
heat -= Draw / efficiency * (1 - 1 / Context.Evaluate(_data.ThrottlingFactor, Item));
heat -= Draw / efficiency * (1 - 1 / Item.Evaluate(_data.ThrottlingFactor));
Draw = 0;
}