From 5ae6ffae8e2f06f8fa766dbea2007beedb0abb5c Mon Sep 17 00:00:00 2001 From: EggleEgg <125359838+EggleEgg@users.noreply.github.com> Date: Thu, 30 Oct 2025 05:43:15 +0100 Subject: [PATCH] consider efficiency in reactor heat (#11322) * whatever * final touches maybe * well forget that, I m stupid * no --- core/src/mindustry/io/SaveIO.java | 1 - core/src/mindustry/world/blocks/power/NuclearReactor.java | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/io/SaveIO.java b/core/src/mindustry/io/SaveIO.java index 3bb3a43207..bd409f6ded 100644 --- a/core/src/mindustry/io/SaveIO.java +++ b/core/src/mindustry/io/SaveIO.java @@ -21,7 +21,6 @@ public class SaveIO{ public static final byte[] header = {'M', 'S', 'A', 'V'}; public static final IntMap versions = new IntMap<>(); public static final Seq versionArray = Seq.with(new Save1(), new Save2(), new Save3(), new Save4(), new Save5(), new Save6(), new Save7(), new Save8(), new Save9(), new Save10(), new Save11()); - static{ for(SaveVersion version : versionArray){ versions.put(version.version, version); diff --git a/core/src/mindustry/world/blocks/power/NuclearReactor.java b/core/src/mindustry/world/blocks/power/NuclearReactor.java index 06fafb1044..b0b3baa2e2 100644 --- a/core/src/mindustry/world/blocks/power/NuclearReactor.java +++ b/core/src/mindustry/world/blocks/power/NuclearReactor.java @@ -32,6 +32,8 @@ public class NuclearReactor extends PowerGenerator{ public float heating = 0.01f; /** max heat this block can output */ public float heatOutput = 10f; + /** rate at which heat progress increases */ + public float heatWarmupRate = 1f; /** threshold at which block starts smoking */ public float smokeThreshold = 0.3f; /** heat threshold at which lights start flashing */ @@ -84,6 +86,7 @@ public class NuclearReactor extends PowerGenerator{ public class NuclearReactorBuild extends GeneratorBuild implements HeatBlock{ public float heat; + public float heatProgress; public float flash; public float smoothLight; @@ -118,6 +121,7 @@ public class NuclearReactor extends PowerGenerator{ } heat = Mathf.clamp(heat); + heatProgress = heatOutput > 0f ? Mathf.approachDelta(heatProgress, heat * heatOutput * efficiency, heatWarmupRate * delta()) : 0f; if(heat >= 0.999f){ Events.fire(Trigger.thoriumReactorOverheat); @@ -127,12 +131,12 @@ public class NuclearReactor extends PowerGenerator{ @Override public float heatFrac(){ - return heatOutput > 0f ? heat : 0f; + return heatProgress / heatOutput; } @Override public float heat(){ - return heatOutput > 0f ? heat * heatOutput : 0f; + return heatProgress; } @Override