Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -3754,6 +3754,7 @@ public class Blocks{
|
||||
ammoUseEffect = Fx.casing3Double;
|
||||
ammoPerShot = 2;
|
||||
velocityRnd = 0.2f;
|
||||
scaleLifetimeOffset = 1f / 9f;
|
||||
recoil = 6f;
|
||||
shake = 2f;
|
||||
range = 290f;
|
||||
|
||||
@@ -92,7 +92,7 @@ public class Planets{
|
||||
}};
|
||||
|
||||
//TODO names
|
||||
gier = makeAsteroid("gier", erekir, Blocks.ferricStoneWall, Blocks.carbonWall, 0.4f, 7, 1f, gen -> {
|
||||
gier = makeAsteroid("gier", erekir, Blocks.ferricStoneWall, Blocks.carbonWall, -5, 0.4f, 7, 1f, gen -> {
|
||||
gen.min = 25;
|
||||
gen.max = 35;
|
||||
gen.carbonChance = 0.6f;
|
||||
@@ -100,7 +100,7 @@ public class Planets{
|
||||
gen.berylChance = 0.1f;
|
||||
});
|
||||
|
||||
notva = makeAsteroid("notva", sun, Blocks.ferricStoneWall, Blocks.beryllicStoneWall, 0.55f, 9, 1.3f, gen -> {
|
||||
notva = makeAsteroid("notva", sun, Blocks.ferricStoneWall, Blocks.beryllicStoneWall, -4, 0.55f, 9, 1.3f, gen -> {
|
||||
gen.berylChance = 0.8f;
|
||||
gen.iceChance = 0f;
|
||||
gen.carbonChance = 0.01f;
|
||||
@@ -158,7 +158,7 @@ public class Planets{
|
||||
landCloudColor = Pal.spore.cpy().a(0.5f);
|
||||
}};
|
||||
|
||||
verilus = makeAsteroid("verlius", sun, Blocks.stoneWall, Blocks.iceWall, 0.5f, 12, 2f, gen -> {
|
||||
verilus = makeAsteroid("verlius", sun, Blocks.stoneWall, Blocks.iceWall, -1, 0.5f, 12, 2f, gen -> {
|
||||
gen.berylChance = 0f;
|
||||
gen.iceChance = 0.6f;
|
||||
gen.carbonChance = 0.1f;
|
||||
@@ -166,7 +166,7 @@ public class Planets{
|
||||
});
|
||||
}
|
||||
|
||||
private static Planet makeAsteroid(String name, Planet parent, Block base, Block tint, float tintThresh, int pieces, float scale, Cons<AsteroidGenerator> cgen){
|
||||
private static Planet makeAsteroid(String name, Planet parent, Block base, Block tint, int seed, float tintThresh, int pieces, float scale, Cons<AsteroidGenerator> cgen){
|
||||
return new Planet(name, parent, 0.12f){{
|
||||
hasAtmosphere = false;
|
||||
updateLighting = false;
|
||||
@@ -189,13 +189,13 @@ public class Planets{
|
||||
Rand rand = new Rand(id + 2);
|
||||
|
||||
meshes.add(new NoiseMesh(
|
||||
this, 0, 2, radius, 2, 0.55f, 0.45f, 14f,
|
||||
this, seed, 2, radius, 2, 0.55f, 0.45f, 14f,
|
||||
color, tinted, 3, 0.6f, 0.38f, tintThresh
|
||||
));
|
||||
|
||||
for(int j = 0; j < pieces; j++){
|
||||
meshes.add(new MatMesh(
|
||||
new NoiseMesh(this, j + 1, 1, 0.022f + rand.random(0.039f) * scale, 2, 0.6f, 0.38f, 20f,
|
||||
new NoiseMesh(this, seed + j + 1, 1, 0.022f + rand.random(0.039f) * scale, 2, 0.6f, 0.38f, 20f,
|
||||
color, tinted, 3, 0.6f, 0.38f, tintThresh),
|
||||
new Mat3D().setToTranslation(Tmp.v31.setToRandomDirection(rand).setLength(rand.random(0.44f, 1.4f) * scale)))
|
||||
);
|
||||
|
||||
@@ -815,7 +815,7 @@ public class NetServer implements ApplicationListener{
|
||||
}
|
||||
case trace -> {
|
||||
PlayerInfo stats = netServer.admins.getInfo(other.uuid());
|
||||
TraceInfo info = new TraceInfo(other.con.address, other.uuid(), other.con.modclient, other.con.mobile, stats.timesJoined, stats.timesKicked, stats.ips.toArray(String.class), stats.names.toArray(String.class));
|
||||
TraceInfo info = new TraceInfo(other.con.address, other.uuid(), other.locale, other.con.modclient, other.con.mobile, stats.timesJoined, stats.timesKicked, stats.ips.toArray(String.class), stats.names.toArray(String.class));
|
||||
if(player.con != null){
|
||||
Call.traceInfo(player.con, other, info);
|
||||
}else{
|
||||
|
||||
@@ -65,7 +65,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
|
||||
}
|
||||
|
||||
public boolean canMine(){
|
||||
return type.mineSpeed > 0 && type.mineTier >= 0;
|
||||
return type.mineSpeed * state.rules.unitMineSpeed(team()) > 0 && type.mineTier >= 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,7 +89,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
|
||||
mineTile = null;
|
||||
mineTimer = 0f;
|
||||
}else if(mining() && item != null){
|
||||
mineTimer += Time.delta * type.mineSpeed;
|
||||
mineTimer += Time.delta * type.mineSpeed * state.rules.unitMineSpeed(team());
|
||||
|
||||
if(Mathf.chance(0.06 * Time.delta)){
|
||||
Fx.pulverizeSmall.at(mineTile.worldx() + Mathf.range(tilesize / 2f), mineTile.worldy() + Mathf.range(tilesize / 2f), 0f, item.color);
|
||||
|
||||
@@ -695,7 +695,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
type.deathExplosionEffect.at(x, y, bounds() / 2f / 8f);
|
||||
}
|
||||
|
||||
float shake = hitSize / 3f;
|
||||
float shake = type.deathShake < 0 ? hitSize / 3f : type.deathShake;
|
||||
|
||||
if(type.createScorch){
|
||||
Effect.scorch(x, y, (int)(hitSize / 5));
|
||||
|
||||
@@ -84,6 +84,8 @@ public class Rules{
|
||||
public float unitHealthMultiplier = 1f;
|
||||
/** How much damage unit crash damage deals. (Compounds with unitDamageMultiplier) */
|
||||
public float unitCrashDamageMultiplier = 1f;
|
||||
/** How fast units can mine. */
|
||||
public float unitMineSpeedMultiplier = 1f;
|
||||
/** If true, ghost blocks will appear upon destruction, letting builder blocks/units rebuild them. */
|
||||
public boolean ghostBlocks = true;
|
||||
/** Whether to allow units to build with logic. */
|
||||
@@ -262,6 +264,10 @@ public class Rules{
|
||||
return unitDamage(team) * unitCrashDamageMultiplier * teams.get(team).unitCrashDamageMultiplier;
|
||||
}
|
||||
|
||||
public float unitMineSpeed(Team team){
|
||||
return unitMineSpeedMultiplier * teams.get(team).unitMineSpeedMultiplier;
|
||||
}
|
||||
|
||||
public float blockHealth(Team team){
|
||||
return blockHealthMultiplier * teams.get(team).blockHealthMultiplier;
|
||||
}
|
||||
@@ -312,6 +318,8 @@ public class Rules{
|
||||
public float unitDamageMultiplier = 1f;
|
||||
/** How much damage unit crash damage deals. (Compounds with unitDamageMultiplier) */
|
||||
public float unitCrashDamageMultiplier = 1f;
|
||||
/** How fast units can mine. */
|
||||
public float unitMineSpeedMultiplier = 1f;
|
||||
/** Multiplier of resources that units take to build. */
|
||||
public float unitCostMultiplier = 1f;
|
||||
/** How much health units start with. */
|
||||
|
||||
@@ -27,7 +27,7 @@ public class HexSkyMesh extends PlanetMesh{
|
||||
|
||||
@Override
|
||||
public boolean skip(Vec3 position){
|
||||
return Simplex.noise3d(planet.id + seed, octaves, persistence, scl, position.x, position.y * 3f, position.z) >= thresh;
|
||||
return Simplex.noise3d(7 + seed, octaves, persistence, scl, position.x, position.y * 3f, position.z) >= thresh;
|
||||
}
|
||||
}, divisions, false, planet.radius, radius), Shaders.clouds);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public class NoiseMesh extends HexMesh{
|
||||
this.mesh = MeshBuilder.buildHex(new HexMesher(){
|
||||
@Override
|
||||
public float getHeight(Vec3 position){
|
||||
return Simplex.noise3d(planet.id + seed, octaves, persistence, scale, 5f + position.x, 5f + position.y, 5f + position.z) * mag;
|
||||
return Simplex.noise3d(7 + seed, octaves, persistence, scale, 5f + position.x, 5f + position.y, 5f + position.z) * mag;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -31,12 +31,12 @@ public class NoiseMesh extends HexMesh{
|
||||
this.mesh = MeshBuilder.buildHex(new HexMesher(){
|
||||
@Override
|
||||
public float getHeight(Vec3 position){
|
||||
return Simplex.noise3d(planet.id + seed, octaves, persistence, scale, 5f + position.x, 5f + position.y, 5f + position.z) * mag;
|
||||
return Simplex.noise3d(7 + seed, octaves, persistence, scale, 5f + position.x, 5f + position.y, 5f + position.z) * mag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getColor(Vec3 position){
|
||||
return Simplex.noise3d(planet.id + seed + 1, coct, cper, cscl, 5f + position.x, 5f + position.y, 5f + position.z) > cthresh ? color2 : color1;
|
||||
return Simplex.noise3d(8 + seed, coct, cper, cscl, 5f + position.x, 5f + position.y, 5f + position.z) > cthresh ? color2 : color1;
|
||||
}
|
||||
}, divisions, false, radius, 0.2f);
|
||||
}
|
||||
|
||||
@@ -955,6 +955,7 @@ public class TypeIO{
|
||||
public static void writeTraceInfo(Writes write, TraceInfo trace){
|
||||
writeString(write, trace.ip);
|
||||
writeString(write, trace.uuid);
|
||||
writeString(write, trace.locale);
|
||||
write.b(trace.modded ? (byte)1 : 0);
|
||||
write.b(trace.mobile ? (byte)1 : 0);
|
||||
write.i(trace.timesJoined);
|
||||
@@ -965,7 +966,7 @@ public class TypeIO{
|
||||
}
|
||||
|
||||
public static TraceInfo readTraceInfo(Reads read){
|
||||
return new TraceInfo(readString(read), readString(read), read.b() == 1, read.b() == 1, read.i(), read.i(), readStrings(read), readStrings(read));
|
||||
return new TraceInfo(readString(read), readString(read), readString(read), read.b() == 1, read.b() == 1, read.i(), read.i(), readStrings(read), readStrings(read));
|
||||
}
|
||||
|
||||
public static void writeStrings(Writes write, String[] strings, int maxLen){
|
||||
|
||||
@@ -1515,7 +1515,7 @@ public class LExecutor{
|
||||
state.rules.bannedUnits.remove(u);
|
||||
}
|
||||
}
|
||||
case unitHealth, unitBuildSpeed, unitCost, unitDamage, blockHealth, blockDamage, buildSpeed, rtsMinSquad, rtsMinWeight -> {
|
||||
case unitHealth, unitBuildSpeed, unitMineSpeed, unitCost, unitDamage, blockHealth, blockDamage, buildSpeed, rtsMinSquad, rtsMinWeight -> {
|
||||
Team team = p1.team();
|
||||
if(team != null){
|
||||
float num = value.numf();
|
||||
@@ -1523,6 +1523,7 @@ public class LExecutor{
|
||||
case buildSpeed -> team.rules().buildSpeedMultiplier = Mathf.clamp(num, 0.001f, 50f);
|
||||
case unitHealth -> team.rules().unitHealthMultiplier = Math.max(num, 0.001f);
|
||||
case unitBuildSpeed -> team.rules().unitBuildSpeedMultiplier = Mathf.clamp(num, 0f, 50f);
|
||||
case unitMineSpeed -> team.rules().unitMineSpeedMultiplier = Math.max(num, 0f);
|
||||
case unitCost -> team.rules().unitCostMultiplier = Math.max(num, 0f);
|
||||
case unitDamage -> team.rules().unitDamageMultiplier = Math.max(num, 0f);
|
||||
case blockHealth -> team.rules().blockHealthMultiplier = Math.max(num, 0.001f);
|
||||
|
||||
@@ -1493,11 +1493,11 @@ public class LStatements{
|
||||
table.add("natural ");
|
||||
fields(table, natural, str -> natural = str);
|
||||
|
||||
table.add("x ").visible(() -> natural.equals("false"));
|
||||
fields(table, x, str -> x = str).visible(() -> natural.equals("false"));
|
||||
table.add("x ").visible(() -> !natural.equals("true"));
|
||||
fields(table, x, str -> x = str).visible(() -> !natural.equals("true"));
|
||||
|
||||
table.add(" y ").visible(() -> natural.equals("false"));
|
||||
fields(table, y, str -> y = str).visible(() -> natural.equals("false"));
|
||||
table.add(" y ").visible(() -> !natural.equals("true"));
|
||||
fields(table, y, str -> y = str).visible(() -> !natural.equals("true"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1547,7 +1547,7 @@ public class LStatements{
|
||||
fields(table, "w", p3, s -> p3 = s);
|
||||
fields(table, "h", p4, s -> p4 = s);
|
||||
}
|
||||
case buildSpeed, unitHealth, unitBuildSpeed, unitCost, unitDamage, blockHealth, blockDamage, rtsMinSquad, rtsMinWeight -> {
|
||||
case buildSpeed, unitHealth, unitBuildSpeed, unitMineSpeed, unitCost, unitDamage, blockHealth, blockDamage, rtsMinSquad, rtsMinWeight -> {
|
||||
if(p1.equals("0")){
|
||||
p1 = "@sharded";
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ public enum LogicRule{
|
||||
buildSpeed,
|
||||
unitHealth,
|
||||
unitBuildSpeed,
|
||||
unitMineSpeed,
|
||||
unitCost,
|
||||
unitDamage,
|
||||
blockHealth,
|
||||
|
||||
@@ -628,14 +628,15 @@ public class Administration{
|
||||
}
|
||||
|
||||
public static class TraceInfo{
|
||||
public String ip, uuid;
|
||||
public String ip, uuid, locale;
|
||||
public boolean modded, mobile;
|
||||
public int timesJoined, timesKicked;
|
||||
public String[] ips, names;
|
||||
|
||||
public TraceInfo(String ip, String uuid, boolean modded, boolean mobile, int timesJoined, int timesKicked, String[] ips, String[] names){
|
||||
public TraceInfo(String ip, String uuid, String locale, boolean modded, boolean mobile, int timesJoined, int timesKicked, String[] ips, String[] names){
|
||||
this.ip = ip;
|
||||
this.uuid = uuid;
|
||||
this.locale = locale;
|
||||
this.modded = modded;
|
||||
this.mobile = mobile;
|
||||
this.timesJoined = timesJoined;
|
||||
|
||||
@@ -90,11 +90,11 @@ public class StatusEffect extends UnlockableContent{
|
||||
|
||||
@Override
|
||||
public void setStats(){
|
||||
if(damageMultiplier != 1) stats.addPercent(Stat.damageMultiplier, damageMultiplier);
|
||||
if(healthMultiplier != 1) stats.addPercent(Stat.healthMultiplier, healthMultiplier);
|
||||
if(speedMultiplier != 1) stats.addPercent(Stat.speedMultiplier, speedMultiplier);
|
||||
if(reloadMultiplier != 1) stats.addPercent(Stat.reloadMultiplier, reloadMultiplier);
|
||||
if(buildSpeedMultiplier != 1) stats.addPercent(Stat.buildSpeedMultiplier, buildSpeedMultiplier);
|
||||
if(damageMultiplier != 1) stats.addMultModifier(Stat.damageMultiplier, damageMultiplier);
|
||||
if(healthMultiplier != 1) stats.addMultModifier(Stat.healthMultiplier, healthMultiplier);
|
||||
if(speedMultiplier != 1) stats.addMultModifier(Stat.speedMultiplier, speedMultiplier);
|
||||
if(reloadMultiplier != 1) stats.addMultModifier(Stat.reloadMultiplier, reloadMultiplier);
|
||||
if(buildSpeedMultiplier != 1) stats.addMultModifier(Stat.buildSpeedMultiplier, buildSpeedMultiplier);
|
||||
if(damage > 0) stats.add(Stat.damage, damage * 60f, StatUnit.perSecond);
|
||||
if(damage < 0) stats.add(Stat.healing, -damage * 60f, StatUnit.perSecond);
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ public class UnitType extends UnlockableContent implements Senseable{
|
||||
accel = 0.5f,
|
||||
/** size of one side of the hitbox square */
|
||||
hitSize = 6f,
|
||||
/** shake on unit death */
|
||||
deathShake = -1f,
|
||||
/** shake on each step for leg/mech units */
|
||||
stepShake = -1f,
|
||||
/** ripple / dust size for legged units */
|
||||
|
||||
@@ -26,7 +26,7 @@ public class Links{
|
||||
new LinkEntry("f-droid", "https://f-droid.org/packages/io.anuke.mindustry/", Icon.android, Color.valueOf("026aa7")),
|
||||
new LinkEntry("github", "https://github.com/Anuken/Mindustry/", Icon.github, Color.valueOf("24292e")),
|
||||
new LinkEntry("dev-builds", "https://github.com/Anuken/MindustryBuilds", Icon.githubSquare, Color.valueOf("fafbfc")),
|
||||
new LinkEntry("bug", report(), Icon.wrench, Color.valueOf("cbd97f"))
|
||||
new LinkEntry("bug", "https://github.com/Anuken/Mindustry/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml", Icon.wrench, Color.valueOf("cbd97f"))
|
||||
};
|
||||
}
|
||||
|
||||
@@ -52,33 +52,4 @@ public class Links{
|
||||
this.title = Core.bundle.get("link." + name + ".title", Strings.capitalize(name.replace("-", " ")));
|
||||
}
|
||||
}
|
||||
|
||||
private static String report(){
|
||||
return "https://github.com/Anuken/Mindustry/issues/new?assignees=&labels=bug&body=" +
|
||||
Strings.encode(Strings.format(
|
||||
"""
|
||||
**Platform**: `@`
|
||||
|
||||
**Build**: `@`
|
||||
|
||||
**Issue**: *Explain your issue in detail.*
|
||||
|
||||
**Steps to reproduce**: *How you happened across the issue, and what exactly you did to make the bug happen.*
|
||||
|
||||
**Link(s) to mod(s) used**: `@`
|
||||
|
||||
**Save file**: *The (zipped) save file you were playing on when the bug happened. THIS IS REQUIRED FOR ANY ISSUE HAPPENING IN-GAME, REGARDLESS OF WHETHER YOU THINK IT HAPPENS EVERYWHERE. DO NOT DELETE OR OMIT THIS LINE UNLESS YOU ARE SURE THAT THE ISSUE DOES NOT HAPPEN IN-GAME.*
|
||||
|
||||
**Crash report**: *The contents of relevant crash report files. REQUIRED if you are reporting a crash.*
|
||||
|
||||
---
|
||||
|
||||
*Place an X (no spaces) between the brackets to confirm that you have read the line below.*
|
||||
- [ ] **I have updated to the latest release (https://github.com/Anuken/Mindustry/releases) to make sure my issue has not been fixed.**
|
||||
- [ ] **I have searched the closed and open issues to make sure that this problem has not already been reported.**
|
||||
""",
|
||||
OS.isAndroid ? "Android " + Core.app.getVersion() : (OS.osName + " x" + OS.osArchBits),
|
||||
Version.combined(),
|
||||
Vars.mods.list().any() ? Vars.mods.list().select(LoadedMod::enabled).map(l -> l.meta.author + "/" + l.name + ":" + l.meta.version) : "none"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,6 +265,7 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
numberi("@rules.unitcap", f -> rules.unitCap = f, () -> rules.unitCap, -999, 999);
|
||||
number("@rules.unitdamagemultiplier", f -> rules.unitDamageMultiplier = f, () -> rules.unitDamageMultiplier);
|
||||
number("@rules.unitcrashdamagemultiplier", f -> rules.unitCrashDamageMultiplier = f, () -> rules.unitCrashDamageMultiplier);
|
||||
number("@rules.unitminespeedmultiplier", f -> rules.unitMineSpeedMultiplier = f, () -> rules.unitMineSpeedMultiplier);
|
||||
number("@rules.unitbuildspeedmultiplier", f -> rules.unitBuildSpeedMultiplier = f, () -> rules.unitBuildSpeedMultiplier, 0f, 50f);
|
||||
number("@rules.unitcostmultiplier", f -> rules.unitCostMultiplier = f, () -> rules.unitCostMultiplier);
|
||||
number("@rules.unithealthmultiplier", f -> rules.unitHealthMultiplier = f, () -> rules.unitHealthMultiplier);
|
||||
@@ -383,6 +384,7 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
|
||||
number("@rules.unitdamagemultiplier", f -> teams.unitDamageMultiplier = f, () -> teams.unitDamageMultiplier);
|
||||
number("@rules.unitcrashdamagemultiplier", f -> teams.unitCrashDamageMultiplier = f, () -> teams.unitCrashDamageMultiplier);
|
||||
number("@rules.unitminespeedmultiplier", f -> teams.unitMineSpeedMultiplier = f, () -> teams.unitMineSpeedMultiplier);
|
||||
number("@rules.unitbuildspeedmultiplier", f -> teams.unitBuildSpeedMultiplier = f, () -> teams.unitBuildSpeedMultiplier, 0.001f, 50f);
|
||||
number("@rules.unitcostmultiplier", f -> teams.unitCostMultiplier = f, () -> teams.unitCostMultiplier);
|
||||
number("@rules.unithealthmultiplier", f -> teams.unitHealthMultiplier = f, () -> teams.unitHealthMultiplier);
|
||||
|
||||
@@ -138,7 +138,9 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
refreshLocal();
|
||||
refreshRemote();
|
||||
refreshCommunity();
|
||||
if(Core.settings.getBool("communityservers", true)){
|
||||
refreshCommunity();
|
||||
}
|
||||
}
|
||||
|
||||
void setupRemote(){
|
||||
@@ -317,7 +319,9 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
section(steam ? "@servers.local.steam" : "@servers.local", local, false);
|
||||
section("@servers.remote", remote, false);
|
||||
section("@servers.global", global, true);
|
||||
if(Core.settings.getBool("communityservers", true)){
|
||||
section("@servers.global", global, true);
|
||||
}
|
||||
|
||||
ScrollPane pane = new ScrollPane(hosts);
|
||||
pane.setFadeScrollBars(false);
|
||||
@@ -631,12 +635,18 @@ public class JoinDialog extends BaseDialog{
|
||||
Core.settings.remove("server-list");
|
||||
}
|
||||
|
||||
var urls = Version.type.equals("bleeding-edge") || Vars.forceBeServers ? serverJsonBeURLs : serverJsonURLs;
|
||||
|
||||
fetchServers(urls, 0);
|
||||
fetchServers();
|
||||
}
|
||||
|
||||
private void fetchServers(String[] urls, int index){
|
||||
public static void fetchServers(){
|
||||
var urls = Version.type.equals("bleeding-edge") || Vars.forceBeServers ? serverJsonBeURLs : serverJsonURLs;
|
||||
|
||||
if(Core.settings.getBool("communityservers", true)){
|
||||
fetchServers(urls, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private static void fetchServers(String[] urls, int index){
|
||||
if(index >= urls.length) return;
|
||||
|
||||
//get servers
|
||||
|
||||
@@ -333,6 +333,13 @@ public class SettingsMenuDialog extends BaseDialog{
|
||||
game.checkPref("crashreport", true);
|
||||
}
|
||||
|
||||
game.checkPref("communityservers", true, val -> {
|
||||
defaultServers.clear();
|
||||
if(val){
|
||||
JoinDialog.fetchServers();
|
||||
}
|
||||
});
|
||||
|
||||
game.checkPref("savecreate", true);
|
||||
game.checkPref("blockreplace", true);
|
||||
game.checkPref("conveyorpathfinding", true);
|
||||
|
||||
@@ -34,6 +34,8 @@ public class TraceDialog extends BaseDialog{
|
||||
c.add(Core.bundle.format("trace.playername", player.name)).row();
|
||||
c.button(Icon.copySmall, style, () -> copy(info.ip)).size(s).padRight(4f);
|
||||
c.add(Core.bundle.format("trace.ip", info.ip)).row();
|
||||
c.button(Icon.copySmall, style, () -> copy(info.locale)).size(s).padRight(4f);
|
||||
c.add(Core.bundle.format("trace.language", info.locale)).row();
|
||||
c.button(Icon.copySmall, style, () -> copy(info.uuid)).size(s).padRight(4f);
|
||||
c.add(Core.bundle.format("trace.id", info.uuid)).row();
|
||||
}).row();
|
||||
|
||||
@@ -26,6 +26,7 @@ public class Door extends Wall{
|
||||
public Effect openfx = Fx.dooropen;
|
||||
public Effect closefx = Fx.doorclose;
|
||||
public Sound doorSound = Sounds.door;
|
||||
public boolean chainEffect = false;
|
||||
public @Load("@-open") TextureRegion openRegion;
|
||||
|
||||
public Door(String name){
|
||||
@@ -44,6 +45,7 @@ public class Door extends Wall{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(chainEffect) entity.effect();
|
||||
entity.open = open;
|
||||
pathfinder.updateTile(entity.tile());
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ public class Turret extends ReloadTurret{
|
||||
public float inaccuracy = 0f;
|
||||
/** Fraction of bullet velocity that is random. */
|
||||
public float velocityRnd = 0f;
|
||||
/** Fraction of lifetime that is added to bullets with lifeScale. */
|
||||
public float scaleLifetimeOffset = 0f;
|
||||
/** Maximum angle difference in degrees at which turret will still try to shoot. */
|
||||
public float shootCone = 8f;
|
||||
/** Turret shoot point. */
|
||||
@@ -640,7 +642,7 @@ public class Turret extends ReloadTurret{
|
||||
bulletY = y + Angles.trnsy(rotation - 90, shootX + xOffset + xSpread, shootY + yOffset),
|
||||
shootAngle = rotation + angleOffset + Mathf.range(inaccuracy + type.inaccuracy);
|
||||
|
||||
float lifeScl = type.scaleLife ? Mathf.clamp(Mathf.dst(bulletX, bulletY, targetPos.x, targetPos.y) / type.range, minRange / type.range, range() / type.range) : 1f;
|
||||
float lifeScl = type.scaleLife ? Mathf.clamp((1 + scaleLifetimeOffset) * Mathf.dst(bulletX, bulletY, targetPos.x, targetPos.y) / type.range, minRange / type.range, range() / type.range) : 1f;
|
||||
|
||||
//TODO aimX / aimY for multi shot turrets?
|
||||
handleBullet(type.create(this, team, bulletX, bulletY, shootAngle, -1f, (1f - velocityRnd) + Mathf.random(velocityRnd), lifeScl, null, mover, targetPos.x, targetPos.y), xOffset, yOffset, shootAngle - rotation);
|
||||
|
||||
@@ -62,20 +62,23 @@ public class PowerDiode extends Block{
|
||||
PowerGraph frontGraph = front().power.graph;
|
||||
if(backGraph == frontGraph) return;
|
||||
|
||||
// 0f - 1f of battery capacity in use
|
||||
float backStored = backGraph.getBatteryStored() / backGraph.getTotalBatteryCapacity();
|
||||
float frontStored = frontGraph.getBatteryStored() / frontGraph.getTotalBatteryCapacity();
|
||||
float backStored = backGraph.getBatteryStored();
|
||||
float backCapacity = backGraph.getTotalBatteryCapacity();
|
||||
float frontStored = frontGraph.getBatteryStored();
|
||||
float frontCapacity = frontGraph.getTotalBatteryCapacity();
|
||||
|
||||
// try to send if the back side has more % capacity stored than the front side
|
||||
if(backStored > frontStored){
|
||||
// send half of the difference
|
||||
float amount = backGraph.getBatteryStored() * (backStored - frontStored) / 2;
|
||||
// prevent sending more than the front can handle
|
||||
amount = Mathf.clamp(amount, 0, frontGraph.getTotalBatteryCapacity() * (1 - frontStored));
|
||||
if(backStored/backCapacity <= frontStored/frontCapacity) return;
|
||||
|
||||
backGraph.transferPower(-amount);
|
||||
frontGraph.transferPower(amount);
|
||||
}
|
||||
float targetPercentage = (frontStored + backStored) / (frontCapacity + backCapacity);
|
||||
|
||||
// send half of the difference
|
||||
float amount = (targetPercentage * frontCapacity - frontStored) / 2;
|
||||
|
||||
// prevent sending more than the front can handle
|
||||
amount = Mathf.clamp(amount, 0, frontCapacity - frontStored);
|
||||
|
||||
backGraph.transferPower(-amount);
|
||||
frontGraph.transferPower(amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ public class StatUnit{
|
||||
perMinute = new StatUnit("perMinute", false),
|
||||
perShot = new StatUnit("perShot", false),
|
||||
timesSpeed = new StatUnit("timesSpeed", false),
|
||||
multiplier = new StatUnit("multiplier", false),
|
||||
percent = new StatUnit("percent", false),
|
||||
shieldHealth = new StatUnit("shieldHealth"),
|
||||
none = new StatUnit("none"),
|
||||
|
||||
@@ -69,6 +69,48 @@ public class StatValues{
|
||||
return number(value, unit, false);
|
||||
}
|
||||
|
||||
public static StatValue multiplierModifier(float value, StatUnit unit, boolean merge){
|
||||
return table -> {
|
||||
String l1 = (unit.icon == null ? "" : unit.icon + " ") + multStat(value), l2 = (unit.space ? " " : "") + unit.localized();
|
||||
|
||||
if(merge){
|
||||
table.add(l1 + l2).left();
|
||||
}else{
|
||||
table.add(l1).left();
|
||||
table.add(l2).left();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static StatValue multiplierModifier(float value, StatUnit unit){
|
||||
return multiplierModifier(value, unit, true);
|
||||
}
|
||||
|
||||
public static StatValue multiplierModifier(float value){
|
||||
return multiplierModifier(value, StatUnit.multiplier);
|
||||
}
|
||||
|
||||
public static StatValue percentModifier(float value, StatUnit unit, boolean merge){
|
||||
return table -> {
|
||||
String l1 = (unit.icon == null ? "" : unit.icon + " ") + ammoStat((value - 1) * 100), l2 = (unit.space ? " " : "") + unit.localized();
|
||||
|
||||
if(merge){
|
||||
table.add(l1 + l2).left();
|
||||
}else{
|
||||
table.add(l1).left();
|
||||
table.add(l2).left();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static StatValue percentModifier(float value, StatUnit unit){
|
||||
return percentModifier(value, unit, true);
|
||||
}
|
||||
|
||||
public static StatValue percentModifier(float value){
|
||||
return percentModifier(value, StatUnit.percent);
|
||||
}
|
||||
|
||||
public static StatValue liquid(Liquid liquid, float amount, boolean perSecond){
|
||||
return table -> table.add(displayLiquid(liquid, amount, perSecond));
|
||||
}
|
||||
@@ -691,6 +733,10 @@ public class StatValues{
|
||||
return (val > 0 ? "[stat]+" : "[negstat]") + Strings.autoFixed(val, 1);
|
||||
}
|
||||
|
||||
private static String multStat(float val){
|
||||
return (val >= 1 ? "[stat]" : "[negstat]") + Strings.autoFixed(val, 2);
|
||||
}
|
||||
|
||||
private static TextureRegion icon(UnlockableContent t){
|
||||
return t.uiIcon;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,16 @@ public class Stats{
|
||||
add(stat, StatValues.number((int)(value * 100), StatUnit.percent));
|
||||
}
|
||||
|
||||
/** Adds a multiplicative modifier stat value. Value is assumed to be in the 0-1 range. */
|
||||
public void addMultModifier(Stat stat, float value){
|
||||
add(stat, StatValues.multiplierModifier(value));
|
||||
}
|
||||
|
||||
/** Adds an percent modifier stat value. Value is assumed to be in the 0-1 range. */
|
||||
public void addPercentModifier(Stat stat, float value){
|
||||
add(stat, StatValues.percentModifier(value));
|
||||
}
|
||||
|
||||
/** Adds a single y/n boolean value. */
|
||||
public void add(Stat stat, boolean value){
|
||||
add(stat, StatValues.bool(value));
|
||||
|
||||
Reference in New Issue
Block a user