From 7eb0da82dea54a4e4afc016df8a7540e6f207063 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 30 Sep 2020 17:44:13 -0400 Subject: [PATCH] Added enemy lights setting --- .../java/mindustry/annotations/entity/EntityProcess.java | 8 ++++---- core/assets/bundles/bundle.properties | 1 + core/src/mindustry/type/AmmoTypes.java | 2 +- core/src/mindustry/type/Weather.java | 2 +- core/src/mindustry/ui/dialogs/CustomRulesDialog.java | 1 + 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java index ec7fbbf159..dd47acd2b9 100644 --- a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java +++ b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java @@ -77,10 +77,10 @@ public class EntityProcess extends BaseProcessor{ if(elem.is(Modifier.ABSTRACT) || elem.is(Modifier.NATIVE)) continue; //get all statements in the method, store them methodBlocks.put(elem.descString(), elem.tree().getBody().toString() - //replace all self() invocations with this - .replaceAll("this\\.<(.*)>self\\(\\)", "this") - .replaceAll("self\\(\\)", "this") - .replaceAll(" yield ", "") + .replaceAll("this\\.<(.*)>self\\(\\)", "this") //fix parameterized self() calls + .replaceAll("self\\(\\)", "this") //fix self() calls + .replaceAll(" yield ", "") //fix enchanced switch + .replaceAll("\\/\\*missing\\*\\/", "var") //fix vars ); } } diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 7c639453e0..0110ee18ef 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -851,6 +851,7 @@ rules.title.unit = Units rules.title.experimental = Experimental rules.title.environment = Environment rules.lighting = Lighting +rules.enemyLights = Enemy Lights rules.fire = Fire rules.explosions = Block/Unit Explosion Damage rules.ambientlight = Ambient Light diff --git a/core/src/mindustry/type/AmmoTypes.java b/core/src/mindustry/type/AmmoTypes.java index 0dafe2ba8b..ce4b049b1f 100644 --- a/core/src/mindustry/type/AmmoTypes.java +++ b/core/src/mindustry/type/AmmoTypes.java @@ -45,7 +45,7 @@ public class AmmoTypes implements ContentList{ Tile closest = Vars.indexer.findClosestFlag(unit.x, unit.y, unit.team, BlockFlag.powerResupply); if(closest != null && closest.build != null && unit.within(closest.build, range) && closest.build.power != null){ - Building build = closest.build; + var build = closest.build; if(build.block.consumes.hasPower() && build.block.consumes.getPower().buffered){ float amount = closest.build.power.status * build.block.consumes.getPower().capacity; diff --git a/core/src/mindustry/type/Weather.java b/core/src/mindustry/type/Weather.java index 98d0a9f7e2..8fb30aecb6 100644 --- a/core/src/mindustry/type/Weather.java +++ b/core/src/mindustry/type/Weather.java @@ -17,7 +17,7 @@ import static mindustry.Vars.*; public abstract class Weather extends UnlockableContent{ /** Default duration of this weather event in ticks. */ - public float duration = 8f * Time.toMinutes; + public float duration = 9f * Time.toMinutes; public float opacityMultiplier = 1f; public Attributes attrs = new Attributes(); diff --git a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java index 68f61f1df2..03c8ebab51 100644 --- a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java +++ b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java @@ -173,6 +173,7 @@ public class CustomRulesDialog extends BaseDialog{ check("@rules.explosions", b -> rules.damageExplosions = b, () -> rules.damageExplosions); check("@rules.fire", b -> rules.fire = b, () -> rules.fire); check("@rules.lighting", b -> rules.lighting = b, () -> rules.lighting); + check("@rules.enemyLights", b -> rules.enemyLights = b, () -> rules.enemyLights); main.button(b -> { b.left();