diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 7f02ce667b..782aa54a14 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -788,6 +788,7 @@ rules.title.unit = Units rules.title.experimental = Experimental rules.lighting = Lighting rules.ambientlight = Ambient Light +rules.solarpowermultiplier = Solar Power Multiplier content.item.name = Items content.liquid.name = Liquids diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index 0515d2ca60..ff946e359c 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -82,6 +82,9 @@ public class Rules{ public boolean lighting = false; /** Ambient light color, used when lighting is enabled. */ public Color ambientLight = new Color(0.01f, 0.01f, 0.04f, 0.99f); + /** Multiplier for solar panel power output. + negative = use ambient light if lighting is enabled. */ + public float solarPowerMultiplier = -1f; /** team of the player by default */ public Team defaultTeam = Team.sharded; /** team of the enemy in waves/sectors */ diff --git a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java index c65efdd919..42ae294123 100644 --- a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java +++ b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java @@ -172,6 +172,7 @@ public class CustomRulesDialog extends FloatingDialog{ number("$rules.enemycorebuildradius", f -> rules.enemyCoreBuildRadius = f * tilesize, () -> Math.min(rules.enemyCoreBuildRadius / tilesize, 200)); title("$rules.title.experimental"); + number("$rules.solarpowermultiplier", f -> rules.solarPowerMultiplier = f, () -> rules.solarPowerMultiplier); check("$rules.lighting", b -> rules.lighting = b, () -> rules.lighting); main.addButton(b -> { diff --git a/core/src/mindustry/world/blocks/power/SolarGenerator.java b/core/src/mindustry/world/blocks/power/SolarGenerator.java index 75a23c9d6f..cd7efdb5ed 100644 --- a/core/src/mindustry/world/blocks/power/SolarGenerator.java +++ b/core/src/mindustry/world/blocks/power/SolarGenerator.java @@ -17,7 +17,7 @@ public class SolarGenerator extends PowerGenerator{ @Override public void update(Tile tile){ - tile.ent().productionEfficiency = state.rules.lighting ? 1f - state.rules.ambientLight.a : 1f; + tile.ent().productionEfficiency = state.rules.solarPowerMultiplier < 0 ? (state.rules.lighting ? 1f - state.rules.ambientLight.a : 1f) : state.rules.solarPowerMultiplier; } @Override