From 97c3d36baebe2034f953d6ded74695a5333cb240 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 19 Nov 2020 12:31:27 -0500 Subject: [PATCH] Re-added preloading of ground enemy path / Core unit casing FX --- core/src/mindustry/ai/Pathfinder.java | 2 ++ core/src/mindustry/content/UnitTypes.java | 3 +++ core/src/mindustry/entities/EntityGroup.java | 8 ++++++++ core/src/mindustry/type/UnitType.java | 2 +- core/src/mindustry/world/Block.java | 2 +- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index e26ae14fd0..392481b3ac 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -87,6 +87,8 @@ public class Pathfinder implements Runnable{ tiles[tile.x][tile.y] = packTile(tile); } + preloadPath(getField(state.rules.waveTeam, costGround, fieldCore)); + start(); }); diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index bf246a2db9..7ee6dfebf2 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -1731,6 +1731,7 @@ public class UnitTypes implements ContentList{ x = 2.75f; y = 1f; top = false; + ejectEffect = Fx.casing1; bullet = new BasicBulletType(2.5f, 10){{ width = 7f; @@ -1772,6 +1773,7 @@ public class UnitTypes implements ContentList{ shots = 2; shotDelay = 4f; spacing = 0f; + ejectEffect = Fx.casing1; bullet = new BasicBulletType(3f, 10){{ width = 7f; @@ -1811,6 +1813,7 @@ public class UnitTypes implements ContentList{ spacing = 2f; inaccuracy = 3f; shotDelay = 3f; + ejectEffect = Fx.casing1; bullet = new BasicBulletType(3.5f, 10){{ width = 6.5f; diff --git a/core/src/mindustry/entities/EntityGroup.java b/core/src/mindustry/entities/EntityGroup.java index 50e97ccae4..6553e72d44 100644 --- a/core/src/mindustry/entities/EntityGroup.java +++ b/core/src/mindustry/entities/EntityGroup.java @@ -4,6 +4,7 @@ import arc.*; import arc.func.*; import arc.math.geom.*; import arc.struct.*; +import arc.util.*; import mindustry.gen.*; import java.util.*; @@ -93,6 +94,7 @@ public class EntityGroup implements Iterable{ return map != null; } + @Nullable public T getByID(int id){ if(map == null) throw new RuntimeException("Mapping is not enabled for group " + id + "!"); return map.get(id); @@ -188,10 +190,16 @@ public class EntityGroup implements Iterable{ clearing = false; } + @Nullable public T find(Boolf pred){ return array.find(pred); } + @Nullable + public T first(){ + return array.first(); + } + @Override public Iterator iterator(){ return array.iterator(); diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 6da3a75ec0..a83f6532ae 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -374,7 +374,7 @@ public class UnitType extends UnlockableContent{ if(stacks != null){ ItemStack[] out = new ItemStack[stacks.length]; for(int i = 0; i < out.length; i++){ - out[i] = new ItemStack(stacks[i].item, UI.roundAmount((int)(Math.pow(stacks[i].amount, 1.11) * 50))); + out[i] = new ItemStack(stacks[i].item, UI.roundAmount((int)(Math.pow(stacks[i].amount, 1.1) * 50))); } return out; diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 7fa2c17d5b..6eec5c2b20 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -617,7 +617,7 @@ public class Block extends UnlockableContent{ public ItemStack[] researchRequirements(){ ItemStack[] out = new ItemStack[requirements.length]; for(int i = 0; i < out.length; i++){ - int quantity = 60 + Mathf.round(Mathf.pow(requirements[i].amount, 1.13f) * 20 * researchCostMultiplier, 10); + int quantity = 60 + Mathf.round(Mathf.pow(requirements[i].amount, 1.1f) * 20 * researchCostMultiplier, 10); out[i] = new ItemStack(requirements[i].item, UI.roundAmount(quantity)); }