diff --git a/README.md b/README.md index 81525383..3f16b47d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # Expanded Industries -Current version - 1.7 Build 1\ -Some content for people to enjoy! +Current version - 1.7 Build 2 (Preview build)\ +Some content for people to enjoy!\ +\ +Special thanks to Siede for making the WhitelistDrill class :D diff --git a/assets/bundles/bundle.properties b/assets/bundles/bundle.properties index 2751facc..591b0fe8 100644 --- a/assets/bundles/bundle.properties +++ b/assets/bundles/bundle.properties @@ -41,54 +41,48 @@ unit.ei-centurion.name = Centurion unit.ei-centurion.description = Harvests resources. Heals units within range.\nCan mine titanium. unit.ei-alturion.name = Alturion unit.ei-alturion.description = Harvests resources. Heals units within range.\nCan mine thorium. -unit.ei-stormer.name = Stormer -unit.ei-stormer.description = Fires piercing laser beams that damage enemy targets and repair allied structures. Can step over most terrain. -unit.ei-rusher.name = Rusher -unit.ei-rusher.description = Fires piercing laser beams and artillery shells at enemies. Can step over most terrain. +unit.ei-agrid.name = Agrid +unit.ei-agrid.description = Fires piercing laser beams that damage enemy targets and repair allied structures. Can step over most terrain. +unit.ei-xerad.name = Xerad +unit.ei-xerad.description = Fires piercing laser beams and artillery shells at enemies. Can step over most terrain. unit.ei-escapade.name = Escapade unit.ei-escapade.description = Fires piercing laser beams and artillery shells at enemies. Can step over most terrain. unit.ei-natorin.name = Natorin unit.ei-natorin.description = Fires continuous laser beams at enemies. Pierces through armor and sets on fire. Can step over most terrain. unit.ei-terrand.name = Terrand unit.ei-terrand.description = Fires charged energy projectiles, shrapnel artillery shells and continuous laser beams.\nPierces through armor, does not pierce through buildings. Can step over most terrain. -unit.ei-small-boi.name = SmolBoi -unit.ei-small-boi.description = Carries small amounts of items. Explodes nearby enemies. -unit.ei-medium-boi.name = MediumBoi -unit.ei-medium-boi.description = Carries mediocre amounts of items. Explodes nearby enemies. -unit.ei-large-boi.name = LargeBoi -unit.ei-large-boi.description = Carries large amounts of items. Explodes nearby enemies. Produces SmolBois. -unit.ei-payload-boi.name = PayloadBoi -unit.ei-payload-boi.description = Carries massive amounts of items. Can carry payload. unit.ei-pygmy.name = Pygmy unit.ei-pygmy.description = Fires homing bullets at enemies. Steals health on hit. unit.ei-schaus.name = Schaus unit.ei-schaus.description = Fires homing bullets in all directions. Steals health on hit. unit.ei-ageronia.name = Ageronia unit.ei-ageronia.description = Fires homing interval bullets at enemies. Steals health on hit. -unit.ei-breadnight.name = BreadNight +unit.ei-requer.name = Requer unit.ei-breadnight.description = Fires standard bullets and laser beams at enemies. Boosts damaged allies. Disables enemy unit weapons. -unit.ei-toastnight.name = ToastNight +unit.ei-convoy.name = Convoy unit.ei-toastnight.description = Fires salvos of bullets at enemies. Boosts damaged allies. Disables enemy unit weapons. unit.ei-piece.name = Piece unit-ei-piece.description = Defends the Frag core from enemies. Builds structures. unit.ei-guardian.name = Guardian unit.ei-guardian.description = Defends the Extensio core from enemies. Builds structures. +unit.ei-creo.name = Creo +unit.ei-creo.description = Seeks out damaged allies to heal them. Can heal structures. #turrets -block.ei-exagon-altillery.name = Exagon Artillery +block.ei-hexagon.name = Hexagon block.ei-exagon-altillery.description = Fires frag artillery bullets at enemies. Especially effective against structures. block.ei-anado.name = Anado block.ei-anado.description = Fires frag bullets at enemies. block.ei-deuse.name = Deuse block.ei-deuse.description = Fires salvos of frag bullets at enemies. -block.ei-fastray.name = Fastray -block.ei-fastray.description = Fires charged energy projectiles that persist on hit. +block.ei-underglow.name = Underglow +block.ei-underglow.description = Fires charged energy projectiles that persist on hit. block.ei-piercer.name = Piercer -block.ei-piercer.description = Fires charged energy projectiles that release multiple lasers. Pierces. Cannot target air. -block.ei-slowray.name = Slowray -block.ei-slowray.description = Fires charged energy projectiles that create damage fields. +block.ei-piercer.description = Fires charged energy projectiles that release multiple lasers.\nPierces. Cannot target air. +block.ei-cavern.name = Cavern +block.ei-cavern.description = Fires crowd control projectiles that create damaging fields on hit. block.ei-enforcer.name = Enforcer -block.ei-enforcer.description = Fires charged energy projectiles that release arcs of electricity at enemy targets. +block.ei-enforcer.description = Fires crowd control projectiles that release arcs of electricity at enemy targets. block.ei-renoit.name = Renoit block.ei-renoit.description = Fires liquids at enemies. Can fire dense liquids. @@ -236,32 +230,51 @@ block.ei-reinforced-solar-panel.description = Provides a small amount of power f #Lequi #items item.ei-teranite.name = Teranite +item-ei.amethyst.name = Amethyst #environment +block.ei-amethyst-crystal.name = Amethyst Crystal block.ei-ionite.name = Ionite block.ei-ionite-wall.name = Ionite Wall block.ei-crayone.name = Crayone block.ei-crayone-wall.name = Crayone Wall block.ei-crayone-vent.name = Crayone Vent -#unfinished -item.ei-neorium.name = Unfinished -item.ei-xenite.name = Unfinished -item.ei-ion.name = Unfinished -liquid.ei-cryoplasm.name = Unfinished -block.ei-xeniteFloor.name = Unfinished -block.ei-xeniteWall.name = Unfinished -block.ei-arcaniteFloor.name = Unfinished -block.ei-arcaniteWall.name = Unfinished -block.ei-arcaniteVent.name = Unfinished +#drills +blocks.ei-crystal-cutter.name = [P] Crystal Cutter +blocks.ei-crystal-cutter.description = Cuts off chunks of crystals. -#abilities -ability.ei-overload = Overload Field: [accent]{0}[] blocks ~ [accent]{1}[]s every [accent]{2}[]s +#other +block.ei-core-ark.name = [P] Core Ark +block.ei-core-ark.description = Core of the base. Warms up units within range. + +#universal +#commands +command.heal-units.name = Repair Units #statuses status.ei-lockdown.name = Lockdown status.ei-sticky.name = Sticky status.ei-overload.name = Overload +status.ei-frozen.name = Frozen +status.ei-warm.name = Warm + +#abilities +ability.ei-overload = Overload Field: [accent]{0}[] blocks ~ [accent]{1}[]s every [accent]{2}[]s + +#weathers +weather.ei-hailstorm.name = [P] Hailstorm + +#unfinished +item.ei-neorium.name = [U] Neorium +item.ei-xenite.name = [U] Xenite +item.ei-ion.name = [U] Ion +liquid.ei-cryoplasm.name = [U] Cryoplasm +block.ei-xeniteFloor.name = [U] Xenite Floor +block.ei-xeniteWall.name = [U] Xenite Wall +block.ei-arcaniteFloor.name = [U] Acranite Floor +block.ei-arcaniteWall.name = [U] Arcanite Wall +block.ei-arcaniteVent.name = [U] Arcanite Vent #templates for things #block.ei- diff --git a/assets/mod.hjson b/assets/mod.hjson index 6613c0d5..cf8e227c 100644 --- a/assets/mod.hjson +++ b/assets/mod.hjson @@ -3,7 +3,7 @@ name: "EI" author: "WMF Industries" main: "ExpandedIndustries.ExpandedIndustries" description: "Some content for people to enjoy :> --Current version : 1.7 [B1]" -version: "1.7 [B1]" +-Current version : 1.7 [B2]" +version: "1.7 [B2]" minGameVersion: 145 java: true \ No newline at end of file diff --git a/assets/sprites/blocks/defence/slowray.png b/assets/sprites/blocks/defence/cavern.png similarity index 100% rename from assets/sprites/blocks/defence/slowray.png rename to assets/sprites/blocks/defence/cavern.png diff --git a/assets/sprites/blocks/defence/exagon-altillery-outline.png b/assets/sprites/blocks/defence/hexagon-outline.png similarity index 100% rename from assets/sprites/blocks/defence/exagon-altillery-outline.png rename to assets/sprites/blocks/defence/hexagon-outline.png diff --git a/assets/sprites/blocks/defence/exagon-altillery.png b/assets/sprites/blocks/defence/hexagon.png similarity index 100% rename from assets/sprites/blocks/defence/exagon-altillery.png rename to assets/sprites/blocks/defence/hexagon.png diff --git a/assets/sprites/blocks/defence/fastray.png b/assets/sprites/blocks/defence/underglow.png similarity index 100% rename from assets/sprites/blocks/defence/fastray.png rename to assets/sprites/blocks/defence/underglow.png diff --git a/assets/sprites/blocks/effect/core-ark-team.png b/assets/sprites/blocks/effect/core-ark-team.png new file mode 100644 index 00000000..6a34bde3 Binary files /dev/null and b/assets/sprites/blocks/effect/core-ark-team.png differ diff --git a/assets/sprites/blocks/effect/core-ark.png b/assets/sprites/blocks/effect/core-ark.png new file mode 100644 index 00000000..d1fe947b Binary files /dev/null and b/assets/sprites/blocks/effect/core-ark.png differ diff --git a/assets/sprites/blocks/environment/amethyst-crystal.png b/assets/sprites/blocks/environment/amethyst-crystal.png new file mode 100644 index 00000000..b6ee902c Binary files /dev/null and b/assets/sprites/blocks/environment/amethyst-crystal.png differ diff --git a/assets/sprites/blocks/environment/ore/amethyst1.png b/assets/sprites/blocks/environment/ore/amethyst1.png new file mode 100644 index 00000000..0648d6ca Binary files /dev/null and b/assets/sprites/blocks/environment/ore/amethyst1.png differ diff --git a/assets/sprites/blocks/environment/ore/amethyst2.png b/assets/sprites/blocks/environment/ore/amethyst2.png new file mode 100644 index 00000000..4f0033d2 Binary files /dev/null and b/assets/sprites/blocks/environment/ore/amethyst2.png differ diff --git a/assets/sprites/blocks/environment/ore/amethyst3.png b/assets/sprites/blocks/environment/ore/amethyst3.png new file mode 100644 index 00000000..e1eb6024 Binary files /dev/null and b/assets/sprites/blocks/environment/ore/amethyst3.png differ diff --git a/assets/sprites/blocks/extraction/crysta-cutter-top.png b/assets/sprites/blocks/extraction/crysta-cutter-top.png new file mode 100644 index 00000000..fdf950d0 Binary files /dev/null and b/assets/sprites/blocks/extraction/crysta-cutter-top.png differ diff --git a/assets/sprites/blocks/extraction/crystal-cutter-rotator.png b/assets/sprites/blocks/extraction/crystal-cutter-rotator.png new file mode 100644 index 00000000..95739813 Binary files /dev/null and b/assets/sprites/blocks/extraction/crystal-cutter-rotator.png differ diff --git a/assets/sprites/blocks/extraction/crystal-cutter.png b/assets/sprites/blocks/extraction/crystal-cutter.png new file mode 100644 index 00000000..1170b28f Binary files /dev/null and b/assets/sprites/blocks/extraction/crystal-cutter.png differ diff --git a/assets/sprites/icons/repair.png b/assets/sprites/icons/repair.png new file mode 100644 index 00000000..83b1c27f Binary files /dev/null and b/assets/sprites/icons/repair.png differ diff --git a/assets/sprites/items/amethyst.png b/assets/sprites/items/amethyst.png new file mode 100644 index 00000000..18b1873c Binary files /dev/null and b/assets/sprites/items/amethyst.png differ diff --git a/assets/sprites/statuses/frozen.png b/assets/sprites/statuses/frozen.png new file mode 100644 index 00000000..48385048 Binary files /dev/null and b/assets/sprites/statuses/frozen.png differ diff --git a/assets/sprites/statuses/warm.png b/assets/sprites/statuses/warm.png new file mode 100644 index 00000000..85ab1648 Binary files /dev/null and b/assets/sprites/statuses/warm.png differ diff --git a/assets/sprites/units/stormer-cell.png b/assets/sprites/units/agrid-cell.png similarity index 100% rename from assets/sprites/units/stormer-cell.png rename to assets/sprites/units/agrid-cell.png diff --git a/assets/sprites/units/rusher-foot.png b/assets/sprites/units/agrid-foot.png similarity index 100% rename from assets/sprites/units/rusher-foot.png rename to assets/sprites/units/agrid-foot.png diff --git a/assets/sprites/units/rusher-joint.png b/assets/sprites/units/agrid-joint.png similarity index 100% rename from assets/sprites/units/rusher-joint.png rename to assets/sprites/units/agrid-joint.png diff --git a/assets/sprites/units/rusher-leg-base.png b/assets/sprites/units/agrid-leg-base.png similarity index 100% rename from assets/sprites/units/rusher-leg-base.png rename to assets/sprites/units/agrid-leg-base.png diff --git a/assets/sprites/units/rusher-leg.png b/assets/sprites/units/agrid-leg.png similarity index 100% rename from assets/sprites/units/rusher-leg.png rename to assets/sprites/units/agrid-leg.png diff --git a/assets/sprites/units/stormer.png b/assets/sprites/units/agrid.png similarity index 100% rename from assets/sprites/units/stormer.png rename to assets/sprites/units/agrid.png diff --git a/assets/sprites/units/breadnight-base.png b/assets/sprites/units/convoy-base.png similarity index 100% rename from assets/sprites/units/breadnight-base.png rename to assets/sprites/units/convoy-base.png diff --git a/assets/sprites/units/toastnight-cell.png b/assets/sprites/units/convoy-cell.png similarity index 100% rename from assets/sprites/units/toastnight-cell.png rename to assets/sprites/units/convoy-cell.png diff --git a/assets/sprites/units/breadnight-leg.png b/assets/sprites/units/convoy-leg.png similarity index 100% rename from assets/sprites/units/breadnight-leg.png rename to assets/sprites/units/convoy-leg.png diff --git a/assets/sprites/units/toastnight.png b/assets/sprites/units/convoy.png similarity index 100% rename from assets/sprites/units/toastnight.png rename to assets/sprites/units/convoy.png diff --git a/assets/sprites/units/creo-cell.png b/assets/sprites/units/creo-cell.png new file mode 100644 index 00000000..e38a0184 Binary files /dev/null and b/assets/sprites/units/creo-cell.png differ diff --git a/assets/sprites/units/creo.png b/assets/sprites/units/creo.png new file mode 100644 index 00000000..8b72a202 Binary files /dev/null and b/assets/sprites/units/creo.png differ diff --git a/assets/sprites/units/toastnight-base.png b/assets/sprites/units/requer-base.png similarity index 100% rename from assets/sprites/units/toastnight-base.png rename to assets/sprites/units/requer-base.png diff --git a/assets/sprites/units/breadnight-cell.png b/assets/sprites/units/requer-cell.png similarity index 100% rename from assets/sprites/units/breadnight-cell.png rename to assets/sprites/units/requer-cell.png diff --git a/assets/sprites/units/toastnight-leg.png b/assets/sprites/units/requer-leg.png similarity index 100% rename from assets/sprites/units/toastnight-leg.png rename to assets/sprites/units/requer-leg.png diff --git a/assets/sprites/units/breadnight.png b/assets/sprites/units/requer.png similarity index 100% rename from assets/sprites/units/breadnight.png rename to assets/sprites/units/requer.png diff --git a/assets/sprites/units/stormer-foot.png b/assets/sprites/units/stormer-foot.png deleted file mode 100644 index cb2348f9..00000000 Binary files a/assets/sprites/units/stormer-foot.png and /dev/null differ diff --git a/assets/sprites/units/stormer-joint.png b/assets/sprites/units/stormer-joint.png deleted file mode 100644 index 05487945..00000000 Binary files a/assets/sprites/units/stormer-joint.png and /dev/null differ diff --git a/assets/sprites/units/stormer-leg-base.png b/assets/sprites/units/stormer-leg-base.png deleted file mode 100644 index df93d2d3..00000000 Binary files a/assets/sprites/units/stormer-leg-base.png and /dev/null differ diff --git a/assets/sprites/units/stormer-leg.png b/assets/sprites/units/stormer-leg.png deleted file mode 100644 index b4ffb9cb..00000000 Binary files a/assets/sprites/units/stormer-leg.png and /dev/null differ diff --git a/assets/sprites/units/weapons/stormer-weapon.png b/assets/sprites/units/weapons/agrid-weapon.png similarity index 100% rename from assets/sprites/units/weapons/stormer-weapon.png rename to assets/sprites/units/weapons/agrid-weapon.png diff --git a/assets/sprites/units/weapons/toastnight-weapon.png b/assets/sprites/units/weapons/convoy-weapon.png similarity index 100% rename from assets/sprites/units/weapons/toastnight-weapon.png rename to assets/sprites/units/weapons/convoy-weapon.png diff --git a/assets/sprites/units/weapons/breadnight-laser.png b/assets/sprites/units/weapons/requer-laser.png similarity index 100% rename from assets/sprites/units/weapons/breadnight-laser.png rename to assets/sprites/units/weapons/requer-laser.png diff --git a/assets/sprites/units/weapons/breadnight-weapon.png b/assets/sprites/units/weapons/requer-weapon.png similarity index 100% rename from assets/sprites/units/weapons/breadnight-weapon.png rename to assets/sprites/units/weapons/requer-weapon.png diff --git a/assets/sprites/units/weapons/rusher-weapon.png b/assets/sprites/units/weapons/rusher-weapon.png deleted file mode 100644 index 5455fea9..00000000 Binary files a/assets/sprites/units/weapons/rusher-weapon.png and /dev/null differ diff --git a/assets/sprites/units/weapons/rusher-artillery.png b/assets/sprites/units/weapons/xerad-artillery.png similarity index 100% rename from assets/sprites/units/weapons/rusher-artillery.png rename to assets/sprites/units/weapons/xerad-artillery.png diff --git a/assets/sprites/units/weapons/xerad-weapon.png b/assets/sprites/units/weapons/xerad-weapon.png new file mode 100644 index 00000000..265ebf62 Binary files /dev/null and b/assets/sprites/units/weapons/xerad-weapon.png differ diff --git a/assets/sprites/units/rusher-cell.png b/assets/sprites/units/xerad-cell.png similarity index 100% rename from assets/sprites/units/rusher-cell.png rename to assets/sprites/units/xerad-cell.png diff --git a/assets/sprites/units/rusher.png b/assets/sprites/units/xerad.png similarity index 100% rename from assets/sprites/units/rusher.png rename to assets/sprites/units/xerad.png diff --git a/build.gradle b/build.gradle index 748f7e5a..9b103714 100644 --- a/build.gradle +++ b/build.gradle @@ -9,12 +9,14 @@ sourceSets.main.java.srcDirs = ["src"] repositories{ mavenCentral() + + maven{ url "https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository" } maven{ url 'https://www.jitpack.io' } } ext{ //the build number that this mod is made for - mindustryVersion = '145.1' + mindustryVersion = 'v146' jabelVersion = "93fde537c7" sdkRoot = System.getenv("ANDROID_HOME") ?: System.getenv("ANDROID_SDK_ROOT") } diff --git a/src/ExpandedIndustries/ExpandedIndustries.java b/src/ExpandedIndustries/ExpandedIndustries.java index 753c815d..1c5985df 100644 --- a/src/ExpandedIndustries/ExpandedIndustries.java +++ b/src/ExpandedIndustries/ExpandedIndustries.java @@ -20,7 +20,7 @@ public void loadContent(){ loadAllContent(); - Log.info("EI loaded."); + Log.info("Expanded Industries initialized successfully :D"); } private void loadAllContent() { @@ -31,9 +31,10 @@ private void loadAllContent() { EIBullets.load(); EIUnits.load(); EIBlocks.load(); + EIWeathers.load(); EITechTree.load(); EILoadouts.load(); - Log.info("Loading content complete."); + Log.info("Loading content complete!"); } } diff --git a/src/ExpandedIndustries/ai/EICommands.java b/src/ExpandedIndustries/ai/EICommands.java new file mode 100644 index 00000000..d0b4f74c --- /dev/null +++ b/src/ExpandedIndustries/ai/EICommands.java @@ -0,0 +1,9 @@ +package ExpandedIndustries.ai; + +import ExpandedIndustries.ai.types.RepairUnitAI; +import mindustry.ai.UnitCommand; + +public class EICommands{ + public static final UnitCommand + healUnitsCommand = new UnitCommand("heal-units", "units", u -> new RepairUnitAI()); +} \ No newline at end of file diff --git a/src/ExpandedIndustries/ai/types/RepairUnitAI.java b/src/ExpandedIndustries/ai/types/RepairUnitAI.java new file mode 100644 index 00000000..62f8289f --- /dev/null +++ b/src/ExpandedIndustries/ai/types/RepairUnitAI.java @@ -0,0 +1,34 @@ +package ExpandedIndustries.ai.types; + +import arc.util.*; +import mindustry.entities.*; +import mindustry.entities.units.*; +import mindustry.gen.*; +import mindustry.world.meta.BlockFlag; + + +public class RepairUnitAI extends AIController { + public static float retreatDelay = Time.toSeconds * 3f; + private float retreatTimer; + + @Override + public void updateTargeting() { + target = Units.closest(unit.team, unit.x, unit.y, Unit::damaged); + } + + @Override + public void updateMovement(){ + if(target != null){ + if(!unit.within(target, unit.type.range)){ + moveTo(target, unit.type.range * 0.9f , 50f); + unit.controlWeapons(true); + }else unit.controlWeapons(false); + unit.lookAt(target); + retreatTimer = 0f; + }else if((retreatTimer += Time.delta) >= retreatDelay){ + var retreatTarget = targetFlag(unit.x, unit.y, BlockFlag.repair, false); + if(retreatTarget == null) retreatTarget = unit.closestCore(); + moveTo(retreatTarget, (unit.type.range / 2)); + } + } +} diff --git a/src/ExpandedIndustries/content/EIBlocks.java b/src/ExpandedIndustries/content/EIBlocks.java index c98c49a7..2b69444e 100644 --- a/src/ExpandedIndustries/content/EIBlocks.java +++ b/src/ExpandedIndustries/content/EIBlocks.java @@ -1,6 +1,9 @@ package ExpandedIndustries.content; +import ExpandedIndustries.world.blocks.environment.PropOre; import ExpandedIndustries.world.blocks.power.OverheatSolarGenerator; +import ExpandedIndustries.world.blocks.production.WhitelistDrill; +import ExpandedIndustries.world.blocks.storage.StatusCore; import arc.Core; import arc.graphics.*; import arc.math.*; @@ -28,8 +31,10 @@ import mindustry.world.draw.*; import mindustry.world.meta.*; +import java.beans.Visibility; + import static ExpandedIndustries.content.EIUnits.*; -import static mindustry.Vars.tilesize; +import static mindustry.Vars.*; import static mindustry.content.Fx.none; import static mindustry.type.ItemStack.with; @@ -38,7 +43,7 @@ public class EIBlocks { public static Block //environment - flower, orePeridotium, oreStarium, oreNeorium, oreTeranite, ion, + flower, orePeridotium, oreStarium, oreNeorium, oreTeranite, ion, propAmethyst, oreAmethyst, crayoneFloor, crayoneWall, crayoneVent, ioniteFloor, ioniteWall, xeniteFloor, xeniteWall, arcaniteFloor, arcaniteWall, arcaniteVent, grassWater, liquidReurium, cryoplasm, //distribution @@ -47,7 +52,7 @@ public class EIBlocks { //storage crate, //extraction - electricDrill, precisionDrill, hammerDrill, hugePlasmaBore, largeCliffCrusher, + electricDrill, precisionDrill, hammerDrill, hugePlasmaBore, largeCliffCrusher, crystalCutter, //production cryofluidPlant, cryofluidStirrer, oxygenLiquifier, coalLiquifier, oilCrystaliser, freezer, oilPurifier, heavyOilRefinery, fuelAssembler, siliconFabricator, @@ -58,10 +63,10 @@ public class EIBlocks { //logic controllerProcessor, armProcessor, threadripperProcessor, //other - coreFrag, coreExtensio, microPad, planetaryMender, planetaryOverdrive, hardenedUnloader, advancedUnloader, + coreFrag, coreExtensio, coreArk, microPad, planetaryMender, planetaryOverdrive, hardenedUnloader, advancedUnloader, //defense stariumWall, largeStariumWall, graphiteWall, largeGraphiteWall, anado, deuse, - exagonArtillery, slowRay, fastRay, piercer, enforcer, renoit, raven, region, + hexagon, cavern, underglow, piercer, enforcer, renoit, raven, region, //factories & recons groundFactory, airFactory, starruneReconstructor, eraniteReconstructor, ultraReconstructor, terraReconstructor, @@ -69,7 +74,6 @@ public class EIBlocks { overkillAssembler; public static void load() { - crayoneFloor = new Floor("crayone") {{ variants = 4; mapColor = Color.valueOf("853399"); @@ -129,9 +133,21 @@ public static void load() { attributes.set(Attribute.steam, 1f); }}; + propAmethyst = new Prop("amethyst-crystal"){{ + breakable = false; + alwaysReplace = false; + solid = true; + + cacheLayer = CacheLayer.normal; + buildVisibility = BuildVisibility.hidden; + }}; + oreAmethyst = new PropOre("ore-amethyst", EIItems.amethyst){{ + parent = propAmethyst; + blendGroup = crayoneFloor; + }}; grassWater = new Floor("grass-water") {{ shallow = supportsOverlay = isLiquid = placeableOn = true; - editorIcon = Core.atlas.find(name + "1"); + if(net.client()) editorIcon = Core.atlas.find(name + "1"); liquidDrop = Liquids.water; liquidMultiplier = 0.75f; @@ -469,6 +485,18 @@ public static void load() { consumeLiquid(Liquids.hydrogen, 3f / 60f); requirements(Category.production, with(Items.silicon, 70, Items.tungsten, 90, Items.beryllium, 80)); }}; + crystalCutter = new WhitelistDrill("crystal-cutter"){{ + hasLiquids = hasPower = false; + + itemsWhitelisted = Seq.with(EIItems.amethyst); + drillTime = 360; + size = 5; + liquidBoostIntensity = 1; + + rotateSpeed = 3.7f; + + requirements(Category.production, BuildVisibility.sandboxOnly, with(EIItems.neorium, 1)); + }}; siliconFabricator = new AttributeCrafter("silicon-fabricator") {{ hasPower = true; hasLiquids = false; @@ -844,6 +872,16 @@ public static void load() { requirements(Category.effect, with(Items.copper, 18000, Items.lead, 18000, Items.silicon, 10500, Items.thorium, 7000, Items.surgeAlloy, 1025)); }}; + coreArk = new StatusCore("core-ark"){{ + isFirstTier = alwaysUnlocked = true; + + unitType = piece; + health = 7000; + itemCapacity = 3500; + size = 4; + unitCapModifier = 8; + requirements(Category.effect, BuildVisibility.campaignOnly, with(EIItems.neorium, 1500, EIItems.xenite, 1000)); + }}; microPad = new LaunchPad("micro-pad") {{ hasPower = true; @@ -1068,7 +1106,7 @@ Items.plastanium, new BasicBulletType(4.5f, 29) {{ limitRange(); requirements(Category.turret, with(Items.lead, 130, Items.copper, 70, Items.silicon, 60, Items.titanium, 40)); }}; - exagonArtillery = new ItemTurret("exagon-altillery") {{ + hexagon = new ItemTurret("hexagon") {{ ammo( Items.surgeAlloy, new ArtilleryBulletType(5f, 42) {{ collidesTiles = collidesAir = false; @@ -1132,7 +1170,7 @@ EIItems.stariumAlloy, new ArtilleryBulletType(5f, 60) {{ limitRange(0f); requirements(Category.turret, with(Items.copper, 360, Items.lead, 290, Items.silicon, 220, Items.titanium, 160, Items.plastanium, 130, Items.surgeAlloy, 90)); }}; - slowRay = new PowerTurret("slowray") {{ + cavern = new PowerTurret("cavern") {{ moveWhileCharging = false; range = 230; @@ -1685,7 +1723,7 @@ EIItems.stariumAlloy, new ArtilleryBulletType(5f, 60) {{ } }; }}; - fastRay = new PowerTurret("fastray") {{ + underglow = new PowerTurret("underglow") {{ range = 210; coolantMultiplier = 1.1f; recoil = 7; @@ -1995,7 +2033,6 @@ EIItems.stariumAlloy, new ArtilleryBulletType(5f, 60) {{ colorTo = Color.valueOf("84f491"); }}, new ParticleEffect() {{ - startDelay(30); line = true; lenFrom = 4; lenTo = 5; @@ -2121,8 +2158,8 @@ EILiquids.reurium, new LiquidBulletType(EILiquids.reurium){{ requirements(Category.units, with(Items.copper, 90, Items.silicon, 70, Items.titanium, 50)); plans = Seq.with( - new UnitPlan(stormer, 60f * 10, with(Items.silicon, 30, Items.titanium, 10)), - new UnitPlan(breadnight, 60f * 15, with(Items.silicon, 25, Items.graphite, 20)) + new UnitPlan(agrid, 60f * 10, with(Items.silicon, 30, Items.titanium, 10)), + new UnitPlan(requer, 60f * 15, with(Items.silicon, 25, Items.graphite, 20)) ); }}; airFactory = new UnitFactory("air-factory"){{ @@ -2133,7 +2170,7 @@ EILiquids.reurium, new LiquidBulletType(EILiquids.reurium){{ plans = Seq.with( new UnitPlan(pygmy, 60f * 15, with(Items.silicon, 25, Items.graphite, 10)), - new UnitPlan(SmolBoi, 60f * 10, with(Items.silicon, 30, Items.titanium, 15)) + new UnitPlan(creo, 60f * 25, with(Items.silicon, 25, Items.titanium, 20)) ); }}; starruneReconstructor = new Reconstructor("starrune-reconstructor"){{ @@ -2145,11 +2182,10 @@ EILiquids.reurium, new LiquidBulletType(EILiquids.reurium){{ requirements(Category.units, with(Items.copper, 200, Items.lead, 120, Items.silicon, 90, Items.graphite, 70)); upgrades.addAll( - new UnitType[]{stormer, rusher}, - new UnitType[]{breadnight, toastnight}, + new UnitType[]{agrid, xerad}, + new UnitType[]{requer, convoy}, new UnitType[]{pygmy, schaus}, - new UnitType[]{UnitTypes.mono, centurion}, - new UnitType[]{SmolBoi, MediumBoi} + new UnitType[]{UnitTypes.mono, centurion} ); }}; eraniteReconstructor = new Reconstructor("eranite-reconstructor"){{ @@ -2161,10 +2197,9 @@ EILiquids.reurium, new LiquidBulletType(EILiquids.reurium){{ requirements(Category.units, with(Items.lead, 650, Items.silicon, 450, Items.titanium, 350, Items.thorium, 650, EIItems.starium, 250)); upgrades.addAll( - new UnitType[]{rusher, escapade}, + new UnitType[]{xerad, escapade}, new UnitType[]{schaus, ageronia}, - new UnitType[]{centurion, alturion}, - new UnitType[]{MediumBoi, LargeBoi} + new UnitType[]{centurion, alturion} ); }}; ultraReconstructor = new Reconstructor("ultra-reconstructor"){{ @@ -2177,8 +2212,7 @@ EILiquids.reurium, new LiquidBulletType(EILiquids.reurium){{ requirements(Category.units, with(Items.lead, 2000, Items.silicon, 1000, Items.titanium, 2000, Items.thorium, 750, Items.plastanium, 450, EIItems.enhancedPeridotium, 600, EIItems.starium, 400)); upgrades.addAll( - new UnitType[]{escapade, natorin}, - new UnitType[]{LargeBoi, PayloadBoi} + new UnitType[]{escapade, natorin} ); }}; terraReconstructor = new Reconstructor("terra-reconstructor"){{ diff --git a/src/ExpandedIndustries/content/EIItems.java b/src/ExpandedIndustries/content/EIItems.java index 4f30d14b..27c27bea 100644 --- a/src/ExpandedIndustries/content/EIItems.java +++ b/src/ExpandedIndustries/content/EIItems.java @@ -4,7 +4,7 @@ import mindustry.type.*; public class EIItems { - public static Item starium, peridotium, lumium, stariumAlloy, enhancedPeridotium, ice, solidFuel, neorium, teranite, xenite, ion; + public static Item starium, peridotium, lumium, stariumAlloy, enhancedPeridotium, ice, solidFuel, neorium, teranite, xenite, ion, amethyst; public static void load(){ starium = new Item("starium", Color.valueOf("4c4379")){{ @@ -54,5 +54,8 @@ public static void load(){ }}; ion = new Item("ion"); + amethyst = new Item("amethyst"){{ + hardness = Integer.MAX_VALUE; + }}; } } diff --git a/src/ExpandedIndustries/content/EILoadouts.java b/src/ExpandedIndustries/content/EILoadouts.java index 66b7a7b5..bbec90e5 100644 --- a/src/ExpandedIndustries/content/EILoadouts.java +++ b/src/ExpandedIndustries/content/EILoadouts.java @@ -6,9 +6,6 @@ public class EILoadouts{ public static Schematic basicFrag; - public EILoadouts(){ - } - public static void load() { basicFrag = Schematics.readBase64("bXNjaAF4nGNgYmBiZmDJS8xNZeByzi9KtVJwK0pMZ+BOSS1OLsosKMnMz2NgYGDLSUxKzSlmYIqOZWTgSc3UTQYq1U0DqWRgYGSAAADGiBF7"); } diff --git a/src/ExpandedIndustries/content/EIStatusEffects.java b/src/ExpandedIndustries/content/EIStatusEffects.java index 62f69f80..8949b7a8 100644 --- a/src/ExpandedIndustries/content/EIStatusEffects.java +++ b/src/ExpandedIndustries/content/EIStatusEffects.java @@ -1,18 +1,20 @@ package ExpandedIndustries.content; +import arc.Events; import arc.graphics.Color; import arc.math.Mathf; import mindustry.content.Fx; +import mindustry.game.EventType; import mindustry.type.StatusEffect; -import static mindustry.content.StatusEffects.burning; -import static mindustry.content.StatusEffects.freezing; +import static mindustry.Vars.state; +import static mindustry.content.StatusEffects.*; public class EIStatusEffects { - public static StatusEffect lockdown, overload, sticky; + public static StatusEffect lockdown, overload, sticky, frozen, warm; - public static void load(){ - lockdown = new StatusEffect("lockdown"){{ + public static void load() { + lockdown = new StatusEffect("lockdown") {{ speedMultiplier = 0.6f; reloadMultiplier = 0.7f; buildSpeedMultiplier = 0.5f; @@ -20,11 +22,11 @@ public static void load(){ color = Color.clear; effect = Fx.none; }}; - overload = new StatusEffect("overload"){{ + overload = new StatusEffect("overload") {{ speedMultiplier = 0.2f; disarm = true; }}; - sticky = new StatusEffect("sticky"){{ + sticky = new StatusEffect("sticky") {{ speedMultiplier = 0.4f; reloadMultiplier = 0.6f; damageMultiplier = 0.7f; @@ -32,7 +34,7 @@ public static void load(){ effect = EIFx.reu; init(() -> { - opposite(freezing); + opposite(freezing, frozen); affinity(burning, (unit, result, time) -> { unit.damagePierce(transitionDamage); Fx.burning.at(unit.x + Mathf.range(unit.bounds() / 2f), unit.y + Mathf.range(unit.bounds() / 2f)); @@ -40,5 +42,13 @@ public static void load(){ }); }); }}; + frozen = new StatusEffect("frozen") {{ + speedMultiplier = 0; + reloadMultiplier = 0; + damage = 0.11f; + permanent = true; + init(() -> opposite(warm, burning, melting)); + }}; + warm = new StatusEffect("warm"); } } diff --git a/src/ExpandedIndustries/content/EITechTree.java b/src/ExpandedIndustries/content/EITechTree.java index 81ccf0da..1db0e889 100644 --- a/src/ExpandedIndustries/content/EITechTree.java +++ b/src/ExpandedIndustries/content/EITechTree.java @@ -12,7 +12,6 @@ import static mindustry.content.TechTree.TechNode; public class EITechTree { - //this is stupid but seems to work public static TechNode context = null; public static void mergeNode(UnlockableContent p, Runnable c) { @@ -230,15 +229,15 @@ public static void load() { }); }); mergeNode(Blocks.ripple, () -> { - node(exagonArtillery); + node(hexagon); }); mergeNode(Blocks.tsunami, () -> { node(renoit); }); mergeNode(Blocks.lancer, () -> { node(enforcer, () -> { - node(slowRay, () -> { - node(fastRay); + node(cavern, () -> { + node(underglow); }); }); node(piercer); @@ -264,13 +263,13 @@ public static void load() { }); }); mergeNode(UnitTypes.dagger, () -> { - node(breadnight, () -> { - node(toastnight); + node(requer, () -> { + node(convoy); }); }); mergeNode(UnitTypes.nova, () -> { - node(stormer, () -> { - node(rusher, () -> { + node(agrid, () -> { + node(xerad, () -> { node(escapade, () -> { node(natorin, () -> { node(terrand); @@ -278,6 +277,7 @@ public static void load() { }); }); }); + node(creo); }); mergeNode(UnitTypes.flare, () -> { node(pygmy, () -> { @@ -285,45 +285,38 @@ public static void load() { node(ageronia); }); }); - node(SmolBoi, () -> { - node(MediumBoi, () -> { - node(LargeBoi, () -> { - node(PayloadBoi); - }); - }); - }); }); mergeNode(Items.titanium, () -> { - node(EIItems.starium, () -> { - node(EIItems.stariumAlloy, () -> { + nodeProduce(EIItems.starium, () -> { + nodeProduce(EIItems.stariumAlloy, () -> { }); }); }); mergeNode(Items.thorium, () -> { - node(EIItems.peridotium, () -> { - node(EIItems.enhancedPeridotium, () -> { + nodeProduce(EIItems.peridotium, () -> { + nodeProduce(EIItems.enhancedPeridotium, () -> { }); }); - node(EIItems.lumium, () -> { + nodeProduce(EIItems.lumium, () -> { }); }); mergeNode(Liquids.oil, () -> { - node(EILiquids.heavyOil, () -> { - node(EILiquids.lightOil, () -> { - node(EIItems.solidFuel, () -> { + nodeProduce(EILiquids.heavyOil, () -> { + nodeProduce(EILiquids.lightOil, () -> { + nodeProduce(EIItems.solidFuel, () -> { }); }); }); }); mergeNode(Liquids.cryofluid, () -> { - node(EILiquids.lox, () -> { + nodeProduce(EILiquids.lox, () -> { }); }); mergeNode(Liquids.water, () -> { - node(EIItems.ice, () -> { + nodeProduce(EIItems.ice, () -> { }); - node(EILiquids.steam, () -> { + nodeProduce(EILiquids.steam, () -> { }); }); //erekir diff --git a/src/ExpandedIndustries/content/EIUnits.java b/src/ExpandedIndustries/content/EIUnits.java index 00766696..86d7e34a 100644 --- a/src/ExpandedIndustries/content/EIUnits.java +++ b/src/ExpandedIndustries/content/EIUnits.java @@ -1,14 +1,15 @@ package ExpandedIndustries.content; +import ExpandedIndustries.ai.EICommands; import ExpandedIndustries.ai.types.CircleTargetFlyingAI; import ExpandedIndustries.entities.bullet.LifestealBulletType; import ExpandedIndustries.entities.bullet.abilities.OverloadAbility; import arc.graphics.Color; +import arc.struct.Seq; +import mindustry.Vars; import mindustry.ai.UnitCommand; import mindustry.ai.types.BuilderAI; -import mindustry.ai.types.FlyingAI; import mindustry.ai.types.FlyingFollowAI; -import mindustry.ai.types.MinerAI; import mindustry.content.Fx; import mindustry.content.StatusEffects; import mindustry.content.UnitTypes; @@ -23,9 +24,10 @@ import mindustry.type.UnitType; import mindustry.type.Weapon; import mindustry.type.ammo.PowerAmmoType; +import mindustry.type.weapons.RepairBeamWeapon; import mindustry.world.meta.BlockFlag; -import static ExpandedIndustries.content.EIBullets.SuicideBulletType; +import static ExpandedIndustries.content.EIStatusEffects.frozen; import static mindustry.Vars.tilePayload; import static mindustry.Vars.tilesize; import static mindustry.content.Fx.none; @@ -33,22 +35,24 @@ public class EIUnits { public static UnitType - stormer, rusher, escapade, natorin, terrand, + agrid, xerad, escapade, natorin, terrand, - breadnight, toastnight, + requer, convoy, centurion, alturion, pygmy, schaus, ageronia, - SmolBoi, MediumBoi, LargeBoi, PayloadBoi, + creo, - piece, guardian, + quark, atrias, exatro, + + piece, guardian, quarad, //Overkill Content; starnight; public static void load() { - stormer = new UnitType("stormer") {{ + agrid = new UnitType("agrid") {{ constructor = LegsUnit::create; groundLayer = Layer.legUnit; @@ -70,7 +74,7 @@ public static void load() { ammoType = new PowerAmmoType(750); weapons.add( - new Weapon("ei-stormer-weapon") {{ + new Weapon("ei-agrid-weapon") {{ top = false; shake = 2f; @@ -94,10 +98,15 @@ public static void load() { }} ); }}; - rusher = new UnitType("rusher") {{ + xerad = new UnitType("xerad") {{ constructor = LegsUnit::create; groundLayer = Layer.legUnit; + legRegion = UnitTypes.atrax.legRegion; + legBaseRegion = UnitTypes.atrax.legBaseRegion; + jointRegion = UnitTypes.atrax.jointRegion; + footRegion = UnitTypes.atrax.footRegion; + allowLegStep = hovering = true; outlines = false; @@ -117,7 +126,7 @@ public static void load() { ammoType = new PowerAmmoType(1000); weapons.add( - new Weapon("ei-rusher-weapon") {{ + new Weapon("ei-xerad-weapon") {{ top = rotate = false; reload = 75f; @@ -140,7 +149,7 @@ public static void load() { colors = new Color[]{Pal.heal.cpy().a(0.4f), Pal.heal, Color.white}; }}; }}, - new Weapon("ei-rusher-artillery") {{ + new Weapon("ei-xerad-artillery") {{ top = rotate = true; mirror = false; @@ -480,7 +489,7 @@ public static void load() { }} ); }}; - breadnight = new UnitType("breadnight"){{ + requer = new UnitType("requer"){{ constructor = MechUnit::create; outlines = false; @@ -496,7 +505,7 @@ public static void load() { ); weapons.add( - new Weapon("ei-breadnight-laser"){{ + new Weapon("ei-requer-laser"){{ mirror = alternate = true; rotate = top = false; @@ -514,7 +523,7 @@ public static void load() { length = 18 * tilesize; }}; }}, - new Weapon("ei-breadnight-weapon"){{ + new Weapon("ei-requer-weapon"){{ autoTarget = rotate = top = mirror = alternate = true; controllable = false; @@ -528,7 +537,7 @@ public static void load() { }} ); }}; - toastnight = new UnitType("toastnight"){{ + convoy = new UnitType("convoy"){{ constructor = MechUnit::create; outlines = false; @@ -544,7 +553,7 @@ public static void load() { ); weapons.add( - new Weapon("ei-toastnight-weapon"){{ + new Weapon("ei-convoy-weapon"){{ mirror = alternate = true; rotate = top = false; @@ -842,116 +851,50 @@ public static void load() { }}; }}); }}; - SmolBoi = new UnitType("small-boi"){{ + /*quark = new UnitType("quark"){{ + + }};*/ + creo = new UnitType("creo"){{ constructor = UnitEntity::create; - aiController = FlyingAI::new; + defaultCommand = EICommands.healUnitsCommand; - flying = faceTarget = true; - outlines = false; + flying = faceTarget = lowAltitude = true; + outlines = logicControllable = isEnemy = false; - health = 210; + health = 170; hitSize = 6f; - speed = 1.9f; - rotateSpeed = 3; - itemCapacity = 50; + speed = 2.35f; + rotateSpeed = 3.4f; + itemCapacity = 5; - lightRadius = 50; + lightRadius = 25; - targetFlags = new BlockFlag[]{BlockFlag.factory, BlockFlag.battery, null}; - - weapons.add(new Weapon() {{ + weapons.add(new RepairBeamWeapon() {{ + targetUnits = targetBuildings = true; top = mirror = false; - reload = 24; - shootCone = 180; - x = 0; - y = 0; - - shootSound = Sounds.explosion; - - bullet = SuicideBulletType; - }}); - }}; - MediumBoi = new UnitType("medium-boi"){{ - constructor = UnitEntity::create; - aiController = FlyingAI::new; - - flying = faceTarget = true; - outlines = false; - - health = 280; - hitSize = 12f; - speed = 1.8f; - rotateSpeed = 3; - itemCapacity = 90; - - engineOffset = 6.25f; - - lightRadius = 50; - - weapons.add(new Weapon() {{ - top = mirror = false; + range = 60; + beamWidth = 0.7f; + repairSpeed = 0.9f; + fractionRepairSpeed = 0.025f; - reload = 24; - shootCone = 180; x = 0; - y = 0; - - shootSound = Sounds.explosion; - - bullet = SuicideBulletType; + y = 1.25f; }}); - }}; - LargeBoi = new UnitType("large-boi"){{ - constructor = UnitEntity::create; - aiController = FlyingAI::new; - - flying = faceTarget = true; - outlines = false; - - health = 470; - hitSize = 20; - speed = 1.6f; - rotateSpeed = 3; - itemCapacity = 170; - - engineOffset = 11.25f; - engineSize = 2.75f; - lightRadius = 50; - - abilities.add(new UnitSpawnAbility(SmolBoi, 1050, 0, 2)); - - weapons.add(new Weapon() {{ - top = mirror = false; - - reload = 24; - shootCone = 180; - x = 0; - y = 0; - - shootSound = Sounds.explosion; - - bullet = SuicideBulletType; - }}); - }}; - PayloadBoi = new UnitType("payload-boi"){{ - constructor = PayloadUnit::create; - - flying = true; - outlines = false; - - health = 5300; - hitSize = 40f; - speed = 3.35f; - rotateSpeed = 3.3f; - drag = 0.1f; - accel = 0.2f; - itemCapacity = 340; - payloadCapacity = (4 * 4) * tilePayload; - - engineSize = 4.5f; - engineOffset = 16; - }}; + }public void init(){ + super.init(); + + Seq cmds = Seq.with(commands); + cmds.add(EICommands.healUnitsCommand); + + commands = cmds.toArray(); + } + public void update(Unit unit){ + super.update(unit); + if(unit.isPlayer() && (Vars.net.server() || !Vars.net.active())){ + unit.getPlayer().clearUnit(); + }} + }; piece = new UnitType("piece"){{ constructor = UnitEntity::create; aiController = BuilderAI::new; @@ -1038,6 +981,13 @@ public static void load() { }}; }}); }}; + /*quarad = new UnitType("quarad"){{ + constructor = UnitEntity::create; + + flying = lowAltitude = true; + + engineSize = -1; + }};*/ starnight = new UnitType("starnight"){{ constructor = UnitEntity::create; aiController = FlyingFollowAI::new; diff --git a/src/ExpandedIndustries/content/EIWeathers.java b/src/ExpandedIndustries/content/EIWeathers.java new file mode 100644 index 00000000..807a3680 --- /dev/null +++ b/src/ExpandedIndustries/content/EIWeathers.java @@ -0,0 +1,33 @@ +package ExpandedIndustries.content; + +import arc.graphics.Color; +import mindustry.gen.Sounds; +import mindustry.type.Weather; +import mindustry.type.weather.ParticleWeather; +import mindustry.world.meta.Attribute; + +public class EIWeathers { + public static Weather hailstorm; + public static void load() { + hailstorm = new ParticleWeather("hailstorm"){{ + particleRegion = "particle"; + color = Color.cyan; + yspeed = -8.7f; + xspeed = -4.4f; + sizeMax = 11f; + sizeMin = 4f; + density = 1500f; + opacityMultiplier = 0.73f; + attrs.set(Attribute.light, -0.20f); + attrs.set(Attribute.water, 1.5f); + + sound = Sounds.windhowl; + soundVol = 0f; + soundVolOscMag = 1.5f; + soundVolOscScl = 1100f; + soundVolMin = 0.02f; + + status = EIStatusEffects.frozen; + }}; + } +} diff --git a/src/ExpandedIndustries/entities/bullet/abilities/OverloadAbility.java b/src/ExpandedIndustries/entities/bullet/abilities/OverloadAbility.java index 51515ad2..c3449c4d 100644 --- a/src/ExpandedIndustries/entities/bullet/abilities/OverloadAbility.java +++ b/src/ExpandedIndustries/entities/bullet/abilities/OverloadAbility.java @@ -20,14 +20,15 @@ public class OverloadAbility extends Ability { private static final Seq all = new Seq<>(); + public boolean applyToSelf = false, infiniteSelfStatus = false; public float reload = 100, range = 60; public StatusEffect status = EIStatusEffects.overload; public StatusEffect teamStatus = StatusEffects.overclock; public float statusDuration = 60f * 15f, teamStatusDuration = 60f * 10.5f; public float x, y; - protected float timer, curStroke; - protected boolean anyNearby = false; + protected float timer, curStroke, selfStatusDuration = teamStatusDuration; + protected boolean anyNearby = false, reapply = true; public Effect activeEffect = EIFx.overload; public OverloadAbility(float reload, float range){ @@ -37,7 +38,7 @@ public OverloadAbility(float reload, float range){ @Override public String localized(){ - return Core.bundle.format("ability.ei-overload", range / Vars.tilesize, statusDuration/60, reload/60); + return Core.bundle.format("ability.ei-overload", range / Vars.tilesize, statusDuration / 60, reload / 60); } @Override @@ -64,7 +65,7 @@ public void update(Unit unit){ if(((Teamc)other).team() == unit.team){ anyNearby = true; - if(other instanceof Statusc s){ + if(other instanceof Statusc s) { s.apply(teamStatus, teamStatusDuration); } }else{ @@ -75,8 +76,17 @@ public void update(Unit unit){ } } - if(anyNearby){ - activeEffect.at(unit, range); + if(anyNearby || (applyToSelf && reapply)){ + if(anyNearby){ + activeEffect.at(unit, range); + } + if(applyToSelf){ + if(infiniteSelfStatus){ + selfStatusDuration = Float.MAX_VALUE; + reapply = false; + } + unit.apply(teamStatus, selfStatusDuration); + } timer = 0f; } } diff --git a/src/ExpandedIndustries/world/blocks/environment/PropOre.java b/src/ExpandedIndustries/world/blocks/environment/PropOre.java new file mode 100644 index 00000000..c02a14f6 --- /dev/null +++ b/src/ExpandedIndustries/world/blocks/environment/PropOre.java @@ -0,0 +1,91 @@ +package ExpandedIndustries.world.blocks.environment; + +import arc.Core; +import arc.graphics.Color; +import arc.graphics.Pixmap; +import arc.graphics.g2d.Draw; +import arc.graphics.g2d.PixmapRegion; +import arc.math.Mathf; +import arc.math.geom.Point2; +import mindustry.Vars; +import mindustry.content.Blocks; +import mindustry.graphics.MultiPacker; +import mindustry.type.Item; +import mindustry.world.Block; +import mindustry.world.Tile; +import mindustry.world.blocks.environment.Floor; +import mindustry.world.blocks.environment.OreBlock; +import mindustry.world.blocks.environment.OverlayFloor; +import mindustry.world.blocks.environment.Prop; + +import static mindustry.Vars.tilesize; + +public class PropOre extends OreBlock{ + public static final Point2[] offsets = { + new Point2(-2, -2), + new Point2(-2, -1), + new Point2(-2, 0), + new Point2(-2, 1), + new Point2(-2, 2), + new Point2(-1, -2), + new Point2(0, -2), + new Point2(1, -2), + new Point2(2, -2), + new Point2(-1, -1), + new Point2(-1, 0), + new Point2(-1, 1), + new Point2(-1, 2), + new Point2(0, -1), + new Point2(1, -1), + new Point2(2, -1), + new Point2(0, 0), + new Point2(0, 1), + new Point2(0, 2), + new Point2(1, 0), + new Point2(2, 0), + new Point2(1, 1), + new Point2(1, 2), + new Point2(2, 1), + new Point2(2, 2), + }; + + public Block parent = Blocks.air; + + static{ + for(var p : offsets){ + p.sub(1, 1); + } + } + + public PropOre(String name, Item ore){ + super(name); + this.localizedName = ore.localizedName; + this.itemDrop = ore; + this.variants = 3; + this.mapColor.set(ore.color); + this.useColor = true; + } + + public boolean checkAdjacent(Tile tile){ + for(var point : offsets){ + Tile other = Vars.world.tile(tile.x + point.x, tile.y + point.y); + if(other == null || other.overlay() != this){ + return false; + } + } + return true; + } + + @Override + public boolean updateRender(Tile tile){ + return checkAdjacent(tile); + } + + @Override + public void renderUpdate(UpdateRenderState state){ + Tile tile = Vars.world.tile(state.tile.x - 1, state.tile.y - 1); + if(tile.block() == Blocks.air || (tile.block() instanceof Prop && tile.block() != parent)){ + tile.setNet(parent); + } + } +} diff --git a/src/ExpandedIndustries/world/blocks/production/WhitelistDrill.java b/src/ExpandedIndustries/world/blocks/production/WhitelistDrill.java new file mode 100644 index 00000000..516093d6 --- /dev/null +++ b/src/ExpandedIndustries/world/blocks/production/WhitelistDrill.java @@ -0,0 +1,136 @@ +package ExpandedIndustries.world.blocks.production; + +import arc.Core; +import arc.graphics.Blending; +import arc.graphics.Color; +import arc.graphics.g2d.Draw; +import arc.math.Mathf; +import arc.struct.Seq; +import arc.util.Time; +import mindustry.content.Blocks; +import mindustry.content.Items; +import mindustry.game.Team; +import mindustry.graphics.Drawf; +import mindustry.graphics.Layer; +import mindustry.type.Item; +import mindustry.world.Block; +import mindustry.world.Tile; +import mindustry.world.blocks.environment.Prop; +import mindustry.world.blocks.production.Drill; +import mindustry.world.consumers.ConsumeLiquidBase; +import mindustry.world.meta.Stat; +import mindustry.world.meta.StatUnit; +import mindustry.world.meta.StatValues; + +import static mindustry.Vars.*; + +public class WhitelistDrill extends Drill{ + public String itemDisplayPrefix = "-crystal"; + public Seq itemsWhitelisted = Seq.with(Items.copper,Items.lead); + public WhitelistDrill(String name) + { + super(name); + tier = Integer.MAX_VALUE; + } + + @Override + public float getDrillTime(Item item){ + return drillTime + hardnessDrillMultiplier / drillMultipliers.get(item, 1f); + } + + @Override + public void setStats(){ + super.setStats(); + + stats.remove(Stat.drillTier); + + stats.remove(Stat.drillSpeed); + stats.add(Stat.drillSpeed, 60f / drillTime * size * size, StatUnit.itemsSecond); + + if(liquidBoostIntensity != 1 && findConsumer(f -> f instanceof ConsumeLiquidBase) instanceof ConsumeLiquidBase consBase){ + stats.remove(Stat.booster); + stats.add(Stat.booster, + StatValues.speedBoosters("{0}" + StatUnit.timesSpeed.localized(), + consBase.amount, + liquidBoostIntensity * liquidBoostIntensity, false, this::consumesLiquid) + ); + } + } + + @Override + public void drawPlace(int x, int y, int rotation, boolean valid){ + Tile tile = world.tile(x, y); + if(tile == null) return; + + countOre(tile); + + if(returnItem != null){ + float width = drawPlaceText(Core.bundle.formatFloat("bar.drillspeed", 60f / getDrillTime(returnItem) * returnCount, 2), x, y, valid); + float dx = x * tilesize + offset - width/2f - 4f, dy = y * tilesize + offset + size * tilesize / 2f + 5, s = iconSmall / 4f; + Draw.mixcol(Color.darkGray, 1f); + Draw.rect(returnItem.fullIcon, dx, dy - 1, s, s); + Draw.reset(); + Draw.rect(returnItem.fullIcon, dx, dy, s, s); + }else{ + Tile to = tile.getLinkedTilesAs(this, tempTiles).find(t -> t.drop() != null && (t.drop().hardness > tier || t.drop() == blockedItem)); + Item item = to == null ? null : to.drop(); + if(item != null){ + drawPlaceText(Core.bundle.get("bar.drilltierreq"), x, y, valid); + } + } + } + + @Override + public boolean canReplace(Block other){ + return other instanceof Prop || other == null || other == Blocks.air; + } + + @Override + public boolean canMine(Tile tile){ + if(tile == null || tile.block().isStatic()) return false; + Item drops = tile.drop(); + return drops != null && itemsWhitelisted.contains(drops); + } + + @Override + public boolean canPlaceOn(Tile tile, Team team, int rotation){ + for(Tile other : tile.getLinkedTilesAs(this, tempTiles)){ + if(canMine(other)){ + return returnCount == 25; + } + } + return false; + } + + public class WhitelistDrillBuild extends DrillBuild { + @Override + public void draw(){ + float s = 0.3f; + float ts = 0.6f; + + if(drawSpinSprite){ + Drawf.spinSprite(rotatorRegion, x, y, timeDrilled * rotateSpeed); + }else{ + Draw.rect(rotatorRegion, x, y, timeDrilled * rotateSpeed); + } + + Draw.rect(region, x, y); + Draw.z(Layer.blockCracks); + drawDefaultCracks(); + + Draw.z(Layer.blockAfterCracks); + if(drawRim){ + Draw.color(heatColor); + Draw.alpha(warmup * ts * (1f - s + Mathf.absin(Time.time, 3f, s))); + Draw.blend(Blending.additive); + Draw.rect(rimRegion, x, y); + Draw.blend(); + Draw.color(); + } + + if(itemDisplayPrefix != null) { + Draw.rect(dominantItem.name + itemDisplayPrefix, x, y); + } + } + } +} diff --git a/src/ExpandedIndustries/world/blocks/storage/StatusCore.java b/src/ExpandedIndustries/world/blocks/storage/StatusCore.java new file mode 100644 index 00000000..85e6703c --- /dev/null +++ b/src/ExpandedIndustries/world/blocks/storage/StatusCore.java @@ -0,0 +1,85 @@ +package ExpandedIndustries.world.blocks.storage; + +import ExpandedIndustries.content.EIStatusEffects; +import arc.graphics.Color; +import arc.graphics.g2d.Draw; +import arc.graphics.g2d.Lines; +import arc.struct.Seq; +import arc.util.Time; +import mindustry.entities.Units; +import mindustry.gen.Unit; +import mindustry.graphics.Layer; +import mindustry.logic.Ranged; +import mindustry.type.StatusEffect; +import mindustry.world.blocks.storage.CoreBlock; +import mindustry.world.meta.Stat; +import mindustry.world.meta.StatUnit; + +import static mindustry.Vars.tilesize; + +public class StatusCore extends CoreBlock{ + public StatusEffect statusEffect; + public Color effectColor; + public float statusDuration, applyRange, applyDelay, effectSize, effectLifetime; + public Seq targets = new Seq<>(); + + public StatusCore(String name){ + super(name); + + statusEffect = EIStatusEffects.warm; + effectColor = Color.orange; + effectSize = 3f; + applyRange = 15 * tilesize; + statusDuration = 15; + applyDelay = 60f; + effectLifetime = 210f; + } + + @Override + public void setStats(){ + super.setStats(); + + stats.add(Stat.range, applyRange / tilesize, StatUnit.blocks); + stats.add(Stat.boostEffect, statusEffect.emoji() + " " + statusEffect.localizedName, statusDuration, StatUnit.seconds); + } + + public class StatusCoreBuild extends CoreBuild implements Ranged { + public float refresh = 0, drawProgress = 0; + + @Override + public void updateTile() { + if ((refresh += Time.delta) > applyDelay) { + targets.clear(); + refresh = 0f; + + Units.nearby(team, x, y, applyRange, u -> { + targets.add(u); + }); + + for (var target : targets) { + target.apply(statusEffect, (statusDuration * 60)); + } + } + + drawProgress += Time.delta / effectLifetime; + } + + @Override + public void draw(){ + super.draw(); + + Draw.z(Layer.effect); + float mod = drawProgress % 1f; + Draw.color(effectColor); + Lines.circle(x, y, applyRange); + Lines.stroke(effectSize * (1f - mod)); + Lines.circle(x, y, applyRange * mod); + Draw.reset(); + } + + @Override + public float range() { + return applyRange; + } + } +}