Add a solar panel output multiplier (#7013)
* do * world processor compatibility * useless
This commit is contained in:
@@ -58,6 +58,8 @@ public class Rules{
|
||||
public boolean unitCapVariable = true;
|
||||
/** If true, unit spawn points are shown. */
|
||||
public boolean showSpawns = false;
|
||||
/** Multiplies power output of solar panels. */
|
||||
public float solarMultiplier = 1f;
|
||||
/** How fast unit factories build units. */
|
||||
public float unitBuildSpeedMultiplier = 1f;
|
||||
/** How much damage any other units deal. */
|
||||
|
||||
@@ -1401,6 +1401,7 @@ public class LExecutor{
|
||||
}
|
||||
}
|
||||
case ambientLight -> state.rules.ambientLight.fromDouble(exec.num(value));
|
||||
case solarMultiplier -> state.rules.solarMultiplier = exec.numf(value);
|
||||
case unitBuildSpeed, unitDamage, blockHealth, blockDamage, buildSpeed, rtsMinSquad, rtsMinWeight -> {
|
||||
Team team = exec.team(p1);
|
||||
if(team != null){
|
||||
|
||||
@@ -13,6 +13,7 @@ public enum LogicRule{
|
||||
mapArea,
|
||||
lighting,
|
||||
ambientLight,
|
||||
solarMultiplier,
|
||||
|
||||
//team specific
|
||||
buildSpeed,
|
||||
|
||||
@@ -208,6 +208,8 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
numberi("h", h -> state.rules.limitHeight = h, () -> state.rules.limitHeight, () -> state.rules.limitMapArea, 0, 10000);
|
||||
}
|
||||
|
||||
number("@rules.solarmultiplier", f -> rules.solarMultiplier = f, () -> rules.solarMultiplier);
|
||||
|
||||
main.button(b -> {
|
||||
b.left();
|
||||
b.table(Tex.pane, in -> {
|
||||
|
||||
@@ -26,7 +26,7 @@ public class SolarGenerator extends PowerGenerator{
|
||||
@Override
|
||||
public void updateTile(){
|
||||
productionEfficiency = enabled ?
|
||||
Mathf.maxZero(Attribute.light.env() +
|
||||
state.rules.solarMultiplier * Mathf.maxZero(Attribute.light.env() +
|
||||
(state.rules.lighting ?
|
||||
1f - state.rules.ambientLight.a :
|
||||
1f
|
||||
|
||||
Reference in New Issue
Block a user