From f1551abca1b7d443676da25630af92c89cdc32b5 Mon Sep 17 00:00:00 2001 From: Benny_Li Date: Sat, 22 Feb 2025 01:11:18 +0800 Subject: [PATCH 1/8] update bundle_zh_CN.properties, make param final --- core/assets/bundles/bundle_zh_CN.properties | 28 ++++++++++----------- core/src/mindustry/game/Difficulty.java | 4 ++- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/core/assets/bundles/bundle_zh_CN.properties b/core/assets/bundles/bundle_zh_CN.properties index 95f40b0df45a..c948d122c1f4 100644 --- a/core/assets/bundles/bundle_zh_CN.properties +++ b/core/assets/bundles/bundle_zh_CN.properties @@ -706,7 +706,7 @@ marker.shape.name = 形状 marker.text.name = 文本 marker.line.name = 线 marker.quad.name = 四边形 -marker.texture.name = Texture +marker.texture.name = 纹理 marker.background = 背景 marker.outline = 轮廓 @@ -813,11 +813,11 @@ threat.medium = 中度 threat.high = 高度 threat.extreme = 极高 threat.eradication = 毁灭 -difficulty.casual = Casual -difficulty.easy = Easy -difficulty.normal = Normal -difficulty.hard = Hard -difficulty.eradication = Eradication +difficulty.casual = 休闲 +difficulty.easy = 简单 +difficulty.normal = 普通 +difficulty.hard = 困难 +difficulty.eradication = 扫荡 planets = 行星 @@ -2151,10 +2151,10 @@ block.phase-wall.description = 保护己方建筑,挡下敌方炮弹。 受大 block.phase-wall-large.description = 保护己方建筑,挡下敌方炮弹。 受大多数子弹攻击时有概率将其反弹。 block.surge-wall.description = 保护己方建筑,挡下敌方炮弹。 受攻击时间断释放电弧。 block.surge-wall-large.description = 保护己方建筑,挡下敌方炮弹。 受攻击时间断释放电弧。 -block.scrap-wall.description = Protects structures from enemy projectiles. -block.scrap-wall-large.description = Protects structures from enemy projectiles. -block.scrap-wall-huge.description = Protects structures from enemy projectiles. -block.scrap-wall-gigantic.description = Protects structures from enemy projectiles. +block.scrap-wall.description = 保护己方建筑,挡下敌方炮弹。 +block.scrap-wall-large.description = 保护己方建筑,挡下敌方炮弹。 +block.scrap-wall-huge.description = 保护己方建筑,挡下敌方炮弹。 +block.scrap-wall-gigantic.description = 保护己方建筑,挡下敌方炮弹。 block.door.description = 可以开关的墙。 block.door-large.description = 可以开关的墙。 block.mender.description = 定期修复附近的建筑。\n可使用硅提高范围和效率。 @@ -2221,10 +2221,10 @@ block.vault.description = 大量存储各种类型的物品。 可使用装卸 block.container.description = 少量存储各种类型的物品。 可使用装卸器卸载物品。 block.unloader.description = 从周围的建筑卸载指定物品。 block.launch-pad.description = 将货物发射至指定区块。 -block.advanced-launch-pad.description = Launches batches of items to selected sectors. Only accepts one item type at a time. -block.advanced-launch-pad.details = Sub-orbital system for point-to-point transportation of resources. -block.landing-pad.description = Receives items from launch pads in other sectors. Requires large amounts of water to protect against impacts of landings. -block.duo.description = 交替向敌人发射子弹。 +block.advanced-launch-pad.description = 将批量物品发射至选定的区域。 仅接受一种物品类型。 +block.advanced-launch-pad.details = 近轨道系统,用于资源的点对点运输。 +block.landing-pad.description = 从其他区域的发射台接收物品。 需要大量水以防止冲击造成的损害。 +block.duo.description = 交替地向敌人发射子弹。 block.scatter.description = 向敌方战机发射铅、 废料或钢化玻璃高射炮弹。 block.scorch.description = 焚烧任何靠近它的地面敌人。 近距离内十分有效。 block.hail.description = 向远距离地面敌人发射小型炮弹。 diff --git a/core/src/mindustry/game/Difficulty.java b/core/src/mindustry/game/Difficulty.java index fe657294ed1b..234e46368014 100644 --- a/core/src/mindustry/game/Difficulty.java +++ b/core/src/mindustry/game/Difficulty.java @@ -13,7 +13,9 @@ public enum Difficulty{ public static final Difficulty[] all = values(); //TODO add more fields - public float enemyHealthMultiplier, enemySpawnMultiplier, waveTimeMultiplier; + public final float enemyHealthMultiplier; + public final float enemySpawnMultiplier; + public final float waveTimeMultiplier; Difficulty(float enemyHealthMultiplier, float enemySpawnMultiplier, float waveTimeMultiplier){ this.enemySpawnMultiplier = enemySpawnMultiplier; From d8d058c11cab0e67f744dd68fee70a4ea57dc57b Mon Sep 17 00:00:00 2001 From: Benny_Li Date: Sat, 22 Feb 2025 01:16:59 +0800 Subject: [PATCH 2/8] update bundle_zh_TW.properties --- core/assets/bundles/bundle_zh_TW.properties | 68 +++++++++++---------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/core/assets/bundles/bundle_zh_TW.properties b/core/assets/bundles/bundle_zh_TW.properties index 2ae9fdc05e1a..3efd5d306b18 100644 --- a/core/assets/bundles/bundle_zh_TW.properties +++ b/core/assets/bundles/bundle_zh_TW.properties @@ -2653,36 +2653,38 @@ lenum.build = 建造一個建築 lenum.getblock = Fetch building, floor and block type at coordinates.\nUnit must be in range of the position, otherwise null is returned. lenum.within = 單位是否在指定範圍內 lenum.boost = 使用推進器 -lenum.flushtext = Flush print buffer's content to marker, if applicable.\nIf fetch is set to true, tries to fetch properties from map locale bundle or game's bundle. -lenum.texture = Texture name straight from game's texture atlas (using kebab-case naming style).\nIf printFlush is set to true, consumes text buffer content as text argument. -lenum.texturesize = Size of texture in tiles. Zero value scales marker width to original texture's size. -lenum.autoscale = Whether to scale marker corresponding to player's zoom level. -lenum.posi = Indexed position, used for line and quad markers with index zero being the first position. -lenum.uvi = Texture's position ranging from zero to one, used for quad markers. -lenum.colori = Indexed position, used for line and quad markers with index zero being the first color. -lenum.wavetimer = Whether the waves come automatically on a timer. If not, waves come when the play button is pressed. -lenum.wave = Current wave number. Can be anything in non-wave modes. -lenum.currentwavetime = Wave countdown in ticks. -lenum.waves = Whether waves are spawnable at all. -lenum.wavesending = Whether the waves can be manually summoned with the play button. -lenum.attackmode = Determines if gamemode is attack mode. -lenum.wavespacing = Time between waves in ticks. -lenum.enemycorebuildradius = No-build zone around enemy core radius. -lenum.dropzoneradius = Radius around enemy wave drop zones. -lenum.unitcap = Base unit cap. Can still be increased by blocks. -lenum.lighting = Whether ambient lighting is enabled. -lenum.buildspeed = Multiplier for building speed. -lenum.unithealth = How much health units start with. -lenum.unitbuildspeed = How fast unit factories build units. -lenum.unitcost = Multiplier of resources that units take to build. -lenum.unitdamage = How much damage units deal. -lenum.blockhealth = How much health blocks start with. -lenum.blockdamage = How much damage blocks (turrets) deal. -lenum.rtsminweight = Minimum "advantage" needed for a squad to attack. Higher -> more cautious. -lenum.rtsminsquad = Minimum size of attack squads. -lenum.maparea = Playable map area. Anything outside the area will not be interactable. -lenum.ambientlight = Ambient light color. Used when lighting is enabled. -lenum.solarmultiplier = Multiplies power output of solar panels. -lenum.dragmultiplier = Environment drag multiplier. -lenum.ban = Blocks or units that cannot be placed or built. -lenum.unban = Unban a unit or block. +lenum.flushtext = 如果適用的話,將打印緩沖區的內容刷新到標記。\n如果 fetch 設置為 true,則嘗試從地圖本地化包或遊戲的包中獲取屬性。 +lenum.texture = 直接來自遊戲紋理圖集的紋理名稱(使用 kebab-case 命名風格)。\n如果 printFlush 設置為 true,則將文本緩沖區內容作為文本參數消耗。 +lenum.texturesize = 紋理的大小(格)。零值將標記寬度縮放為原始紋理的大小。 +lenum.autoscale = 是否根據玩家的縮放級別縮放標記。 +lenum.posi = 索引位置,用於線和四邊形標記,索引零表示第一個位置。 +lenum.uvi = 紋理的位置範圍從零到一,用於四邊形標記。 +lenum.colori = 索引位置,用於線和四邊形標記,索引零表示第一個顏色。 + +lenum.wavetimer = 波次是否自動出現在計時器上。如果沒有,按下播放按鈕時會出現波次 +lenum.wave = 當前波數,可以是非波次模式下的任何值 +lenum.currentwavetime = 波次倒計時(以tick為單位) +lenum.waves = 波次是否可以生成 +lenum.wavesending = 是否可以通過播放按鈕手動生成波次 +lenum.attackmode = 確定遊戲模式是否為攻擊模式 +lenum.wavespacing = 波形之間的時間(以tick為單位) +lenum.enemycorebuildradius = 敵人核心半徑周圍無建築區 +lenum.dropzoneradius = 敵人出生點周圍的半徑 +lenum.unitcap = 基本單位上限。但仍然可以通過方塊增加 +lenum.lighting = 是否啟用環境照明 +lenum.buildspeed = 建築速度倍率 +lenum.unithealth = 單位受傷減免, 計算方式是傷害除以減免值 +lenum.unitbuildspeed = 單元工廠建造單元的速度 +lenum.unitcost = 單位建設所需資源的倍率 +lenum.unitdamage = 單位造成多少傷害 +lenum.blockhealth = 方塊受傷減免, 計算方式是傷害除以減免值 +lenum.blockdamage = 方塊(炮塔)造成的傷害有多大 +lenum.rtsminweight = 進攻小隊所需的最小“優勢”。越高->越謹慎 +lenum.rtsminsquad = 攻擊小隊的最小規模 +lenum.maparea = 設置區域範圍 +lenum.ambientlight = 環境光顏色,啟用照明時使用 +lenum.solarmultiplier = 太陽能電池板的功率輸出倍率 +lenum.dragmultiplier = 環境阻力乘數 +lenum.ban = 無法放置或構建的塊或單元 +lenum.unban = 取消ban + From d7664aaece555ad17c4edb970f6b66329fb64d42 Mon Sep 17 00:00:00 2001 From: Benny_Li Date: Sun, 23 Feb 2025 13:22:01 +0800 Subject: [PATCH 3/8] javadoc --- core/src/mindustry/graphics/FloorRenderer.java | 6 +++--- core/src/mindustry/service/GameService.java | 4 ++-- core/src/mindustry/type/Planet.java | 2 +- tests/src/test/java/ModTestBM.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/mindustry/graphics/FloorRenderer.java b/core/src/mindustry/graphics/FloorRenderer.java index 872c71953c0b..fa51c8163ce2 100644 --- a/core/src/mindustry/graphics/FloorRenderer.java +++ b/core/src/mindustry/graphics/FloorRenderer.java @@ -17,17 +17,17 @@ /** * general implementation: - * + *

* caching: * 1. create fixed-size float array for rendering into * 2. for each chunk, cache each layer into buffer; record layer boundary indices (alternatively, create mesh per layer for fast recache) * 3. create mesh for this chunk based on buffer size, copy buffer into mesh - * + *

* rendering: * 1. iterate through visible chunks * 2. activate the shader vertex attributes beforehand * 3. bind each mesh individually, draw it - * + *

* */ public class FloorRenderer{ private static final VertexAttribute[] attributes = {VertexAttribute.position, VertexAttribute.color, VertexAttribute.texCoords}; diff --git a/core/src/mindustry/service/GameService.java b/core/src/mindustry/service/GameService.java index 4cad46716b46..6823eb9f46eb 100644 --- a/core/src/mindustry/service/GameService.java +++ b/core/src/mindustry/service/GameService.java @@ -23,10 +23,10 @@ /** * Interface for handling game service across multiple platforms. - * + *

* This includes: * - Desktop (Steam) - * + *

* The default implementation does nothing. * */ public class GameService{ diff --git a/core/src/mindustry/type/Planet.java b/core/src/mindustry/type/Planet.java index abf389716843..1ff713559e2b 100644 --- a/core/src/mindustry/type/Planet.java +++ b/core/src/mindustry/type/Planet.java @@ -76,7 +76,7 @@ public class Planet extends UnlockableContent{ public float orbitOffset; /** Approx. radius of one sector. */ public float sectorApproxRadius; - /** Whether this planet is tidally locked relative to its parent - see https://en.wikipedia.org/wiki/Tidal_locking */ + /** Whether this planet is tidally locked relative to its parent - see ... */ public boolean tidalLock = false; /** Whether this planet is listed in the planet access UI. **/ public boolean accessible = true; diff --git a/tests/src/test/java/ModTestBM.java b/tests/src/test/java/ModTestBM.java index 24e817b4416f..371e8aafaa18 100644 --- a/tests/src/test/java/ModTestBM.java +++ b/tests/src/test/java/ModTestBM.java @@ -22,7 +22,7 @@ public void begin(){ Block type = Vars.content.blocks().find(u -> u.name.equals("betamindy-piston")); assertNotNull(type, "A mod block must be loaded."); - assertSame(type.buildVisibility, BuildVisibility.shown, "A mod block must be buildable."); + assertSame(BuildVisibility.shown, type.buildVisibility, "A mod block must be buildable."); world.loadMap(maps.loadInternalMap("groundZero")); Tile t = world.tile(3, 3); From 1cedb99b5a3dca716032df8275ebdba1f3d1eda0 Mon Sep 17 00:00:00 2001 From: Benny_Li Date: Sun, 23 Feb 2025 13:23:39 +0800 Subject: [PATCH 4/8] lambda --- .../mindustry/annotations/BaseProcessor.java | 4 +- .../annotations/misc/LoadRegionProcessor.java | 4 +- .../annotations/remote/CallGenerator.java | 4 +- core/src/mindustry/Vars.java | 4 +- core/src/mindustry/ai/BlockIndexer.java | 8 +- core/src/mindustry/ai/ControlPathfinder.java | 6 +- core/src/mindustry/ai/RtsAI.java | 20 +- core/src/mindustry/ai/WaveSpawner.java | 4 +- core/src/mindustry/audio/SoundControl.java | 4 +- .../src/mindustry/content/ErekirTechTree.java | 302 ++---- core/src/mindustry/content/Fx.java | 632 ++++-------- .../mindustry/content/SerpuloTechTree.java | 906 +++++++----------- core/src/mindustry/core/Control.java | 20 +- core/src/mindustry/core/Logic.java | 4 +- core/src/mindustry/core/NetServer.java | 4 +- core/src/mindustry/core/Platform.java | 18 +- core/src/mindustry/core/Renderer.java | 4 +- core/src/mindustry/core/World.java | 8 +- .../src/mindustry/editor/MapEditorDialog.java | 28 +- .../mindustry/editor/MapGenerateDialog.java | 10 +- core/src/mindustry/editor/MapInfoDialog.java | 12 +- .../mindustry/editor/MapProcessorsDialog.java | 66 +- .../editor/SectorGenerateDialog.java | 18 +- core/src/mindustry/editor/WaveGraph.java | 4 +- core/src/mindustry/entities/Damage.java | 4 +- .../entities/bullet/PointBulletType.java | 4 +- .../entities/effect/ExplosionEffect.java | 4 +- .../entities/pattern/ShootMulti.java | 10 +- core/src/mindustry/game/FogControl.java | 4 +- core/src/mindustry/game/Schematics.java | 4 +- core/src/mindustry/game/SectorInfo.java | 8 +- core/src/mindustry/game/SpawnGroup.java | 2 +- .../src/mindustry/graphics/BlockRenderer.java | 4 +- core/src/mindustry/graphics/EnvRenderers.java | 26 +- core/src/mindustry/graphics/MenuRenderer.java | 8 +- .../mindustry/graphics/OverlayRenderer.java | 8 +- core/src/mindustry/input/DesktopInput.java | 20 +- core/src/mindustry/input/InputHandler.java | 40 +- core/src/mindustry/input/MobileInput.java | 8 +- core/src/mindustry/logic/LAssembler.java | 4 +- core/src/mindustry/logic/LCanvas.java | 4 +- core/src/mindustry/logic/LStatements.java | 12 +- core/src/mindustry/logic/LogicDialog.java | 8 +- core/src/mindustry/logic/LogicOp.java | 4 +- .../mindustry/maps/filters/LogicFilter.java | 4 +- core/src/mindustry/mod/ModClassLoader.java | 7 +- core/src/mindustry/mod/Mods.java | 96 +- core/src/mindustry/service/GameService.java | 14 +- core/src/mindustry/type/Sector.java | 6 +- core/src/mindustry/ui/Menus.java | 6 +- .../mindustry/ui/dialogs/AdminsDialog.java | 18 +- core/src/mindustry/ui/dialogs/BansDialog.java | 10 +- .../ui/dialogs/CampaignRulesDialog.java | 8 +- .../src/mindustry/ui/dialogs/ColorPicker.java | 10 +- .../ui/dialogs/CustomRulesDialog.java | 20 +- .../mindustry/ui/dialogs/DatabaseDialog.java | 4 +- .../mindustry/ui/dialogs/DiscordDialog.java | 4 +- .../ui/dialogs/EditorMapsDialog.java | 112 +-- .../src/mindustry/ui/dialogs/FileChooser.java | 12 +- core/src/mindustry/ui/dialogs/HostDialog.java | 10 +- .../ui/dialogs/IconSelectDialog.java | 66 +- core/src/mindustry/ui/dialogs/JoinDialog.java | 60 +- .../ui/dialogs/LaunchLoadoutDialog.java | 4 +- core/src/mindustry/ui/dialogs/LoadDialog.java | 96 +- core/src/mindustry/ui/dialogs/ModsDialog.java | 22 +- .../mindustry/ui/dialogs/PlanetDialog.java | 112 +-- .../mindustry/ui/dialogs/ResearchDialog.java | 46 +- .../ui/dialogs/SchematicsDialog.java | 128 ++- .../ui/dialogs/SettingsMenuDialog.java | 60 +- .../mindustry/ui/fragments/HudFragment.java | 16 +- .../mindustry/ui/fragments/MenuFragment.java | 34 +- .../ui/fragments/PlacementFragment.java | 24 +- .../mindustry/world/blocks/ItemSelection.java | 4 +- .../world/blocks/defense/RegenProjector.java | 6 +- .../world/blocks/logic/CanvasBlock.java | 168 ++-- .../world/blocks/logic/LogicBlock.java | 4 +- .../world/blocks/units/DroneCenter.java | 4 +- .../world/blocks/units/Reconstructor.java | 5 +- .../world/blocks/units/UnitAssembler.java | 6 +- .../world/blocks/units/UnitFactory.java | 4 +- core/src/mindustry/world/meta/StatValues.java | 36 +- .../mindustry/desktop/DesktopLauncher.java | 4 +- .../src/mindustry/desktop/steam/SStats.java | 12 +- .../mindustry/desktop/steam/SWorkshop.java | 59 +- .../src/mindustry/server/ServerControl.java | 22 +- tests/src/test/java/ApplicationTests.java | 2 +- tools/src/mindustry/tools/Generators.java | 108 +-- 87 files changed, 1431 insertions(+), 2302 deletions(-) diff --git a/annotations/src/main/java/mindustry/annotations/BaseProcessor.java b/annotations/src/main/java/mindustry/annotations/BaseProcessor.java index d4a057b36812..f8313c4df99a 100644 --- a/annotations/src/main/java/mindustry/annotations/BaseProcessor.java +++ b/annotations/src/main/java/mindustry/annotations/BaseProcessor.java @@ -123,8 +123,8 @@ public static void write(TypeSpec.Builder builder) throws Exception{ } public static void write(TypeSpec.Builder builder, Seq imports) throws Exception{ - builder.superinterfaces.sort(Structs.comparing(t -> t.toString())); - builder.methodSpecs.sort(Structs.comparing(m -> m.toString())); + builder.superinterfaces.sort(Structs.comparing(TypeName::toString)); + builder.methodSpecs.sort(Structs.comparing(MethodSpec::toString)); builder.fieldSpecs.sort(Structs.comparing(f -> f.name)); JavaFile file = JavaFile.builder(packageName, builder.build()).skipJavaLangImports(true).build(); diff --git a/annotations/src/main/java/mindustry/annotations/misc/LoadRegionProcessor.java b/annotations/src/main/java/mindustry/annotations/misc/LoadRegionProcessor.java index b9b2bc9dad45..9ee4a61a146b 100644 --- a/annotations/src/main/java/mindustry/annotations/misc/LoadRegionProcessor.java +++ b/annotations/src/main/java/mindustry/annotations/misc/LoadRegionProcessor.java @@ -34,11 +34,11 @@ public void process(RoundEnvironment env) throws Exception{ } Seq entries = Seq.with(fieldMap.keys()); - entries.sortComparing(e -> e.name()); + entries.sortComparing(Selement::name); for(Stype type : entries){ Seq fields = fieldMap.get(type); - fields.sortComparing(s -> s.name()); + fields.sortComparing(Selement::name); method.beginControlFlow("if(content instanceof $L)", type.fullName()); for(Svar field : fields){ diff --git a/annotations/src/main/java/mindustry/annotations/remote/CallGenerator.java b/annotations/src/main/java/mindustry/annotations/remote/CallGenerator.java index d13d4bae3ccc..5ac63e014dc9 100644 --- a/annotations/src/main/java/mindustry/annotations/remote/CallGenerator.java +++ b/annotations/src/main/java/mindustry/annotations/remote/CallGenerator.java @@ -373,12 +373,12 @@ public static MethodSpec writeHandleMethod(MethodEntry ent, boolean isClient){ //execute the relevant method before the forward //if it throws a ValidateException, the method won't be forwarded - builder.addStatement("$N." + elem.name() + "(" + params.toString(", ", s -> s.name()) + ")", ((TypeElement)elem.up()).getQualifiedName().toString()); + builder.addStatement("$N." + elem.name() + "(" + params.toString(", ", Selement::name) + ")", ((TypeElement)elem.up()).getQualifiedName().toString()); //call forwarded method, don't forward on the client reader if(ent.forward && ent.where.isServer && !isClient){ //call forwarded method - builder.addStatement("$L.$L.$L__forward(con, $L)", packageName, ent.className, elem.name(), params.toString(", ", s -> s.name())); + builder.addStatement("$L.$L.$L__forward(con, $L)", packageName, ent.className, elem.name(), params.toString(", ", Selement::name)); } return builder.build(); diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java index 8fef2f1616fb..e84ad3c36a8f 100644 --- a/core/src/mindustry/Vars.java +++ b/core/src/mindustry/Vars.java @@ -347,9 +347,7 @@ public static void init(){ modDirectory.mkdirs(); - Events.on(ContentInitEvent.class, e -> { - emptyTile = new Tile(Short.MAX_VALUE - 20, Short.MAX_VALUE - 20); - }); + Events.on(ContentInitEvent.class, e -> emptyTile = new Tile(Short.MAX_VALUE - 20, Short.MAX_VALUE - 20)); mods.load(); maps.load(); diff --git a/core/src/mindustry/ai/BlockIndexer.java b/core/src/mindustry/ai/BlockIndexer.java index 7f944a3eb061..dda339341e87 100644 --- a/core/src/mindustry/ai/BlockIndexer.java +++ b/core/src/mindustry/ai/BlockIndexer.java @@ -45,13 +45,9 @@ public class BlockIndexer{ public BlockIndexer(){ clearFlags(); - Events.on(TilePreChangeEvent.class, event -> { - removeIndex(event.tile); - }); + Events.on(TilePreChangeEvent.class, event -> removeIndex(event.tile)); - Events.on(TileChangeEvent.class, event -> { - addIndex(event.tile); - }); + Events.on(TileChangeEvent.class, event -> addIndex(event.tile)); Events.on(WorldLoadEvent.class, event -> { damagedTiles = new Seq[Team.all.length]; diff --git a/core/src/mindustry/ai/ControlPathfinder.java b/core/src/mindustry/ai/ControlPathfinder.java index ba9e3e6c7538..91adfd9129d9 100644 --- a/core/src/mindustry/ai/ControlPathfinder.java +++ b/core/src/mindustry/ai/ControlPathfinder.java @@ -1529,10 +1529,8 @@ public void run(){ clustersToInnerUpdate.remove(cluster); }); - clustersToInnerUpdate.each(cluster -> { - //only recompute the inner links - updateClustersInner(cluster); - }); + //only recompute the inner links + clustersToInnerUpdate.each(this::updateClustersInner); clustersToInnerUpdate.clear(); clustersToUpdate.clear(); diff --git a/core/src/mindustry/ai/RtsAI.java b/core/src/mindustry/ai/RtsAI.java index b97e58e46433..4221534ab192 100644 --- a/core/src/mindustry/ai/RtsAI.java +++ b/core/src/mindustry/ai/RtsAI.java @@ -61,19 +61,15 @@ public RtsAI(TeamData data){ //TODO remove: debugging! if(debug){ - Events.run(Trigger.draw, () -> { + Events.run(Trigger.draw, () -> Draw.draw(Layer.overlayUI, () -> { - Draw.draw(Layer.overlayUI, () -> { - - float s = Fonts.outline.getScaleX(); - Fonts.outline.getData().setScale(0.5f); - for(var target : weights){ - Fonts.outline.draw("[sky]" + Strings.fixed(target.value, 2), target.key.x, target.key.y, Align.center); - } - Fonts.outline.getData().setScale(s); - }); - - }); + float s = Fonts.outline.getScaleX(); + Fonts.outline.getData().setScale(0.5f); + for(var target : weights){ + Fonts.outline.draw("[sky]" + Strings.fixed(target.value, 2), target.key.x, target.key.y, Align.center); + } + Fonts.outline.getData().setScale(s); + })); } } diff --git a/core/src/mindustry/ai/WaveSpawner.java b/core/src/mindustry/ai/WaveSpawner.java index 7935418c5f98..c63e833ad840 100644 --- a/core/src/mindustry/ai/WaveSpawner.java +++ b/core/src/mindustry/ai/WaveSpawner.java @@ -34,9 +34,7 @@ public WaveSpawner(){ @Nullable public Tile getFirstSpawn(){ firstSpawn = null; - eachGroundSpawn((cx, cy) -> { - firstSpawn = world.tile(cx, cy); - }); + eachGroundSpawn((cx, cy) -> firstSpawn = world.tile(cx, cy)); return firstSpawn; } diff --git a/core/src/mindustry/audio/SoundControl.java b/core/src/mindustry/audio/SoundControl.java index 432a3c05b610..17c6fab1edc5 100644 --- a/core/src/mindustry/audio/SoundControl.java +++ b/core/src/mindustry/audio/SoundControl.java @@ -57,9 +57,7 @@ public SoundControl(){ setupFilters(); - Events.on(ResetEvent.class, e -> { - lastPlayed = Time.millis(); - }); + Events.on(ResetEvent.class, e -> lastPlayed = Time.millis()); } protected void setupFilters(){ diff --git a/core/src/mindustry/content/ErekirTechTree.java b/core/src/mindustry/content/ErekirTechTree.java index 680c0194dd3e..1abb4d03bac8 100644 --- a/core/src/mindustry/content/ErekirTechTree.java +++ b/core/src/mindustry/content/ErekirTechTree.java @@ -68,17 +68,11 @@ public static void load(){ node(duct, erekirSector, () -> { node(ductRouter, () -> { node(ductBridge, () -> { - node(armoredDuct, () -> { - node(surgeConveyor, () -> { - node(surgeRouter); - }); - }); + node(armoredDuct, () -> node(surgeConveyor, () -> node(surgeRouter))); - node(unitCargoLoader, () -> { - node(unitCargoUnloadPoint, () -> { + node(unitCargoLoader, () -> node(unitCargoUnloadPoint, () -> { - }); - }); + })); }); node(overflowDuct, Seq.with(new OnSector(aegis)), () -> { @@ -94,34 +88,26 @@ public static void load(){ }); }); - node(reinforcedMessage, Seq.with(new OnSector(aegis)), () -> { - node(canvas); - }); + node(reinforcedMessage, Seq.with(new OnSector(aegis)), () -> node(canvas)); }); node(reinforcedPayloadConveyor, Seq.with(new OnSector(atlas)), () -> { //TODO should only be unlocked in unit sector node(payloadMassDriver, Seq.with(new Research(siliconArcFurnace), new OnSector(split)), () -> { //TODO further limitations - node(payloadLoader, () -> { - node(payloadUnloader, () -> { - node(largePayloadMassDriver, () -> { + node(payloadLoader, () -> node(payloadUnloader, () -> node(largePayloadMassDriver, () -> { - }); - }); - }); + }))); - node(constructor, Seq.with(new OnSector(split)), () -> { - node(smallDeconstructor, Seq.with(new OnSector(peaks)), () -> { - node(largeConstructor, Seq.with(new OnSector(siege)), () -> { + node(constructor, Seq.with(new OnSector(split)), () -> node(smallDeconstructor, Seq.with(new OnSector(peaks)), () -> { + node(largeConstructor, Seq.with(new OnSector(siege)), () -> { - }); + }); - node(deconstructor, Seq.with(new OnSector(siege)), () -> { + node(deconstructor, Seq.with(new OnSector(siege)), () -> { - }); }); - }); + })); }); node(reinforcedPayloadRouter, () -> { @@ -131,33 +117,21 @@ public static void load(){ }); //TODO move into turbine condenser? - node(plasmaBore, () -> { - node(impactDrill, Seq.with(new OnSector(aegis)), () -> { - node(largePlasmaBore, Seq.with(new OnSector(caldera)), () -> { - node(eruptionDrill, Seq.with(new OnSector(stronghold)), () -> { + node(plasmaBore, () -> node(impactDrill, Seq.with(new OnSector(aegis)), () -> node(largePlasmaBore, Seq.with(new OnSector(caldera)), () -> { + node(eruptionDrill, Seq.with(new OnSector(stronghold)), () -> { - }); + }); - node(largeCliffCrusher, Seq.with(new OnSector(stronghold)), () -> { + node(largeCliffCrusher, Seq.with(new OnSector(stronghold)), () -> { - }); - }); }); - }); + }))); node(turbineCondenser, () -> { node(beamNode, () -> { - node(ventCondenser, Seq.with(new OnSector(aegis)), () -> { - node(chemicalCombustionChamber, Seq.with(new OnSector(basin)), () -> { - node(pyrolysisGenerator, Seq.with(new OnSector(crevice)), () -> { - node(fluxReactor, Seq.with(new OnSector(crossroads), new Research(cyanogenSynthesizer)), () -> { - node(neoplasiaReactor, Seq.with(new OnSector(karst)), () -> { + node(ventCondenser, Seq.with(new OnSector(aegis)), () -> node(chemicalCombustionChamber, Seq.with(new OnSector(basin)), () -> node(pyrolysisGenerator, Seq.with(new OnSector(crevice)), () -> node(fluxReactor, Seq.with(new OnSector(crossroads), new Research(cyanogenSynthesizer)), () -> node(neoplasiaReactor, Seq.with(new OnSector(karst)), () -> { - }); - }); - }); - }); - }); + }))))); node(beamTower, Seq.with(new OnSector(peaks)), () -> { @@ -166,11 +140,9 @@ public static void load(){ node(regenProjector, Seq.with(new OnSector(peaks)), () -> { //TODO more tiers of build tower or "support" structures like overdrive projectors - node(buildTower, Seq.with(new OnSector(stronghold)), () -> { - node(shockwaveTower, Seq.with(new OnSector(siege)), () -> { + node(buildTower, Seq.with(new OnSector(stronghold)), () -> node(shockwaveTower, Seq.with(new OnSector(siege)), () -> { - }); - }); + })); }); }); @@ -185,62 +157,44 @@ public static void load(){ }); - node(reinforcedLiquidRouter, () -> { - node(reinforcedLiquidContainer, () -> { - node(reinforcedLiquidTank, Seq.with(new SectorComplete(intersect)), () -> { + node(reinforcedLiquidRouter, () -> node(reinforcedLiquidContainer, () -> node(reinforcedLiquidTank, Seq.with(new SectorComplete(intersect)), () -> { - }); - }); - }); + }))); }); }); - node(cliffCrusher, () -> { - node(siliconArcFurnace, () -> { - node(electrolyzer, Seq.with(new OnSector(atlas)), () -> { - node(oxidationChamber, Seq.with(new Research(tankRefabricator), new OnSector(marsh)), () -> { + node(cliffCrusher, () -> node(siliconArcFurnace, () -> node(electrolyzer, Seq.with(new OnSector(atlas)), () -> { + node(oxidationChamber, Seq.with(new Research(tankRefabricator), new OnSector(marsh)), () -> { - node(surgeCrucible, Seq.with(new OnSector(ravine)), () -> { + node(surgeCrucible, Seq.with(new OnSector(ravine)), () -> { - }); - node(heatRedirector, Seq.with(new OnSector(ravine)), () -> { - node(electricHeater, Seq.with(new OnSector(ravine), new Research(afflict)), () -> { - node(slagHeater, Seq.with(new OnSector(caldera)), () -> { + }); + node(heatRedirector, Seq.with(new OnSector(ravine)), () -> node(electricHeater, Seq.with(new OnSector(ravine), new Research(afflict)), () -> { + node(slagHeater, Seq.with(new OnSector(caldera)), () -> { - }); + }); - node(atmosphericConcentrator, Seq.with(new OnSector(caldera)), () -> { - node(cyanogenSynthesizer, Seq.with(new OnSector(siege)), () -> { + node(atmosphericConcentrator, Seq.with(new OnSector(caldera)), () -> node(cyanogenSynthesizer, Seq.with(new OnSector(siege)), () -> { - }); - }); + })); - node(carbideCrucible, Seq.with(new OnSector(crevice)), () -> { - node(phaseSynthesizer, Seq.with(new OnSector(karst)), () -> { - node(phaseHeater, Seq.with(new Research(phaseSynthesizer)), () -> { + node(carbideCrucible, Seq.with(new OnSector(crevice)), () -> node(phaseSynthesizer, Seq.with(new OnSector(karst)), () -> node(phaseHeater, Seq.with(new Research(phaseSynthesizer)), () -> { - }); - }); - }); + }))); - node(heatRouter, () -> { - node(smallHeatRedirector, () -> { + node(heatRouter, () -> node(smallHeatRedirector, () -> { - }); - }); - }); - }); - }); + })); + })); + }); - node(slagIncinerator, Seq.with(new OnSector(basin)), () -> { + node(slagIncinerator, Seq.with(new OnSector(basin)), () -> { - //TODO these are unused. - //node(slagCentrifuge, () -> {}); - //node(heatReactor, () -> {}); - }); - }); + //TODO these are unused. + //node(slagCentrifuge, () -> {}); + //node(heatReactor, () -> {}); }); - }); + }))); }); @@ -251,48 +205,28 @@ public static void load(){ }); node(tungstenWall, () -> { - node(tungstenWallLarge, () -> { - node(blastDoor, () -> { + node(tungstenWallLarge, () -> node(blastDoor, () -> { - }); - }); + })); - node(reinforcedSurgeWall, () -> { - node(reinforcedSurgeWallLarge, () -> { - node(shieldedWall, () -> { + node(reinforcedSurgeWall, () -> node(reinforcedSurgeWallLarge, () -> node(shieldedWall, () -> { - }); - }); - }); + }))); - node(carbideWall, () -> { - node(carbideWallLarge, () -> { + node(carbideWall, () -> node(carbideWallLarge, () -> { - }); - }); + })); }); }); node(diffuse, Seq.with(new OnSector(lake)), () -> { - node(sublimate, Seq.with(new OnSector(marsh)), () -> { - node(afflict, Seq.with(new OnSector(ravine)), () -> { - node(titan, Seq.with(new OnSector(stronghold)), () -> { - node(lustre, Seq.with(new OnSector(crevice)), () -> { - node(smite, Seq.with(new OnSector(karst)), () -> { + node(sublimate, Seq.with(new OnSector(marsh)), () -> node(afflict, Seq.with(new OnSector(ravine)), () -> node(titan, Seq.with(new OnSector(stronghold)), () -> node(lustre, Seq.with(new OnSector(crevice)), () -> node(smite, Seq.with(new OnSector(karst)), () -> { - }); - }); - }); - }); - }); + }))))); - node(disperse, Seq.with(new OnSector(stronghold)), () -> { - node(scathe, Seq.with(new OnSector(siege)), () -> { - node(malign, Seq.with(new SectorComplete(karst)), () -> { + node(disperse, Seq.with(new OnSector(stronghold)), () -> node(scathe, Seq.with(new OnSector(siege)), () -> node(malign, Seq.with(new SectorComplete(karst)), () -> { - }); - }); - }); + }))); }); @@ -301,11 +235,9 @@ public static void load(){ }); }); - node(coreCitadel, Seq.with(new SectorComplete(peaks)), () -> { - node(coreAcropolis, Seq.with(new SectorComplete(siege)), () -> { + node(coreCitadel, Seq.with(new SectorComplete(peaks)), () -> node(coreAcropolis, Seq.with(new SectorComplete(siege)), () -> { - }); - }); + })); node(tankFabricator, Seq.with(new Research(siliconArcFurnace), new Research(plasmaBore), new Research(turbineCondenser)), () -> { node(UnitTypes.stell); @@ -338,27 +270,17 @@ public static void load(){ node(tankAssembler, Seq.with(new OnSector(siege), new Research(constructor), new Research(atmosphericConcentrator)), () -> { - node(UnitTypes.vanquish, () -> { - node(UnitTypes.conquer, Seq.with(new OnSector(karst)), () -> { + node(UnitTypes.vanquish, () -> node(UnitTypes.conquer, Seq.with(new OnSector(karst)), () -> { - }); - }); + })); - node(shipAssembler, Seq.with(new OnSector(crossroads)), () -> { - node(UnitTypes.quell, () -> { - node(UnitTypes.disrupt, Seq.with(new OnSector(karst)), () -> { + node(shipAssembler, Seq.with(new OnSector(crossroads)), () -> node(UnitTypes.quell, () -> node(UnitTypes.disrupt, Seq.with(new OnSector(karst)), () -> { - }); - }); - }); + }))); - node(mechAssembler, Seq.with(new OnSector(crossroads)), () -> { - node(UnitTypes.tecta, () -> { - node(UnitTypes.collaris, Seq.with(new OnSector(karst)), () -> { + node(mechAssembler, Seq.with(new OnSector(crossroads)), () -> node(UnitTypes.tecta, () -> node(UnitTypes.collaris, Seq.with(new OnSector(karst)), () -> { - }); - }); - }); + }))); node(basicAssemblerModule, Seq.with(new SectorComplete(karst)), () -> { @@ -371,97 +293,61 @@ public static void load(){ }); }); - node(onset, () -> { - node(aegis, Seq.with(new SectorComplete(onset), new Research(ductRouter), new Research(ductBridge)), () -> { - node(lake, Seq.with(new SectorComplete(aegis)), () -> { + node(onset, () -> node(aegis, Seq.with(new SectorComplete(onset), new Research(ductRouter), new Research(ductBridge)), () -> { + node(lake, Seq.with(new SectorComplete(aegis)), () -> { - }); + }); - node(intersect, Seq.with(new SectorComplete(aegis), new SectorComplete(lake), new Research(ventCondenser), new Research(shipFabricator)), () -> { - node(atlas, Seq.with(new SectorComplete(intersect), new Research(mechFabricator)), () -> { - node(split, Seq.with(new SectorComplete(atlas), new Research(reinforcedPayloadConveyor), new Research(reinforcedContainer)), () -> { + node(intersect, Seq.with(new SectorComplete(aegis), new SectorComplete(lake), new Research(ventCondenser), new Research(shipFabricator)), () -> node(atlas, Seq.with(new SectorComplete(intersect), new Research(mechFabricator)), () -> { + node(split, Seq.with(new SectorComplete(atlas), new Research(reinforcedPayloadConveyor), new Research(reinforcedContainer)), () -> { - }); + }); - node(basin, Seq.with(new SectorComplete(atlas)), () -> { - node(marsh, Seq.with(new SectorComplete(basin)), () -> { - node(ravine, Seq.with(new SectorComplete(marsh), new Research(Liquids.slag)), () -> { - node(caldera, Seq.with(new SectorComplete(peaks), new Research(heatRedirector)), () -> { - node(stronghold, Seq.with(new SectorComplete(caldera), new Research(coreCitadel)), () -> { - node(crevice, Seq.with(new SectorComplete(stronghold)), () -> { - node(siege, Seq.with(new SectorComplete(crevice)), () -> { - node(crossroads, Seq.with(new SectorComplete(siege)), () -> { - node(karst, Seq.with(new SectorComplete(crossroads), new Research(coreAcropolis)), () -> { - node(origin, Seq.with(new SectorComplete(karst), new Research(coreAcropolis), new Research(UnitTypes.vanquish), new Research(UnitTypes.disrupt), new Research(UnitTypes.collaris), new Research(malign), new Research(basicAssemblerModule), new Research(neoplasiaReactor)), () -> { - - }); - }); - }); - }); - }); - }); - }); - }); + node(basin, Seq.with(new SectorComplete(atlas)), () -> node(marsh, Seq.with(new SectorComplete(basin)), () -> { + node(ravine, Seq.with(new SectorComplete(marsh), new Research(Liquids.slag)), () -> node(caldera, Seq.with(new SectorComplete(peaks), new Research(heatRedirector)), () -> node(stronghold, Seq.with(new SectorComplete(caldera), new Research(coreCitadel)), () -> node(crevice, Seq.with(new SectorComplete(stronghold)), () -> node(siege, Seq.with(new SectorComplete(crevice)), () -> node(crossroads, Seq.with(new SectorComplete(siege)), () -> node(karst, Seq.with(new SectorComplete(crossroads), new Research(coreAcropolis)), () -> node(origin, Seq.with(new SectorComplete(karst), new Research(coreAcropolis), new Research(UnitTypes.vanquish), new Research(UnitTypes.disrupt), new Research(UnitTypes.collaris), new Research(malign), new Research(basicAssemblerModule), new Research(neoplasiaReactor)), () -> { - node(peaks, Seq.with(new SectorComplete(marsh), new SectorComplete(split)), () -> { + })))))))); + + node(peaks, Seq.with(new SectorComplete(marsh), new SectorComplete(split)), () -> { - }); - }); - }); }); - }); - }); - }); + })); + })); + })); nodeProduce(Items.beryllium, () -> { - nodeProduce(Items.sand, () -> { - nodeProduce(Items.silicon, () -> { - nodeProduce(Items.oxide, () -> { - //nodeProduce(Items.fissileMatter, () -> {}); - }); - }); - }); + nodeProduce(Items.sand, () -> nodeProduce(Items.silicon, () -> nodeProduce(Items.oxide, () -> { + //nodeProduce(Items.fissileMatter, () -> {}); + }))); - nodeProduce(Liquids.water, () -> { - nodeProduce(Liquids.ozone, () -> { - nodeProduce(Liquids.hydrogen, () -> { - nodeProduce(Liquids.nitrogen, () -> { + nodeProduce(Liquids.water, () -> nodeProduce(Liquids.ozone, () -> nodeProduce(Liquids.hydrogen, () -> { + nodeProduce(Liquids.nitrogen, () -> { - }); + }); - nodeProduce(Liquids.cyanogen, () -> { - nodeProduce(Liquids.neoplasm, () -> { + nodeProduce(Liquids.cyanogen, () -> nodeProduce(Liquids.neoplasm, () -> { - }); - }); - }); - }); - }); + })); + }))); - nodeProduce(Items.graphite, () -> { - nodeProduce(Items.tungsten, () -> { - nodeProduce(Liquids.slag, () -> { + nodeProduce(Items.graphite, () -> nodeProduce(Items.tungsten, () -> { + nodeProduce(Liquids.slag, () -> { - }); + }); - nodeProduce(Liquids.arkycite, () -> { + nodeProduce(Liquids.arkycite, () -> { - }); + }); - nodeProduce(Items.thorium, () -> { - nodeProduce(Items.carbide, () -> { + nodeProduce(Items.thorium, () -> nodeProduce(Items.carbide, () -> { - //nodeProduce(Liquids.gallium, () -> {}); - }); - }); + //nodeProduce(Liquids.gallium, () -> {}); + })); - nodeProduce(Items.surgeAlloy, () -> { - nodeProduce(Items.phaseFabric, () -> { + nodeProduce(Items.surgeAlloy, () -> nodeProduce(Items.phaseFabric, () -> { - }); - }); - }); - }); + })); + })); }); }); } diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index 25c604c98600..6b85c78d3719 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -250,9 +250,7 @@ public class Fx{ stroke(4f - e.fin() * 3f); Lines.square(e.x, e.y, tilesize / 2f * e.rotation * 1.2f + e.fin() * 5f); - randLenVectors(e.id, 5 + (int)(e.rotation * 5), e.rotation * 3f + (tilesize * e.rotation) * e.finpow() * 1.5f, (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * (4f + e.rotation)); - }); + randLenVectors(e.id, 5 + (int)(e.rotation * 5), e.rotation * 3f + (tilesize * e.rotation) * e.finpow() * 1.5f, (x, y) -> Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * (4f + e.rotation))); }), tapBlock = new Effect(12, e -> { @@ -266,9 +264,7 @@ public class Fx{ stroke(3f - e.fin() * 2f); Lines.square(e.x, e.y, tilesize / 2f * e.rotation + e.fin() * 3f); - randLenVectors(e.id, 3 + (int)(e.rotation * 3), e.rotation * 2f + (tilesize * e.rotation) * e.finpow(), (x, y) -> { - Fill.square(e.x + x, e.y + y, 1f + e.fout() * (3f + e.rotation)); - }); + randLenVectors(e.id, 3 + (int)(e.rotation * 3), e.rotation * 2f + (tilesize * e.rotation) * e.finpow(), (x, y) -> Fill.square(e.x + x, e.y + y, 1f + e.fout() * (3f + e.rotation))); }), payloadDeposit = new Effect(30f, e -> { @@ -358,38 +354,28 @@ public class Fx{ breakProp = new Effect(23, e -> { float scl = Math.max(e.rotation, 1); color(Tmp.c1.set(e.color).mul(1.1f)); - randLenVectors(e.id, 6, 19f * e.finpow() * scl, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 3.5f * scl + 0.3f); - }); + randLenVectors(e.id, 6, 19f * e.finpow() * scl, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 3.5f * scl + 0.3f)); }).layer(Layer.debris), unitDrop = new Effect(30, e -> { color(Pal.lightishGray); - randLenVectors(e.id, 9, 3 + 20f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.4f); - }); + randLenVectors(e.id, 9, 3 + 20f * e.finpow(), (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.4f)); }).layer(Layer.debris), unitLand = new Effect(30, e -> { color(Tmp.c1.set(e.color).mul(1.1f)); //TODO doesn't respect rotation / size - randLenVectors(e.id, 6, 17f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.3f); - }); + randLenVectors(e.id, 6, 17f * e.finpow(), (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.3f)); }).layer(Layer.debris), unitDust = new Effect(30, e -> { color(Tmp.c1.set(e.color).mul(1.3f)); - randLenVectors(e.id, 3, 8f * e.finpow(), e.rotation, 30f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.3f); - }); + randLenVectors(e.id, 3, 8f * e.finpow(), e.rotation, 30f, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.3f)); }).layer(Layer.debris), unitLandSmall = new Effect(30, e -> { color(Tmp.c1.set(e.color).mul(1.1f)); - randLenVectors(e.id, (int)(6 * e.rotation), 12f * e.finpow() * e.rotation, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.1f); - }); + randLenVectors(e.id, (int)(6 * e.rotation), 12f * e.finpow() * e.rotation, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.1f)); }).layer(Layer.debris), unitPickup = new Effect(18, e -> { @@ -400,9 +386,7 @@ public class Fx{ crawlDust = new Effect(35, e -> { color(Tmp.c1.set(e.color).mul(1.6f)); - randLenVectors(e.id, 2, 10f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fslope() * 4f + 0.3f); - }); + randLenVectors(e.id, 2, 10f * e.finpow(), (x, y) -> Fill.circle(e.x + x, e.y + y, e.fslope() * 4f + 0.3f)); }).layer(Layer.debris), landShock = new Effect(12, e -> { @@ -467,15 +451,13 @@ public class Fx{ rand.setSeed(b.id*2 + i); float lenScl = rand.random(0.5f, 1f); int fi = i; - b.scaled(b.lifetime * lenScl, e -> { - randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 22f * intensity, (x, y, in, out) -> { - float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); - float rad = fout * ((2f + intensity) * 2.35f); - - Fill.circle(e.x + x, e.y + y, rad); - Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f); - }); - }); + b.scaled(b.lifetime * lenScl, e -> randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 22f * intensity, (x, y, in, out) -> { + float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); + float rad = fout * ((2f + intensity) * 2.35f); + + Fill.circle(e.x + x, e.y + y, rad); + Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f); + })); } }), @@ -487,24 +469,20 @@ public class Fx{ rand.setSeed(b.id*2 + i); float lenScl = rand.random(0.5f, 1f); int fi = i; - b.scaled(b.lifetime * lenScl, e -> { - randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 26f * intensity, (x, y, in, out) -> { - float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); - float rad = fout * ((2f + intensity) * 2.35f); - - Fill.circle(e.x + x, e.y + y, rad); - Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f); - }); - }); + b.scaled(b.lifetime * lenScl, e -> randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 26f * intensity, (x, y, in, out) -> { + float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); + float rad = fout * ((2f + intensity) * 2.35f); + + Fill.circle(e.x + x, e.y + y, rad); + Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f); + })); } }), smokeAoeCloud = new Effect(60f * 3f, 250f, e -> { color(e.color, 0.65f); - randLenVectors(e.id, 80, 90f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 6f * Mathf.clamp(e.fin() / 0.1f) * Mathf.clamp(e.fout() / 0.1f)); - }); + randLenVectors(e.id, 80, 90f, (x, y) -> Fill.circle(e.x + x, e.y + y, 6f * Mathf.clamp(e.fin() / 0.1f) * Mathf.clamp(e.fout() / 0.1f))); }), missileTrailSmoke = new Effect(180f, 300f, b -> { @@ -515,15 +493,13 @@ public class Fx{ rand.setSeed(b.id*2 + i); float lenScl = rand.random(0.5f, 1f); int fi = i; - b.scaled(b.lifetime * lenScl, e -> { - randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 13f * intensity, (x, y, in, out) -> { - float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); - float rad = fout * ((2f + intensity) * 2.35f); - - Fill.circle(e.x + x, e.y + y, rad); - Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f); - }); - }); + b.scaled(b.lifetime * lenScl, e -> randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 13f * intensity, (x, y, in, out) -> { + float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); + float rad = fout * ((2f + intensity) * 2.35f); + + Fill.circle(e.x + x, e.y + y, rad); + Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f); + })); } }).layer(Layer.bullet - 1f), @@ -535,15 +511,13 @@ public class Fx{ rand.setSeed(b.id*2 + i); float lenScl = rand.random(0.5f, 1f); int fi = i; - b.scaled(b.lifetime * lenScl, e -> { - randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 13f * intensity, (x, y, in, out) -> { - float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); - float rad = fout * ((2f + intensity) * 2.35f); - - Fill.circle(e.x + x, e.y + y, rad); - Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f); - }); - }); + b.scaled(b.lifetime * lenScl, e -> randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 13f * intensity, (x, y, in, out) -> { + float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); + float rad = fout * ((2f + intensity) * 2.35f); + + Fill.circle(e.x + x, e.y + y, rad); + Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f); + })); } }).layer(Layer.bullet - 1f), @@ -555,15 +529,13 @@ public class Fx{ rand.setSeed(b.id*2 + i); float lenScl = rand.random(0.5f, 1f); int fi = i; - b.scaled(b.lifetime * lenScl, e -> { - randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(5f * intensity), 22f * intensity, (x, y, in, out) -> { - float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); - float rad = fout * ((2f + intensity) * 1.35f); - - Fill.circle(e.x + x, e.y + y, rad); - Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f); - }); - }); + b.scaled(b.lifetime * lenScl, e -> randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(5f * intensity), 22f * intensity, (x, y, in, out) -> { + float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); + float rad = fout * ((2f + intensity) * 1.35f); + + Fill.circle(e.x + x, e.y + y, rad); + Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f); + })); } }).layer(Layer.bullet - 2f), @@ -687,9 +659,7 @@ public class Fx{ greenCloud = new Effect(80f, e -> { color(Pal.heal); - randLenVectors(e.id, e.fin(), 7, 9f, (x, y, fin, fout) -> { - Fill.circle(e.x + x, e.y + y, 5f * fout); - }); + randLenVectors(e.id, e.fin(), 7, 9f, (x, y, fin, fout) -> Fill.circle(e.x + x, e.y + y, 5f * fout)); }), healWaveDynamic = new Effect(22, e -> { @@ -844,9 +814,7 @@ public class Fx{ hitLiquid = new Effect(16, e -> { color(e.color); - randLenVectors(e.id, 5, 1f + e.fin() * 15f, e.rotation, 60f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 2f); - }); + randLenVectors(e.id, 5, 1f + e.fin() * 15f, e.rotation, 60f, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 2f)); }), hitLaserBlast = new Effect(12, e -> { @@ -892,9 +860,7 @@ public class Fx{ hitFlameBeam = new Effect(19, e -> { color(e.color); - randLenVectors(e.id, 7, e.finpow() * 11f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 2 + 0.5f); - }); + randLenVectors(e.id, 7, e.finpow() * 11f, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 2 + 0.5f)); }), hitMeltdown = new Effect(12, e -> { @@ -990,9 +956,7 @@ public class Fx{ e.scaled(12f, c -> { color(Pal.bulletYellowBack); - randLenVectors(e.id, 25, 5f + e.fin() * 80f, e.rotation, 60f, (x, y) -> { - Fill.square(e.x + x, e.y + y, c.fout() * 3f, 45f); - }); + randLenVectors(e.id, 25, 5f + e.fin() * 80f, e.rotation, 60f, (x, y) -> Fill.square(e.x + x, e.y + y, c.fout() * 3f, 45f)); }); }), @@ -1023,11 +987,7 @@ public class Fx{ }), - airBubble = new Effect(100f, e -> { - randLenVectors(e.id, 1, e.fin() * 12f, (x, y) -> { - rect(renderer.bubbles[Math.min((int)(renderer.bubbles.length * Mathf.curveMargin(e.fin(), 0.11f, 0.06f)), renderer.bubbles.length - 1)], e.x + x, e.y + y); - }); - }).layer(Layer.flyingUnitLow + 1), + airBubble = new Effect(100f, e -> randLenVectors(e.id, 1, e.fin() * 12f, (x, y) -> rect(renderer.bubbles[Math.min((int)(renderer.bubbles.length * Mathf.curveMargin(e.fin(), 0.11f, 0.06f)), renderer.bubbles.length - 1)], e.x + x, e.y + y))).layer(Layer.flyingUnitLow + 1), flakExplosion = new Effect(20, e -> { color(Pal.bulletYellow); @@ -1039,16 +999,12 @@ public class Fx{ color(Color.gray); - randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f); - }); + randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f)); color(Pal.lighterOrange); stroke(e.fout()); - randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); + randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f)); Drawf.light(e.x, e.y, 50f, Pal.lighterOrange, 0.8f * e.fout()); }), @@ -1063,16 +1019,12 @@ public class Fx{ color(Color.gray); - randLenVectors(e.id, 7, 2f + 28f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); - }); + randLenVectors(e.id, 7, 2f + 28f * e.finpow(), (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f)); color(Pal.plastaniumBack); stroke(e.fout()); - randLenVectors(e.id + 1, 4, 1f + 25f * e.finpow(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); + randLenVectors(e.id + 1, 4, 1f + 25f * e.finpow(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f)); Drawf.light(e.x, e.y, 50f, Pal.plastaniumBack, 0.8f * e.fout()); }), @@ -1087,16 +1039,12 @@ public class Fx{ color(Color.gray); - randLenVectors(e.id, 7, 2f + 30f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); - }); + randLenVectors(e.id, 7, 2f + 30f * e.finpow(), (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f)); color(Pal.plastaniumBack); stroke(e.fout()); - randLenVectors(e.id + 1, 4, 1f + 30f * e.finpow(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); + randLenVectors(e.id + 1, 4, 1f + 30f * e.finpow(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f)); }), blastExplosion = new Effect(22, e -> { @@ -1109,16 +1057,12 @@ public class Fx{ color(Color.gray); - randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); - }); + randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f)); color(Pal.missileYellowBack); stroke(e.fout()); - randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); + randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f)); Drawf.light(e.x, e.y, 45f, Pal.missileYellowBack, 0.8f * e.fout()); }), @@ -1133,16 +1077,12 @@ public class Fx{ color(Color.gray); - randLenVectors(e.id, 9, 2f + 70 * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); - }); + randLenVectors(e.id, 9, 2f + 70 * e.finpow(), (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f)); color(Pal.sapBulletBack); stroke(e.fout()); - randLenVectors(e.id + 1, 8, 1f + 60f * e.finpow(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); + randLenVectors(e.id + 1, 8, 1f + 60f * e.finpow(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f)); Drawf.light(e.x, e.y, 90f, Pal.sapBulletBack, 0.8f * e.fout()); }), @@ -1157,16 +1097,12 @@ public class Fx{ color(Color.gray); - randLenVectors(e.id, 8, 2f + 30f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); - }); + randLenVectors(e.id, 8, 2f + 30f * e.finpow(), (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f)); color(Pal.missileYellowBack); stroke(e.fout()); - randLenVectors(e.id + 1, 6, 1f + 29f * e.finpow(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 4f); - }); + randLenVectors(e.id + 1, 6, 1f + 29f * e.finpow(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 4f)); Drawf.light(e.x, e.y, 50f, Pal.missileYellowBack, 0.8f * e.fout()); }), @@ -1225,16 +1161,12 @@ public class Fx{ color(Color.gray); - randLenVectors(e.id, 6, 2f + 23f * e.finpow(), (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f); - }); + randLenVectors(e.id, 6, 2f + 23f * e.finpow(), (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f)); color(Pal.bulletYellow); stroke(e.fout()); - randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); + randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f)); Drawf.light(e.x, e.y, 60f, Pal.bulletYellowBack, 0.7f * e.fout()); }), @@ -1242,9 +1174,7 @@ public class Fx{ burning = new Effect(35f, e -> { color(Pal.lightFlame, Pal.darkFlame, e.fin()); - randLenVectors(e.id, 3, 2f + e.fin() * 7f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.1f + e.fout() * 1.4f); - }); + randLenVectors(e.id, 3, 2f + e.fin() * 7f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.1f + e.fout() * 1.4f)); }), fireRemove = new Effect(70f, e -> { @@ -1257,9 +1187,7 @@ public class Fx{ fire = new Effect(50f, e -> { color(Pal.lightFlame, Pal.darkFlame, e.fin()); - randLenVectors(e.id, 2, 2f + e.fin() * 9f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); - }); + randLenVectors(e.id, 2, 2f + e.fin() * 9f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f)); color(); @@ -1269,9 +1197,7 @@ public class Fx{ fireHit = new Effect(35f, e -> { color(Pal.lightFlame, Pal.darkFlame, e.fin()); - randLenVectors(e.id, 3, 2f + e.fin() * 10f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.6f); - }); + randLenVectors(e.id, 3, 2f + e.fin() * 10f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.6f)); color(); }), @@ -1279,26 +1205,20 @@ public class Fx{ fireSmoke = new Effect(35f, e -> { color(Color.gray); - randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); - }); + randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f)); }), //TODO needs a lot of work neoplasmHeal = new Effect(120f, e -> { color(Pal.neoplasm1, Pal.neoplasm2, e.fin()); - randLenVectors(e.id, 1, e.fin() * 3f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 2f); - }); + randLenVectors(e.id, 1, e.fin() * 3f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 2f)); }).followParent(true).rotWithParent(true).layer(Layer.bullet - 2), steam = new Effect(35f, e -> { color(Color.lightGray); - randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); - }); + randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f)); }), ventSteam = new Effect(140f, e -> { @@ -1334,59 +1254,45 @@ public class Fx{ color(e.color); alpha(e.fout() * 0.7f); - randLenVectors(e.id, 2, 3f + e.finpow() * 10f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.6f + e.fin() * 5f); - }); + randLenVectors(e.id, 2, 3f + e.finpow() * 10f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.6f + e.fin() * 5f)); }).layer(Layer.bullet - 1f), vapor = new Effect(110f, e -> { color(e.color); alpha(e.fout()); - randLenVectors(e.id, 3, 2f + e.finpow() * 11f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.6f + e.fin() * 5f); - }); + randLenVectors(e.id, 3, 2f + e.finpow() * 11f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.6f + e.fin() * 5f)); }), vaporSmall = new Effect(50f, e -> { color(e.color); alpha(e.fout()); - randLenVectors(e.id, 4, 2f + e.finpow() * 5f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 1f + e.fin() * 4f); - }); + randLenVectors(e.id, 4, 2f + e.finpow() * 5f, (x, y) -> Fill.circle(e.x + x, e.y + y, 1f + e.fin() * 4f)); }), fireballsmoke = new Effect(25f, e -> { color(Color.gray); - randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f); - }); + randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f)); }), ballfire = new Effect(25f, e -> { color(Pal.lightFlame, Pal.darkFlame, e.fin()); - randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f); - }); + randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f)); }), freezing = new Effect(40f, e -> { color(Liquids.cryofluid.color); - randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 1.2f); - }); + randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 1.2f)); }), melting = new Effect(40f, e -> { color(Liquids.slag.color, Color.white, e.fout() / 5f + Mathf.randomSeedRange(e.id, 0.12f)); - randLenVectors(e.id, 2, 1f + e.fin() * 3f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, .2f + e.fout() * 1.2f); - }); + randLenVectors(e.id, 2, 1f + e.fin() * 3f, (x, y) -> Fill.circle(e.x + x, e.y + y, .2f + e.fout() * 1.2f)); }), wet = new Effect(80f, e -> { @@ -1406,17 +1312,13 @@ public class Fx{ sapped = new Effect(40f, e -> { color(Pal.sap); - randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { - Fill.square(e.x + x, e.y + y, e.fslope() * 1.1f, 45f); - }); + randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> Fill.square(e.x + x, e.y + y, e.fslope() * 1.1f, 45f)); }), electrified = new Effect(40f, e -> { color(Pal.heal); - randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { - Fill.square(e.x + x, e.y + y, e.fslope() * 1.1f, 45f); - }); + randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> Fill.square(e.x + x, e.y + y, e.fslope() * 1.1f, 45f)); }), sporeSlowed = new Effect(40f, e -> { @@ -1428,17 +1330,13 @@ public class Fx{ oily = new Effect(42f, e -> { color(Liquids.oil.color); - randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout()); - }); + randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout())); }), overdriven = new Effect(20f, e -> { color(e.color); - randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { - Fill.square(e.x + x, e.y + y, e.fout() * 2.3f + 0.5f); - }); + randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> Fill.square(e.x + x, e.y + y, e.fout() * 2.3f + 0.5f)); }), overclocked = new Effect(50f, e -> { @@ -1496,9 +1394,7 @@ public class Fx{ color(Pal.lighterOrange, Pal.lightOrange, Color.gray, e.fin()); stroke(1.5f * e.fout()); - randLenVectors(e.id + 1, 8, 1f + 23f * e.finpow(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); - }); + randLenVectors(e.id + 1, 8, 1f + 23f * e.finpow(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f)); }), dynamicExplosion = new Effect(30, 500f, b -> { @@ -1513,12 +1409,10 @@ public class Fx{ rand.setSeed(b.id*2 + i); float lenScl = rand.random(0.4f, 1f); int fi = i; - b.scaled(b.lifetime * lenScl, e -> { - randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(3f * intensity), 14f * intensity, (x, y, in, out) -> { - float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); - Fill.circle(e.x + x, e.y + y, fout * ((2f + intensity) * 1.8f)); - }); - }); + b.scaled(b.lifetime * lenScl, e -> randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(3f * intensity), 14f * intensity, (x, y, in, out) -> { + float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); + Fill.circle(e.x + x, e.y + y, fout * ((2f + intensity) * 1.8f)); + })); } b.scaled(baseLifetime, e -> { @@ -1550,15 +1444,13 @@ public class Fx{ rand.setSeed(b.id*2 + i); float lenScl = rand.random(0.4f, 1f); int fi = i; - b.scaled(b.lifetime * lenScl, e -> { - randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 22f * intensity, (x, y, in, out) -> { - float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); - float rad = fout * ((2f + intensity) * 2.35f); - - Fill.circle(e.x + x, e.y + y, rad); - Drawf.light(e.x + x, e.y + y, rad * 2.5f, Pal.reactorPurple, 0.5f); - }); - }); + b.scaled(b.lifetime * lenScl, e -> randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 22f * intensity, (x, y, in, out) -> { + float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); + float rad = fout * ((2f + intensity) * 2.35f); + + Fill.circle(e.x + x, e.y + y, rad); + Drawf.light(e.x + x, e.y + y, rad * 2.5f, Pal.reactorPurple, 0.5f); + })); } b.scaled(baseLifetime, e -> { @@ -1591,15 +1483,13 @@ public class Fx{ rand.setSeed(b.id*2 + i); float lenScl = rand.random(0.25f, 1f); int fi = i; - b.scaled(b.lifetime * lenScl, e -> { - randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.8f * intensity), 25f * intensity, (x, y, in, out) -> { - float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); - float rad = fout * ((2f + intensity) * 2.35f); - - Fill.circle(e.x + x, e.y + y, rad); - Drawf.light(e.x + x, e.y + y, rad * 2.6f, Pal.lighterOrange, 0.7f); - }); - }); + b.scaled(b.lifetime * lenScl, e -> randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.8f * intensity), 25f * intensity, (x, y, in, out) -> { + float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); + float rad = fout * ((2f + intensity) * 2.35f); + + Fill.circle(e.x + x, e.y + y, rad); + Drawf.light(e.x + x, e.y + y, rad * 2.6f, Pal.lighterOrange, 0.7f); + })); } b.scaled(baseLifetime, e -> { @@ -1634,9 +1524,7 @@ public class Fx{ color(Pal.water, Color.lightGray, e.fin(Interp.pow2Out)); alpha(e.fout(Interp.pow3Out)); - randLenVectors(e.id, 4, e.finpow() * 7f, e.rotation, 30f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, Math.max(e.fout(), Math.min(1f, e.fin() * 8f)) * 2.8f); - }); + randLenVectors(e.id, 4, e.finpow() * 7f, e.rotation, 30f, (x, y) -> Fill.circle(e.x + x, e.y + y, Math.max(e.fout(), Math.min(1f, e.fin() * 8f)) * 2.8f)); }), smokePuff = new Effect(30, e -> { @@ -1679,9 +1567,7 @@ public class Fx{ shootSmallSmoke = new Effect(20f, e -> { color(Pal.lighterOrange, Color.lightGray, Color.gray, e.fin()); - randLenVectors(e.id, 5, e.finpow() * 6f, e.rotation, 20f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f); - }); + randLenVectors(e.id, 5, e.finpow() * 6f, e.rotation, 20f, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f)); }), shootBig = new Effect(9, e -> { @@ -1715,25 +1601,19 @@ public class Fx{ shootBigSmoke = new Effect(17f, e -> { color(Pal.lighterOrange, Color.lightGray, Color.gray, e.fin()); - randLenVectors(e.id, 8, e.finpow() * 19f, e.rotation, 10f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 2f + 0.2f); - }); + randLenVectors(e.id, 8, e.finpow() * 19f, e.rotation, 10f, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 2f + 0.2f)); }), shootBigSmoke2 = new Effect(18f, e -> { color(Pal.lightOrange, Color.lightGray, Color.gray, e.fin()); - randLenVectors(e.id, 9, e.finpow() * 23f, e.rotation, 20f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 2.4f + 0.2f); - }); + randLenVectors(e.id, 9, e.finpow() * 23f, e.rotation, 20f, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 2.4f + 0.2f)); }), shootSmokeDisperse = new Effect(25f, e -> { color(Pal.lightOrange, Color.white, Color.gray, e.fin()); - randLenVectors(e.id, 9, e.finpow() * 29f, e.rotation, 18f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 2.2f + 0.1f); - }); + randLenVectors(e.id, 9, e.finpow() * 29f, e.rotation, 18f, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 2.2f + 0.1f)); }), shootSmokeSquare = new Effect(20f, e -> { @@ -1799,9 +1679,7 @@ public class Fx{ rand.setSeed(e.id); for(int i = 0; i < 35; i++){ v.trns(e.rotation + 180f + rand.range(21f), rand.random(e.finpow() * 90f)).add(rand.range(3f), rand.range(3f)); - e.scaled(e.lifetime * rand.random(0.2f, 1f), b -> { - Fill.circle(e.x + v.x, e.y + v.y, b.fout() * 9f + 0.3f); - }); + e.scaled(e.lifetime * rand.random(0.2f, 1f), b -> Fill.circle(e.x + v.x, e.y + v.y, b.fout() * 9f + 0.3f)); } }), @@ -1811,9 +1689,7 @@ public class Fx{ rand.setSeed(e.id); for(int i = 0; i < 35; i++){ v.trns(e.rotation + 180f + rand.range(21f), rand.random(e.finpow() * 90f)).add(rand.range(3f), rand.range(3f)); - e.scaled(e.lifetime * rand.random(0.2f, 1f), b -> { - Fill.circle(e.x + v.x, e.y + v.y, b.fout() * 9f + 0.3f); - }); + e.scaled(e.lifetime * rand.random(0.2f, 1f), b -> Fill.circle(e.x + v.x, e.y + v.y, b.fout() * 9f + 0.3f)); } }), @@ -1827,9 +1703,7 @@ public class Fx{ color(e.color, Color.white, e.fin()); stroke(e.fout() * 1.4f + 0.5f); - randLenVectors(e.id, 4, 17f * e.fin(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 0.5f); - }); + randLenVectors(e.id, 4, 17f * e.fin(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 0.5f)); }), regenSuppressSeek = new Effect(140f, e -> { @@ -1896,27 +1770,21 @@ public class Fx{ color(Color.white, e.color, e.fin()); stroke(e.fout() * 1.1f + 0.5f); - randLenVectors(e.id, 9, 27f * e.fin(), 9f, (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 5f + 0.5f); - }); + randLenVectors(e.id, 9, 27f * e.fin(), 9f, (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 5f + 0.5f)); }), colorSpark = new Effect(21f, e -> { color(Color.white, e.color, e.fin()); stroke(e.fout() * 1.1f + 0.5f); - randLenVectors(e.id, 5, 27f * e.fin(), e.rotation, 9f, (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 5f + 0.5f); - }); + randLenVectors(e.id, 5, 27f * e.fin(), e.rotation, 9f, (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 5f + 0.5f)); }), colorSparkBig = new Effect(25f, e -> { color(Color.white, e.color, e.fin()); stroke(e.fout() * 1.3f + 0.7f); - randLenVectors(e.id, 8, 41f * e.fin(), e.rotation, 10f, (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 6f + 0.5f); - }); + randLenVectors(e.id, 8, 41f * e.fin(), e.rotation, 10f, (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 6f + 0.5f)); }), randLifeSpark = new Effect(24f, e -> { @@ -1949,25 +1817,19 @@ public class Fx{ shootSmallFlame = new Effect(32f, 80f, e -> { color(Pal.lightFlame, Pal.darkFlame, Color.gray, e.fin()); - randLenVectors(e.id, 8, e.finpow() * 60f, e.rotation, 10f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f); - }); + randLenVectors(e.id, 8, e.finpow() * 60f, e.rotation, 10f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f)); }), shootPyraFlame = new Effect(33f, 80f, e -> { color(Pal.lightPyraFlame, Pal.darkPyraFlame, Color.gray, e.fin()); - randLenVectors(e.id, 10, e.finpow() * 70f, e.rotation, 10f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.6f); - }); + randLenVectors(e.id, 10, e.finpow() * 70f, e.rotation, 10f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.6f)); }), shootLiquid = new Effect(15f, 80f, e -> { color(e.color); - randLenVectors(e.id, 2, e.finpow() * 15f, e.rotation, 11f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, 0.5f + e.fout() * 2.5f); - }); + randLenVectors(e.id, 2, e.finpow() * 15f, e.rotation, 11f, (x, y) -> Fill.circle(e.x + x, e.y + y, 0.5f + e.fout() * 2.5f)); }), casing1 = new Effect(30f, e -> { @@ -2111,17 +1973,13 @@ public class Fx{ color(Color.white); float length = !(e.data instanceof Float) ? 70f : (Float)e.data; - randLenVectors(e.id, 7, length, e.rotation, 0f, (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f); - }); + randLenVectors(e.id, 7, length, e.rotation, 0f, (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f)); }), lancerLaserCharge = new Effect(38f, e -> { color(Pal.lancerLaser); - randLenVectors(e.id, 14, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 1f); - }); + randLenVectors(e.id, 14, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 1f)); }), lancerLaserChargeBegin = new Effect(60f, e -> { @@ -2138,45 +1996,35 @@ public class Fx{ lightningCharge = new Effect(38f, e -> { color(Pal.lancerLaser); - randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> { - Drawf.tri(e.x + x, e.y + y, e.fslope() * 3f + 1, e.fslope() * 3f + 1, Mathf.angle(x, y)); - }); + randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> Drawf.tri(e.x + x, e.y + y, e.fslope() * 3f + 1, e.fslope() * 3f + 1, Mathf.angle(x, y))); }), sparkShoot = new Effect(12f, e -> { color(Color.white, e.color, e.fin()); stroke(e.fout() * 1.2f + 0.6f); - randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 3f, (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 5f + 0.5f); - }); + randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 3f, (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 5f + 0.5f)); }), lightningShoot = new Effect(12f, e -> { color(Color.white, Pal.lancerLaser, e.fin()); stroke(e.fout() * 1.2f + 0.5f); - randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 5f + 2f); - }); + randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 5f + 2f)); }), thoriumShoot = new Effect(12f, e -> { color(Color.white, Pal.thoriumPink, e.fin()); stroke(e.fout() * 1.2f + 0.5f); - randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 5f + 2f); - }); + randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 5f + 2f)); }), - reactorsmoke = new Effect(17, e -> { - randLenVectors(e.id, 4, e.fin() * 8f, (x, y) -> { - float size = 1f + e.fout() * 5f; - color(Color.lightGray, Color.gray, e.fin()); - Fill.circle(e.x + x, e.y + y, size/2f); - }); - }), + reactorsmoke = new Effect(17, e -> randLenVectors(e.id, 4, e.fin() * 8f, (x, y) -> { + float size = 1f + e.fout() * 5f; + color(Color.lightGray, Color.gray, e.fin()); + Fill.circle(e.x + x, e.y + y, size/2f); + })), redgeneratespark = new Effect(90, e -> { color(Pal.redSpark); @@ -2200,83 +2048,61 @@ public class Fx{ } }).layer(Layer.bullet - 1f), - generatespark = new Effect(18, e -> { - randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> { - color(Pal.orangeSpark, Color.gray, e.fin()); - Fill.circle(e.x + x, e.y + y, e.fout() * 4f /2f); - }); - }), + generatespark = new Effect(18, e -> randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> { + color(Pal.orangeSpark, Color.gray, e.fin()); + Fill.circle(e.x + x, e.y + y, e.fout() * 4f /2f); + })), - fuelburn = new Effect(23, e -> { - randLenVectors(e.id, 5, e.fin() * 9f, (x, y) -> { - color(Color.lightGray, Color.gray, e.fin()); - Fill.circle(e.x + x, e.y + y, e.fout() * 2f); - }); - }), + fuelburn = new Effect(23, e -> randLenVectors(e.id, 5, e.fin() * 9f, (x, y) -> { + color(Color.lightGray, Color.gray, e.fin()); + Fill.circle(e.x + x, e.y + y, e.fout() * 2f); + })), - incinerateSlag = new Effect(34, e -> { - randLenVectors(e.id, 4, e.finpow() * 5f, (x, y) -> { - color(Pal.slagOrange, Color.gray, e.fin()); - Fill.circle(e.x + x, e.y + y, e.fout() * 1.7f); - }); - }), + incinerateSlag = new Effect(34, e -> randLenVectors(e.id, 4, e.finpow() * 5f, (x, y) -> { + color(Pal.slagOrange, Color.gray, e.fin()); + Fill.circle(e.x + x, e.y + y, e.fout() * 1.7f); + })), - coreBurn = new Effect(23, e -> { - randLenVectors(e.id, 5, e.fin() * 9f, (x, y) -> { - float len = e.fout() * 4f; - color(Pal.accent, Color.gray, e.fin()); - Fill.circle(e.x + x, e.y + y, len/2f); - }); - }), + coreBurn = new Effect(23, e -> randLenVectors(e.id, 5, e.fin() * 9f, (x, y) -> { + float len = e.fout() * 4f; + color(Pal.accent, Color.gray, e.fin()); + Fill.circle(e.x + x, e.y + y, len/2f); + })), - plasticburn = new Effect(40, e -> { - randLenVectors(e.id, 5, 3f + e.fin() * 5f, (x, y) -> { - color(Pal.plasticBurn, Color.gray, e.fin()); - Fill.circle(e.x + x, e.y + y, e.fout()); - }); - }), + plasticburn = new Effect(40, e -> randLenVectors(e.id, 5, 3f + e.fin() * 5f, (x, y) -> { + color(Pal.plasticBurn, Color.gray, e.fin()); + Fill.circle(e.x + x, e.y + y, e.fout()); + })), conveyorPoof = new Effect(35, e -> { color(Pal.plasticBurn, Color.gray, e.fin()); - randLenVectors(e.id, 4, 3f + e.fin() * 4f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() * 1.11f); - }); + randLenVectors(e.id, 4, 3f + e.fin() * 4f, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() * 1.11f)); }), - pulverize = new Effect(40, e -> { - randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { - color(Pal.stoneGray); - Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); - }); - }), + pulverize = new Effect(40, e -> randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { + color(Pal.stoneGray); + Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); + })), - pulverizeRed = new Effect(40, e -> { - randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { - color(Pal.redDust, Pal.stoneGray, e.fin()); - Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); - }); - }), + pulverizeRed = new Effect(40, e -> randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { + color(Pal.redDust, Pal.stoneGray, e.fin()); + Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); + })), - pulverizeSmall = new Effect(30, e -> { - randLenVectors(e.id, 3, e.fin() * 5f, (x, y) -> { - color(Pal.stoneGray); - Fill.square(e.x + x, e.y + y, e.fout() + 0.5f, 45); - }); - }), + pulverizeSmall = new Effect(30, e -> randLenVectors(e.id, 3, e.fin() * 5f, (x, y) -> { + color(Pal.stoneGray); + Fill.square(e.x + x, e.y + y, e.fout() + 0.5f, 45); + })), - pulverizeMedium = new Effect(30, e -> { - randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { - color(Pal.stoneGray); - Fill.square(e.x + x, e.y + y, e.fout() + 0.5f, 45); - }); - }), + pulverizeMedium = new Effect(30, e -> randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { + color(Pal.stoneGray); + Fill.square(e.x + x, e.y + y, e.fout() + 0.5f, 45); + })), - producesmoke = new Effect(12, e -> { - randLenVectors(e.id, 8, 4f + e.fin() * 18f, (x, y) -> { - color(Color.white, Pal.accent, e.fin()); - Fill.square(e.x + x, e.y + y, 1f + e.fout() * 3f, 45); - }); - }), + producesmoke = new Effect(12, e -> randLenVectors(e.id, 8, 4f + e.fin() * 18f, (x, y) -> { + color(Color.white, Pal.accent, e.fin()); + Fill.square(e.x + x, e.y + y, 1f + e.fout() * 3f, 45); + })), artilleryTrailSmoke = new Effect(50, e -> { color(e.color); @@ -2293,50 +2119,38 @@ public class Fx{ } }), - smokeCloud = new Effect(70, e -> { - randLenVectors(e.id, e.fin(), 30, 30f, (x, y, fin, fout) -> { - color(Color.gray); - alpha((0.5f - Math.abs(fin - 0.5f)) * 2f); - Fill.circle(e.x + x, e.y + y, 0.5f + fout * 4f); - }); - }), - - smeltsmoke = new Effect(15, e -> { - randLenVectors(e.id, 6, 4f + e.fin() * 5f, (x, y) -> { - color(Color.white, e.color, e.fin()); - Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45); - }); - }), - - coalSmeltsmoke = new Effect(40f, e -> { - randLenVectors(e.id, 0.2f + e.fin(), 4, 6.3f, (x, y, fin, out) -> { - color(Color.darkGray, Pal.coalBlack, e.finpowdown()); - Fill.circle(e.x + x, e.y + y, out * 2f + 0.35f); - }); - }), - - formsmoke = new Effect(40, e -> { - randLenVectors(e.id, 6, 5f + e.fin() * 8f, (x, y) -> { - color(Pal.plasticSmoke, Color.lightGray, e.fin()); - Fill.square(e.x + x, e.y + y, 0.2f + e.fout() * 2f, 45); - }); - }), - - blastsmoke = new Effect(26, e -> { - randLenVectors(e.id, 12, 1f + e.fin() * 23f, (x, y) -> { - float size = 2f + e.fout() * 6f; - color(Color.lightGray, Color.darkGray, e.fin()); - Fill.circle(e.x + x, e.y + y, size/2f); - }); - }), + smokeCloud = new Effect(70, e -> randLenVectors(e.id, e.fin(), 30, 30f, (x, y, fin, fout) -> { + color(Color.gray); + alpha((0.5f - Math.abs(fin - 0.5f)) * 2f); + Fill.circle(e.x + x, e.y + y, 0.5f + fout * 4f); + })), - lava = new Effect(18, e -> { - randLenVectors(e.id, 3, 1f + e.fin() * 10f, (x, y) -> { - float size = e.fslope() * 4f; - color(Color.orange, Color.gray, e.fin()); - Fill.circle(e.x + x, e.y + y, size/2f); - }); - }), + smeltsmoke = new Effect(15, e -> randLenVectors(e.id, 6, 4f + e.fin() * 5f, (x, y) -> { + color(Color.white, e.color, e.fin()); + Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45); + })), + + coalSmeltsmoke = new Effect(40f, e -> randLenVectors(e.id, 0.2f + e.fin(), 4, 6.3f, (x, y, fin, out) -> { + color(Color.darkGray, Pal.coalBlack, e.finpowdown()); + Fill.circle(e.x + x, e.y + y, out * 2f + 0.35f); + })), + + formsmoke = new Effect(40, e -> randLenVectors(e.id, 6, 5f + e.fin() * 8f, (x, y) -> { + color(Pal.plasticSmoke, Color.lightGray, e.fin()); + Fill.square(e.x + x, e.y + y, 0.2f + e.fout() * 2f, 45); + })), + + blastsmoke = new Effect(26, e -> randLenVectors(e.id, 12, 1f + e.fin() * 23f, (x, y) -> { + float size = 2f + e.fout() * 6f; + color(Color.lightGray, Color.darkGray, e.fin()); + Fill.circle(e.x + x, e.y + y, size/2f); + })), + + lava = new Effect(18, e -> randLenVectors(e.id, 3, 1f + e.fin() * 10f, (x, y) -> { + float size = e.fslope() * 4f; + color(Color.orange, Color.gray, e.fin()); + Fill.circle(e.x + x, e.y + y, size/2f); + })), dooropen = new Effect(10, e -> { stroke(e.fout() * 1.6f); @@ -2366,44 +2180,32 @@ public class Fx{ mineWallSmall = new Effect(50, e -> { color(e.color, Color.darkGray, e.fin()); - randLenVectors(e.id, 2, e.fin() * 6f, (x, y) -> { - Fill.circle(e.x + x, e.y + y, e.fout() + 0.5f); - }); + randLenVectors(e.id, 2, e.fin() * 6f, (x, y) -> Fill.circle(e.x + x, e.y + y, e.fout() + 0.5f)); }), mineSmall = new Effect(30, e -> { color(e.color, Color.lightGray, e.fin()); - randLenVectors(e.id, 3, e.fin() * 5f, (x, y) -> { - Fill.square(e.x + x, e.y + y, e.fout() + 0.5f, 45); - }); + randLenVectors(e.id, 3, e.fin() * 5f, (x, y) -> Fill.square(e.x + x, e.y + y, e.fout() + 0.5f, 45)); }), mine = new Effect(20, e -> { color(e.color, Color.lightGray, e.fin()); - randLenVectors(e.id, 6, 3f + e.fin() * 6f, (x, y) -> { - Fill.square(e.x + x, e.y + y, e.fout() * 2f, 45); - }); + randLenVectors(e.id, 6, 3f + e.fin() * 6f, (x, y) -> Fill.square(e.x + x, e.y + y, e.fout() * 2f, 45)); }), mineBig = new Effect(30, e -> { color(e.color, Color.lightGray, e.fin()); - randLenVectors(e.id, 6, 4f + e.fin() * 8f, (x, y) -> { - Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.2f, 45); - }); + randLenVectors(e.id, 6, 4f + e.fin() * 8f, (x, y) -> Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.2f, 45)); }), mineHuge = new Effect(40, e -> { color(e.color, Color.lightGray, e.fin()); - randLenVectors(e.id, 8, 5f + e.fin() * 10f, (x, y) -> { - Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); - }); + randLenVectors(e.id, 8, 5f + e.fin() * 10f, (x, y) -> Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45)); }), mineImpact = new Effect(90, e -> { color(e.color, Color.lightGray, e.fin()); - randLenVectors(e.id, 12, 5f + e.finpow() * 22f, (x, y) -> { - Fill.square(e.x + x, e.y + y, e.fout() * 2.5f + 0.5f, 45); - }); + randLenVectors(e.id, 12, 5f + e.finpow() * 22f, (x, y) -> Fill.square(e.x + x, e.y + y, e.fout() * 2.5f + 0.5f, 45)); }), mineImpactWave = new Effect(50f, e -> { @@ -2411,9 +2213,7 @@ public class Fx{ stroke(e.fout() * 1.5f); - randLenVectors(e.id, 12, 4f + e.finpow() * e.rotation, (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 5 + 1f); - }); + randLenVectors(e.id, 12, 4f + e.finpow() * e.rotation, (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 5 + 1f)); e.scaled(30f, b -> { Lines.stroke(5f * b.fout()); @@ -2423,9 +2223,7 @@ public class Fx{ payloadReceive = new Effect(30, e -> { color(Color.white, Pal.accent, e.fin()); - randLenVectors(e.id, 12, 7f + e.fin() * 13f, (x, y) -> { - Fill.square(e.x + x, e.y + y, e.fout() * 2.1f + 0.5f, 45); - }); + randLenVectors(e.id, 12, 7f + e.fin() * 13f, (x, y) -> Fill.square(e.x + x, e.y + y, e.fout() * 2.1f + 0.5f, 45)); }), teleportActivate = new Effect(50, e -> { @@ -2438,9 +2236,7 @@ public class Fx{ stroke(e.fout() * 2f); - randLenVectors(e.id, 30, 4f + 40f * e.fin(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); - }); + randLenVectors(e.id, 30, 4f + 40f * e.fin(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f)); }), teleport = new Effect(60, e -> { @@ -2448,9 +2244,7 @@ public class Fx{ stroke(e.fin() * 2f); Lines.circle(e.x, e.y, 7f + e.fout() * 8f); - randLenVectors(e.id, 20, 6f + 20f * e.fout(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); - }); + randLenVectors(e.id, 20, 6f + 20f * e.fout(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f)); }), teleportOut = new Effect(20, e -> { @@ -2458,9 +2252,7 @@ public class Fx{ stroke(e.fout() * 2f); Lines.circle(e.x, e.y, 7f + e.fin() * 8f); - randLenVectors(e.id, 20, 4f + 20f * e.fin(), (x, y) -> { - lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 4f + 1f); - }); + randLenVectors(e.id, 20, 4f + 20f * e.fin(), (x, y) -> lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 4f + 1f)); }), ripple = new Effect(30, e -> { @@ -2474,9 +2266,7 @@ public class Fx{ bubble = new Effect(20, e -> { color(Tmp.c1.set(e.color).shiftValue(0.1f)); stroke(e.fout() + 0.2f); - randLenVectors(e.id, 2, e.rotation * 0.9f, (x, y) -> { - Lines.circle(e.x + x, e.y + y, 1f + e.fin() * 3f); - }); + randLenVectors(e.id, 2, e.rotation * 0.9f, (x, y) -> Lines.circle(e.x + x, e.y + y, 1f + e.fin() * 3f)); }), launchAccelerator = new Effect(22, e -> { @@ -2605,9 +2395,7 @@ public class Fx{ color(e.color, 0.9f); stroke(c.fout() * 2f + 0.1f); - randLenVectors(e.id, (int)(radius * 1.2f), radius/2f + c.finpow() * radius*1.25f, (x, y) -> { - lineAngle(c.x + x, c.y + y, Mathf.angle(x, y), c.fout() * 5 + 1f); - }); + randLenVectors(e.id, (int)(radius * 1.2f), radius/2f + c.finpow() * radius*1.25f, (x, y) -> lineAngle(c.x + x, c.y + y, Mathf.angle(x, y), c.fout() * 5 + 1f)); }); color(e.color, e.fout() * 0.9f); diff --git a/core/src/mindustry/content/SerpuloTechTree.java b/core/src/mindustry/content/SerpuloTechTree.java index e791f676807b..d67b2460ca5f 100644 --- a/core/src/mindustry/content/SerpuloTechTree.java +++ b/core/src/mindustry/content/SerpuloTechTree.java @@ -15,94 +15,63 @@ public class SerpuloTechTree{ public static void load(){ Planets.serpulo.techTree = nodeRoot("serpulo", coreShard, () -> { - node(conveyor, () -> { + node(conveyor, () -> node(junction, () -> node(router, () -> { + node(advancedLaunchPad, Seq.with(new SectorComplete(extractionOutpost)), () -> node(landingPad, () -> node(interplanetaryAccelerator, Seq.with(new SectorComplete(planetaryTerminal)), () -> { - node(junction, () -> { - node(router, () -> { - node(advancedLaunchPad, Seq.with(new SectorComplete(extractionOutpost)), () -> { - node(landingPad, () -> { - node(interplanetaryAccelerator, Seq.with(new SectorComplete(planetaryTerminal)), () -> { + }))); - }); - }); - }); - - node(distributor); - node(sorter, () -> { - node(invertedSorter); - node(overflowGate, () -> { - node(underflowGate); - }); - }); - node(container, Seq.with(new SectorComplete(biomassFacility)), () -> { - node(unloader); - node(vault, Seq.with(new SectorComplete(stainedMountains)), () -> { + node(distributor); + node(sorter, () -> { + node(invertedSorter); + node(overflowGate, () -> node(underflowGate)); + }); + node(container, Seq.with(new SectorComplete(biomassFacility)), () -> { + node(unloader); + node(vault, Seq.with(new SectorComplete(stainedMountains)), () -> { - }); - }); + }); + }); - node(itemBridge, () -> { - node(titaniumConveyor, Seq.with(new SectorComplete(craters)), () -> { - node(phaseConveyor, () -> { - node(massDriver, () -> { + node(itemBridge, () -> node(titaniumConveyor, Seq.with(new SectorComplete(craters)), () -> { + node(phaseConveyor, () -> node(massDriver, () -> { - }); - }); + })); - node(payloadConveyor, () -> { - node(payloadRouter, () -> { + node(payloadConveyor, () -> node(payloadRouter, () -> { - }); - }); + })); - node(armoredConveyor, () -> { - node(plastaniumConveyor, () -> { + node(armoredConveyor, () -> node(plastaniumConveyor, () -> { - }); - }); - }); - }); - }); - }); - }); + })); + })); + }))); - node(coreFoundation, () -> { - node(coreNucleus, () -> { + node(coreFoundation, () -> node(coreNucleus, () -> { - }); - }); + })); node(mechanicalDrill, () -> { - node(mechanicalPump, () -> { - node(conduit, () -> { - node(liquidJunction, () -> { - node(liquidRouter, () -> { - node(liquidContainer, () -> { - node(liquidTank); - }); + node(mechanicalPump, () -> node(conduit, () -> node(liquidJunction, () -> node(liquidRouter, () -> { + node(liquidContainer, () -> node(liquidTank)); - node(bridgeConduit); + node(bridgeConduit); - node(pulseConduit, Seq.with(new SectorComplete(windsweptIslands)), () -> { - node(phaseConduit, () -> { + node(pulseConduit, Seq.with(new SectorComplete(windsweptIslands)), () -> { + node(phaseConduit, () -> { - }); + }); - node(platedConduit, () -> { + node(platedConduit, () -> { - }); + }); - node(rotaryPump, () -> { - node(impulsePump, () -> { + node(rotaryPump, () -> node(impulsePump, () -> { - }); - }); - }); - }); - }); + })); }); - }); + })))); node(graphitePress, () -> { node(pneumaticDrill, Seq.with(new SectorComplete(frozenForest)), () -> { @@ -115,84 +84,58 @@ public static void load(){ }); - node(waterExtractor, Seq.with(new SectorComplete(saltFlats)), () -> { - node(oilExtractor, () -> { + node(waterExtractor, Seq.with(new SectorComplete(saltFlats)), () -> node(oilExtractor, () -> { - }); - }); + })); }); }); - node(pyratiteMixer, () -> { - node(blastMixer, Seq.with(new SectorComplete(facility32m)), () -> { + node(pyratiteMixer, () -> node(blastMixer, Seq.with(new SectorComplete(facility32m)), () -> { - }); - }); + })); node(siliconSmelter, () -> { node(sporePress, () -> { - node(coalCentrifuge, () -> { - node(multiPress, () -> { - node(siliconCrucible, () -> { + node(coalCentrifuge, () -> node(multiPress, () -> node(siliconCrucible, () -> { - }); - }); - }); + }))); - node(plastaniumCompressor, Seq.with(new SectorComplete(windsweptIslands), new OnSector(tarFields)), () -> { - node(phaseWeaver, Seq.with(new SectorComplete(tarFields)), () -> { + node(plastaniumCompressor, Seq.with(new SectorComplete(windsweptIslands), new OnSector(tarFields)), () -> node(phaseWeaver, Seq.with(new SectorComplete(tarFields)), () -> { - }); - }); + })); }); - node(kiln, Seq.with(new SectorComplete(craters)), () -> { - node(pulverizer, () -> { - node(incinerator, () -> { - node(melter, () -> { - node(surgeSmelter, () -> { + node(kiln, Seq.with(new SectorComplete(craters)), () -> node(pulverizer, () -> node(incinerator, () -> node(melter, () -> { + node(surgeSmelter, () -> { - }); + }); - node(separator, () -> { - node(disassembler, () -> { + node(separator, () -> node(disassembler, () -> { - }); - }); + })); - node(cryofluidMixer, () -> { + node(cryofluidMixer, () -> { - }); - }); - }); }); - }); + })))); //logic disabled until further notice - node(microProcessor, () -> { - node(switchBlock, () -> { - node(message, () -> { - node(logicDisplay, () -> { - node(largeLogicDisplay, () -> { + node(microProcessor, () -> node(switchBlock, () -> { + node(message, () -> { + node(logicDisplay, () -> node(largeLogicDisplay, () -> { - }); - }); + })); - node(memoryCell, () -> { - node(memoryBank, () -> { + node(memoryCell, () -> node(memoryBank, () -> { - }); - }); - }); + })); + }); - node(logicProcessor, () -> { - node(hyperProcessor, () -> { + node(logicProcessor, () -> node(hyperProcessor, () -> { - }); - }); - }); - }); + })); + })); node(illuminator, () -> { @@ -201,520 +144,389 @@ public static void load(){ }); - node(combustionGenerator, Seq.with(new Research(Items.coal)), () -> { - node(powerNode, () -> { - node(powerNodeLarge, () -> { - node(diode, () -> { - node(surgeTower, () -> { + node(combustionGenerator, Seq.with(new Research(Items.coal)), () -> node(powerNode, () -> { + node(powerNodeLarge, () -> node(diode, () -> node(surgeTower, () -> { - }); - }); - }); + }))); - node(battery, () -> { - node(batteryLarge, () -> { + node(battery, () -> node(batteryLarge, () -> { - }); - }); + })); - node(mender, () -> { - node(mendProjector, () -> { - node(forceProjector, Seq.with(new SectorComplete(impact0078)), () -> { - node(overdriveProjector, Seq.with(new SectorComplete(impact0078)), () -> { - node(overdriveDome, Seq.with(new SectorComplete(impact0078)), () -> { + node(mender, () -> node(mendProjector, () -> { + node(forceProjector, Seq.with(new SectorComplete(impact0078)), () -> node(overdriveProjector, Seq.with(new SectorComplete(impact0078)), () -> node(overdriveDome, Seq.with(new SectorComplete(impact0078)), () -> { - }); - }); - }); + }))); - node(repairPoint, () -> { - node(repairTurret, () -> { + node(repairPoint, () -> node(repairTurret, () -> { - }); - }); - }); - }); + })); + })); - node(steamGenerator, Seq.with(new SectorComplete(craters)), () -> { - node(thermalGenerator, () -> { - node(differentialGenerator, () -> { - node(thoriumReactor, Seq.with(new Research(Liquids.cryofluid)), () -> { - node(impactReactor, () -> { + node(steamGenerator, Seq.with(new SectorComplete(craters)), () -> node(thermalGenerator, () -> node(differentialGenerator, () -> node(thoriumReactor, Seq.with(new Research(Liquids.cryofluid)), () -> { + node(impactReactor, () -> { - }); + }); - node(rtgGenerator, () -> { + node(rtgGenerator, () -> { - }); - }); - }); - }); }); + })))); - node(solarPanel, () -> { - node(largeSolarPanel, () -> { + node(solarPanel, () -> node(largeSolarPanel, () -> { - }); - }); - }); - }); + })); + })); }); node(duo, () -> { - node(copperWall, () -> { - node(copperWallLarge, () -> { - node(scrapWall, () -> { - node(scrapWallLarge, () -> { - node(scrapWallHuge, () -> { - node(scrapWallGigantic); - }); - }); - }); + node(copperWall, () -> node(copperWallLarge, () -> { + node(scrapWall, () -> node(scrapWallLarge, () -> node(scrapWallHuge, () -> node(scrapWallGigantic)))); - node(titaniumWall, () -> { - node(titaniumWallLarge); + node(titaniumWall, () -> { + node(titaniumWallLarge); - node(door, () -> { - node(doorLarge); - }); + node(door, () -> node(doorLarge)); - node(plastaniumWall, () -> { - node(plastaniumWallLarge, () -> { + node(plastaniumWall, () -> node(plastaniumWallLarge, () -> { - }); - }); - node(thoriumWall, () -> { - node(thoriumWallLarge); - node(surgeWall, () -> { - node(surgeWallLarge); - node(phaseWall, () -> { - node(phaseWallLarge); - }); - }); + })); + node(thoriumWall, () -> { + node(thoriumWallLarge); + node(surgeWall, () -> { + node(surgeWallLarge); + node(phaseWall, () -> node(phaseWallLarge)); }); }); }); - }); + })); - node(scatter, () -> { - node(hail, Seq.with(new SectorComplete(craters)), () -> { - node(salvo, () -> { - node(swarmer, () -> { - node(cyclone, () -> { - node(spectre, Seq.with(new SectorComplete(nuclearComplex)), () -> { + node(scatter, () -> node(hail, Seq.with(new SectorComplete(craters)), () -> node(salvo, () -> { + node(swarmer, () -> node(cyclone, () -> node(spectre, Seq.with(new SectorComplete(nuclearComplex)), () -> { - }); - }); - }); + }))); - node(ripple, () -> { - node(fuse, () -> { + node(ripple, () -> node(fuse, () -> { - }); - }); - }); - }); - }); + })); + }))); - node(scorch, () -> { - node(arc, () -> { - node(wave, () -> { - node(parallax, () -> { - node(segment, () -> { + node(scorch, () -> node(arc, () -> { + node(wave, () -> { + node(parallax, () -> node(segment, () -> { - }); - }); + })); - node(tsunami, () -> { + node(tsunami, () -> { - }); }); + }); - node(lancer, () -> { - node(meltdown, () -> { - node(foreshadow, () -> { + node(lancer, () -> { + node(meltdown, () -> node(foreshadow, () -> { - }); - }); + })); - node(shockMine, () -> { + node(shockMine, () -> { - }); }); }); - }); + })); }); node(groundFactory, () -> { node(dagger, () -> { - node(mace, () -> { - node(fortress, () -> { - node(scepter, () -> { - node(reign, () -> { + node(mace, () -> node(fortress, () -> node(scepter, () -> node(reign, () -> { - }); - }); - }); - }); + })))); - node(nova, () -> { - node(pulsar, () -> { - node(quasar, () -> { - node(vela, () -> { - node(corvus, () -> { + node(nova, () -> node(pulsar, () -> node(quasar, () -> node(vela, () -> node(corvus, () -> { - }); - }); - }); - }); - }); + }))))); //override research requirements to have graphite, not coal - node(crawler, ItemStack.with(Items.silicon, 400, Items.graphite, 400), () -> { - node(atrax, () -> { - node(spiroct, () -> { - node(arkyid, () -> { - node(toxopid, Seq.with(new SectorComplete(mycelialBastion)), () -> { - - }); - }); - }); - }); - }); + node(crawler, ItemStack.with(Items.silicon, 400, Items.graphite, 400), () -> node(atrax, () -> node(spiroct, () -> node(arkyid, () -> node(toxopid, Seq.with(new SectorComplete(mycelialBastion)), () -> { + + }))))); }); node(airFactory, () -> { node(flare, () -> { - node(horizon, () -> { - node(zenith, () -> { - node(antumbra, () -> { - node(eclipse, () -> { + node(horizon, () -> node(zenith, () -> node(antumbra, () -> node(eclipse, () -> { - }); - }); - }); - }); + })))); - node(mono, () -> { - node(poly, () -> { - node(mega, () -> { - node(quad, () -> { - node(oct, () -> { + node(mono, () -> node(poly, () -> node(mega, () -> node(quad, () -> node(oct, () -> { - }); - }); - }); - }); - }); + }))))); }); - node(navalFactory, Seq.with(new OnSector(windsweptIslands)), () -> { - node(risso, () -> { - node(minke, () -> { - node(bryde, () -> { - node(sei, () -> { - node(omura, () -> { + node(navalFactory, Seq.with(new OnSector(windsweptIslands)), () -> node(risso, () -> { + node(minke, () -> node(bryde, () -> node(sei, () -> node(omura, () -> { - }); - }); - }); - }); + })))); - node(retusa, Seq.with(new SectorComplete(windsweptIslands)), () -> { - node(oxynoe, Seq.with(new SectorComplete(coastline)), () -> { - node(cyerce, () -> { - node(aegires, () -> { - node(navanax, Seq.with(new SectorComplete(navalFortress)), () -> { + node(retusa, Seq.with(new SectorComplete(windsweptIslands)), () -> node(oxynoe, Seq.with(new SectorComplete(coastline)), () -> node(cyerce, () -> node(aegires, () -> node(navanax, Seq.with(new SectorComplete(navalFortress)), () -> { - }); - }); - }); - }); - }); - }); - }); + }))))); + })); }); - node(additiveReconstructor, Seq.with(new SectorComplete(biomassFacility)), () -> { - node(multiplicativeReconstructor, Seq.with(new SectorComplete(overgrowth)), () -> { - node(exponentialReconstructor, () -> { - node(tetrativeReconstructor, () -> { + node(additiveReconstructor, Seq.with(new SectorComplete(biomassFacility)), () -> node(multiplicativeReconstructor, Seq.with(new SectorComplete(overgrowth)), () -> node(exponentialReconstructor, () -> node(tetrativeReconstructor, () -> { - }); - }); - }); - }); + })))); }); - node(groundZero, () -> { - node(frozenForest, Seq.with( - new SectorComplete(groundZero), - new Research(junction), - new Research(router) + node(groundZero, () -> node(frozenForest, Seq.with( + new SectorComplete(groundZero), + new Research(junction), + new Research(router) + ), () -> { + node(craters, Seq.with( + new SectorComplete(frozenForest), + new Research(mender), + new Research(combustionGenerator) ), () -> { - node(craters, Seq.with( - new SectorComplete(frozenForest), - new Research(mender), - new Research(combustionGenerator) + node(frontier, Seq.with( + new Research(groundFactory), + new Research(airFactory), + new Research(thermalGenerator), + new Research(dagger), + new Research(mono) ), () -> { - node(frontier, Seq.with( - new Research(groundFactory), - new Research(airFactory), - new Research(thermalGenerator), - new Research(dagger), - new Research(mono) + + }); + + node(ruinousShores, Seq.with( + new SectorComplete(craters), + new Research(graphitePress), + new Research(kiln), + new Research(mechanicalPump) + ), () -> node(windsweptIslands, Seq.with( + new SectorComplete(ruinousShores), + new Research(pneumaticDrill), + new Research(hail), + new Research(siliconSmelter), + new Research(steamGenerator) + ), () -> { + node(seaPort, Seq.with( + new SectorComplete(biomassFacility), + new Research(navalFactory), + new Research(risso), + new Research(retusa), + new Research(steamGenerator), + new Research(cultivator), + new Research(coalCentrifuge) ), () -> { }); - node(ruinousShores, Seq.with( - new SectorComplete(craters), - new Research(graphitePress), - new Research(kiln), - new Research(mechanicalPump) + node(tarFields, Seq.with( + new SectorComplete(windsweptIslands), + new Research(coalCentrifuge), + new Research(conduit), + new Research(wave) + ), () -> node(impact0078, Seq.with( + new SectorComplete(tarFields), + new Research(Items.thorium), + new Research(lancer), + new Research(salvo), + new Research(coreFoundation) + ), () -> node(desolateRift, Seq.with( + new SectorComplete(impact0078), + new Research(thermalGenerator), + new Research(thoriumReactor), + new Research(coreNucleus) + ), () -> node(planetaryTerminal, Seq.with( + new SectorComplete(desolateRift), + new SectorComplete(nuclearComplex), + new SectorComplete(overgrowth), + new SectorComplete(extractionOutpost), + new SectorComplete(saltFlats), + new Research(risso), + new Research(minke), + new Research(bryde), + new Research(sei), + new Research(omura), + new Research(spectre), + new Research(advancedLaunchPad), + new Research(massDriver), + new Research(impactReactor), + new Research(additiveReconstructor), + new Research(exponentialReconstructor), + new Research(tetrativeReconstructor) ), () -> { - node(windsweptIslands, Seq.with( - new SectorComplete(ruinousShores), - new Research(pneumaticDrill), - new Research(hail), - new Research(siliconSmelter), - new Research(steamGenerator) + node(geothermalStronghold, Seq.with( + new Research(omura), + new Research(navanax), + new Research(eclipse), + new Research(oct), + new Research(reign), + new Research(corvus), + new Research(toxopid) + ), () -> { + + }); + + node(cruxscape, Seq.with( + new Research(omura), + new Research(navanax), + new Research(eclipse), + new Research(oct), + new Research(reign), + new Research(corvus), + new Research(toxopid) ), () -> { - node(seaPort, Seq.with( - new SectorComplete(biomassFacility), - new Research(navalFactory), - new Research(risso), - new Research(retusa), - new Research(steamGenerator), - new Research(cultivator), - new Research(coalCentrifuge) - ), () -> { - - }); - - node(tarFields, Seq.with( - new SectorComplete(windsweptIslands), - new Research(coalCentrifuge), - new Research(conduit), - new Research(wave) - ), () -> { - node(impact0078, Seq.with( - new SectorComplete(tarFields), - new Research(Items.thorium), - new Research(lancer), - new Research(salvo), - new Research(coreFoundation) - ), () -> { - node(desolateRift, Seq.with( - new SectorComplete(impact0078), - new Research(thermalGenerator), - new Research(thoriumReactor), - new Research(coreNucleus) - ), () -> { - node(planetaryTerminal, Seq.with( - new SectorComplete(desolateRift), - new SectorComplete(nuclearComplex), - new SectorComplete(overgrowth), - new SectorComplete(extractionOutpost), - new SectorComplete(saltFlats), - new Research(risso), - new Research(minke), - new Research(bryde), - new Research(sei), - new Research(omura), - new Research(spectre), - new Research(advancedLaunchPad), - new Research(massDriver), - new Research(impactReactor), - new Research(additiveReconstructor), - new Research(exponentialReconstructor), - new Research(tetrativeReconstructor) - ), () -> { - node(geothermalStronghold, Seq.with( - new Research(omura), - new Research(navanax), - new Research(eclipse), - new Research(oct), - new Research(reign), - new Research(corvus), - new Research(toxopid) - ), () -> { - - }); - - node(cruxscape, Seq.with( - new Research(omura), - new Research(navanax), - new Research(eclipse), - new Research(oct), - new Research(reign), - new Research(corvus), - new Research(toxopid) - ), () -> { - - }); - }); - }); - }); - }); - - node(facility32m, Seq.with( - new Research(pneumaticDrill), - new SectorComplete(stainedMountains) - ), () -> { - node(extractionOutpost, Seq.with( - new SectorComplete(windsweptIslands), - new SectorComplete(facility32m), - new Research(groundFactory), - new Research(nova), - new Research(airFactory), - new Research(mono) - ), () -> { - //TODO: removed for now - /*node(polarAerodrome, Seq.with( - new SectorComplete(fungalPass), - new SectorComplete(desolateRift), - new SectorComplete(overgrowth), - new Research(multiplicativeReconstructor), - new Research(zenith), - new Research(swarmer), - new Research(cyclone), - new Research(blastDrill), - new Research(blastDrill), - new Research(massDriver) - ), () -> { - - }); - */ - }); - }); - - node(saltFlats, Seq.with( - new SectorComplete(windsweptIslands), - new Research(groundFactory), - new Research(additiveReconstructor), - new Research(airFactory), - new Research(door) - ), () -> { - node(testingGrounds, Seq.with( - new Research(cryofluidMixer), - new Research(Liquids.cryofluid), - new Research(waterExtractor), - new Research(ripple) - ), () -> { - - }); - - node(coastline, Seq.with( - new SectorComplete(windsweptIslands), - new SectorComplete(saltFlats), - new Research(navalFactory), - new Research(payloadConveyor) - ), () -> { - - node(navalFortress, Seq.with( - new SectorComplete(coastline), - new SectorComplete(extractionOutpost), - new Research(coreNucleus), - new Research(massDriver), - new Research(oxynoe), - new Research(minke), - new Research(bryde), - new Research(cyclone), - new Research(ripple) - ), () -> { - node(weatheredChannels, Seq.with( - new SectorComplete(impact0078), - new Research(bryde), - new Research(surgeSmelter), - new Research(overdriveProjector) - ), () -> { - - }); - }); - }); - }); + }); - }); + })))); - node(overgrowth, Seq.with( - new SectorComplete(craters), - new SectorComplete(fungalPass), - new Research(cultivator), - new Research(sporePress), - new Research(additiveReconstructor), - new Research(UnitTypes.mace), - new Research(UnitTypes.flare) + node(facility32m, Seq.with( + new Research(pneumaticDrill), + new SectorComplete(stainedMountains) + ), () -> node(extractionOutpost, Seq.with( + new SectorComplete(windsweptIslands), + new SectorComplete(facility32m), + new Research(groundFactory), + new Research(nova), + new Research(airFactory), + new Research(mono) ), () -> { - node(mycelialBastion, Seq.with( - new Research(atrax), - new Research(spiroct), + //TODO: removed for now + /*node(polarAerodrome, Seq.with( + new SectorComplete(fungalPass), + new SectorComplete(desolateRift), + new SectorComplete(overgrowth), new Research(multiplicativeReconstructor), - new Research(exponentialReconstructor) + new Research(zenith), + new Research(swarmer), + new Research(cyclone), + new Research(blastDrill), + new Research(blastDrill), + new Research(massDriver) ), () -> { }); + */ + })); - node(atolls, Seq.with( - new SectorComplete(windsweptIslands), - new Research(multiplicativeReconstructor), - new Research(mega) + node(saltFlats, Seq.with( + new SectorComplete(windsweptIslands), + new Research(groundFactory), + new Research(additiveReconstructor), + new Research(airFactory), + new Research(door) + ), () -> { + node(testingGrounds, Seq.with( + new Research(cryofluidMixer), + new Research(Liquids.cryofluid), + new Research(waterExtractor), + new Research(ripple) ), () -> { }); + + node(coastline, Seq.with( + new SectorComplete(windsweptIslands), + new SectorComplete(saltFlats), + new Research(navalFactory), + new Research(payloadConveyor) + ), () -> node(navalFortress, Seq.with( + new SectorComplete(coastline), + new SectorComplete(extractionOutpost), + new Research(coreNucleus), + new Research(massDriver), + new Research(oxynoe), + new Research(minke), + new Research(bryde), + new Research(cyclone), + new Research(ripple) + ), () -> node(weatheredChannels, Seq.with( + new SectorComplete(impact0078), + new Research(bryde), + new Research(surgeSmelter), + new Research(overdriveProjector) + ), () -> { + + }))); }); - }); + })); - node(biomassFacility, Seq.with( - new SectorComplete(frozenForest), - new Research(powerNode), - new Research(steamGenerator), - new Research(scatter), - new Research(graphitePress) + node(overgrowth, Seq.with( + new SectorComplete(craters), + new SectorComplete(fungalPass), + new Research(cultivator), + new Research(sporePress), + new Research(additiveReconstructor), + new Research(UnitTypes.mace), + new Research(UnitTypes.flare) ), () -> { - node(taintedWoods, Seq.with( - new SectorComplete(biomassFacility), - new Research(Items.sporePod), - new Research(wave) + node(mycelialBastion, Seq.with( + new Research(atrax), + new Research(spiroct), + new Research(multiplicativeReconstructor), + new Research(exponentialReconstructor) ), () -> { }); - node(stainedMountains, Seq.with( - new SectorComplete(biomassFacility), - new Research(pneumaticDrill), - new Research(siliconSmelter) + node(atolls, Seq.with( + new SectorComplete(windsweptIslands), + new Research(multiplicativeReconstructor), + new Research(mega) ), () -> { - node(fungalPass, Seq.with( - new SectorComplete(stainedMountains), - new Research(groundFactory), - new Research(door) - ), () -> { - node(infestedCanyons, Seq.with( - new SectorComplete(fungalPass), - new Research(navalFactory), - new Research(risso), - new Research(minke), - new Research(additiveReconstructor) - ), () -> { - - }); - - node(nuclearComplex, Seq.with( - new SectorComplete(fungalPass), - new Research(thermalGenerator), - new Research(laserDrill), - new Research(Items.plastanium), - new Research(swarmer) - ), () -> { - - }); - }); + }); }); }); - }); + + node(biomassFacility, Seq.with( + new SectorComplete(frozenForest), + new Research(powerNode), + new Research(steamGenerator), + new Research(scatter), + new Research(graphitePress) + ), () -> { + node(taintedWoods, Seq.with( + new SectorComplete(biomassFacility), + new Research(Items.sporePod), + new Research(wave) + ), () -> { + + }); + + node(stainedMountains, Seq.with( + new SectorComplete(biomassFacility), + new Research(pneumaticDrill), + new Research(siliconSmelter) + ), () -> node(fungalPass, Seq.with( + new SectorComplete(stainedMountains), + new Research(groundFactory), + new Research(door) + ), () -> { + node(infestedCanyons, Seq.with( + new SectorComplete(fungalPass), + new Research(navalFactory), + new Research(risso), + new Research(minke), + new Research(additiveReconstructor) + ), () -> { + + }); + + node(nuclearComplex, Seq.with( + new SectorComplete(fungalPass), + new Research(thermalGenerator), + new Research(laserDrill), + new Research(Items.plastanium), + new Research(swarmer) + ), () -> { + + }); + })); + }); + })); nodeProduce(Items.copper, () -> { nodeProduce(Liquids.water, () -> { @@ -744,34 +556,26 @@ public static void load(){ }); nodeProduce(Items.sand, () -> { - nodeProduce(Items.scrap, () -> { - nodeProduce(Liquids.slag, () -> { + nodeProduce(Items.scrap, () -> nodeProduce(Liquids.slag, () -> { - }); - }); + })); nodeProduce(Items.coal, () -> { - nodeProduce(Items.graphite, () -> { - nodeProduce(Items.silicon, () -> { + nodeProduce(Items.graphite, () -> nodeProduce(Items.silicon, () -> { - }); - }); + })); - nodeProduce(Items.pyratite, () -> { - nodeProduce(Items.blastCompound, () -> { + nodeProduce(Items.pyratite, () -> nodeProduce(Items.blastCompound, () -> { - }); - }); + })); nodeProduce(Items.sporePod, () -> { }); - nodeProduce(Liquids.oil, () -> { - nodeProduce(Items.plastanium, () -> { + nodeProduce(Liquids.oil, () -> nodeProduce(Items.plastanium, () -> { - }); - }); + })); }); }); }); diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index ac274c820cb1..972cc9638dbe 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -70,9 +70,7 @@ public Control(){ //show dialog saying that mod loading was skipped. Events.on(ClientLoadEvent.class, e -> { if(Vars.mods.skipModLoading() && Vars.mods.list().any()){ - Time.runTask(4f, () -> { - ui.showInfo("@mods.initfailed"); - }); + Time.runTask(4f, () -> ui.showInfo("@mods.initfailed")); } checkAutoUnlocks(); }); @@ -102,9 +100,7 @@ public Control(){ } }); - Events.on(SaveLoadEvent.class, event -> { - input.checkUnit(); - }); + Events.on(SaveLoadEvent.class, event -> input.checkUnit()); Events.on(ResetEvent.class, event -> { player.reset(); @@ -173,9 +169,7 @@ public Control(){ app.post(this::checkAutoUnlocks); if(!net.client() && e.sector.preset != null && e.sector.preset.isLastSector && e.initialCapture){ - Time.run(60f * 2f, () -> { - ui.campaignComplete.show(e.sector.planet); - }); + Time.run(60f * 2f, () -> ui.campaignComplete.show(e.sector.planet)); } }); @@ -258,9 +252,7 @@ public Control(){ if(anyBuilds){ for(var ccore : state.rules.defaultTeam.data().cores){ - Time.run(coreDelay, () -> { - Fx.coreBuildShockwave.at(ccore.x, ccore.y, buildRadius); - }); + Time.run(coreDelay, () -> Fx.coreBuildShockwave.at(ccore.x, ccore.y, buildRadius)); } } } @@ -269,9 +261,7 @@ public Control(){ Events.on(SaveWriteEvent.class, e -> forcePlaceAll()); Events.on(HostEvent.class, e -> forcePlaceAll()); - Events.on(HostEvent.class, e -> { - state.set(State.playing); - }); + Events.on(HostEvent.class, e -> state.set(State.playing)); } private void forcePlaceAll(){ diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index 328d838c4c41..eecb1a015d2f 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -162,9 +162,7 @@ public Logic(){ Events.on(BlockDestroyEvent.class, e -> { if(e.tile.build instanceof CoreBuild core && core.team.isAI() && state.rules.coreDestroyClear){ - Core.app.post(() -> { - core.team.data().timeDestroy(core.x, core.y, state.rules.enemyCoreBuildRadius); - }); + Core.app.post(() -> core.team.data().timeDestroy(core.x, core.y, state.rules.enemyCoreBuildRadius)); } }); diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index b882706e83e1..fd2861ff23fe 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -381,9 +381,7 @@ private void registerCommands(){ StringBuilder builder = new StringBuilder(); builder.append("[orange]Players to kick: \n"); - Groups.player.each(p -> !p.admin && p.con != null && p != player, p -> { - builder.append("[lightgray] ").append(p.name).append("[accent] (#").append(p.id()).append(")\n"); - }); + Groups.player.each(p -> !p.admin && p.con != null && p != player, p -> builder.append("[lightgray] ").append(p.name).append("[accent] (#").append(p.id()).append(")\n")); player.sendMessage(builder.toString()); }else if(args.length == 1){ player.sendMessage("[orange]You need a valid reason to kick the player. Add a reason after the player name."); diff --git a/core/src/mindustry/core/Platform.java b/core/src/mindustry/core/Platform.java index e395d824127a..c4a2202f58ff 100644 --- a/core/src/mindustry/core/Platform.java +++ b/core/src/mindustry/core/Platform.java @@ -110,16 +110,14 @@ default void shareFile(Fi file){ default void export(String name, String extension, FileWriter writer){ if(!ios){ - platform.showFileChooser(false, extension, file -> { - ui.loadAnd(() -> { - try{ - writer.write(file); - }catch(Throwable e){ - ui.showException(e); - Log.err(e); - } - }); - }); + platform.showFileChooser(false, extension, file -> ui.loadAnd(() -> { + try{ + writer.write(file); + }catch(Throwable e){ + ui.showException(e); + Log.err(e); + } + })); }else{ ui.loadAnd(() -> { try{ diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index f8babe63b5b9..9b41ced66cf4 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -110,9 +110,7 @@ public void init(){ loadFluidFrames(); - Events.on(ClientLoadEvent.class, e -> { - loadFluidFrames(); - }); + Events.on(ClientLoadEvent.class, e -> loadFluidFrames()); assets.load("sprites/clouds.png", Texture.class).loaded = t -> { t.setWrap(TextureWrap.repeat); diff --git a/core/src/mindustry/core/World.java b/core/src/mindustry/core/World.java index a9e858a0c746..df3ea90f92c2 100644 --- a/core/src/mindustry/core/World.java +++ b/core/src/mindustry/core/World.java @@ -38,13 +38,9 @@ public class World{ private ObjectMap customMapLoaders = new ObjectMap<>(); public World(){ - Events.on(TileChangeEvent.class, e -> { - tileChanges ++; - }); + Events.on(TileChangeEvent.class, e -> tileChanges ++); - Events.on(WorldLoadEvent.class, e -> { - tileChanges = -1; - }); + Events.on(WorldLoadEvent.class, e -> tileChanges = -1); } /** Adds a custom handler function for loading a custom map - usually a generated one. */ diff --git a/core/src/mindustry/editor/MapEditorDialog.java b/core/src/mindustry/editor/MapEditorDialog.java index ad35a4a45f63..f842e1f71149 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -92,15 +92,13 @@ public MapEditorDialog(){ t.button("@editor.import", Icon.download, () -> createDialog("@editor.import", "@editor.importmap", "@editor.importmap.description", Icon.download, (Runnable)loadDialog::show, "@editor.importfile", "@editor.importfile.description", Icon.file, (Runnable)() -> - platform.showFileChooser(true, mapExtension, file -> ui.loadAnd(() -> { - maps.tryCatchMapError(() -> { - if(MapIO.isImage(file)){ - ui.showInfo("@editor.errorimage"); - }else{ - editor.beginEdit(MapIO.createMap(file, true)); - } - }); - })), + platform.showFileChooser(true, mapExtension, file -> ui.loadAnd(() -> maps.tryCatchMapError(() -> { + if(MapIO.isImage(file)){ + ui.showInfo("@editor.errorimage"); + }else{ + editor.beginEdit(MapIO.createMap(file, true)); + } + }))), "@editor.importimage", "@editor.importimage.description", Icon.fileImage, (Runnable)() -> platform.showFileChooser(true, "png", file -> @@ -187,9 +185,7 @@ public MapEditorDialog(){ resizeDialog = new MapResizeDialog((width, height, shiftX, shiftY) -> { if(!(editor.width() == width && editor.height() == height && shiftX == 0 && shiftY == 0)){ - ui.loadAnd(() -> { - editor.resize(width, height, shiftX, shiftY); - }); + ui.loadAnd(() -> editor.resize(width, height, shiftX, shiftY)); } }); @@ -635,16 +631,12 @@ public void build(){ mid.row(); if(!mobile){ - mid.table(t -> { - t.button("@editor.center", Icon.move, Styles.flatt, view::center).growX().margin(9f); - }).growX().top(); + mid.table(t -> t.button("@editor.center", Icon.move, Styles.flatt, view::center).growX().margin(9f)).growX().top(); } mid.row(); - mid.table(t -> { - t.button("@editor.cliffs", Icon.terrain, Styles.flatt, editor::addCliffs).growX().margin(9f); - }).growX().top(); + mid.table(t -> t.button("@editor.cliffs", Icon.terrain, Styles.flatt, editor::addCliffs).growX().margin(9f)).growX().top(); }).margin(0).left().growY(); diff --git a/core/src/mindustry/editor/MapGenerateDialog.java b/core/src/mindustry/editor/MapGenerateDialog.java index bb04261baf09..81ff1593b118 100644 --- a/core/src/mindustry/editor/MapGenerateDialog.java +++ b/core/src/mindustry/editor/MapGenerateDialog.java @@ -69,12 +69,10 @@ public MapGenerateDialog(boolean applied){ buttons.button("@back", Icon.left, this::hide); if(applied){ - buttons.button("@editor.apply", Icon.ok, () -> { - ui.loadAnd(() -> { - apply(); - hide(); - }); - }); + buttons.button("@editor.apply", Icon.ok, () -> ui.loadAnd(() -> { + apply(); + hide(); + })); } buttons.button("@editor.randomize", Icon.refresh, () -> { diff --git a/core/src/mindustry/editor/MapInfoDialog.java b/core/src/mindustry/editor/MapInfoDialog.java index ebc1f0b300d2..f7b6ff7c21c7 100644 --- a/core/src/mindustry/editor/MapInfoDialog.java +++ b/core/src/mindustry/editor/MapInfoDialog.java @@ -38,24 +38,18 @@ private void setup(){ t.add("@editor.mapname").padRight(8).left(); t.defaults().padTop(15); - TextField name = t.field(tags.get("name", ""), text -> { - tags.put("name", text); - }).size(400, 55f).maxTextLength(50).get(); + TextField name = t.field(tags.get("name", ""), text -> tags.put("name", text)).size(400, 55f).maxTextLength(50).get(); name.setMessageText("@unknown"); t.row(); t.add("@editor.description").padRight(8).left(); - TextArea description = t.area(tags.get("description", ""), Styles.areaField, text -> { - tags.put("description", text); - }).size(400f, 140f).maxTextLength(1000).get(); + TextArea description = t.area(tags.get("description", ""), Styles.areaField, text -> tags.put("description", text)).size(400f, 140f).maxTextLength(1000).get(); t.row(); t.add("@editor.author").padRight(8).left(); - TextField author = t.field(tags.get("author", ""), text -> { - tags.put("author", text); - }).size(400, 55f).maxTextLength(50).get(); + TextField author = t.field(tags.get("author", ""), text -> tags.put("author", text)).size(400, 55f).maxTextLength(50).get(); author.setMessageText("@unknown"); t.row(); diff --git a/core/src/mindustry/editor/MapProcessorsDialog.java b/core/src/mindustry/editor/MapProcessorsDialog.java index 8867c2df13ab..8ab29b973f08 100644 --- a/core/src/mindustry/editor/MapProcessorsDialog.java +++ b/core/src/mindustry/editor/MapProcessorsDialog.java @@ -64,9 +64,7 @@ public MapProcessorsDialog(){ search.setMessageText("@players.search"); }).width(440f).fillX().padBottom(4).row(); - cont.pane(t -> { - list = t; - }); + cont.pane(t -> list = t); } private void rebuild(){ @@ -83,27 +81,21 @@ private void rebuild(){ for(var build : processors){ if(build instanceof LogicBuild log && (text.isEmpty() || (log.tag != null && log.tag.toLowerCase().contains(text)))){ - t.button(log.iconTag == 0 ? Styles.none : new TextureRegionDrawable(Fonts.getLargeIcon(Fonts.unicodeToName(log.iconTag))), Styles.graySquarei, iconMed, () -> { - iconSelect.show(ic -> { - log.iconTag = (char)ic; - rebuild(); - }); - }).size(h); + t.button(log.iconTag == 0 ? Styles.none : new TextureRegionDrawable(Fonts.getLargeIcon(Fonts.unicodeToName(log.iconTag))), Styles.graySquarei, iconMed, () -> iconSelect.show(ic -> { + log.iconTag = (char)ic; + rebuild(); + })).size(h); t.button((log.tag == null ? "\n" : "[accent]" + log.tag + "\n") + "[lightgray][[" + log.tile.x + ", " + log.tile.y + "]", Styles.grayt, () -> { //TODO: bug: if you edit name inside of the edit dialog, it won't show up in the list properly log.showEditDialog(true); - }).size(Vars.mobile ? 390f : 450f, h).margin(10f).with(b -> { - b.getLabel().setAlignment(Align.left, Align.left); - }); - - t.button(Icon.pencil, Styles.graySquarei, Vars.iconMed, () -> { - ui.showTextInput("", "@editor.name", LogicBlock.maxNameLength, log.tag == null ? "" : log.tag, tag -> { - //bypass configuration and set it directly in case privileged checks mess things up - log.tag = tag; - setup(); - }); - }).size(h); + }).size(Vars.mobile ? 390f : 450f, h).margin(10f).with(b -> b.getLabel().setAlignment(Align.left, Align.left)); + + t.button(Icon.pencil, Styles.graySquarei, Vars.iconMed, () -> ui.showTextInput("", "@editor.name", LogicBlock.maxNameLength, log.tag == null ? "" : log.tag, tag -> { + //bypass configuration and set it directly in case privileged checks mess things up + log.tag = tag; + setup(); + })).size(h); if(Vars.state.isGame() && state.isEditor()){ t.button(Icon.eyeSmall, Styles.graySquarei, Vars.iconMed, () -> { @@ -113,25 +105,23 @@ private void rebuild(){ }).size(h); } - t.button(Icon.trash, Styles.graySquarei, iconMed, () -> { - ui.showConfirm("@editor.worldprocessors.delete.confirm", () -> { - boolean surrounded = true; - for(int i = 0; i < 4; i++){ - Tile other = build.tile.nearby(i); - if(other != null && !(other.block().privileged || other.block().isStatic())){ - surrounded = false; - break; - } - } - if(surrounded){ - build.tile.setNet(build.tile.floor().wall instanceof StaticWall ? build.tile.floor().wall : Blocks.stoneWall); - }else{ - build.tile.setNet(Blocks.air); + t.button(Icon.trash, Styles.graySquarei, iconMed, () -> ui.showConfirm("@editor.worldprocessors.delete.confirm", () -> { + boolean surrounded = true; + for(int i = 0; i < 4; i++){ + Tile other = build.tile.nearby(i); + if(other != null && !(other.block().privileged || other.block().isStatic())){ + surrounded = false; + break; } - processors.remove(build); - rebuild(); - }); - }).size(h); + } + if(surrounded){ + build.tile.setNet(build.tile.floor().wall instanceof StaticWall ? build.tile.floor().wall : Blocks.stoneWall); + }else{ + build.tile.setNet(Blocks.air); + } + processors.remove(build); + rebuild(); + })).size(h); t.row(); } diff --git a/core/src/mindustry/editor/SectorGenerateDialog.java b/core/src/mindustry/editor/SectorGenerateDialog.java index 4d0b8bcb37fb..d19bad1696ad 100644 --- a/core/src/mindustry/editor/SectorGenerateDialog.java +++ b/core/src/mindustry/editor/SectorGenerateDialog.java @@ -59,28 +59,22 @@ void setup(){ cont.add("@editor.sector").padRight(10f); - cont.field(sector + "", text -> { - sector = Strings.parseInt(text); - }).width(200f).valid(text -> planet.sectors.size > Strings.parseInt(text, 99999) && Strings.parseInt(text, 9999) >= 0); + cont.field(sector + "", text -> sector = Strings.parseInt(text)).width(200f).valid(text -> planet.sectors.size > Strings.parseInt(text, 99999) && Strings.parseInt(text, 9999) >= 0); cont.row(); cont.add("@editor.seed").padRight(10f); - cont.field(seed + "", text -> { - seed = Strings.parseInt(text); - }).width(200f).valid(Strings::canParseInt); + cont.field(seed + "", text -> seed = Strings.parseInt(text)).width(200f).valid(Strings::canParseInt); cont.row(); cont.label(() -> "[ " + planet.sectors.get(sector).getSize() + "x" + planet.sectors.get(sector).getSize() + " ]").color(Pal.accent).center().labelAlign(Align.center).padTop(5).colspan(2); - buttons.button("@editor.apply", Icon.ok, () -> { - ui.loadAnd(() -> { - apply(); - hide(); - }); - }); + buttons.button("@editor.apply", Icon.ok, () -> ui.loadAnd(() -> { + apply(); + hide(); + })); } void apply(){ diff --git a/core/src/mindustry/editor/WaveGraph.java b/core/src/mindustry/editor/WaveGraph.java index 11e6e6cfe874..97a46a210c4f 100644 --- a/core/src/mindustry/editor/WaveGraph.java +++ b/core/src/mindustry/editor/WaveGraph.java @@ -237,9 +237,7 @@ public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode but ButtonGroup