Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Utility Mods/MoA Fusion Systems/Data/BlockCategories.sbc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<string>ExtendableRadiatorBase</string>
<string>Heat_FlatRadiator</string>
<string>ActiveRadiator</string>
<string>ActiveRadiatorFake</string>
</ItemIds>
</Category>
</CategoryClasses>
Expand Down
37 changes: 37 additions & 0 deletions Utility Mods/MoA Fusion Systems/Data/CubeBlocks/ActiveRadiator.sbc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,43 @@
<MountPoint Side="Bottom" StartX="0.00" StartY="0.00" EndX="5.00" EndY="5.00"/>
</MountPoints>
<MirroringY>X</MirroringY>
</Definition>
<Definition>
<Id>
<TypeId>TerminalBlock</TypeId>
<SubtypeId>ActiveRadiatorFake</SubtypeId>
</Id>
<DisplayName>RealFake Rotary Active Radiator</DisplayName>
<Description>
Looks just like the Rotary Active Radiator, but doesn't actually reduce heat!
Animation tied to grid power draw.
</Description>
<Icon>Textures\GUI\Icons\Cubes\ActiveRadiator.dds</Icon>
<CubeSize>Large</CubeSize>
<BlockTopology>TriangleMesh</BlockTopology>
<Size x="5" y="1" z="5"/>
<ModelOffset x="0" y="0" z="0"/>
<Model>Models\ActiveRadiator.mwm</Model>
<Components>
<Component Subtype="SteelPlate" Count="100" />
<Component Subtype="Construction" Count="100" />
<Component Subtype="LargeTube" Count="40" />
<Component Subtype="Motor" Count="40" />
<Component Subtype="Computer" Count="20" />
<Component Subtype="SteelPlate" Count="500" />
</Components>
<CriticalComponent Subtype="Computer" Index="0"/>
<GeneralDamageMultiplier>0.3</GeneralDamageMultiplier>
<BlockPairName>ActiveRadiatorFake</BlockPairName>
<MountPoints>
<MountPoint Side="Front" StartX="0.00" StartY="0.00" EndX="5.00" EndY="1.00"/>
<MountPoint Side="Back" StartX="0.00" StartY="0.00" EndX="5.00" EndY="1.00"/>
<MountPoint Side="Left" StartX="0.00" StartY="0.00" EndX="5.00" EndY="1.00"/>
<MountPoint Side="Right" StartX="0.00" StartY="0.00" EndX="5.00" EndY="1.00"/>
<MountPoint Side="Top" StartX="0.00" StartY="0.00" EndX="5.00" EndY="5.00"/>
<MountPoint Side="Bottom" StartX="0.00" StartY="0.00" EndX="5.00" EndY="5.00"/>
</MountPoints>
<MirroringY>X</MirroringY>
</Definition>
</CubeBlocks>
</Definitions>
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@

namespace Epstein_Fusion_DS.HeatParts.ExtendableRadiators
{
[MyEntityComponentDescriptor(typeof(MyObjectBuilder_TerminalBlock), false, "ActiveRadiator")]
[MyEntityComponentDescriptor(typeof(MyObjectBuilder_TerminalBlock), false, "ActiveRadiator", "ActiveRadiatorFake")]
internal class ActiveRadiatorAnimation : MyGameLogicComponent
{
private IMyCubeBlock Block;
private MyEntitySubpart FanPart;
private MyParticleEffect Particle;
private readonly MyDefinitionId ElectricityId = MyDefinitionId.Parse("GasProperties/Electricity");

private float UsedPowerPct => Block.CubeGrid.ResourceDistributor.TotalRequiredInputByType(ElectricityId, Block.CubeGrid) / Block.CubeGrid.ResourceDistributor.MaxAvailableResourceByType(ElectricityId);

public override void Init(MyObjectBuilder_EntityBase objectBuilder)
{
Expand All @@ -41,7 +44,9 @@ public override void UpdateOnceBeforeFrame()

public override void UpdateAfterSimulation()
{
float heatLevel = HeatManager.I.GetGridHeatLevel(Block.CubeGrid);
float heatLevel = Block.BlockDefinition.SubtypeName == "ActiveRadiatorFake" ? UsedPowerPct : HeatManager.I.GetGridHeatLevel(Block.CubeGrid);
if (!Block.IsWorking)
heatLevel = 0;

Matrix refMatrix = MatrixD.CreateFromAxisAngle(Vector3D.Up, -0.1 * heatLevel) * FanPart.PositionComp.LocalMatrixRef;
refMatrix.Translation = FanPart.PositionComp.LocalMatrixRef.Translation;
Expand Down