More branch merging

This commit is contained in:
Anuken
2021-10-14 20:58:03 -04:00
parent ad1c75d050
commit 6b59c1cd83
108 changed files with 1018 additions and 380 deletions

View File

@@ -6,6 +6,7 @@ import arc.util.*;
import arc.util.serialization.*;
import arc.util.serialization.Json.*;
import mindustry.content.*;
import mindustry.graphics.g3d.*;
import mindustry.io.*;
import mindustry.type.*;
import mindustry.type.Weather.*;
@@ -117,8 +118,22 @@ public class Rules{
public @Nullable String modeName;
/** Whether cores incinerate items when full, just like in the campaign. */
public boolean coreIncinerates = false;
/** If false, borders fade out into darkness. Only use with custom backgrounds!*/
public boolean borderDarkness = true;
/** special tags for additional info. */
public StringMap tags = new StringMap();
/** Name of callback to call for background rendering in mods; see Renderer#addCustomBackground. Runs last. */
public @Nullable String customBackgroundCallback;
/** path to background texture with extension (e.g. "sprites/space.png")*/
public @Nullable String backgroundTexture;
/** background texture move speed scaling - bigger numbers mean slower movement. 0 to disable. */
public float backgroundSpeed = 27000f;
/** background texture scaling factor */
public float backgroundScl = 1f;
/** background UV offsets */
public float backgroundOffsetX = 0.1f, backgroundOffsetY = 0.1f;
/** Parameters for planet rendered in the background. Cannot be changed once a map is loaded. */
public @Nullable PlanetParams planetBackground;
/** Copies this ruleset exactly. Not efficient at all, do not use often. */
public Rules copy(){
@@ -140,6 +155,10 @@ public class Rules{
}
}
public boolean hasEnv(int env){
return (environment & env) != 0;
}
public float unitBuildSpeed(Team team){
return unitBuildSpeedMultiplier * teams.get(team).unitBuildSpeedMultiplier;
}

View File

@@ -82,10 +82,11 @@ public class Universe{
}
}
if(state.hasSector()){
if(state.hasSector() && state.getSector().planet.updateLighting){
var planet = state.getSector().planet;
//update sector light
float light = state.getSector().getLight();
float alpha = Mathf.clamp(Mathf.map(light, 0f, 0.8f, 0.3f, 1f));
float alpha = Mathf.clamp(Mathf.map(light, planet.lightSrcFrom, planet.lightSrcTo, planet.lightDstFrom, planet.lightDstTo));
//assign and map so darkness is not 100% dark
state.rules.ambientLight.a = 1f - alpha;