mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-25 10:25:42 +07:00
Separate ambient light and solar panel efficiency (#1593)
* new branch * Separate ambient light and solar panel efficiency * Made ambient light -> solar efficiency default
This commit is contained in:
parent
de560ac6f8
commit
fe22d334dc
@ -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
|
||||
|
@ -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 */
|
||||
|
@ -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 -> {
|
||||
|
@ -17,7 +17,7 @@ public class SolarGenerator extends PowerGenerator{
|
||||
|
||||
@Override
|
||||
public void update(Tile tile){
|
||||
tile.<GeneratorEntity>ent().productionEfficiency = state.rules.lighting ? 1f - state.rules.ambientLight.a : 1f;
|
||||
tile.<GeneratorEntity>ent().productionEfficiency = state.rules.solarPowerMultiplier < 0 ? (state.rules.lighting ? 1f - state.rules.ambientLight.a : 1f) : state.rules.solarPowerMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user