diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/ActiveRadiatorParticle.sbc b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/ActiveRadiatorParticle.sbc
new file mode 100644
index 000000000..7f6031369
--- /dev/null
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/ActiveRadiatorParticle.sbc
@@ -0,0 +1,449 @@
+
+
+
+
+
+ -1279450868
+ 90
+ 0
+ false
+ true
+ 0
+ 0
+ 0
+
+
+ GPU
+
+
+
+ 16
+ 16
+ 0
+
+
+
+ 0
+
+
+ 32
+
+
+
+
+
+
+
+
+
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+ 0.5
+
+
+
+
+
+
+ 5
+ 0.5
+ 5
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+ 0
+ 0
+ -1
+
+
+
+
+
+
+ 5
+
+
+
+
+
+
+
+
+ 2
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+ 360
+
+
+
+
+
+
+ 0
+ 10
+ 0
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+ 0
+
+
+
+
+ 0
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+ 0.8
+
+
+
+
+ 0.8
+
+
+
+
+ 0.8
+
+
+
+
+ 0.8
+
+
+
+
+
+
+
+
+ 0.5
+
+
+ 1
+
+
+ 1
+
+
+ 0.015625
+
+
+ true
+
+
+
+
+
+ 10000
+
+
+
+
+
+ Atlas_D_01
+
+
+ 1
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ 1
+
+
+ 0
+
+
+
+ 0
+ 0.75
+ 0
+
+
+
+ 0
+
+
+ 0
+
+
+ true
+
+
+ 0
+
+
+ 0
+
+
+ false
+
+
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+ 1000
+
+
+
+
+ 1000
+
+
+
+
+ 1000
+
+
+
+
+ 1000
+
+
+
+
+
+
+
+
+ 5
+
+
+ false
+
+
+ false
+
+
+ 1
+
+
+ 0.4
+
+
+ 1
+
+
+ 0
+
+
+ 0
+
+
+ true
+
+
+ 0
+
+
+
+
+
+ 3000
+ 1
+
+
+
\ No newline at end of file
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/ActiveRadiator.sbc b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/ActiveRadiator.sbc
new file mode 100644
index 000000000..cce13f0ba
--- /dev/null
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/ActiveRadiator.sbc
@@ -0,0 +1,28 @@
+
+
+
+
+
+ TerminalBlock
+ ActiveRadiator
+
+
+ Rotary Active Radiator
+
+
+ Provides massive heat dissipation at the cost of a high surface area.
+
+ Textures\GUI\Icons\AstronautBackpack.dds
+ Large
+ TriangleMesh
+
+
+ Models\ActiveRadiator.mwm
+
+
+
+
+ ActiveRadiator
+
+
+
\ No newline at end of file
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/Caster_FocusLens.sbc b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/Caster_FocusLens.sbc
index 9fa8cdabb..a3e9a7f41 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/Caster_FocusLens.sbc
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/Caster_FocusLens.sbc
@@ -35,7 +35,7 @@
Caster_FocusLens
Thrust
- 100
+ 34560000
0.200
0.000002
1
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/ExtendableRadiatorBase.sbc b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/ExtendableRadiatorBase.sbc
new file mode 100644
index 000000000..7425abeef
--- /dev/null
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/ExtendableRadiatorBase.sbc
@@ -0,0 +1,31 @@
+
+
+
+
+
+ TerminalBlock
+ ExtendableRadiatorBase
+
+ Retractable Radiator Base
+
+ Allows attached radiator panels to be retracted and extended.
+
+ Textures\GUI\Icons\Cubes\ExtendableRadiatorBase.dds
+ Large
+ TriangleMesh
+
+
+ Models\ExtendableRadiatorBase.mwm
+
+
+
+
+
+
+
+
+
+ ExtendableRadiatorBase
+
+
+
\ No newline at end of file
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/Heat_FlatRadiator.sbc b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/Heat_FlatRadiator.sbc
index b73ed2f80..f332111a8 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/Heat_FlatRadiator.sbc
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/Heat_FlatRadiator.sbc
@@ -17,7 +17,7 @@
Models\Heat_FlatRadiator.mwm
-
+
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/RadiatorPanel.sbc b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/RadiatorPanel.sbc
new file mode 100644
index 000000000..886baf42e
--- /dev/null
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/CubeBlocks/RadiatorPanel.sbc
@@ -0,0 +1,34 @@
+
+
+
+
+
+ CubeBlock
+ RadiatorPanel
+
+ Retractable Radiator Panel
+
+ A simple radiator panel. Can be retracted when attached to a base, but still functions as a radiator when standalone.
+
+ Textures\GUI\Icons\Cubes\RadiatorPanel.dds
+ Large
+ TriangleMesh
+
+
+ Models\RadiatorPanel.mwm
+
+
+
+
+ RadiatorPanel
+
+
+
+
+
+
+ Y
+ X
+
+
+
\ No newline at end of file
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/DefinitionAPI.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/DefinitionAPI.cs
index 5461f5e36..543c9d0e7 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/DefinitionAPI.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/DefinitionAPI.cs
@@ -7,8 +7,7 @@
using VRage.Utils;
using VRageMath;
-namespace StarCore.FusionSystems.
- Communication
+namespace Epstein_Fusion_DS.Communication
{
///
/// Class used to communicate with the Modular Assemblies Framework mod.
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/DefinitionCollector.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/DefinitionCollector.cs
index a298ea1e7..9490077e1 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/DefinitionCollector.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/DefinitionCollector.cs
@@ -1,8 +1,8 @@
-using StarCore.FusionSystems.Communication;
-using static StarCore.FusionSystems.Communication.DefinitionDefs;
+using Epstein_Fusion_DS.Communication;
+using static Epstein_Fusion_DS.Communication.DefinitionDefs;
// ReSharper disable once CheckNamespace
-namespace StarCore.FusionSystems
+namespace Epstein_Fusion_DS
{
internal partial class ModularDefinition
{
@@ -20,7 +20,7 @@ internal void LoadDefinitions(params ModularPhysicalDefinition[] defs)
///
internal static ModularDefinitionContainer GetBaseDefinitions()
{
- return new StarCore.FusionSystems.ModularDefinition().Container;
+ return new Epstein_Fusion_DS.ModularDefinition().Container;
}
}
}
\ No newline at end of file
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/ModularDefinitionSender.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/ModularDefinitionSender.cs
index 550a9cdab..2cf873fc8 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/ModularDefinitionSender.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Communication/ModularDefinitionSender.cs
@@ -1,9 +1,8 @@
using VRage.Game.Components;
using VRage.Utils;
-using static StarCore.FusionSystems.Communication.DefinitionDefs;
+using static Epstein_Fusion_DS.Communication.DefinitionDefs;
-namespace StarCore.FusionSystems.
- Communication
+namespace Epstein_Fusion_DS.Communication
{
[MySessionComponentDescriptor(MyUpdateOrder.Simulation, int.MinValue)]
internal class ModularDefinitionSender : MySessionComponentBase
@@ -16,20 +15,20 @@ public override void LoadData()
$"{ModContext.ModName}.ModularDefinition: Init new ModularAssembliesDefinition");
// Init
- StoredDef = ModularDefinition.GetBaseDefinitions();
+ StoredDef = Epstein_Fusion_DS.ModularDefinition.GetBaseDefinitions();
// Send definitions over as soon as the API loads, and create the API before anything else can init.
- ModularDefinition.ModularApi.Init(ModContext, SendDefinitions);
+ Epstein_Fusion_DS.ModularDefinition.ModularApi.Init(ModContext, SendDefinitions);
}
protected override void UnloadData()
{
- ModularDefinition.ModularApi.UnloadData();
+ Epstein_Fusion_DS.ModularDefinition.ModularApi.UnloadData();
}
private void SendDefinitions()
{
- ModularDefinition.ModularApi.RegisterDefinitions(StoredDef);
+ Epstein_Fusion_DS.ModularDefinition.ModularApi.RegisterDefinitions(StoredDef);
}
}
}
\ No newline at end of file
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts.cs
index 54a231c3f..137f07be5 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts.cs
@@ -1,9 +1,9 @@
using System.Collections.Generic;
-using StarCore.FusionSystems.FusionParts;
+using Epstein_Fusion_DS.FusionParts;
using VRageMath;
-using static StarCore.FusionSystems.Communication.DefinitionDefs;
+using static Epstein_Fusion_DS.Communication.DefinitionDefs;
-namespace StarCore.FusionSystems
+namespace Epstein_Fusion_DS
{
internal partial class ModularDefinition
{
@@ -36,6 +36,7 @@ internal partial class ModularDefinition
AllowedBlockSubtypes = new[]
{
"Caster_FocusLens",
+
"Caster_Accelerator_0",
"Caster_Accelerator_90",
"Caster_CentralPipe_0",
@@ -52,94 +53,27 @@ internal partial class ModularDefinition
// If the connection type whitelist is empty, all allowed subtypes may connect on that side.
AllowedConnections = new Dictionary>
{
+ // Note - Offsets line up with BuildInfo block orientation.
+ // Note - Offsets are measured from the center of the block; in this case, the Caster_FocusLens is a 3x3 that has connections on the back in a plus shape.
+ #region Drives
+
{
- // Note - Offsets line up with BuildInfo block orientation.
- // Note - Offsets are measured from the center of the block; in this case, the Caster_FocusLens is a 3x3 that has connections on the back in a plus shape.
"Caster_FocusLens", new Dictionary
{
- {
- new Vector3I(1, 0, 2), new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- "Caster_Reactor",
- "Caster_Controller",
- "Caster_FocusLens",
- "Caster_ConveyorCap"
- }
- },
- {
- new Vector3I(-1, 0, 2), new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- "Caster_Reactor",
- "Caster_Controller",
- "Caster_FocusLens",
- "Caster_ConveyorCap"
- }
- },
- {
- new Vector3I(0, 1, 2), new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- "Caster_Reactor",
- "Caster_Controller",
- "Caster_FocusLens",
- "Caster_ConveyorCap"
- }
- },
- {
- new Vector3I(0, -1, 2), new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- "Caster_Reactor",
- "Caster_Controller",
- "Caster_FocusLens",
- "Caster_ConveyorCap"
- }
- }
+ [new Vector3I(1, 0, 2)] = AllowedPipeConnections,
+ [new Vector3I(-1, 0, 2)] = AllowedPipeConnections,
+ [new Vector3I(0, 1, 2)] = AllowedPipeConnections,
+ [new Vector3I(0, -1, 2)] = AllowedPipeConnections,
}
},
+
+ #endregion
+
{
"Caster_Reactor", new Dictionary
{
- {
- new Vector3I(0, 2, 0), new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- "Caster_FocusLens",
- //"Caster_Controller",
- "Caster_Reactor",
- "Caster_ConveyorCap"
- }
- },
- {
- new Vector3I(0, -2, 0), new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- "Caster_FocusLens",
- //"Caster_Controller",
- "Caster_Reactor",
- "Caster_ConveyorCap"
- }
- }
+ [new Vector3I(0, 2, 0)] = AllowedPipeConnections,
+ [new Vector3I(0, -2, 0)] = AllowedPipeConnections,
}
},
{
@@ -187,137 +121,33 @@ internal partial class ModularDefinition
{
"Caster_CentralPipe_0", new Dictionary
{
- {
- Vector3I.Forward, new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- //"Caster_Controller",
- "Caster_FocusLens",
- "Caster_Reactor",
- "Caster_ConveyorCap"
- }
- },
- {
- Vector3I.Backward, new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- //"Caster_Controller",
- "Caster_FocusLens",
- "Caster_Reactor",
- "Caster_ConveyorCap"
- }
- }
+ [Vector3I.Forward] = AllowedPipeConnections,
+ [Vector3I.Backward] = AllowedPipeConnections,
}
},
{
"Caster_CentralPipe_90", new Dictionary
{
- {
- Vector3I.Forward, new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- //"Caster_Controller",
- "Caster_FocusLens",
- "Caster_Reactor",
- "Caster_ConveyorCap"
- }
- },
- {
- Vector3I.Right, new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- //"Caster_Controller",
- "Caster_FocusLens",
- "Caster_Reactor",
- "Caster_ConveyorCap"
- }
- }
+ [Vector3I.Forward] = AllowedPipeConnections,
+ [Vector3I.Right] = AllowedPipeConnections,
}
},
{
"Caster_CentralPipe_T", new Dictionary
{
- {
- Vector3I.Forward, new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- //"Caster_Controller",
- "Caster_FocusLens",
- "Caster_Reactor",
- "Caster_ConveyorCap"
- }
- },
- {
- Vector3I.Right, new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- //"Caster_Controller",
- "Caster_FocusLens",
- "Caster_Reactor",
- "Caster_ConveyorCap"
- }
- },
- {
- Vector3I.Backward, new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- //"Caster_Controller",
- "Caster_FocusLens",
- "Caster_Reactor",
- "Caster_ConveyorCap"
- }
- }
+ [Vector3I.Forward] = AllowedPipeConnections,
+ [Vector3I.Right] = AllowedPipeConnections,
+ [Vector3I.Backward] = AllowedPipeConnections,
}
},
{
"Caster_Feeder", new Dictionary
{
{
- Vector3I.Forward, new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- //"Caster_Controller",
- "Caster_FocusLens",
- "Caster_Reactor",
- "Caster_ConveyorCap"
- }
+ Vector3I.Forward, AllowedPipeConnections
},
{
- Vector3I.Backward, new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- //"Caster_Controller",
- "Caster_FocusLens",
- "Caster_Reactor",
- "Caster_ConveyorCap"
- }
+ Vector3I.Backward, AllowedPipeConnections
},
{
@@ -338,38 +168,28 @@ internal partial class ModularDefinition
}
}
},
- //{
- // "Caster_Controller", new Dictionary
- // {
- // {
- // Vector3I.Backward, new[]
- // {
- // "Caster_CentralPipe_0",
- // "Caster_CentralPipe_90",
- // "Caster_CentralPipe_T",
- // "Caster_Feeder",
- // "Caster_Reactor"
- // }
- // }
- // }
- //}
{
"Caster_ConveyorCap", new Dictionary
{
{
- Vector3I.Backward, new[]
- {
- "Caster_CentralPipe_0",
- "Caster_CentralPipe_90",
- "Caster_CentralPipe_T",
- "Caster_Feeder",
- "Caster_Reactor",
- "Caster_FocusLens",
- }
+ Vector3I.Backward, AllowedPipeConnections
}
}
}
}
};
+
+ private static readonly string[] AllowedPipeConnections =
+ {
+ "Caster_FocusLens",
+
+ "Caster_CentralPipe_0",
+ "Caster_CentralPipe_90",
+ "Caster_CentralPipe_T",
+ "Caster_Feeder",
+ //"Caster_Controller",
+ "Caster_Reactor",
+ "Caster_ConveyorCap"
+ };
}
}
\ No newline at end of file
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionConveyor/ConveyorCap.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionConveyor/ConveyorCap.cs
index 7eb8763e3..32f504114 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionConveyor/ConveyorCap.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionConveyor/ConveyorCap.cs
@@ -1,14 +1,13 @@
using System;
-using Sandbox.ModAPI.Interfaces.Terminal;
-using Sandbox.ModAPI;
using System.Collections.Generic;
using Sandbox.Common.ObjectBuilders;
+using Sandbox.ModAPI;
+using Sandbox.ModAPI.Interfaces.Terminal;
+using VRage.Game.Components;
using VRage.ModAPI;
using VRage.ObjectBuilders;
-using VRageMath;
-using VRage.Game.Components;
-namespace StarCore.FusionSystems.FusionParts.FusionConveyor
+namespace Epstein_Fusion_DS.FusionParts.FusionConveyor
{
///
/// Forces stockpile on and prevents players from disabling it on caster conveyor tanks.
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionPart.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionPart.cs
index bf67064a9..209b879a1 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionPart.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionPart.cs
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
+using Epstein_Fusion_DS.Communication;
+using Epstein_Fusion_DS.HeatParts;
using ProtoBuf;
using Sandbox.Game.EntityComponents;
using Sandbox.ModAPI;
using Sandbox.ModAPI.Interfaces.Terminal;
-using StarCore.FusionSystems.Communication;
-using StarCore.FusionSystems.HeatParts;
using VRage.Game;
using VRage.Game.Components;
using VRage.Game.ModAPI;
@@ -17,7 +17,7 @@
using VRage.Sync;
using VRage.Utils;
-namespace StarCore.FusionSystems.FusionParts
+namespace Epstein_Fusion_DS.FusionParts
{
public abstract class FusionPart : MyGameLogicComponent, IMyEventProxy
where T : IMyCubeBlock
@@ -46,18 +46,21 @@ public abstract class FusionPart : MyGameLogicComponent, IMyEventProxy
public MySync PowerUsageSync;
internal FusionPartSettings Settings;
- internal static ModularDefinitionApi ModularApi => ModularDefinition.ModularApi;
+ internal static ModularDefinitionApi ModularApi => Epstein_Fusion_DS.ModularDefinition.ModularApi;
///
/// Block subtypes allowed.
///
- internal abstract string BlockSubtype { get; }
+ internal abstract string[] BlockSubtypes { get; }
///
/// Human-readable name for this part type.
///
internal abstract string ReadableName { get; }
+ internal virtual Func MinOverrideLimit { get; } = b => 0.01f;
+ internal virtual Func MaxOverrideLimit { get; } = b => 4;
+
#region Controls
private void CreateControls()
@@ -83,7 +86,7 @@ private void CreateControls()
boostPowerToggle.OnText = MyStringId.GetOrCompute("On");
boostPowerToggle.OffText = MyStringId.GetOrCompute("Off");
- boostPowerToggle.Visible = block => block.BlockDefinition.SubtypeName == BlockSubtype;
+ boostPowerToggle.Visible = block => BlockSubtypes.Contains(block.BlockDefinition.SubtypeName);
boostPowerToggle.SupportsMultipleBlocks = true;
boostPowerToggle.Enabled = block => true;
@@ -106,7 +109,7 @@ private void CreateControls()
builder?.Append(Math.Round(block.GameLogic.GetAs>()?.PowerUsageSync.Value * 100 ?? 0))
.Append('%');
- powerUsageSlider.Visible = block => block.BlockDefinition.SubtypeName == BlockSubtype;
+ powerUsageSlider.Visible = block => BlockSubtypes.Contains(block.BlockDefinition.SubtypeName);
powerUsageSlider.SupportsMultipleBlocks = true;
powerUsageSlider.Enabled = block => true;
@@ -120,7 +123,7 @@ private void CreateControls()
boostPowerUsageSlider.Tooltip =
MyStringId.GetOrCompute(
$"Fusion Power generation this {ReadableName} should use when Override is enabled.");
- boostPowerUsageSlider.SetLimits(0.01f, 4.0f);
+ boostPowerUsageSlider.SetLimits(MinOverrideLimit, MaxOverrideLimit);
boostPowerUsageSlider.Getter = block =>
block.GameLogic.GetAs>()?.OverridePowerUsageSync.Value ?? 0;
boostPowerUsageSlider.Setter = (block, value) =>
@@ -131,7 +134,7 @@ private void CreateControls()
Math.Round(block.GameLogic.GetAs>()?.OverridePowerUsageSync.Value * 100 ?? 0))
.Append('%');
- boostPowerUsageSlider.Visible = block => block.BlockDefinition.SubtypeName == BlockSubtype;
+ boostPowerUsageSlider.Visible = block => BlockSubtypes.Contains(block.BlockDefinition.SubtypeName);
boostPowerUsageSlider.SupportsMultipleBlocks = true;
boostPowerUsageSlider.Enabled = block => true;
@@ -157,7 +160,7 @@ private void CreateControls()
if (logic != null) sb.Append(logic.OverrideEnabled.Value ? "OVR On" : "OVR Off");
};
boostPowerAction.Icon = @"Textures\GUI\Icons\Actions\Toggle.dds";
- boostPowerAction.Enabled = block => block.BlockDefinition.SubtypeName == BlockSubtype;
+ boostPowerAction.Enabled = block => BlockSubtypes.Contains(block.BlockDefinition.SubtypeName);
MyAPIGateway.TerminalControls.AddAction(boostPowerAction);
}
@@ -168,7 +171,7 @@ private void CreateControls()
private void AssignDetailedInfoGetter(IMyTerminalBlock block, List controls)
{
- if (block?.BlockDefinition.SubtypeName != BlockSubtype)
+ if (!BlockSubtypes.Contains(block.BlockDefinition.SubtypeName))
return;
block.RefreshCustomInfo();
block.SetDetailedInfoDirty();
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionReactor/FusionReactorLogic.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionReactor/FusionReactorLogic.cs
index f95a2d4d0..3af302316 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionReactor/FusionReactorLogic.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionReactor/FusionReactorLogic.cs
@@ -5,7 +5,7 @@
using VRage.ModAPI;
using VRage.ObjectBuilders;
-namespace StarCore.FusionSystems.FusionParts.FusionReactor
+namespace Epstein_Fusion_DS.FusionParts.FusionReactor
{
[MyEntityComponentDescriptor(typeof(MyObjectBuilder_Reactor), false, "Caster_Reactor")]
public class FusionReactorLogic : FusionPart
@@ -14,7 +14,7 @@ public class FusionReactorLogic : FusionPart
private float _bufferReactorOutput;
- internal override string BlockSubtype => "Caster_Reactor";
+ internal override string[] BlockSubtypes => new[] { "Caster_Reactor" };
internal override string ReadableName => "Reactor";
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionThruster/FusionThrusterLogic.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionThruster/FusionThrusterLogic.cs
index 74ca353c7..cf061490c 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionThruster/FusionThrusterLogic.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionThruster/FusionThrusterLogic.cs
@@ -1,49 +1,66 @@
using System;
+using System.Collections.Generic;
using Sandbox.Common.ObjectBuilders;
using Sandbox.ModAPI;
using VRage.Game.Components;
using VRage.ModAPI;
using VRage.ObjectBuilders;
-using VRageMath;
-namespace StarCore.FusionSystems.FusionParts.FusionThruster
+namespace Epstein_Fusion_DS.FusionParts.FusionThruster
{
- [MyEntityComponentDescriptor(typeof(MyObjectBuilder_Thrust), false, "Caster_FocusLens")]
+ [MyEntityComponentDescriptor(typeof(MyObjectBuilder_Thrust), false,
+ "Caster_FocusLens"
+ )]
public class FusionThrusterLogic : FusionPart
{
private int _bufferBlockCount = 1;
private float _bufferThrustOutput;
- internal override string BlockSubtype => "Caster_FocusLens";
+ internal override string[] BlockSubtypes => new[]
+ {
+ "Caster_FocusLens",
+ };
+
internal override string ReadableName => "Thruster";
+ internal override Func MinOverrideLimit =>
+ b => 1;
+ internal override Func MaxOverrideLimit =>
+ b => DriveSettings[b.BlockDefinition.SubtypeId].MaxOverclock;
+
+ internal static readonly Dictionary DriveSettings = new Dictionary
+ {
+ ["Caster_FocusLens"] = new DriveSetting(4.00f, 1.5f, 34.56f*2*1000000),
+ };
+
public override void UpdatePower(float powerGeneration, float newtonsPerFusionPower, int numberThrusters)
{
BufferPowerGeneration = powerGeneration;
_bufferBlockCount = numberThrusters;
- var consumptionMultiplier =
- OverrideEnabled.Value
- ? OverridePowerUsageSync
- : PowerUsageSync.Value; // This is ugly, let's make it better.
- consumptionMultiplier /= numberThrusters;
+ var overrideModifier = (OverrideEnabled ? OverridePowerUsageSync : PowerUsageSync).Value;
- // Power generation consumed (per second)
- var powerConsumption = powerGeneration * 60 * consumptionMultiplier;
+ var thrustOutput = Block.CurrentThrust;
+ var maxThrustOutput = DriveSettings[Block.BlockDefinition.SubtypeId].BaseThrust * overrideModifier;
+ // This formula is very dumb but it just about does the trick. Approaches 200% efficiency at zero usage, and 0% at 2x usage.
+ var efficiencyMultiplier = DriveSettings[Block.BlockDefinition.SubtypeId].EfficiencyModifier
+ *
+ (2 - 1/(DriveSettings[Block.BlockDefinition.SubtypeId].BaseThrust/maxThrustOutput));
- var efficiencyMultiplier = 1 / (0.489f + consumptionMultiplier);
+ // Power generation consumed (per second)
+ var powerConsumption = thrustOutput / newtonsPerFusionPower / efficiencyMultiplier;
// Power generated (per second)
- var thrustOutput = efficiencyMultiplier * powerConsumption * newtonsPerFusionPower;
- _bufferThrustOutput = thrustOutput;
+ //var thrustOutput = efficiencyMultiplier * powerConsumption * newtonsPerFusionPower;
+ _bufferThrustOutput = maxThrustOutput;
MaxPowerConsumption = powerConsumption / 60;
InfoText.Clear();
InfoText.AppendLine(
- $"\nOutput: {Math.Round(thrustOutput, 1)}/{Math.Round(powerGeneration * 60 * newtonsPerFusionPower, 1)}");
- InfoText.AppendLine($"Input: {Math.Round(powerConsumption, 1)}/{Math.Round(powerGeneration * 60, 1)}");
- InfoText.AppendLine($"Efficiency: {Math.Round(efficiencyMultiplier * 100)}%");
+ $"\nOutput: {thrustOutput/1000000:F1}/{maxThrustOutput/1000000:F1} MN");
+ InfoText.AppendLine($"Input: {powerConsumption:F1}/{powerGeneration * 60:F1}");
+ InfoText.AppendLine($"Efficiency: {efficiencyMultiplier * 100:F1}%");
// Convert back into power per tick
if (!IsShutdown)
@@ -120,5 +137,30 @@ public override void UpdateAfterSimulation()
}
#endregion
+
+ public struct DriveSetting
+ {
+ ///
+ /// Efficiency modifier for converting fusing rate into power.
+ ///
+ public float EfficiencyModifier;
+
+ ///
+ /// Maximum overclock, in percent.
+ ///
+ public float MaxOverclock;
+
+ ///
+ /// Default thrust output.
+ ///
+ public float BaseThrust;
+
+ public DriveSetting(float efficiencyModifier, float maxOverclock, float baseThrust)
+ {
+ EfficiencyModifier = efficiencyModifier;
+ MaxOverclock = maxOverclock;
+ BaseThrust = baseThrust;
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionArm.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionArm.cs
index 2e3a13a68..db4b5e5c1 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionArm.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionArm.cs
@@ -1,11 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using StarCore.FusionSystems.Communication;
+using Epstein_Fusion_DS.Communication;
+using Epstein_Fusion_DS.HudHelpers;
using VRage.Game.ModAPI;
using VRageMath;
-namespace StarCore.FusionSystems.
+namespace Epstein_Fusion_DS.
FusionParts
{
///
@@ -18,7 +19,7 @@ internal struct SFusionArm
private const float BlockPowerStorage = 32f;
private const float SharedPropertyModifier = 0.05f;
- private static ModularDefinitionApi ModularApi => ModularDefinition.ModularApi;
+ private static ModularDefinitionApi ModularApi => Epstein_Fusion_DS.ModularDefinition.ModularApi;
public readonly bool IsValid;
@@ -75,7 +76,7 @@ public SFusionArm(IMyCubeBlock newPart, string rootSubtype)
private static bool PerformScan(IMyCubeBlock blockEntity, ref HashSet parts, string stopAtSubtype)
{
if (ModularApi.IsDebug())
- DebugDraw.DebugDraw.AddGridPoint(blockEntity.Position,
+ DebugDraw.AddGridPoint(blockEntity.Position,
blockEntity.CubeGrid, Color.Blue, 2);
var connectedBlocks = ModularApi.GetConnectedBlocks(blockEntity, "Modular_Fusion", false);
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionManager.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionManager.cs
index f8b55cfaf..dc44c7d6c 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionManager.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionManager.cs
@@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.Linq;
-using StarCore.FusionSystems.Communication;
+using Epstein_Fusion_DS.Communication;
using VRage.Game.ModAPI;
-namespace StarCore.FusionSystems.FusionParts
+namespace Epstein_Fusion_DS.FusionParts
{
internal class SFusionManager
{
@@ -15,7 +15,7 @@ internal class SFusionManager
public ModularDefinition FusionDefinition;
public Dictionary FusionSystems = new Dictionary();
public ModularDefinition HeatDefinition;
- private static ModularDefinitionApi ModularApi => ModularDefinition.ModularApi;
+ private static ModularDefinitionApi ModularApi => Epstein_Fusion_DS.ModularDefinition.ModularApi;
public void Load()
{
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionSystem.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionSystem.cs
index 7d52791b5..fccb63910 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionSystem.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionSystem.cs
@@ -1,21 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Sandbox.Game.EntityComponents;
+using Epstein_Fusion_DS.Communication;
+using Epstein_Fusion_DS.FusionParts.FusionReactor;
+using Epstein_Fusion_DS.FusionParts.FusionThruster;
using Sandbox.ModAPI;
-using StarCore.FusionSystems.Communication;
-using StarCore.FusionSystems.FusionParts.FusionReactor;
-using StarCore.FusionSystems.FusionParts.FusionThruster;
-using StarCore.FusionSystems.HeatParts;
using VRage.Game.ModAPI;
-namespace StarCore.FusionSystems.
+namespace Epstein_Fusion_DS.
FusionParts
{
internal class SFusionSystem
{
- public const float MegawattsPerFusionPower = 32;
- public const float NewtonsPerFusionPower = 12800000;
+ public const float MegawattsPerFusionPower = 16;
+ public const float NewtonsPerFusionPower = 1500000;
+ public const float HydrogenPerFusionPower = 42;
public readonly IMyCubeGrid Grid;
public readonly List Arms = new List();
@@ -38,6 +37,8 @@ internal class SFusionSystem
///
public float PowerGeneration;
+ public float MaxPowerGeneration;
+
public readonly List Reactors = new List();
public readonly List Thrusters = new List();
public readonly List Tanks = new List();
@@ -57,7 +58,7 @@ public float PowerStored
set { ModularApi.SetAssemblyProperty(PhysicalAssemblyId, "PowerStored", value); }
}
- private static ModularDefinitionApi ModularApi => ModularDefinition.ModularApi;
+ private static ModularDefinitionApi ModularApi => Epstein_Fusion_DS.ModularDefinition.ModularApi;
public void AddPart(IMyCubeBlock newPart)
{
@@ -156,6 +157,7 @@ public void RemovePart(IMyCubeBlock part)
var logic = part.GameLogic.GetAs();
logic.MemberSystem = null;
Thrusters.Remove(logic);
+ logic.UpdatePower(PowerGeneration, NewtonsPerFusionPower, Thrusters.Count);
}
if (part is IMyReactor)
@@ -163,6 +165,7 @@ public void RemovePart(IMyCubeBlock part)
var logic = part.GameLogic.GetAs();
logic.MemberSystem = null;
Reactors.Remove(logic);
+ logic.UpdatePower(PowerGeneration, NewtonsPerFusionPower, Thrusters.Count);
}
if (part is IMyGasTank)
@@ -185,7 +188,6 @@ public void RemovePart(IMyCubeBlock part)
private void UpdatePower(bool updateReactors = false)
{
- //var generationModifier = 1 / (HeatManager.I.GetGridHeatLevel(Grid) + 0.5f);
var generationModifier = 1;
var powerGeneration = float.Epsilon;
var powerCapacity = float.Epsilon;
@@ -216,6 +218,7 @@ private void UpdatePower(bool updateReactors = false)
// Subtract power usage afterwards so that all reactors have the same stats.
PowerGeneration = powerGeneration;
+ MaxPowerGeneration = PowerGeneration;
MaxPowerStored = powerCapacity;
PowerConsumption = totalPowerUsage;
@@ -226,7 +229,7 @@ private void UpdatePower(bool updateReactors = false)
if (!MyAPIGateway.Session.CreativeMode)
{
double availableGas = Tanks.Sum(t => t.FilledRatio * t.Capacity);
- double gasNeeded = PowerGeneration * 25;
+ double gasNeeded = PowerGeneration * HydrogenPerFusionPower;
if (Tanks.Count == 0 || availableGas <= gasNeeded)
{
@@ -251,7 +254,7 @@ private void UpdatePower(bool updateReactors = false)
PowerStored += PowerGeneration;
if (PowerStored > MaxPowerStored) PowerStored = MaxPowerStored;
ModularApi.SetAssemblyProperty(PhysicalAssemblyId, "HeatGeneration",
- PowerConsumption * MegawattsPerFusionPower);
+ PowerConsumption * MegawattsPerFusionPower * 3);
}
public void UpdateTick()
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts.cs
index cb50d9cfc..0aece114e 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts.cs
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
-using StarCore.FusionSystems.FusionParts;
-using StarCore.FusionSystems.HeatParts;
+using Epstein_Fusion_DS.FusionParts;
+using Epstein_Fusion_DS.HeatParts;
using VRageMath;
-using static StarCore.FusionSystems.Communication.DefinitionDefs;
+using static Epstein_Fusion_DS.Communication.DefinitionDefs;
-namespace StarCore.FusionSystems
+namespace Epstein_Fusion_DS
{
internal partial class ModularDefinition
{
@@ -35,7 +35,10 @@ internal partial class ModularDefinition
AllowedBlockSubtypes = new[]
{
"Heat_Heatsink",
- "Heat_FlatRadiator"
+ "Heat_FlatRadiator",
+ "RadiatorPanel",
+ "ExtendableRadiatorBase",
+ "ActiveRadiator",
},
// Allowed connection directions & whitelists, measured in blocks.
@@ -53,23 +56,23 @@ internal partial class ModularDefinition
["Heat_FlatRadiator"] = new Dictionary
{
[Vector3I.Forward] = Array.Empty(),
+ [Vector3I.Up] = Array.Empty(),
+ [Vector3I.Down] = Array.Empty(),
+ [Vector3I.Left] = Array.Empty(),
+ [Vector3I.Right] = Array.Empty(),
+ },
+ ["RadiatorPanel"] = new Dictionary
+ {
+ [Vector3I.Down] = Array.Empty(),
+ [Vector3I.Up] = Array.Empty(),
+ },
+ ["ExtendableRadiatorBase"] = new Dictionary
+ {
[Vector3I.Up] = new[]
{
- "Heat_FlatRadiator"
- },
- [Vector3I.Down] = new[]
- {
- "Heat_FlatRadiator"
+ "RadiatorPanel"
},
- [Vector3I.Left] = new[]
- {
- "Heat_FlatRadiator"
- },
- [Vector3I.Right] = new[]
- {
- "Heat_FlatRadiator"
- }
- }
+ },
}
};
}
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/Definitions/HeatPartDefinition.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/Definitions/HeatPartDefinition.cs
new file mode 100644
index 000000000..16eca682c
--- /dev/null
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/Definitions/HeatPartDefinition.cs
@@ -0,0 +1,28 @@
+using System;
+using VRage.Game.ModAPI;
+
+namespace Epstein_Fusion_DS.HeatParts.Definitions
+{
+ internal class HeatPartDefinition
+ {
+ ///
+ /// The subtype of the heat part block.
+ ///
+ public string SubtypeId;
+
+ ///
+ /// Amount of heat removed per second by one block.
+ ///
+ public float HeatDissipation;
+
+ ///
+ /// Amount of heat that can be stored by one block.
+ ///
+ public float HeatCapacity;
+
+ ///
+ /// Optional line of sight check. Returns the occlusion percentage (dissipation efficiency modifier) of the input radiator. Set to null if unneeded.
+ ///
+ public Func LoSCheck;
+ }
+}
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/Definitions/HeatPartDefinitions.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/Definitions/HeatPartDefinitions.cs
new file mode 100644
index 000000000..18dd35caf
--- /dev/null
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/Definitions/HeatPartDefinitions.cs
@@ -0,0 +1,153 @@
+using Epstein_Fusion_DS.Communication;
+using System.Collections.Generic;
+using System.Linq;
+using Epstein_Fusion_DS.HudHelpers;
+using Sandbox.ModAPI;
+using VRage.Game.ModAPI;
+using VRageMath;
+
+namespace Epstein_Fusion_DS.HeatParts.Definitions
+{
+ internal static class HeatPartDefinitions
+ {
+ private static ModularDefinitionApi ModularApi => Epstein_Fusion_DS.ModularDefinition.ModularApi;
+
+ public static HeatPartDefinition GetDefinition(string subtypeId) =>
+ Definitions.FirstOrDefault(d => d.SubtypeId == subtypeId);
+
+ public static bool HasDefinition(string subtypeId) =>
+ Definitions.Any(d => d.SubtypeId == subtypeId);
+
+ ///
+ /// Internal buffer list for cell casting
+ ///
+ private static readonly List _cellPositions = new List();
+
+ ///
+ /// Array of all heat part definitions
+ ///
+ public static readonly HeatPartDefinition[] Definitions =
+ {
+ new HeatPartDefinition
+ {
+ SubtypeId = "Heat_Heatsink",
+ HeatCapacity = 60,
+ HeatDissipation = 0,
+ LoSCheck = null
+ },
+ new HeatPartDefinition
+ {
+ SubtypeId = "Heat_FlatRadiator",
+ HeatCapacity = 0,
+ HeatDissipation = 2,
+ LoSCheck = radiatorBlock => CheckGridIntersect(radiatorBlock, Vector3I.Zero, Vector3I.Backward) ? 0 : 1
+ },
+ new HeatPartDefinition
+ {
+ SubtypeId = "MDA_Radiator_1x2",
+ HeatCapacity = 0,
+ HeatDissipation = 4,
+ LoSCheck = radiatorBlock =>
+ {
+ float occlusionModifier = 0;
+
+ if (!CheckGridIntersect(radiatorBlock, Vector3I.Up, Vector3I.Forward))
+ occlusionModifier += 1 / 6f;
+ if (!CheckGridIntersect(radiatorBlock, Vector3I.Up, Vector3I.Backward))
+ occlusionModifier += 1 / 6f;
+
+ if (!CheckGridIntersect(radiatorBlock, Vector3I.Zero, Vector3I.Forward))
+ occlusionModifier += 1 / 6f;
+ if (!CheckGridIntersect(radiatorBlock, Vector3I.Zero, Vector3I.Backward))
+ occlusionModifier += 1 / 6f;
+
+ if (!CheckGridIntersect(radiatorBlock, Vector3I.Down, Vector3I.Forward))
+ occlusionModifier += 1 / 6f;
+ if (!CheckGridIntersect(radiatorBlock, Vector3I.Down, Vector3I.Backward))
+ occlusionModifier += 1 / 6f;
+
+ return occlusionModifier;
+ }
+ },
+ new HeatPartDefinition
+ {
+ SubtypeId = "RadiatorPanel",
+ HeatCapacity = 0,
+ HeatDissipation = 2,
+ LoSCheck = radiatorBlock =>
+ {
+ float occlusionModifier = 0;
+
+ if (!CheckGridIntersect(radiatorBlock, Vector3I.Zero, Vector3I.Right))
+ occlusionModifier += 1 / 2f;
+ if (!CheckGridIntersect(radiatorBlock, Vector3I.Zero, Vector3I.Left))
+ occlusionModifier += 1 / 2f;
+
+ return occlusionModifier;
+ }
+ },
+ new HeatPartDefinition
+ {
+ SubtypeId = "ActiveRadiator",
+ HeatCapacity = 60,
+ HeatDissipation = 50,
+ LoSCheck = radiatorBlock =>
+ {
+ float occlusionModifier = 0;
+
+ Vector3I[] checkPositions =
+ {
+ new Vector3I(1, 0, -1),
+ new Vector3I(0, 0, -1),
+ new Vector3I(-1, 0, -1),
+
+ new Vector3I(1, 0, 0),
+ Vector3I.Zero,
+ new Vector3I(-1, 0, 0),
+
+ new Vector3I(1, 0, 1),
+ new Vector3I(0, 0, 1),
+ new Vector3I(-1, 0, 1),
+ };
+
+ foreach (var pos in checkPositions)
+ if (!CheckGridIntersect(radiatorBlock, pos, Vector3I.Up))
+ occlusionModifier += 1f / checkPositions.Length;
+
+ if (!CheckGridIntersect(radiatorBlock, Vector3I.Zero, Vector3I.Up))
+ occlusionModifier += 1 / 2f;
+ if (!CheckGridIntersect(radiatorBlock, Vector3I.Right, Vector3I.Up))
+ occlusionModifier += 1 / 2f;
+
+ return occlusionModifier;
+ }
+ }
+ };
+
+ private static bool CheckGridIntersect(IMyCubeBlock block, Vector3I checkOffset, Vector3I checkDirection)
+ {
+ _cellPositions.Clear();
+
+ var grid = block.CubeGrid;
+ var blockMatrix = block.WorldMatrix;
+ var gridMaxExtents = Vector3.Distance(grid.Max, grid.Min) * grid.GridSize;
+ var checkStartPosition = Vector3D.Transform(checkOffset * block.CubeGrid.GridSize, ref blockMatrix);
+
+ if (ModularApi.IsDebug())
+ DebugDraw.AddLine(checkStartPosition,
+ checkStartPosition + Vector3D.TransformNormal(checkDirection, ref blockMatrix) * gridMaxExtents, Color.Bisque, 2);
+
+ block.CubeGrid.RayCastCells(checkStartPosition,
+ checkStartPosition + Vector3D.TransformNormal(checkDirection, ref blockMatrix) * gridMaxExtents, _cellPositions);
+
+ foreach (var cellPosition in _cellPositions)
+ {
+ var testBlock = grid.GetCubeBlock(cellPosition);
+ if (testBlock != null && testBlock != block.SlimBlock)
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/ActiveRadiatorAnimation.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/ActiveRadiatorAnimation.cs
new file mode 100644
index 000000000..b21d9f7df
--- /dev/null
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/ActiveRadiatorAnimation.cs
@@ -0,0 +1,62 @@
+using Sandbox.ModAPI;
+using VRage.Game;
+using VRage.Game.Components;
+using VRage.Game.Entity;
+using VRage.Game.ModAPI;
+using VRage.ModAPI;
+using VRage.ObjectBuilders;
+using VRageMath;
+
+namespace Epstein_Fusion_DS.HeatParts.ExtendableRadiators
+{
+ [MyEntityComponentDescriptor(typeof(MyObjectBuilder_TerminalBlock), false, "ActiveRadiator")]
+ internal class ActiveRadiatorAnimation : MyGameLogicComponent
+ {
+ private IMyCubeBlock Block;
+ private MyEntitySubpart FanPart;
+ private MyParticleEffect Particle;
+
+ public override void Init(MyObjectBuilder_EntityBase objectBuilder)
+ {
+ base.Init(objectBuilder);
+
+ Block = (IMyCubeBlock)Entity;
+
+ NeedsUpdate |= MyEntityUpdateEnum.BEFORE_NEXT_FRAME;
+ }
+
+ public override void UpdateOnceBeforeFrame()
+ {
+ base.UpdateOnceBeforeFrame();
+
+ if (Block?.CubeGrid?.Physics == null || MyAPIGateway.Utilities.IsDedicated)
+ return;
+
+ FanPart = Block.GetSubpart("blades");
+
+ MyParticlesManager.TryCreateParticleEffect("ActiveRadiatorParticle", ref MatrixD.Identity, ref Vector3D.Zero, Block.Render.GetRenderObjectID(), out Particle);
+
+ NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME;
+ }
+
+ public override void UpdateAfterSimulation()
+ {
+ float heatLevel = HeatManager.I.GetGridHeatLevel(Block.CubeGrid);
+
+ Matrix refMatrix = MatrixD.CreateFromAxisAngle(Vector3D.Up, -0.1 * heatLevel) * FanPart.PositionComp.LocalMatrixRef;
+ refMatrix.Translation = FanPart.PositionComp.LocalMatrixRef.Translation;
+ FanPart.PositionComp.SetLocalMatrix(ref refMatrix);
+
+ if (heatLevel < 0.15)
+ heatLevel = 0;
+
+ Particle.UserBirthMultiplier = heatLevel * heatLevel;
+ Particle.UserVelocityMultiplier = heatLevel * heatLevel;
+ }
+
+ public override void Close()
+ {
+ Particle?.Close();
+ }
+ }
+}
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/ExtendableRadiator.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/ExtendableRadiator.cs
new file mode 100644
index 000000000..8e8c80e10
--- /dev/null
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/ExtendableRadiator.cs
@@ -0,0 +1,282 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using Epstein_Fusion_DS.Communication;
+using Epstein_Fusion_DS.HudHelpers;
+using ProtoBuf;
+using Sandbox.Game.Entities;
+using Sandbox.Game.EntityComponents;
+using Sandbox.ModAPI;
+using VRage.Game;
+using VRage.Game.Components;
+using VRage.Game.ModAPI;
+using VRage.ModAPI;
+using VRage.ObjectBuilders;
+using VRageMath;
+
+namespace Epstein_Fusion_DS.HeatParts.ExtendableRadiators
+{
+ [MyEntityComponentDescriptor(typeof(MyObjectBuilder_TerminalBlock), false, "ExtendableRadiatorBase")]
+ internal class ExtendableRadiator : MyGameLogicComponent
+ {
+ public static readonly Guid RadiatorGuid = new Guid("e6b87818-5fd8-47a6-a480-3365e20214e1");
+ public static readonly string[] ValidPanelSubtypes =
+ {
+ "RadiatorPanel",
+ };
+
+
+ public IMyCubeBlock Block;
+ internal StoredRadiator[] StoredRadiators = Array.Empty();
+ internal RadiatorAnimation Animation;
+
+ private bool _isExtended = true;
+ public bool IsExtended
+ {
+ get
+ {
+ return _isExtended;
+ }
+ set
+ {
+ if (Animation.IsActive)
+ return;
+
+ if (value)
+ ExtendPanels();
+ else
+ RetractPanels();
+ _isExtended = value;
+ }
+ }
+
+ public override void Init(MyObjectBuilder_EntityBase objectBuilder)
+ {
+ base.Init(objectBuilder);
+
+ Block = (IMyCubeBlock)Entity;
+
+ NeedsUpdate |= MyEntityUpdateEnum.BEFORE_NEXT_FRAME;
+ }
+
+ public override void UpdateOnceBeforeFrame()
+ {
+ RadiatorControls.DoOnce();
+ base.UpdateOnceBeforeFrame();
+
+ if (Block?.CubeGrid?.Physics == null)
+ return;
+
+ LoadSettings();
+
+ try
+ {
+ SaveSettings();
+ }
+ catch (Exception ex)
+ {
+ ModularDefinition.ModularApi.Log(ex.ToString());
+ }
+
+ Animation = new RadiatorAnimation(this);
+ NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME;
+ //NeedsUpdate |= MyEntityUpdateEnum.EACH_100TH_FRAME;
+ }
+
+ public override void UpdateAfterSimulation()
+ {
+ base.UpdateAfterSimulation();
+
+ // This is stupid, but prevents the mod profiler cost from being incurred every tick per block when inactive
+ if (Animation.IsActive)
+ Animation.UpdateTick();
+ }
+
+ public override bool IsSerialized()
+ {
+ try
+ {
+ SaveSettings();
+ }
+ catch (Exception ex)
+ {
+ ModularDefinition.ModularApi.Log(ex.ToString());
+ }
+
+ return base.IsSerialized();
+ }
+
+ internal void SaveSettings()
+ {
+ if (Block == null)
+ return; // called too soon or after it was already closed, ignore
+
+ if (StoredRadiators == null)
+ throw new NullReferenceException($"Settings == null on entId={Entity?.EntityId}; Test log 1");
+
+ if (MyAPIGateway.Utilities == null)
+ throw new NullReferenceException($"MyAPIGateway.Utilities == null; entId={Entity?.EntityId}; Test log 2");
+
+ if (Block.Storage == null)
+ Block.Storage = new MyModStorageComponent();
+
+ Block.Storage.SetValue(RadiatorGuid, Convert.ToBase64String(MyAPIGateway.Utilities.SerializeToBinary(StoredRadiators)));
+ }
+
+ internal void LoadSettings()
+ {
+ if (Block.Storage == null)
+ return;
+
+ string rawData;
+ if (!Block.Storage.TryGetValue(RadiatorGuid, out rawData))
+ return;
+
+ try
+ {
+ var loadedSettings = MyAPIGateway.Utilities.SerializeFromBinary(Convert.FromBase64String(rawData)) ?? Array.Empty();
+
+ StoredRadiators = loadedSettings;
+ _isExtended = StoredRadiators.Length == 0;
+
+ for (int i = 0; i < StoredRadiators.Length; i++)
+ {
+ if (Block.LocalMatrix == StoredRadiators[i].BaseLocalMatrix)
+ break;
+
+ var matrix = Matrix.Invert(StoredRadiators[i].BaseLocalMatrix) * Block.LocalMatrix;
+
+ StoredRadiators[i].ObjectBuilder.Min = Block.Position + (Vector3I)Block.LocalMatrix.Up * (i+1);
+ StoredRadiators[i].LocalMatrix *= matrix;
+ StoredRadiators[i].ObjectBuilder.Orientation = Quaternion.CreateFromRotationMatrix(StoredRadiators[i].LocalMatrix);
+
+ var matrix2 = StoredRadiators[i].LocalMatrix;
+ StoredRadiators[i].ObjectBuilder.BlockOrientation = new MyBlockOrientation(ref matrix2);
+
+ StoredRadiators[i].BaseLocalMatrix = Block.LocalMatrix;
+ }
+ }
+ catch (Exception e)
+ {
+ ModularDefinition.ModularApi.Log(e.ToString());
+ }
+ }
+
+ public void ExtendPanels()
+ {
+ if (_isExtended || Animation.IsActive)
+ return;
+
+ Vector3I nextPosition = Block.Position;
+
+ try
+ {
+ // TODO move this to clientside
+ for (int i = 0; i < StoredRadiators.Length; i++)
+ {
+ nextPosition += (Vector3I)(Block.LocalMatrix.Up * (i + 1));
+
+ if (Block.CubeGrid.CubeExists(nextPosition))
+ {
+ MyAPIGateway.Utilities.ShowNotification("Block already exists at position!");
+ DebugDraw.AddGridPoint(nextPosition, Block.CubeGrid, Color.Red, 4);
+ _isExtended = false;
+ return;
+ }
+ }
+
+ for (int i = 0; i < StoredRadiators.Length; i++)
+ {
+ StoredRadiators[i].ObjectBuilder.Name = null;
+
+ var newBlock = Block.CubeGrid.AddBlock(StoredRadiators[i].ObjectBuilder, true);
+ if (newBlock?.FatBlock != null)
+ newBlock.FatBlock.Visible = false;
+ else
+ ModularDefinition.ModularApi.Log($"Stored radiator panel is null!\n Builder: {StoredRadiators[i].ObjectBuilder == null}\n Slimblock: {newBlock == null}\n Fatblock: {newBlock?.FatBlock == null}");
+ }
+
+ Animation.StartExtension();
+ }
+ catch (Exception ex)
+ {
+ ModularDefinition.ModularApi.Log(ex.ToString());
+ }
+ }
+
+ ///
+ /// Panels start invisible for the animation to play. This makes them visible again.
+ ///
+ public void MakePanelsVisible()
+ {
+ IMyCubeBlock nextBlock;
+ int idx = 1;
+
+ while (GetNextPanel(idx, out nextBlock))
+ {
+ nextBlock.Visible = true;
+ idx++;
+ }
+
+ StoredRadiators = Array.Empty();
+ }
+
+ public void RetractPanels()
+ {
+ if (!_isExtended)
+ return;
+
+ IMyCubeBlock nextBlock;
+ List builders = new List();
+ int idx = 1;
+
+ while (GetNextPanel(idx, out nextBlock))
+ {
+ var builder = nextBlock.GetObjectBuilderCubeBlock(true);
+
+ builder.BlockOrientation = nextBlock.Orientation;
+
+ Matrix matrix;
+ builders.Add(new StoredRadiator(builder, nextBlock.LocalMatrix, nextBlock.CalculateCurrentModel(out matrix), Block.LocalMatrix));
+
+ nextBlock.CubeGrid.RemoveBlock(nextBlock.SlimBlock, true);
+ idx++;
+ }
+
+ StoredRadiators = builders.ToArray();
+
+ Animation.StartRetraction();
+ }
+
+ internal bool GetNextPanel(int idx, out IMyCubeBlock next)
+ {
+ IMySlimBlock block = Block.CubeGrid.GetCubeBlock((Vector3I)(Block.Position + Block.LocalMatrix.Up * idx));
+ if (block == null || !ValidPanelSubtypes.Contains(block.BlockDefinition.Id.SubtypeName))
+ {
+ next = null;
+ return false;
+ }
+
+ next = block.FatBlock;
+ return true;
+ }
+
+ [ProtoContract]
+ internal struct StoredRadiator
+ {
+ [ProtoMember(1)] public MyObjectBuilder_CubeBlock ObjectBuilder;
+ [ProtoMember(2)] public Matrix LocalMatrix;
+ [ProtoMember(4)] public Matrix BaseLocalMatrix;
+ [ProtoMember(3)] public string Model;
+
+
+ public StoredRadiator(MyObjectBuilder_CubeBlock objectBuilder, Matrix localMatrix, string model, Matrix baseLocalMatrix)
+ {
+ ObjectBuilder = objectBuilder;
+ LocalMatrix = localMatrix;
+ Model = model;
+ BaseLocalMatrix = baseLocalMatrix;
+ }
+ }
+ }
+}
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/RadiatorAnimation.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/RadiatorAnimation.cs
new file mode 100644
index 000000000..f152477a5
--- /dev/null
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/RadiatorAnimation.cs
@@ -0,0 +1,207 @@
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using Epstein_Fusion_DS.HudHelpers;
+using Sandbox.Engine.Physics;
+using Sandbox.Game.Entities;
+using Sandbox.ModAPI;
+using VRage.Game.Components;
+using VRage.Game.Entity;
+using VRage.Game.ModAPI;
+using VRage.ModAPI;
+using VRage.ObjectBuilders;
+using VRageMath;
+using CollisionLayers = Sandbox.Engine.Physics.MyPhysics.CollisionLayers;
+using Color = VRageMath.Color;
+
+namespace Epstein_Fusion_DS.HeatParts.ExtendableRadiators
+{
+ internal class RadiatorAnimation
+ {
+ public readonly ExtendableRadiator Radiator;
+ public bool IsActive = false;
+ public bool IsExtending = false;
+
+ private HashSet _animationEntities = new HashSet();
+
+ public RadiatorAnimation(ExtendableRadiator radiator)
+ {
+ Radiator = radiator;
+ }
+
+ public void StartExtension()
+ {
+ IsActive = true;
+ IsExtending = true;
+ }
+
+ public void StartRetraction()
+ {
+ IsActive = true;
+ IsExtending = false;
+ }
+
+ private int _animationTick = 0;
+ public void UpdateTick()
+ {
+ if (!IsActive)
+ return;
+
+ _animationTick++;
+
+ if (IsExtending)
+ {
+ // Extension animation
+
+ if (_animationTick == 1)
+ {
+ MyEntity parentEntity = (MyEntity) Radiator.Block;
+ Matrix localMatrixOffset = Matrix.Invert(Radiator.Block.LocalMatrix);
+
+ for (int i = 0; i < Radiator.StoredRadiators.Length; i++)
+ {
+ _animationEntities.Add(new AnimationPanel(Radiator.StoredRadiators[i].Model, Radiator.StoredRadiators[i].LocalMatrix * localMatrixOffset, parentEntity));
+ parentEntity = _animationEntities.Last();
+ localMatrixOffset = Matrix.Invert(Radiator.StoredRadiators[i].LocalMatrix);
+ }
+
+ int idx = 0;
+ foreach (var entity in _animationEntities)
+ {
+ if (idx == 0)
+ {
+ entity.RotateAroundLocalAxis(1.1781);
+ entity.MoveLocalSpace(entity.RightVector * -0.75f);
+ }
+ else
+ {
+ entity.RotateAroundLocalAxis(1.1781*2);
+ }
+
+ idx++;
+ }
+ }
+
+ if (_animationTick <= 120)
+ {
+ int idx = 0;
+ foreach (var entity in _animationEntities)
+ {
+ if (idx == 0)
+ {
+ entity.RotateAroundLocalAxis(-1.1781/120);
+ entity.MoveLocalSpace(entity.RightVector * 0.75f/120);
+ }
+ else
+ {
+ entity.RotateAroundLocalAxis(-1.1781/120*2);
+ }
+
+ idx++;
+ }
+
+ return;
+ }
+
+ Reset();
+ Radiator.MakePanelsVisible();
+ }
+ else
+ {
+ // Retraction animation
+
+ if (_animationTick == 1)
+ {
+ MyEntity parentEntity = (MyEntity) Radiator.Block;
+ Matrix localMatrixOffset = Matrix.Invert(Radiator.Block.LocalMatrix);
+
+ for (int i = 0; i < Radiator.StoredRadiators.Length; i++)
+ {
+ _animationEntities.Add(new AnimationPanel(Radiator.StoredRadiators[i].Model, Radiator.StoredRadiators[i].LocalMatrix * localMatrixOffset, parentEntity));
+ parentEntity = _animationEntities.Last();
+ localMatrixOffset = Matrix.Invert(Radiator.StoredRadiators[i].LocalMatrix);
+ }
+ }
+
+ if (_animationTick <= 120)
+ {
+ int idx = 0;
+ foreach (var entity in _animationEntities)
+ {
+ if (idx == 0)
+ {
+ entity.RotateAroundLocalAxis(1.1781/120);
+ entity.MoveLocalSpace(entity.RightVector * -0.75f/120);
+ }
+ else
+ {
+ entity.RotateAroundLocalAxis(1.1781/120*2);
+ }
+
+ idx++;
+ }
+
+ return;
+ }
+
+ Reset();
+ return;
+ }
+ }
+
+ private void Reset()
+ {
+ _animationTick = 0;
+ IsActive = false;
+
+ foreach (var entity in _animationEntities)
+ entity.Close();
+ _animationEntities.Clear();
+ }
+
+ private sealed class AnimationPanel : MyEntity
+ {
+ ///
+ /// As the block rotates, its orientation changes. RightVector is used to translate the block relative to itself after rotation.
+ ///
+ public readonly Vector3D RightVector;
+ private Vector3D _rotationPoint = new Vector3D(-0.5, 1.25, 0);
+ private readonly bool _isUpsideDown;
+
+ public AnimationPanel(string model, Matrix localMatrix, MyEntity parent)
+ {
+ Init(null, model, parent, 1);
+ if (string.IsNullOrEmpty(model))
+ Flags &= ~EntityFlags.Visible;
+ Save = false;
+ NeedsWorldMatrix = true;
+
+ PositionComp.SetLocalMatrix(ref localMatrix);
+ MyEntities.Add(this);
+
+ RightVector = PositionComp.LocalMatrixRef.Right;
+
+ _isUpsideDown = PositionComp.LocalMatrixRef.Up.Y * PositionComp.LocalMatrixRef.Translation.Y > 0;
+ if (_isUpsideDown)
+ _rotationPoint *= -1;
+ }
+
+ public void RotateAroundLocalAxis(double amount)
+ {
+ Matrix newMatrix = Utils.RotateMatrixAroundPoint(PositionComp.LocalMatrixRef,
+ Vector3D.Transform(_rotationPoint, PositionComp.LocalMatrixRef), PositionComp.LocalMatrixRef.Backward, amount);
+ PositionComp.SetLocalMatrix(ref newMatrix);
+ }
+
+ public void MoveLocalSpace(Vector3 amount)
+ {
+ if (_isUpsideDown)
+ amount *= -1;
+
+ Matrix newMatrix = PositionComp.LocalMatrixRef;
+ newMatrix.Translation += amount;
+ PositionComp.SetLocalMatrix(ref newMatrix);
+ }
+ }
+ }
+}
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/RadiatorControls.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/RadiatorControls.cs
new file mode 100644
index 000000000..ea8e7739e
--- /dev/null
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/ExtendableRadiators/RadiatorControls.cs
@@ -0,0 +1,80 @@
+using System.Text;
+using Sandbox.ModAPI;
+using Sandbox.ModAPI.Interfaces.Terminal;
+using VRage.Utils;
+
+namespace Epstein_Fusion_DS.HeatParts.ExtendableRadiators
+{
+ internal static class RadiatorControls
+ {
+ private static bool _done = false;
+
+ static bool CustomVisibleCondition(IMyTerminalBlock b)
+ {
+ // only visible for the blocks having this gamelogic comp
+ return b?.GameLogic?.GetAs() != null;
+ }
+
+ public static void DoOnce() // called by GyroLogic.cs
+ {
+ if (_done)
+ return;
+ _done = true;
+
+ // these are all the options and they're not all required so use only what you need.
+ CreateControls();
+ }
+
+ private static void CreateControls()
+ {
+ {
+ var c = MyAPIGateway.TerminalControls.CreateControl("Radiator_ToggleExtended");
+ c.Title = MyStringId.GetOrCompute("Toggle Extension");
+ c.Tooltip = MyStringId.GetOrCompute("Extends or retracts radiator panels attached to this block.");
+ c.SupportsMultipleBlocks = true;
+
+ c.Visible = CustomVisibleCondition;
+
+ c.OnText = MyStringId.GetOrCompute("Extended");
+ c.OffText = MyStringId.GetOrCompute("Retracted");
+
+ c.Getter = (b) => b?.GameLogic?.GetAs()?.IsExtended ?? false;
+ c.Setter = (b, v) =>
+ {
+ var logic = b?.GameLogic?.GetAs();
+ if (logic != null)
+ logic.IsExtended = v;
+ c.UpdateVisual();
+ };
+
+ MyAPIGateway.TerminalControls.AddControl(c);
+ }
+
+ {
+ var a = MyAPIGateway.TerminalControls.CreateAction("Radiator_ToggleExtended");
+ a.Name = new StringBuilder("Toggle Extension");
+ a.ValidForGroups = true;
+
+ a.Enabled = CustomVisibleCondition;
+
+ a.Writer = (block, builder) =>
+ {
+ builder.Clear();
+ if (block?.GameLogic?.GetAs()?.IsExtended ?? false)
+ builder.Append("Extended");
+ else
+ builder.Append("Retracted");
+ };
+
+ a.Action = (block) =>
+ {
+ var logic = block?.GameLogic?.GetAs();
+ if (logic != null)
+ logic.IsExtended = !logic.IsExtended;
+ };
+
+ MyAPIGateway.TerminalControls.AddAction(a);
+ }
+ }
+ }
+}
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/GridHeatManager.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/GridHeatManager.cs
index 229748faf..e2384241e 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/GridHeatManager.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/GridHeatManager.cs
@@ -1,10 +1,10 @@
using System.Collections.Generic;
+using Epstein_Fusion_DS.Communication;
using Sandbox.Game.Entities;
-using StarCore.FusionSystems.Communication;
using VRage.Game.ModAPI;
using VRageMath;
-namespace StarCore.FusionSystems.HeatParts
+namespace Epstein_Fusion_DS.HeatParts
{
internal class GridHeatManager
{
@@ -30,7 +30,7 @@ public GridHeatManager(IMyCubeGrid grid)
Grid = (MyCubeGrid)grid;
}
- private static ModularDefinitionApi ModularApi => ModularDefinition.ModularApi;
+ private static ModularDefinitionApi ModularApi => Epstein_Fusion_DS.ModularDefinition.ModularApi;
public MyCubeGrid Grid { get; }
@@ -88,7 +88,10 @@ public void OnPartAdd(int assemblyId, IMyCubeBlock block, bool isBaseBlock)
public void OnPartRemove(int assemblyId, IMyCubeBlock block, bool isBaseBlock)
{
- var system = _heatSystems[assemblyId];
+ var system = _heatSystems.GetValueOrDefault(assemblyId, null);
+ if (system == null)
+ return;
+
system.OnPartRemove(block);
if (system.BlockCount <= 0)
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/HeatManager.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/HeatManager.cs
index 6558142f9..8749312f5 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/HeatManager.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/HeatManager.cs
@@ -3,7 +3,7 @@
using VRage.Game.ModAPI;
using VRage.ModAPI;
-namespace StarCore.FusionSystems.HeatParts
+namespace Epstein_Fusion_DS.HeatParts
{
internal class HeatManager
{
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/HeatSystem.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/HeatSystem.cs
index deac41872..50ac777fa 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/HeatSystem.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/HeatSystem.cs
@@ -1,20 +1,18 @@
using System.Collections.Generic;
-using StarCore.FusionSystems.Communication;
+using System.Linq;
+using Epstein_Fusion_DS.Communication;
+using Epstein_Fusion_DS.HeatParts.Definitions;
using VRage.Game.ModAPI;
using VRageMath;
-namespace StarCore.FusionSystems.HeatParts
+namespace Epstein_Fusion_DS.HeatParts
{
internal class HeatSystem
{
- private const float HeatCapacityPerSink = 60;
- private const float HeatDissipationPerRadiator = 5f;
-
- private readonly List _cellPositions = new List();
-
- private readonly HashSet _occludedRadiators = new HashSet();
- private readonly List _radiatorBlocks = new List();
- private readonly HashSet _visibleRadiators = new HashSet();
+ ///
+ /// Maps radiator blocks to their heat dissipation.
+ ///
+ private readonly Dictionary _radiatorBlocks = new Dictionary();
public int AssemblyId;
@@ -33,7 +31,7 @@ public HeatSystem(int assemblyId, GridHeatManager parent)
Parent.Grid.OnBlockRemoved += UpdateLoS;
}
- private static ModularDefinitionApi ModularApi => ModularDefinition.ModularApi;
+ private static ModularDefinitionApi ModularApi => Epstein_Fusion_DS.ModularDefinition.ModularApi;
public int BlockCount { get; private set; }
///
@@ -56,19 +54,20 @@ public float HeatCapacity
public void OnPartAdd(IMyCubeBlock block)
{
- switch (block.BlockDefinition.SubtypeName)
+ var definition = HeatPartDefinitions.GetDefinition(block.BlockDefinition.SubtypeId);
+ if (definition == null)
+ return;
+
+ if (definition.HeatCapacity != 0)
+ {
+ HeatCapacity += definition.HeatCapacity;
+ Parent.HeatCapacity += definition.HeatCapacity;
+ }
+
+ if (definition.HeatDissipation != 0)
{
- case "Heat_Heatsink":
- HeatCapacity += HeatCapacityPerSink;
- Parent.HeatCapacity += HeatCapacityPerSink;
- break;
- case "Heat_FlatRadiator":
- _radiatorBlocks.Add(block);
- _visibleRadiators.Add(block);
- HeatDissipation += HeatDissipationPerRadiator;
- Parent.HeatDissipation += HeatDissipationPerRadiator;
- DoLoSCheck(block);
- break;
+ _radiatorBlocks.Add(block, 0);
+ DoLoSCheck(block);
}
BlockCount++;
@@ -76,22 +75,21 @@ public void OnPartAdd(IMyCubeBlock block)
public void OnPartRemove(IMyCubeBlock block)
{
- switch (block.BlockDefinition.SubtypeName)
+ var definition = HeatPartDefinitions.GetDefinition(block.BlockDefinition.SubtypeId);
+ if (definition == null)
+ return;
+
+ if (definition.HeatCapacity != 0)
+ {
+ HeatCapacity -= definition.HeatCapacity;
+ Parent.HeatCapacity -= definition.HeatCapacity;
+ }
+
+ if (definition.HeatDissipation != 0)
{
- case "Heat_Heatsink":
- HeatCapacity -= HeatCapacityPerSink;
- Parent.HeatCapacity -= HeatCapacityPerSink;
- break;
- case "Heat_FlatRadiator":
- _radiatorBlocks.Remove(block);
- _occludedRadiators.Remove(block);
- if (_visibleRadiators.Remove(block))
- {
- HeatDissipation -= HeatDissipationPerRadiator;
- Parent.HeatDissipation -= HeatDissipationPerRadiator;
- }
-
- break;
+ HeatDissipation -= _radiatorBlocks[block];
+ Parent.HeatDissipation -= _radiatorBlocks[block];
+ _radiatorBlocks.Remove(block);
}
BlockCount--;
@@ -106,60 +104,38 @@ public void OnClose()
private void UpdateLoS(IMySlimBlock newBlock)
{
Quaternion radQuaternion;
- foreach (var radiator in _radiatorBlocks)
+
+ foreach (var radiator in _radiatorBlocks.Keys.ToArray())
{
radiator.Orientation.GetQuaternion(out radQuaternion);
var offset = (Vector3I)(radQuaternion * (newBlock.Position - radiator.Position));
+ var radiatorSize = (radiator.Max - radiator.Min + Vector3I.One).AbsMax();
// If block is in front of radiator panel
- if (offset.X == 0 && offset.Y == 0 && offset.Z > 0) DoLoSCheck(radiator);
+ if (offset.X < radiatorSize && offset.Y < radiatorSize && offset.Z < radiatorSize) DoLoSCheck(radiator);
}
}
private void DoLoSCheck(IMyCubeBlock radiatorBlock)
{
- var blockMatrix = radiatorBlock.WorldMatrix;
- var gridMaxExtents = Vector3.Distance(Parent.Grid.Max, Parent.Grid.Min) * Parent.Grid.GridSize;
-
- var doesIntersect = false;
+ var definition = HeatPartDefinitions.GetDefinition(radiatorBlock.BlockDefinition.SubtypeId);
+ if (definition == null)
+ return;
- if (ModularApi.IsDebug())
- DebugDraw.DebugDraw.AddLine(blockMatrix.Translation,
- blockMatrix.Translation + blockMatrix.Backward * gridMaxExtents, Color.Bisque, 2);
+ float currentDissipation = (definition.LoSCheck?.Invoke(radiatorBlock) ?? 1) * definition.HeatDissipation;
+ float prevDissipation = _radiatorBlocks[radiatorBlock];
- Parent.Grid.RayCastCells(blockMatrix.Translation,
- blockMatrix.Translation + blockMatrix.Backward * gridMaxExtents, _cellPositions);
-
- foreach (var cellPosition in _cellPositions)
- {
- if (cellPosition == radiatorBlock.Position || !Parent.Grid.CubeExists(cellPosition))
- continue;
+ if (currentDissipation == prevDissipation)
+ return;
- doesIntersect = true;
- break;
- }
+ HeatDissipation -= prevDissipation;
+ Parent.HeatDissipation -= prevDissipation;
- _cellPositions.Clear();
+ HeatDissipation += currentDissipation;
+ Parent.HeatDissipation += currentDissipation;
- if (doesIntersect)
- {
- _visibleRadiators.Remove(radiatorBlock);
- if (_occludedRadiators.Add(radiatorBlock))
- {
- HeatDissipation -= HeatDissipationPerRadiator;
- Parent.HeatDissipation -= HeatDissipationPerRadiator;
- }
- }
- else
- {
- _occludedRadiators.Remove(radiatorBlock);
- if (_visibleRadiators.Add(radiatorBlock))
- {
- HeatDissipation += HeatDissipationPerRadiator;
- Parent.HeatDissipation += HeatDissipationPerRadiator;
- }
- }
+ _radiatorBlocks[radiatorBlock] = currentDissipation;
}
}
}
\ No newline at end of file
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/ConsumptionBar.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/ConsumptionBar.cs
index 07b46f65a..a67d508dc 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/ConsumptionBar.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/ConsumptionBar.cs
@@ -1,21 +1,16 @@
using System;
-using RichHudFramework;
-using RichHudFramework.Internal;
+using Epstein_Fusion_DS.Communication;
+using Epstein_Fusion_DS.FusionParts;
+using Epstein_Fusion_DS.HeatParts;
using RichHudFramework.UI;
using RichHudFramework.UI.Client;
using RichHudFramework.UI.Rendering;
-using Sandbox.Game;
using Sandbox.Game.Entities;
using Sandbox.ModAPI;
-using StarCore.FusionSystems.Communication;
-using StarCore.FusionSystems.FusionParts;
-using StarCore.FusionSystems.HeatParts;
-using VRage.Audio;
using VRage.Game.Entity;
-using VRage.Input;
using VRageMath;
-namespace StarCore.FusionSystems.HudHelpers
+namespace Epstein_Fusion_DS.HudHelpers
{
internal class ConsumptionBar : WindowBase
{
@@ -73,7 +68,7 @@ public ConsumptionBar(HudParentBase parent) : base(parent)
0); // Relative to 1920x1080
}
- private static ModularDefinitionApi ModularApi => ModularDefinition.ModularApi;
+ private static ModularDefinitionApi ModularApi => Epstein_Fusion_DS.ModularDefinition.ModularApi;
protected override void Layout()
{
@@ -126,7 +121,11 @@ public void Update()
reactorIntegrity += reactor.Block.SlimBlock.Integrity/reactor.Block.SlimBlock.MaxIntegrity;
reactorCount++;
}
-
+ foreach (var thruster in system.Value.Thrusters)
+ {
+ reactorIntegrity += thruster.Block.SlimBlock.Integrity/thruster.Block.SlimBlock.MaxIntegrity;
+ reactorCount++;
+ }
}
reactorIntegrity /= reactorCount;
@@ -150,16 +149,21 @@ public void Update()
else
timeToCharge = 0;
- HeaderText = $"Fusion | {(totalFusionGeneration > 0 ? "+" : "-")}{Math.Round(timeToCharge)}s";
+ //if (timeToCharge > 0)
+ // HeaderText = $"Fusion | {(totalFusionGeneration > 0 ? "+" : "-")}{Math.Round(timeToCharge)}s";
+ //else
+ // HeaderText = $"Fusion | {totalFusionGeneration:N0}/s";
+ HeaderText = $"Fusion | {totalFusionStored/totalFusionCapacity * 100:N0}%";
+
_noticeLabel.Text = new RichText
{
- {"Reactor Integrity: ", GlyphFormat.White},
+ {"Integrity: ", GlyphFormat.White},
{(reactorIntegrity*100).ToString("N0") + "%", GlyphFormat.White.WithColor(reactorIntegrity > 0.52 ? Color.White : Color.Red)}
};
if (HeatManager.I.GetGridHeatLevel(playerGrid) > 0.8f)
{
- _noticeLabel.TextBoard.Append("\nTAKING THERMAL DAMAGE", GlyphFormat.White.WithColor(Color.Red));
+ _noticeLabel.TextBoard.Append("\nTHERMAL DAMAGE", GlyphFormat.White.WithColor(Color.Red));
if (_soundEmitter == null)
{
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/DebugDraw/DebugDrawManager.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/DebugDrawManager.cs
similarity index 99%
rename from Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/DebugDraw/DebugDrawManager.cs
rename to Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/DebugDrawManager.cs
index 2a36d77f2..2a38074db 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/DebugDraw/DebugDrawManager.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/DebugDrawManager.cs
@@ -8,11 +8,9 @@
using VRage.Game.ModAPI;
using VRage.Utils;
using VRageMath;
-using VRageRender;
using static VRageRender.MyBillboard;
-namespace StarCore.FusionSystems.
- DebugDraw
+namespace Epstein_Fusion_DS.HudHelpers
{
[MySessionComponentDescriptor(MyUpdateOrder.NoUpdate)]
public class DebugDraw : MySessionComponentBase
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/RichHud/LICENSE b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/RichHud/LICENSE
index dd4b98af1..42871ca51 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/RichHud/LICENSE
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/RichHud/LICENSE
@@ -1,21 +1,21 @@
-MIT License
-
-Copyright (c) 2020 Zachary Hembree
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+MIT License
+
+Copyright (c) 2020 Zachary Hembree
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/RichHud/README.md b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/RichHud/README.md
index aad2e9588..a0490c337 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/RichHud/README.md
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/RichHud/README.md
@@ -1,17 +1,17 @@
-## Rich HUD Framework
-This is a framework for creating custom retained-mode GUI in Space Engineers workshop mods using the billboards supplied by the mod API. It's nothing fancy, but it has most of the basic functionality you'd expect from a UI framework: text rendering, custom fonts, UI layering, key binds, mouse input, everything you might need to get started creating custom GUI in Space Engineers, sans markup lanugage. Everything is done in C#. If you want an idea of what that looks like, exactly, then have a look at some of the elements in the UI [library](https://github.com/ZachHembree/RichHudFramework.Client/blob/master/Shared/UI/HUD/HudElements/ClickableHudElements/Buttons/BorderedButton.cs); most of it's pretty straightforward.
-
-## Getting Started
-Space Engineer's mods are all compiled to independent assemblies with no references between them, for reasons I trust are apparent, but this has the obvious drawback of preventing any two mods from directly sharing code. Fortunately, the game does provide utilities for sharing data at runtime using types exposed by the game's mod API, like generic delegates and tuples. For this reason, this framework is split into three modules: Master, Client and Shared. The master module contains the implementation for things like the text renderer, bind manager, and manages the UI tree, among other things and the Client module provides wrappers and utilities that provide easy access to those systems.
-
-To get started using this framework, you'll need to download a copy of the [client](https://github.com/ZachHembree/RichHudFramework.Client/releases) module from releases and include it in your mod. Usage details can be found in the [wiki](https://github.com/ZachHembree/RichHudFramework.Client/wiki), in addition to a detailed overview of the framework's functions.
-
-## Demo
-If you want to get a better idea of what you can do with this framework, [Rich HUD Master](https://steamcommunity.com/workshop/filedetails/?id=1965654081) has a demo built into the terminal that can be enabled using the chat command "/rhd toggledebug". This demo allows you to spawn most of the UI elements in the library in their default state while also allowing you to maniplate their [HUD Space](https://github.com/ZachHembree/RichHudFramework.Client/wiki/HUD-Spaces) in real time.
-
-
-
-## Example Mod
-You can find a well-documented example Text Editor Mod [here](https://github.com/ZachHembree/TextEditorExample). Fair warning, the corresponding walkthrough in the wiki is currently outdated, and I probably won't get around to finishing it for a while.
-
-
+## Rich HUD Framework
+This is a framework for creating custom retained-mode GUI in Space Engineers workshop mods using the billboards supplied by the mod API. It's nothing fancy, but it has most of the basic functionality you'd expect from a UI framework: text rendering, custom fonts, UI layering, key binds, mouse input, everything you might need to get started creating custom GUI in Space Engineers, sans markup lanugage. Everything is done in C#. If you want an idea of what that looks like, exactly, then have a look at some of the elements in the UI [library](https://github.com/ZachHembree/RichHudFramework.Client/blob/master/Shared/UI/HUD/HudElements/ClickableHudElements/Buttons/BorderedButton.cs); most of it's pretty straightforward.
+
+## Getting Started
+Space Engineer's mods are all compiled to independent assemblies with no references between them, for reasons I trust are apparent, but this has the obvious drawback of preventing any two mods from directly sharing code. Fortunately, the game does provide utilities for sharing data at runtime using types exposed by the game's mod API, like generic delegates and tuples. For this reason, this framework is split into three modules: Master, Client and Shared. The master module contains the implementation for things like the text renderer, bind manager, and manages the UI tree, among other things and the Client module provides wrappers and utilities that provide easy access to those systems.
+
+To get started using this framework, you'll need to download a copy of the [client](https://github.com/ZachHembree/RichHudFramework.Client/releases) module from releases and include it in your mod. Usage details can be found in the [wiki](https://github.com/ZachHembree/RichHudFramework.Client/wiki), in addition to a detailed overview of the framework's functions.
+
+## Demo
+If you want to get a better idea of what you can do with this framework, [Rich HUD Master](https://steamcommunity.com/workshop/filedetails/?id=1965654081) has a demo built into the terminal that can be enabled using the chat command "/rhd toggledebug". This demo allows you to spawn most of the UI elements in the library in their default state while also allowing you to maniplate their [HUD Space](https://github.com/ZachHembree/RichHudFramework.Client/wiki/HUD-Spaces) in real time.
+
+
+
+## Example Mod
+You can find a well-documented example Text Editor Mod [here](https://github.com/ZachHembree/TextEditorExample). Fair warning, the corresponding walkthrough in the wiki is currently outdated, and I probably won't get around to finishing it for a while.
+
+
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/MasterDefinition.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/MasterDefinition.cs
index 55fe677ab..0c261dcf3 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/MasterDefinition.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/MasterDefinition.cs
@@ -1,4 +1,4 @@
-namespace StarCore.FusionSystems
+namespace Epstein_Fusion_DS
{
// turns out whoever wrote the CoreSystems definition handler is REALLY SMART. hats off to you
internal partial class ModularDefinition
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs
index c1dad10fe..e21fca76b 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs
@@ -1,16 +1,16 @@
using System;
using System.Linq;
+using Epstein_Fusion_DS.Communication;
+using Epstein_Fusion_DS.FusionParts;
+using Epstein_Fusion_DS.HeatParts;
+using Epstein_Fusion_DS.HudHelpers;
using RichHudFramework.Client;
using RichHudFramework.UI.Client;
using Sandbox.Game;
-using StarCore.FusionSystems.Communication;
-using StarCore.FusionSystems.FusionParts;
-using StarCore.FusionSystems.HeatParts;
-using StarCore.FusionSystems.HudHelpers;
using VRage.Game.Components;
using VRage.Utils;
-namespace StarCore.FusionSystems
+namespace Epstein_Fusion_DS
{
///
/// Semi-independent script for managing the player HUD.
@@ -22,7 +22,7 @@ public class SFusionPlayerHud : MySessionComponentBase
private int _ticks;
private ConsumptionBar _consumptionBar;
- private static ModularDefinitionApi ModularApi => ModularDefinition.ModularApi;
+ private static ModularDefinitionApi ModularApi => Epstein_Fusion_DS.ModularDefinition.ModularApi;
private static SFusionManager FusionManager => SFusionManager.I;
private static HeatManager HeatManager => HeatManager.I;
@@ -76,7 +76,8 @@ public override void UpdateAfterSimulation()
continue;
MyVisualScriptLogicProvider.AddQuestlogDetailLocal(
- $"[{system.PhysicalAssemblyId}] Power: {Math.Round(system.PowerStored / system.MaxPowerStored * 100f)}% ({Math.Round(system.MaxPowerStored)} @ {Math.Round(system.PowerGeneration * 60, 1)}/s) | Loops: {system.Arms.Count} | Heat: -{HeatManager.I.GetGridHeatDissipation(system.Grid):N0} +{HeatManager.I.GetGridHeatGeneration(system.Grid):N0} ({HeatManager.I.GetGridHeatLevel(system.Grid)*100:F1}%)",
+ $"[({system.PhysicalAssemblyId})] Thrusters: {system.Thrusters.Count} | Reactors: {system.Reactors.Count} | Loops: {system.Arms.Count} | Heat: -{HeatManager.I.GetGridHeatDissipation(system.Grid):N0} +{HeatManager.I.GetGridHeatGeneration(system.Grid):N0} ({HeatManager.I.GetGridHeatLevel(system.Grid)*100:F1}%)\n" +
+ $" Stored: {system.PowerStored:N0}/{system.MaxPowerStored:N0} | Generation: {system.PowerGeneration:N1}/{system.MaxPowerGeneration:N1}",
false, false);
displayedCount++;
}
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/SyncMultipliers.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/SyncMultipliers.cs
index da216e96a..8cebec229 100644
--- a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/SyncMultipliers.cs
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/SyncMultipliers.cs
@@ -5,7 +5,7 @@
using VRage.Game.Components;
using VRage.Game.ModAPI;
-namespace StarCore.FusionSystems
+namespace Epstein_Fusion_DS
{
[MySessionComponentDescriptor(MyUpdateOrder.AfterSimulation)]
public class SyncMultipliers : MySessionComponentBase
@@ -92,6 +92,9 @@ protected override void UnloadData()
public static void ReactorOutput(IMyReactor reactor, float output)
{
+ if (reactor == null || _i == null)
+ return;
+
if (Math.Abs(reactor.MaxOutput - output) < 0.1f || !_i._updateLimiter.Add(reactor))
return;
@@ -115,6 +118,9 @@ public static void ReactorOutput(IMyReactor reactor, float output)
public static void ThrusterOutput(IMyThrust thrust, float output)
{
+ if (thrust == null || _i == null)
+ return;
+
if (Math.Abs(thrust.MaxThrust - output) < 1.0f || !_i._updateLimiter.Add(thrust))
return;
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Utils.cs b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Utils.cs
new file mode 100644
index 000000000..50d5541e1
--- /dev/null
+++ b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Utils.cs
@@ -0,0 +1,19 @@
+using VRageMath;
+
+namespace Epstein_Fusion_DS
+{
+ public static class Utils
+ {
+ // TODO make this less inefficient.
+ public static Matrix RotateMatrixAroundPoint(Matrix matrix, Vector3D point, Vector3D axis, double angleRadians)
+ {
+ matrix.Translation -= point;
+ Matrix rotation = MatrixD.CreateFromAxisAngle(axis, angleRadians);
+
+ Matrix transformedMatrix = matrix * rotation;
+ transformedMatrix.Translation += point;
+
+ return transformedMatrix;
+ }
+ }
+}
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/ActiveRadiator.mwm b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/ActiveRadiator.mwm
new file mode 100644
index 000000000..660e1572b
Binary files /dev/null and b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/ActiveRadiator.mwm differ
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/ActiveRadiatorBlades.mwm b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/ActiveRadiatorBlades.mwm
new file mode 100644
index 000000000..413e93a05
Binary files /dev/null and b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/ActiveRadiatorBlades.mwm differ
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/Caster_Reactor.mwm b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/Caster_Reactor.mwm
index d593d1459..68ba7542f 100644
Binary files a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/Caster_Reactor.mwm and b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/Caster_Reactor.mwm differ
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/ExtendableRadiatorBase.mwm b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/ExtendableRadiatorBase.mwm
new file mode 100644
index 000000000..c7c14fd91
Binary files /dev/null and b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/ExtendableRadiatorBase.mwm differ
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/RadiatorPanel.mwm b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/RadiatorPanel.mwm
new file mode 100644
index 000000000..d124bc746
Binary files /dev/null and b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Models/RadiatorPanel.mwm differ
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Textures/GUI/Icons/Cubes/ExtendableRadiatorBase.dds b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Textures/GUI/Icons/Cubes/ExtendableRadiatorBase.dds
new file mode 100644
index 000000000..fd0575a65
Binary files /dev/null and b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Textures/GUI/Icons/Cubes/ExtendableRadiatorBase.dds differ
diff --git a/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Textures/GUI/Icons/Cubes/RadiatorPanel.dds b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Textures/GUI/Icons/Cubes/RadiatorPanel.dds
new file mode 100644
index 000000000..433c6d862
Binary files /dev/null and b/Utility Mods/Stable/Modular Assembly Mods/MoA Fusion Systems/Textures/GUI/Icons/Cubes/RadiatorPanel.dds differ