From 406d2b949bcc5b73df856ba9ac86a9abbfcad14b Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 18 Feb 2022 15:40:17 -0500 Subject: [PATCH] Beryllium floor ore --- .../blocks/environment/ore-beryllium1.png | Bin 0 -> 301 bytes .../blocks/environment/ore-beryllium2.png | Bin 0 -> 328 bytes .../blocks/environment/ore-beryllium3.png | Bin 0 -> 273 bytes core/assets/icons/icons.properties | 1 + core/src/mindustry/ai/types/CommandAI.java | 17 ++++++++++++++++- core/src/mindustry/content/Blocks.java | 8 +++++--- .../maps/planet/AsteroidGenerator.java | 2 +- .../maps/planet/ErekirPlanetGenerator.java | 2 +- 8 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 core/assets-raw/sprites/blocks/environment/ore-beryllium1.png create mode 100644 core/assets-raw/sprites/blocks/environment/ore-beryllium2.png create mode 100644 core/assets-raw/sprites/blocks/environment/ore-beryllium3.png diff --git a/core/assets-raw/sprites/blocks/environment/ore-beryllium1.png b/core/assets-raw/sprites/blocks/environment/ore-beryllium1.png new file mode 100644 index 0000000000000000000000000000000000000000..2cadc169adc5785d5ed720063e5e9c154079dfb2 GIT binary patch literal 301 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}jKx9jP7LeL$-HD>V0iB7 z;usRq`gZbO-a`fgt@8zEr*J=8*ms0UB$AD$r2-TqPu~3*Tf!&w>9vmK zzkPT3FI@Wccu5rh{rKzUb?aWJ7N8)s|GJpQBVfZ?y@ad+!H(wbT7#KWV{an^L HB{Ts5Btd?? literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/blocks/environment/ore-beryllium2.png b/core/assets-raw/sprites/blocks/environment/ore-beryllium2.png new file mode 100644 index 0000000000000000000000000000000000000000..8f1d546d2c3d6620dd5e1d0888935e2ea82ebc86 GIT binary patch literal 328 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}jKx9jP7LeL$-HD>U}W-i zaSVxQeH*%ymswHZiB5S@Yykg9&%6T%O&gxvU=;{%*TYp^Iv~&d#AMTl!Lb2X_juD&hrM2LWUm&E`R*9%eLKTfy%la$Bu-0 zH5^e4IJh_ANm*fsr|P}mZBi?I0}f646#br0*jc5|V#<889Vx5^g1r@tw;lX@qRVuw zUj=e43}F<~d*&)SAtCyE>t(}7o*J^d_kOtM-X7L)`MAi6ISuxj3k4=ue2IErboynU z!cJy4{e?_{9MuaCv0d4~_*Qm-*@dop;RTF&^4X4T9ahP?9FZv}TEgx~q=}yqn8o%w h_S&|4o%0W|8(PeGEWBzU^wmR z;usRq`gZb0-a`&NuCif?-DjM8k1&bo2xyuz2N=6-Tae1T!mmj0e!BD=laH%~G|T_b zt?$$DoRspuBs<4y-@5sqYV7XKl6=TyGe^0zh0EiiZs*~!hb}IE3!-X-)e@FY<5+p1 z=-2Vjw$=0XzU#R>m|mc_v5GaQ!f{T+bG^ly83)gD?J3_Gm(JVH6jX6@ivBc*>t|IK zv@Yh|BlI=utGdhMD}E78I*W`OcO|d&=8j?FbaeJ_|Ieh|!E+&lZK0>j>7D8ekD c)2{EmF{knG^}Saa7#J8lUHx3vIVCg!0ABEI5C8xG literal 0 HcmV?d00001 diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index 42c465dcf0..9237ae8fa7 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -544,3 +544,4 @@ 63159=core-zone|block-core-zone-ui 63158=fabricator|block-fabricator-ui 63157=stell|unit-stell-ui +63156=ore-beryllium|block-ore-beryllium-ui diff --git a/core/src/mindustry/ai/types/CommandAI.java b/core/src/mindustry/ai/types/CommandAI.java index ee85c18074..2e59927e7b 100644 --- a/core/src/mindustry/ai/types/CommandAI.java +++ b/core/src/mindustry/ai/types/CommandAI.java @@ -1,6 +1,8 @@ package mindustry.ai.types; +import arc.math.*; import arc.math.geom.*; +import arc.struct.*; import arc.util.*; import mindustry.*; import mindustry.ai.*; @@ -9,12 +11,14 @@ import mindustry.gen.*; import mindustry.world.*; public class CommandAI extends AIController{ - static Vec2 vecOut = new Vec2(); + private static final float localInterval = 30f; + private static final Vec2 vecOut = new Vec2(); public @Nullable Vec2 targetPos; public @Nullable Teamc attackTarget; private int pathId = -1; + private Seq local = new Seq<>(false); @Override public void updateUnit(){ @@ -26,6 +30,17 @@ public class CommandAI extends AIController{ targetPos = null; } + if(targetPos != null){ + if(timer.get(timerTarget3, localInterval)){ + local.clear(); + float size = unit.hitSize * 3f; + unit.team.data().tree().intersect(unit.x - size / 2f, unit.y - size/2f, size, size, local); + } + }else{ + //make sure updates are staggered randomly + timer.reset(timerTarget3, Mathf.random(localInterval)); + } + if(attackTarget != null){ if(targetPos == null) targetPos = new Vec2(); targetPos.set(attackTarget); diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index b68aff3c3d..2f815b6cf2 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -60,10 +60,10 @@ public class Blocks{ //ores oreCopper, oreLead, oreScrap, oreCoal, oreTitanium, oreThorium, - oreTungsten, oreCrystalThorium, wallOreThorium, + oreBeryllium, oreTungsten, oreCrystalThorium, wallOreThorium, //wall ores - wallOreBeryl, graphiticWall, wallOreTungsten, + wallOreBeryllium, graphiticWall, wallOreTungsten, //crafting siliconSmelter, siliconCrucible, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer, @@ -823,6 +823,8 @@ public class Blocks{ oreScale = 25.380953f; }}; + oreBeryllium = new OreBlock(Items.beryllium); + oreTungsten = new OreBlock(Items.tungsten); oreCrystalThorium = new OreBlock("ore-crystal-thorium", Items.thorium); @@ -831,7 +833,7 @@ public class Blocks{ wallOre = true; }}; - wallOreBeryl = new OreBlock("ore-wall-beryllium", Items.beryllium){{ + wallOreBeryllium = new OreBlock("ore-wall-beryllium", Items.beryllium){{ wallOre = true; }}; diff --git a/core/src/mindustry/maps/planet/AsteroidGenerator.java b/core/src/mindustry/maps/planet/AsteroidGenerator.java index 09112f83f3..959d1564e5 100644 --- a/core/src/mindustry/maps/planet/AsteroidGenerator.java +++ b/core/src/mindustry/maps/planet/AsteroidGenerator.java @@ -116,7 +116,7 @@ public class AsteroidGenerator extends BlankPlanetGenerator{ wallOre(Blocks.carbonWall, Blocks.graphiticWall, 35f, 0.57f * graphiteScale); - wallOre(Blocks.beryllicStoneWall, Blocks.wallOreBeryl, 50f, 0.62f * berylliumScale); + wallOre(Blocks.beryllicStoneWall, Blocks.wallOreBeryllium, 50f, 0.62f * berylliumScale); //titanium pass((x, y) -> { diff --git a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java index fa207636f2..7c606678e7 100644 --- a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java @@ -277,7 +277,7 @@ public class ErekirPlanetGenerator extends PlanetGenerator{ if(block == Blocks.carbonWall && noise(x + 78, y, 4, 0.7f, 33f, 1f) > 0.52f){ block = Blocks.graphiticWall; }else if(block != Blocks.carbonWall && noise(x + 782, y, 4, 0.8f, 38f, 1f) > 0.665f){ - ore = Blocks.wallOreBeryl; + ore = Blocks.wallOreBeryllium; } }