diff --git a/mod.json b/mod.json index 31889475..1a60dad1 100644 --- a/mod.json +++ b/mod.json @@ -1,24 +1,20 @@ { "name": "aeyama", "repo": "aeyama-mod/aeyama", - "minGameVersion": 145, - "version": "0.5.0-dev", + "minGameVersion": 146, + "version": "0.1.0r-dev", "java": true, "main": "aeyama.Aeyama", "displayName": "Aeyama: The New World", - "author": "FredyJabe & Jojo", - "subtitle": "A brand new world...", + "author": "[[]orange]F[[]white]redy[[]orange]J[[]white]abe & [[]#00AB08]J[[]#00C301]o[[]#26D701]j[[]#4DED30]o", + "subtitle": "The rebirth of a world...", "description": "This mod will allow you to explore a whole new world and play differently from the base game. [[]gray]Language: [[]white]- English [[]white]- Français [[]white]- Русский - [[]white]- Polski [[]red](WIP) - [[]white]- Українська [[]red](WIP) - [[]white]- 简体中文 [[]red](WIP) - [[]white]- Español [[]red](WIP) [[]white]. . . check our Discord and GitHub repository for more info!", diff --git a/src/aeyama/Aeyama.java b/src/aeyama/Aeyama.java index 7b88a101..e6880e61 100644 --- a/src/aeyama/Aeyama.java +++ b/src/aeyama/Aeyama.java @@ -1,45 +1,19 @@ package aeyama; -import mindustry.*; +import arc.util.*; import mindustry.mod.*; -import mindustry.type.*; - -import aeyama.content.*; -import aeyama.ui.dialogs.*; - -import static arc.Core.*; public class Aeyama extends Mod { @Override public void init() { AeyamaVars.load(); - SettingsMenuDialog.load(); - - if (settings.getBool("aeyama-showNews")) NewsDialog.load(); - if (settings.getBool("aeyama-checkUpdate")) AeyamaUpdater.check(); - - // Hide the items of this mod on all the other planets. - for (Planet planet : Vars.content.planets()) { - if (planet.name != "aeyama") - planet.hiddenItems.addAll(AeyamaItems.aeyamaItems); - } + + Log.info("Aeyama Reborn!"); } @Override public void loadContent() { // The load order is VERY IMPORTANT, don't change it. - AeyamaAttributes.load(); - AeyamaStatusEffects.load(); - AeyamaLoadouts.load(); - - AeyamaWeapons.load(); - AeyamaUnits.load(); - AeyamaItems.load(); - AeyamaLiquids.load(); - AeyamaBlocks.load(); - - AeyamaPlanets.load(); - AeyamaSectors.load(); - AeyamaTechTree.load(); + } } diff --git a/src/aeyama/AeyamaUpdater.java b/src/aeyama/AeyamaUpdater.java deleted file mode 100644 index d655391c..00000000 --- a/src/aeyama/AeyamaUpdater.java +++ /dev/null @@ -1,169 +0,0 @@ -package aeyama; - -import arc.*; -import arc.files.*; -import arc.input.*; -import arc.util.*; -import arc.util.Http.*; -import arc.util.io.*; -import arc.util.serialization.*; -import arc.util.serialization.Jval.*; - -import mindustry.ui.dialogs.*; - -import java.net.*; - -import static aeyama.AeyamaVars.*; -import static arc.Core.*; -import static mindustry.Vars.*; - -/** Most of this is from the mod "Scheme Size". */ -public class AeyamaUpdater { - private static final String urlReleases = ghApi + "/repos/" + repo + "/releases"; - private static float progress; - - public static void check() { - if (isDev) { - Log.info("[green][Aeyama][lightgray] Not checking for update on development version."); - return; - } - - Log.info("[green][Aeyama][lightgray] Checking for updates..."); - - // x.y.z-__.w --> xyz and w - int modVersionCheck = Integer.parseInt(mod.meta.version.substring(0, 5).replace(".", "")); - // Check if the mod version has a build number (only with -beta or -pre version) - int modBuild = isBeta ? Integer.parseInt(mod.meta.version.substring(mod.meta.version.length() - 1)) : 0; - - // Everything has to be in this HTTP request to work (async) - Http.get(urlReleases, res -> { - /* Get the releases */ - JsonArray releases = Jval.read(res.getResultAsString()).asArray(); - Jval release = null; - Jval betaRelease = null; - boolean uiShown = false; - - // Check if the first release is a "pre-release" (beta) - if (releases.get(0).getBool("prerelease", false)) { - betaRelease = releases.get(0); - // Get the first non "pre-release" (release) - for (int i=1; i < releases.size; i++) { - // Check if the release is a "pre-release", skip. - if (!releases.get(i).getBool("prerelease", false)) { - release = releases.get(i); - break; - } - } - } else { // The first release is not beta, ignore beta - release = releases.get(0); - betaRelease = null; - } - - String releaseVersion = release.getString("tag_name").substring(1); // Get version of release without the 'v' - - if (betaRelease != null && settings.getBool("aeyama-checkBeta")) { // There's a beta to check - // vx.y.z-__.w --> xyz and w - String betaVersion = betaRelease.getString("tag_name").substring(1); - int betaVersionCheck = Integer.parseInt(betaVersion.substring(0, 5).replace(".", "")); - int betaBuild = Integer.parseInt(betaVersion.substring(betaVersion.length() - 1)); - - //Check if the beta version is newer than the installed one or that the installed version build number is greater - if (betaVersionCheck > modVersionCheck - || (betaVersionCheck == modVersionCheck && betaBuild > modBuild)) { - String betaDownloadUrl = betaRelease.get("assets").asArray().get(0).getString("browser_download_url"); - String downloadUrl = release.get("assets").asArray().get(0).getString("browser_download_url"); - showCustomConfirmBeta( - "@aeyama.updater.name", Core.bundle.format("aeyama.updater.info-beta", mod.meta.version, releaseVersion, betaVersion), - "@aeyama.updater.install", "@aeyama.updater.install-beta", "@aeyama.updater.ignore", - () -> AeyamaUpdater.update(downloadUrl), () -> AeyamaUpdater.update(betaDownloadUrl) - ); - uiShown = true; - } - } - - // The UI for beta update has not be shown (so no beta or setting disabled) - if (uiShown != true) { - // x.y.z --> xyz - int releaseVersionCheck = Integer.parseInt(releaseVersion.substring(0, 5).replace(".", "")); - - //Check if the release version is newer than the installed one or that the installed version is a beta/pre - if (releaseVersionCheck > modVersionCheck - || (releaseVersionCheck == modVersionCheck && isBeta)) { - String downloadUrl = release.get("assets").asArray().get(0).getString("browser_download_url"); - showCustomConfirm( - "@aeyama.updater.name", Core.bundle.format("aeyama.updater.info", mod.meta.version, releaseVersion), - "@aeyama.updater.install", "@aeyama.updater.ignore", - () -> AeyamaUpdater.update(downloadUrl) - ); - } - } - }, Log::err); - } - - private static void update(String url) { - try { - if (mod.loader instanceof URLClassLoader cl) cl.close(); - mod.loader = null; - } catch (Throwable err) { - Log.err(err); - } - - ui.loadfrag.show("@downloading"); - ui.loadfrag.setProgress(() -> progress); - - Http.get(url, AeyamaUpdater::handle, Log::err); - } - - private static void handle(HttpResponse res) { - try { - Fi file = tmpDirectory.child(repo.replace("/", "") + ".zip"); - Streams.copyProgress(res.getResultAsStream(), file.write(false), res.getContentLength(), 4096, p -> progress = p); - - mods.importMod(file).setRepo(repo); - file.delete(); - - Core.app.post(ui.loadfrag::hide); - ui.showInfoOnHidden("@mods.reloadexit", Core.app::exit); - } catch (Throwable err) { - Log.err(err); - } - } - - /* Custom "showCustomComfirm" for the Updater UI only. */ - private static void showCustomConfirm(String title, String text, String yes, String no, Runnable confirmed) { - BaseDialog dialog = new BaseDialog(title); - dialog.cont.add(text).width(mobile ? 400f : 500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center); - dialog.buttons.defaults().size(125f, 54f).pad(2f); - dialog.setFillParent(false); - dialog.buttons.button(yes, () -> { - dialog.hide(); - confirmed.run(); - }); - dialog.buttons.button(no, dialog::hide); - dialog.keyDown(KeyCode.escape, dialog::hide); - dialog.keyDown(KeyCode.back, dialog::hide); - dialog.show(); - } - - private static void showCustomConfirmBeta(String title, String text, String yes1, String yes2, String no, Runnable confirmed1, Runnable confirmed2) { - BaseDialog dialog = new BaseDialog(title); - dialog.cont.add(text).width(mobile ? 400f : 500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center); - dialog.buttons.defaults().size(250f, 54f).pad(2f); - dialog.setFillParent(false); - dialog.buttons.table(t -> { - t.defaults().size(125f, 54f).pad(2f); - t.button(yes1, () -> { - dialog.hide(); - confirmed1.run(); - }); - t.button(yes2, () -> { - dialog.hide(); - confirmed2.run(); - }); - }).row(); - dialog.buttons.button(no, dialog::hide); - dialog.keyDown(KeyCode.escape, dialog::hide); - dialog.keyDown(KeyCode.back, dialog::hide); - dialog.show(); - } -} diff --git a/src/aeyama/content/AeyamaAttributes.java b/src/aeyama/content/AeyamaAttributes.java deleted file mode 100644 index f34144d8..00000000 --- a/src/aeyama/content/AeyamaAttributes.java +++ /dev/null @@ -1,16 +0,0 @@ -package aeyama.content; - -import mindustry.world.meta.*; - -public class AeyamaAttributes { - - public static void load() { - Attribute.add("wood"); - Attribute.add("stone"); - Attribute.add("iron"); - Attribute.add("zinc"); - Attribute.add("copper"); - Attribute.add("sand"); - Attribute.add("water"); - } -} diff --git a/src/aeyama/content/AeyamaBlocks.java b/src/aeyama/content/AeyamaBlocks.java deleted file mode 100644 index ff71469a..00000000 --- a/src/aeyama/content/AeyamaBlocks.java +++ /dev/null @@ -1,13 +0,0 @@ -package aeyama.content; - -import aeyama.content.blocks.*; - -public class AeyamaBlocks { - public static void load() { - AeyamaDefenseBlocks.load(); - AeyamaDistributionBlocks.load(); - AeyamaProductionBlocks.load(); - AeyamaEffectBlocks.load(); - AeyamaEnvironmentBlocks.load(); - } -} diff --git a/src/aeyama/content/AeyamaItems.java b/src/aeyama/content/AeyamaItems.java deleted file mode 100644 index 647152fc..00000000 --- a/src/aeyama/content/AeyamaItems.java +++ /dev/null @@ -1,173 +0,0 @@ -package aeyama.content; - -import arc.graphics.*; -import arc.struct.*; - -import mindustry.type.*; - -public class AeyamaItems { - public static Item - /* Ressources */ - woodLumber, woodShreds, woodLumberDry, carbon, - stone, stonePebbles, stoneBrick, rawIron, iron, - steel, rawCopper, copper, brass, rawZinc, zinc, - rawTin, tin, bronze, rawAluminum, aluminum, - rawTitanium, titanium, blueprint, advancedBlueprint, - specialBPDefense, specialBPOffense, emptyBattery, - battery, emptyBarrel, - - /* Ammunition */ - rifle, highCaliber, combustibleCanister, rocket, - shotgunShell, shotgunSlug, - - /* Other */ - armorPlating, planet; - - public static final Seq aeyamaItems = new Seq<>(); - - public static void load() { - /* Ressources */ - woodLumber = new Item("wood-lumber", Color.valueOf("#bf7d5a")) {{ - flammability = 0.9f; - }}; - woodShreds = new Item("wood-shreds", Color.valueOf("#efbf8f")) {{ - flammability = 0.8f; - }}; - woodLumberDry = new Item("wood-lumber-dry", Color.valueOf("#7b6b60")) {{ - flammability = 2f; - }}; - carbon = new Item("carbon", Color.valueOf("#313131")) {{ - flammability = 0.3f; - }}; - stone = new Item("stone", Color.valueOf("#e0b28d")) {{ - - }}; - stonePebbles = new Item("stone-pebbles", Color.valueOf("#e0b28c")) {{ - - }}; - stoneBrick = new Item("stone-brick", Color.valueOf("#e0b28c")) {{ - - }}; - rawIron = new Item("raw-iron", Color.valueOf("#4f4f4f")) {{ - charge = 0.5f; - hardness = 1; - }}; - iron = new Item("iron", Color.valueOf("#3e3e3e")) {{ - charge = 0.5f; - }}; - steel = new Item("steel", Color.valueOf("#cbcbcb")) {{ - charge = 0.5f; - }}; - rawCopper = new Item("raw-copper", Color.valueOf("#eac2a9")) {{ - hardness = 1; - }}; - copper = new Item("copper", Color.valueOf("#eac2a9")) {{ - charge = 0.8f; - }}; - brass = new Item("brass", Color.valueOf("#b3a57d")) {{ - charge = 0.3f; - }}; - rawZinc = new Item("raw-zinc", Color.valueOf("#9d9d9d")) {{ - charge = 0.7f; - hardness = 1; - }}; - zinc = new Item("zinc", Color.valueOf("#d2d2d2")) {{ - charge = 0.7f; - }}; - rawTin = new Item("raw-tin", Color.valueOf("#000000")) {{ - hardness = 2; - }}; - tin = new Item("tin", Color.valueOf("#000000")) {{ - - }}; - bronze = new Item("bronze", Color.valueOf("#000000")) {{ - - }}; - rawAluminum = new Item("raw-aluminum", Color.valueOf("#000000")) {{ - hardness = 2; - }}; - aluminum = new Item("aluminum", Color.valueOf("#000000")) {{ - - }}; - rawTitanium = new Item("raw-titanium", Color.valueOf("#000000")) {{ - charge = 0.5f; - hardness = 2; - }}; - titanium = new Item("titanium", Color.valueOf("#000000")) {{ - - }}; - blueprint = new Item("blueprint", Color.valueOf("#64bcfc")) {{ - flammability = 1f; - }}; - advancedBlueprint = new Item("advanced-blueprint", Color.valueOf("#3b3b3b")) {{ - flammability = 1f; - }}; - specialBPDefense = new Item("special-blueprint-defense", Color.valueOf("#23d200")) {{ - flammability = 1f; - }}; - specialBPOffense = new Item("special-blueprint-offense", Color.valueOf("#d20000")) {{ - flammability = 1f; - }}; - emptyBattery = new Item("empty-battery", Color.valueOf("#ffac00")) {{ - explosiveness = 0f; - flammability = 0.5f; - radioactivity = 0f; - charge = 1f; - }}; - battery = new Item("battery", Color.valueOf("#ffec00")) {{ - explosiveness = 1f; - flammability = 0.7f; - radioactivity = 0f; - charge = 1f; - }}; - emptyBarrel = new Item("empty-barrel", Color.valueOf("#7f7f7f")) {{ - explosiveness = 0.2f; - flammability = 0.2f; - radioactivity = 0f; - charge = 0f; - }}; - - /* Ammunition */ - rifle = new Item("ammunition-rifle", Color.valueOf("#b3a377")) {{ - - }}; - highCaliber = new Item("ammunition-high-caliber", Color.valueOf("#b3a377")) {{ - - }}; - combustibleCanister = new Item("ammunition-combustible-canister", Color.valueOf("#b3a377")) {{ - explosiveness = 1f; - flammability = 2f; - - }}; - rocket = new Item("ammunition-rocket", Color.valueOf("#b3a377")) {{ - explosiveness = 2f; - - }}; - shotgunShell = new Item("ammunition-shotgun-shell", Color.valueOf("#b3a377")) {{ - - }}; - shotgunSlug = new Item("ammunition-shotgun-slug", Color.valueOf("#b3a377")) {{ - - }}; - - /* Other */ - planet = new Item("planet") {{ - alwaysUnlocked = true; - hidden = true; - }}; - armorPlating = new Item("armor-plating", Color.valueOf("#000000")) {{ - - }}; - - aeyamaItems.addAll( - woodLumber, woodShreds, woodLumberDry, carbon, - stone, stonePebbles, stoneBrick, rawIron, iron, - steel, rawCopper, copper, brass, rawZinc, zinc, - rawTin, tin, bronze, rawAluminum, aluminum, - rawTitanium, titanium, blueprint, advancedBlueprint, - specialBPDefense, specialBPOffense, rifle, highCaliber, - combustibleCanister, rocket, shotgunShell, shotgunSlug, - planet, armorPlating - ); - } -} diff --git a/src/aeyama/content/AeyamaLiquids.java b/src/aeyama/content/AeyamaLiquids.java deleted file mode 100644 index c3970e4a..00000000 --- a/src/aeyama/content/AeyamaLiquids.java +++ /dev/null @@ -1,20 +0,0 @@ -package aeyama.content; - -import arc.graphics.*; - -import mindustry.type.*; - -public class AeyamaLiquids { - public static Liquid sulfuricAcid; - - public static void load() { - sulfuricAcid = new Liquid("sulfuric-acid", Color.valueOf("#a7dd01")) {{ - coolant = false; - effect = AeyamaStatusEffects.corrosion; - - heatCapacity = 0.45f; - viscosity = 0.55f; - temperature = 0.85f; - }}; - } -} diff --git a/src/aeyama/content/AeyamaLoadouts.java b/src/aeyama/content/AeyamaLoadouts.java deleted file mode 100644 index 7636155e..00000000 --- a/src/aeyama/content/AeyamaLoadouts.java +++ /dev/null @@ -1,11 +0,0 @@ -package aeyama.content; - -import mindustry.game.*; - -public class AeyamaLoadouts { - public static Schematic basicFrontline; - - public static void load() { - basicFrontline = Schematics.readBase64("bXNjaAF4nD3MQQrCMBAF0N9QFHTdreQCPYQIrnoDcTFORzqQTCQTF4KHtyj4DvAQEHr0RllwOMqLMsV3nOhpvMRTqRLPtVhLaoKtN6GsM3bOi2Rqyo79LM5VH02LAdgkuklyhMu1w0DfcOT1Ge//B+jw8wE4cCQC"); - } -} diff --git a/src/aeyama/content/AeyamaPlanets.java b/src/aeyama/content/AeyamaPlanets.java deleted file mode 100644 index 76bdb3ac..00000000 --- a/src/aeyama/content/AeyamaPlanets.java +++ /dev/null @@ -1,91 +0,0 @@ -package aeyama.content; - -import arc.graphics.*; - -import mindustry.content.*; -import mindustry.graphics.g3d.*; -import mindustry.type.*; - -import aeyama.content.blocks.*; -import aeyama.planets.*; - -public class AeyamaPlanets { - public static Planet - aeyama, moon; - - public static void load() { - aeyama = new Planet("aeyama", Planets.sun, 1f, 1) {{ - iconColor = Color.valueOf("#158400"); - generator = new AeyamaPlanetGenerator(); - - accessible = true; - defaultCore = AeyamaEffectBlocks.coreFrontline; - - drawOrbit = true; - orbitRadius = 32f; - - rotateTime = 24 * 60; // 24 minutes for a Aeyama day - orbitTime = rotateTime * 28; // Full year in 28 Aeyama days - - atmosphereColor = Color.valueOf("#21c7eb"); - atmosphereRadIn = 0.1f; - atmosphereRadOut = 0.3f; - - sectorSeed = 5948; - startSector = 0; - clearSectorOnLose = true; - allowSectorInvasion = false; - allowLaunchToNumbered = false; - allowLaunchLoadout = true; - - ruleSetter = r -> { - r.fog = true; - r.staticFog = true; - }; - - itemWhitelist = AeyamaItems.aeyamaItems; - - meshLoader = () -> new MultiMesh( - new NoiseMesh(this, 262436, - 5, .9f, 4, 1f, .75f, 1.2f, - Color.valueOf("#158400"), Color.valueOf("#7070ff"), - 4, .5f, .5f, .5f), - - new HexSkyMesh(this, 5, - 1.5f, .12f, 5, Color.valueOf("#7eb6debb"), 1, 2f, 2f, .45f) - - // // Grass & Water - // new NoiseMesh(this, 262436, - // 6, 1f, 4, 1f, 0.75f, 1.2f, - // Color.valueOf("#158400"), Color.valueOf("#7070ff"), - // 3, 0.5f, 0.25f, 0.5f), - // // Moutains - // new NoiseMesh(this, 373547, - // 6, 1f, 5, 0.5f, 1f, 1.3f, - // Color.valueOf("#aaaaaa"), Color.valueOf("#cccccc"), - // 4, 0.7f, 0.7f, 0.8f), - - // new HexSkyMesh(this, 5, - // 0.5f, 0.27f, 7, Color.valueOf("#7eb6debb"), - // 1, 2f, 2f, 0.45f) - ); - }}; - - moon = new Planet("moon", aeyama, 0.5f) {{ - visible = true; - accessible = false; - alwaysUnlocked = false; - - drawOrbit = true; - orbitRadius = 5.2f; - rotateTime = aeyama.rotateTime * .5f; //Full rotation in half a Aeyama day - orbitTime = aeyama.rotateTime * 7; //Full orbit per Aeyama week - - hasAtmosphere = false; - - meshLoader = () -> new NoiseMesh(this, 4689, 4, - Color.valueOf("#999999"), .5f, 5, - 1f, .5f, 1f); - }}; - } -} diff --git a/src/aeyama/content/AeyamaSectors.java b/src/aeyama/content/AeyamaSectors.java deleted file mode 100644 index 9a63c100..00000000 --- a/src/aeyama/content/AeyamaSectors.java +++ /dev/null @@ -1,33 +0,0 @@ -package aeyama.content; - -import mindustry.type.*; - -import static mindustry.type.ItemStack.*; - -public class AeyamaSectors { - public static SectorPreset - newWorld, encounter; - - public static void load() { - newWorld = new SectorPreset("new-world", AeyamaPlanets.aeyama, 0) {{ - difficulty = 0; - alwaysUnlocked = true; - - rules = r -> { - r.loadout.clear(); - r.loadout.addAll(with(AeyamaItems.woodLumber, 75, AeyamaItems.stone, 50)); - r.canGameOver = false; - }; - }}; - encounter = new SectorPreset("encounter", AeyamaPlanets.aeyama, 14) {{ - difficulty = 1; - allowLaunchSchematics = true; - allowLaunchLoadout = true; - - rules = r -> { - r.loadout.clear(); - r.loadout.addAll(with(AeyamaItems.woodLumber, 100, AeyamaItems.stoneBrick, 50, AeyamaItems.rawIron, 10)); - }; - }}; - } -} diff --git a/src/aeyama/content/AeyamaStatusEffects.java b/src/aeyama/content/AeyamaStatusEffects.java deleted file mode 100644 index aaebfed5..00000000 --- a/src/aeyama/content/AeyamaStatusEffects.java +++ /dev/null @@ -1,22 +0,0 @@ -package aeyama.content; - -import arc.graphics.*; -import mindustry.type.*; - -public class AeyamaStatusEffects { - public static StatusEffect - knockdown, corrosion; - - public static void load() { - knockdown = new StatusEffect("knockdown") {{ - color = Color.valueOf("#98db17"); - healthMultiplier = 0.8f; - speedMultiplier = 0.8f; - }}; - corrosion = new StatusEffect("corrosion") {{ - color = Color.valueOf("#a7dd01"); - speedMultiplier = 0.4f; - damage = 0.35f; - }}; - } -} diff --git a/src/aeyama/content/AeyamaTechTree.java b/src/aeyama/content/AeyamaTechTree.java deleted file mode 100644 index 1328109c..00000000 --- a/src/aeyama/content/AeyamaTechTree.java +++ /dev/null @@ -1,226 +0,0 @@ -package aeyama.content; - -import arc.struct.*; - -import mindustry.content.*; -import mindustry.game.Objectives.*; - -import aeyama.content.blocks.*; - -import static mindustry.content.TechTree.*; -import static mindustry.type.ItemStack.*; - -public class AeyamaTechTree { - - public static void load() { - AeyamaPlanets.aeyama.techTree = nodeRoot("@aeyama.displayName-simple", AeyamaItems.planet, () -> { - node(AeyamaEffectBlocks.coreDropPod, () -> { - node(AeyamaDistributionBlocks.woodConveyor, with(AeyamaItems.woodLumber, 10, AeyamaItems.stone, 5), Seq.with(new Research(AeyamaProductionBlocks.woodHarvester)), () -> { - node(AeyamaDistributionBlocks.ironConveyor, with(/*TODO*/), Seq.with(new Produce(AeyamaItems.iron)), () -> { - node(AeyamaDistributionBlocks.steelConveyor, with(/*TODO*/), Seq.with(new Produce(AeyamaItems.iron), new Produce(AeyamaItems.steel)), () -> { - - }); - node(AeyamaDistributionBlocks.ironRouter, with(/*TODO*/), Seq.with(new Produce(AeyamaItems.iron)), () -> { - node(AeyamaDistributionBlocks.ironJunction, with(/*TODO*/), Seq.with(new Produce(AeyamaItems.iron)), () -> { - - }); - node(AeyamaDistributionBlocks.ironBridge, with(/*TODO*/), Seq.with(new Produce(AeyamaItems.iron)), () -> { - - }); - }); - }); - node(AeyamaDistributionBlocks.woodRouter, with(AeyamaItems.woodLumber, 20, AeyamaItems.stone, 10), () -> { - - }); - node(AeyamaDistributionBlocks.woodJunction, with(AeyamaItems.woodLumber, 50, AeyamaItems.stone, 10), Seq.with(new SectorComplete(AeyamaSectors.newWorld)), () -> { - - }); - }); - node(AeyamaEffectBlocks.coreFrontline, with(AeyamaItems.woodLumber, 600, AeyamaItems.stoneBrick, 950, AeyamaItems.rawIron, 250, AeyamaItems.blueprint, 2), Seq.with(new Produce(AeyamaItems.blueprint)/*, new Produce(AeyamaUnitTypes.sms)*/), () -> { - node(AeyamaEffectBlocks.coreControl, with(AeyamaItems.woodLumber, 1000, AeyamaItems.stoneBrick, 1000, AeyamaItems.iron, 500, AeyamaItems.specialBPDefense, 3), () -> { - - }); - node(AeyamaEffectBlocks.groundScanner, with(AeyamaItems.stoneBrick, 450, AeyamaItems.iron, 200, AeyamaItems.blueprint, 2), Seq.with(new Produce(AeyamaItems.iron)), () -> { - - }); - }); - node(AeyamaProductionBlocks.woodHarvester, with(AeyamaItems.woodLumber, 80), () -> { - node(AeyamaProductionBlocks.stoneMiner, with(AeyamaItems.woodLumber, 120), () -> { - node(AeyamaProductionBlocks.ironMiner, with(AeyamaItems.woodLumber, 110, AeyamaItems.stoneBrick, 185), () -> { - - }); - node(AeyamaProductionBlocks.copperMiner, with(AeyamaItems.woodLumber, 210, AeyamaItems.stoneBrick, 270, AeyamaItems.iron, 45, AeyamaItems.blueprint, 2), () -> { - - }); - node(AeyamaProductionBlocks.zincMiner, with(AeyamaItems.woodLumber, 210, AeyamaItems.stoneBrick, 270, AeyamaItems.iron, 45, AeyamaItems.blueprint, 2), () -> { - - }); - }); - }); - node(AeyamaEffectBlocks.smallStockpile, with(AeyamaItems.woodLumber, 120, AeyamaItems.stoneBrick, 300, AeyamaItems.blueprint, 1), Seq.with(new Produce(AeyamaItems.rawIron)), () -> { - node(AeyamaEffectBlocks.stockpile, with(AeyamaItems.woodLumber, 1200, AeyamaItems.stoneBrick, 1800, AeyamaItems.iron, 600, AeyamaItems.blueprint, 12), () -> { - node(AeyamaEffectBlocks.largeStockpile, with(AeyamaItems.woodLumber, 3750, AeyamaItems.stoneBrick, 4500, AeyamaItems.iron, 1000, AeyamaItems.advancedBlueprint, 18), () -> { - - }); - }); - }); - node(AeyamaProductionBlocks.brickMaker, with(AeyamaItems.woodLumber, 300, AeyamaItems.stone, 200), Seq.with(new Produce(AeyamaItems.woodLumber), new Produce(AeyamaItems.stone)), () -> { - node(AeyamaProductionBlocks.researchStation, with(AeyamaItems.woodLumber, 400, AeyamaItems.stoneBrick, 600, AeyamaItems.rawIron, 250), Seq.with(new Produce(AeyamaItems.woodLumber), new Produce(AeyamaItems.stoneBrick), new Produce(AeyamaItems.rawIron)), () -> { - node(AeyamaProductionBlocks.woodDryer, with(AeyamaItems.woodLumber, 300, AeyamaItems.stoneBrick, 150, AeyamaItems.blueprint, 1), () -> { - node(AeyamaProductionBlocks.shredder, with(AeyamaItems.woodLumber, 500, AeyamaItems.stoneBrick, 200, AeyamaItems.rawIron, 140), Seq.with(new Produce(AeyamaItems.woodLumber), new Produce(AeyamaItems.stoneBrick), new Produce(AeyamaItems.rawIron), new SectorComplete(AeyamaSectors.newWorld)), () -> { - - }); - }); - node(AeyamaProductionBlocks.burner, with(AeyamaItems.woodLumber, 150, AeyamaItems.stoneBrick, 375, AeyamaItems.rawIron, 75, AeyamaItems.blueprint, 2), () -> { - node(AeyamaProductionBlocks.oreSmelter, with(AeyamaItems.woodLumber, 450, AeyamaItems.stoneBrick, 650, AeyamaItems.rawIron, 300, AeyamaItems.blueprint, 2), () -> { - node(AeyamaProductionBlocks.oreFoundry, with(AeyamaItems.iron, 280, AeyamaItems.woodLumber, 725, AeyamaItems.stoneBrick, 800, AeyamaItems.blueprint, 4), () -> { - - }); - }); - }); - node(AeyamaProductionBlocks.researchLab, with(AeyamaItems.woodLumber, 800, AeyamaItems.stoneBrick, 1200, AeyamaItems.rawIron, 500, AeyamaItems.blueprint, 10), () -> { - - }); - }); - }); - node(AeyamaDefenseBlocks.thrower, with(AeyamaItems.woodLumber, 100, AeyamaItems.stoneBrick, 130, AeyamaItems.iron, 20, AeyamaItems.blueprint, 2), Seq.with(new Produce(AeyamaItems.blueprint), new SectorComplete(AeyamaSectors.newWorld)), () -> { - node(AeyamaDefenseBlocks.bully, with(AeyamaItems.woodLumber, 165, AeyamaItems.stone, 195, AeyamaItems.iron, 45, AeyamaItems.blueprint, 2), Seq.with(new SectorComplete(AeyamaSectors.newWorld)), () -> { - - }); - node(AeyamaDefenseBlocks.craker, with(/*TODO*/), Seq.with(new Produce(AeyamaItems.steel), new Produce(AeyamaItems.advancedBlueprint)), () -> { - node(AeyamaDefenseBlocks.penetration, with(), Seq.with(new SectorComplete(AeyamaSectors.encounter)), () -> { - - }); - }); - node(AeyamaDefenseBlocks.woodWall, with(AeyamaItems.woodLumber, 20), Seq.with(new Produce(AeyamaItems.woodLumber), new SectorComplete(AeyamaSectors.newWorld)), () -> { - node(AeyamaDefenseBlocks.stoneBrickWall, with(AeyamaItems.stoneBrick, 20), Seq.with(new Produce(AeyamaItems.stoneBrick), new SectorComplete(AeyamaSectors.newWorld)), () -> { - node(AeyamaDefenseBlocks.ironWall, with(AeyamaItems.iron, 20), Seq.with(new Produce(AeyamaItems.iron), new SectorComplete(AeyamaSectors.encounter)), () -> { - node(AeyamaDefenseBlocks.steelWall, with(AeyamaItems.steel, 20), Seq.with(new Produce(AeyamaItems.steel)), () -> { - node(AeyamaDefenseBlocks.largeSteelWall, with(AeyamaItems.steel, 100), () -> { - - }); - }); - node(AeyamaDefenseBlocks.largeIronWall, with(AeyamaItems.iron, 100), () -> { - - }); - }); - node(AeyamaDefenseBlocks.largeStoneBrickWall, with(AeyamaItems.stoneBrick, 100), () -> { - - }); - }); - node(AeyamaDefenseBlocks.largeWoodWall, with(AeyamaItems.woodLumber, 100), () -> { - - }); - }); - }); - }); - - nodeProduce(AeyamaItems.woodLumber, () -> { - nodeProduce(AeyamaItems.blueprint, () -> { - nodeProduce(AeyamaItems.advancedBlueprint, () -> { - nodeProduce(AeyamaItems.specialBPDefense, () -> { - - }); - nodeProduce(AeyamaItems.specialBPOffense, () -> { - - }); - }); - }); - nodeProduce(AeyamaItems.carbon, () -> { - - }); - nodeProduce(Items.sand, () -> { - nodeProduce(Liquids.water, () -> { - - }); - }); - nodeProduce(AeyamaItems.stone, () -> { - nodeProduce(AeyamaItems.rawIron, () -> { - nodeProduce(AeyamaItems.iron, () -> { - nodeProduce(AeyamaItems.steel, () -> { - nodeProduce(AeyamaItems.armorPlating, () -> { - - }); - }); - }); - nodeProduce(AeyamaItems.rawCopper, () -> { - nodeProduce(AeyamaItems.copper, () -> { - nodeProduce(AeyamaItems.brass, Seq.with(new Produce(AeyamaItems.zinc), new Produce(AeyamaItems.copper)), () -> { - nodeProduce(AeyamaItems.rifle, Seq.with(new Research(AeyamaProductionBlocks.ammunitionPress)), () -> { - nodeProduce(AeyamaItems.combustibleCanister, Seq.with(new Produce(AeyamaItems.carbon)), () -> { - nodeProduce(AeyamaItems.rocket, () -> { - - }); - }); - nodeProduce(AeyamaItems.highCaliber, () -> { - - }); - nodeProduce(AeyamaItems.shotgunShell, () -> { - nodeProduce(AeyamaItems.shotgunSlug, () -> { - - }); - }); - }); - }); - }); - nodeProduce(AeyamaItems.rawTin, () -> { - nodeProduce(AeyamaItems.tin, () -> { - nodeProduce(AeyamaItems.bronze, () -> { - - }); - }); - }); - }); - nodeProduce(AeyamaItems.rawTitanium, () -> { - nodeProduce(AeyamaItems.titanium, () -> { - - }); - }); - nodeProduce(AeyamaItems.rawZinc, () -> { - nodeProduce(AeyamaItems.rawAluminum, () -> { - nodeProduce(AeyamaItems.aluminum, () -> { - - }); - }); - nodeProduce(AeyamaItems.zinc, () -> { - - }); - }); - }); - nodeProduce(AeyamaItems.stonePebbles, () -> { - - }); - nodeProduce(AeyamaItems.stoneBrick, () -> { - - }); - }); - nodeProduce(AeyamaItems.woodLumberDry, () -> { - - }); - nodeProduce(AeyamaItems.woodShreds, () -> { - - }); - }); - - node(AeyamaSectors.newWorld, () -> { - node(AeyamaSectors.encounter, Seq.with(new SectorComplete(AeyamaSectors.newWorld)), () -> { - - }); - }); - - node(AeyamaUnits.colonist, () -> { - node(AeyamaUnits.sms, with(AeyamaItems.armorPlating, 100), () -> { - node(AeyamaUnits.assault, with(AeyamaItems.armorPlating, 200), () -> { - - }); - node(AeyamaUnits.heavy, with(AeyamaItems.armorPlating, 500), () -> { - - }); - node(AeyamaUnits.scout, with(AeyamaItems.armorPlating, 300), () -> { - - }); - }); - }); - }); - } -} diff --git a/src/aeyama/content/AeyamaUnits.java b/src/aeyama/content/AeyamaUnits.java deleted file mode 100644 index d69713ff..00000000 --- a/src/aeyama/content/AeyamaUnits.java +++ /dev/null @@ -1,371 +0,0 @@ -package aeyama.content; - -import arc.graphics.*; - -import mindustry.ai.types.*; -import mindustry.content.*; -import mindustry.entities.bullet.*; -import mindustry.gen.*; -import mindustry.type.*; - -public class AeyamaUnits { - public static UnitType - colonist, sms, assault, heavy, scout, - - insectCrawler, insectSwarmer, insectSpit; - - public static void load() { - colonist = new UnitType("colonist") {{ - aiController = BuilderAI::new; - constructor = MechUnit::create; - isEnemy = false; - - mechSideSway = 0f; - mechStepParticles = true; - legSpeed = .5f; - - health = 100f; - armor = 2f; - hitSize = 2f; - flying = false; - itemCapacity = 20; - drag = 1.25f; - - speed = 1.75f; - canBoost = true; - boostMultiplier = .75f; // Fly speed over obstacle/far from camera - - buildSpeed = .25f; - buildRange = 150f; - - canAttack = true; - mineSpeed = 2f; - mineTier = 0; - mineFloor = true; - mineWalls = true; - - coreUnitDock = true; - createScorch = false; - }}; - sms = new UnitType("sms") {{ - aiController = BuilderAI::new; - constructor = MechUnit::create; - isEnemy = false; - - mechSideSway = 0f; - mechStepParticles = true; - legSpeed = .5f; - - health = 300f; - speed = 1.75f; - flying = false; - hitSize = 2.5f; - itemCapacity = 40; - drag = 1.25f; - - canBoost = true; - boostMultiplier = .75f; // Fly speed over obstacle/far from camera - - buildSpeed = .75f; - buildRange = 100f; - - canAttack = true; - mineSpeed = 2f; - mineTier = 0; - mineFloor = true; - mineWalls = true; - - coreUnitDock = true; - createScorch = false; - - weapons.add(new Weapon("aeyama-taser") {{ - top = false; - x = 5f; - y = 3f; - shootY = 2f; - reload = 36f; - recoil = 2f; - shootSound = Sounds.spark; - shake = 0.1f; - alternate = false; - mirror = false; - shoot.shots = 3; - shoot.shotDelay = 0.5f; - bullet = new LightningBulletType(){{ - lightningLength = 4; - damage = 6f; - speed = 0f; - collidesTeam = true; - healPercent = 2f; - lifetime = Fx.lightning.lifetime; - hitEffect = Fx.hitLancer; - despawnEffect = Fx.none; - status = StatusEffects.shocked; - statusDuration = 10f; - hittable = false; - lightColor = Color.white; - buildingDamageMultiplier = 0.25f; - lightningColor = hitColor =Color.valueOf("#5b6ee1"); - }}; - }}); - }}; - assault = new UnitType("assault") {{ - aiController = BuilderAI::new; - constructor = MechUnit::create; - isEnemy = false; - - mechSideSway = 0f; - mechStepParticles = true; - legSpeed = .5f; - - health = 300f; - speed = 1.5f; - drag = 1.25f; - flying = false; - omniMovement = true; - hitSize = 2f; - itemCapacity = 10; - - buildSpeed = .25f; - buildRange = 100f; - - canBoost = true; - boostMultiplier = .3f; - - canAttack = true; - mineSpeed = 2f; - mineTier = 0; - mineFloor = true; - mineWalls = true; - - coreUnitDock = true; - createScorch = false; - - weapons.add(AeyamaWeapons.rifle); - }}; - heavy = new UnitType("heavy") {{ - aiController = BuilderAI::new; - constructor = MechUnit::create; - isEnemy = false; - - mechSideSway = 0f; - mechStepParticles = true; - legSpeed = .5f; - - health = 300f; - speed = 1.5f; - drag = 1.25f; - flying = false; - omniMovement = true; - hitSize = 2f; - itemCapacity = 10; - - buildSpeed = .25f; - buildRange = 100f; - - canBoost = true; - boostMultiplier = .3f; - - canAttack = true; - mineSpeed = 2f; - mineTier = 0; - mineFloor = true; - mineWalls = true; - - coreUnitDock = true; - createScorch = false; - - weapons.add(AeyamaWeapons.rifle); - }}; - scout = new UnitType("scout") {{ - aiController = BuilderAI::new; - constructor = MechUnit::create; - isEnemy = false; - - mechSideSway = 0f; - mechStepParticles = true; - legSpeed = .5f; - - health = 300f; - speed = 1.5f; - drag = 1.25f; - flying = false; - omniMovement = true; - hitSize = 2f; - itemCapacity = 10; - - buildSpeed = .25f; - buildRange = 100f; - - canBoost = true; - boostMultiplier = .3f; - - canAttack = true; - mineSpeed = 2f; - mineTier = 0; - mineFloor = true; - mineWalls = true; - - coreUnitDock = true; - createScorch = false; - - weapons.add(AeyamaWeapons.rifle); - }}; - - insectCrawler = new UnitType("insect-crawler") {{ - aiController = GroundAI::new; - constructor = LegsUnit::create; - isEnemy = true; - groundLayer = 60f; - - legSpeed = .5f; - legCount = 6; - legLengthScl = 2f; - legGroupSize = 3; - legMoveSpace = 1f; - legMinLength = .3f; - legMaxLength = .6f; - // legExtension = -2f; - legStraightness = .2f; - legBaseOffset = 2.5f; - legPairOffset = 2.5f; - rippleScale = .15f; - lockLegBase = true; - legContinuousMove = true; - legPhysicsLayer = false; - allowLegStep = false; - - health = 65f; - armor = 1f; - speed = .75f; - drag = 1f; - flying = false; - hitSize = 8f; - physics = true; - stepShake = 0f; - rotateSpeed = 8f; - - createScorch = false; - createWreck = false; - - canAttack = true; - - weapons.add(new Weapon("aeyama-insect-claw") {{ - top = false; - reload = 25f; - recoil = -1f; - x = -0.8f; - y = 3.25f; - shootY = 4f; - shake = .35f; - alternate = false; - mirror = true; - shootSound = Sounds.none; - bullet = new BasicBulletType() {{ - damage = 8f; - speed = 30f; - lifetime = 1f; - frontColor = Color.valueOf("#ffffff00"); - backColor = Color.valueOf("#98ffa900"); - }}; - }}); - }}; - insectSwarmer = new UnitType("insect-swarmer") {{ - aiController = GroundAI::new; - constructor = LegsUnit::create; - isEnemy = true; - groundLayer = 60f; - - legSpeed = .5f; - legCount = 6; - legLengthScl = 2f; - legGroupSize = 3; - legMoveSpace = .5f; - legMinLength = .1f; - legMaxLength = .4f; - legExtension = 1f; - legStraightness = .5f; - legBaseOffset = 1f; - legPairOffset = .5f; - rippleScale = .15f; - lockLegBase = true; - legContinuousMove = true; - legPhysicsLayer = false; - allowLegStep = false; - - health = 16f; - armor = 0f; - speed = 0.75f; - drag = .5f; - flying = false; - hitSize = 4f; - physics = true; - stepShake = 0f; - rotateSpeed = 8f; - - createScorch = false; - createWreck = false; - - canAttack = true; - - weapons.add(new Weapon("aeyama-insect-claw") {{ - top = false; - reload = 5f; - recoil = -1f; - x = -.8f; - y = 2f; - shootY = 3f; - shake = .25f; - alternate = false; - mirror = true; - shootSound = Sounds.none; - bullet = new BasicBulletType() {{ - damage = 2f; - speed = 20f; - lifetime = 1f; - frontColor = Color.valueOf("#ffffff00"); - backColor = Color.valueOf("#98ffa900"); - }}; - }}); - }}; - insectSpit = new UnitType("insect-spit") {{ - aiController = GroundAI::new; - constructor = LegsUnit::create; - isEnemy = true; - groundLayer = 60f; - - legSpeed = 0.7f; - legCount = 6; - legLengthScl = 3f; - legGroupSize = 3; - legMoveSpace = 0.6f; - legMinLength = 0.2f; - legMaxLength = 0.5f; - legExtension = 1f; - legStraightness = 0.5f; - legBaseOffset = 1f; - legPairOffset = 0.6f; - rippleScale = 0.15f; - lockLegBase = true; - legContinuousMove = true; - legPhysicsLayer = false; - allowLegStep = false; - - health = 36f; - armor = 2f; - speed = 0.7f; - drag = 0.5f; - flying = false; - hitSize = 10f; - physics = true; - stepShake = 0.1f; - rotateSpeed = 8f; - - createScorch = false; - createWreck = false; - - canAttack = true; - weapons.add(AeyamaWeapons.insectSpit); - }}; - } -} diff --git a/src/aeyama/content/AeyamaWeapons.java b/src/aeyama/content/AeyamaWeapons.java deleted file mode 100644 index de3d07c8..00000000 --- a/src/aeyama/content/AeyamaWeapons.java +++ /dev/null @@ -1,207 +0,0 @@ -package aeyama.content; - -import arc.graphics.*; - -import mindustry.content.*; -import mindustry.entities.bullet.*; -import mindustry.gen.*; -import mindustry.type.*; - -public class AeyamaWeapons { - public static Weapon - buildTools, rifle, shotgun, sniperRifle, minigun, - - insectJaw, insectJawWeak, insectSpit; - - public static void load() { - buildTools = new Weapon("build-tools") {{ - top = false; - x = 5f; - y = 3f; - shootY = 2f; - reload = 36f; - recoil = 2f; - shootSound = Sounds.spark; - shake = 0.1f; - alternate = false; - mirror = false; - shoot.shots = 3; - shoot.shotDelay = 0.5f; - bullet = new LightningBulletType(){{ - lightningLength = 4; - damage = 6f; - speed = 0f; - collidesTeam = true; - healPercent = 2f; - lifetime = Fx.lightning.lifetime; - hitEffect = Fx.hitLancer; - despawnEffect = Fx.none; - status = StatusEffects.shocked; - statusDuration = 10f; - hittable = false; - lightColor = Color.white; - buildingDamageMultiplier = 0.25f; - lightningColor = hitColor = Color.valueOf("#5b6ee1"); - }}; - }}; - - rifle = new Weapon("rifle") {{ - aiControllable = false; - top = false; - x = 5f; - y = 3f; - shootY = 2f; - reload = 25f; - recoil = 2f; - shootSound = Sounds.pew; - shake = .25f; - alternate = false; - mirror = false; - bullet = new BasicBulletType() {{ - damage = 14f; - speed = 6f; - lifetime = 20f; - frontColor = Color.valueOf("#ffffff"); - backColor = Color.valueOf("#98ffa9"); - }}; - }}; - - shotgun = new Weapon("minigun") {{ - aiControllable = false; - top = false; - x = 5f; - y = 3f; - shootY = 2f; - reload = 40f; - recoil = 3f; - shootSound = Sounds.pew; - shake = .25f; - alternate = false; - mirror = false; - bullet = new BasicBulletType() {{ - damage = 10f; - speed = 6f; - lifetime = 15f; - frontColor = Color.valueOf("#ffffff"); - backColor = Color.valueOf("#98ffa9"); - - instantDisappear = true; - fragRandomSpread = 15f; - fragBullets = 6; - fragBullet = new BasicBulletType() {{ - damage = 10f; - speed = 4f; - lifetime = 20f; - width = 2f; - height = 2f; - }}; - }}; - }}; - - sniperRifle = new Weapon("sniper-rifle") {{ - aiControllable = false; - top = false; - x = 5f; - y = 3f; - shootY = 2f; - reload = 60f; - recoil = 8f; - shootSound = Sounds.pew; - shake = .25f; - alternate = false; - mirror = false; - bullet = new BasicBulletType() {{ - damage = 32f; - speed = 12f; - lifetime = 20f; - frontColor = Color.valueOf("#ffffff"); - backColor = Color.valueOf("#98ffa9"); - }}; - }}; - - minigun = new Weapon("minigun") {{ - aiControllable = false; - top = false; - x = 5f; - y = 3f; - shootY = 2f; - reload = 1f; - recoil = 3f; - shootSound = Sounds.pew; - shake = .25f; - alternate = false; - mirror = false; - bullet = new BasicBulletType() {{ - damage = 4f; - speed = 6f; - lifetime = 17f; - frontColor = Color.valueOf("#ffffff"); - backColor = Color.valueOf("#98ffa9"); - }}; - }}; - - // Insects weapons - insectJaw = new Weapon("insect-jaw") {{ - top = false; - reload = 25f; - recoil = -1f; - x = -0.8f; - y = 3.25f; - shootY = 4f; - shake = .35f; - alternate = false; - mirror = true; - shootSound = Sounds.none; - bullet = new BasicBulletType() {{ - damage = 8f; - speed = 30f; - lifetime = 1f; - frontColor = Color.valueOf("#ffffff00"); - backColor = Color.valueOf("#98ffa900"); - }}; - }}; - - insectJawWeak = new Weapon("insect-jaw-weak") {{ - top = false; - reload = 5f; - recoil = -1f; - x = -.8f; - y = 2f; - shootY = 3f; - shake = .25f; - alternate = false; - mirror = true; - shootSound = Sounds.none; - bullet = new BasicBulletType() {{ - damage = 2f; - speed = 20f; - lifetime = 1f; - frontColor = Color.valueOf("#ffffff00"); - backColor = Color.valueOf("#98ffa900"); - }}; - }}; - - insectSpit = new Weapon("insect-spit") {{ - top = false; - reload = 34f; - recoil = 1f; - x = 0f; - y = 2f; - shootY = 3f; - shake = 0.25f; - alternate = false; - mirror = false; - shootSound = Sounds.none; - bullet = new BasicBulletType(5, 7) {{ - status = AeyamaStatusEffects.knockdown; - statusDuration = 30; - lifetime = 14f; - frontColor = Color.valueOf("#16942e"); - backColor = Color.valueOf("#16942e"); - trailColor = Color.valueOf("#16942e"); - trailWidth = 1.2f; - trailLength = 5; - }}; - }}; - } -} \ No newline at end of file diff --git a/src/aeyama/content/blocks/AeyamaDefenseBlocks.java b/src/aeyama/content/blocks/AeyamaDefenseBlocks.java deleted file mode 100644 index 3d0b673f..00000000 --- a/src/aeyama/content/blocks/AeyamaDefenseBlocks.java +++ /dev/null @@ -1,214 +0,0 @@ -package aeyama.content.blocks; - -import mindustry.entities.bullet.*; -import mindustry.entities.pattern.*; -import mindustry.type.*; -import mindustry.world.*; -import mindustry.world.blocks.defense.*; -import mindustry.world.blocks.defense.turrets.*; - -import aeyama.content.*; - -import static mindustry.type.ItemStack.*; - -public class AeyamaDefenseBlocks { - public static Block - /* Turrets */ - bully, thrower, craker, penetration, - - /* Walls */ - woodWall, largeWoodWall, stoneBrickWall, largeStoneBrickWall, - ironWall, largeIronWall, steelWall, largeSteelWall; - - public static void load() { - /* Turrets */ - bully = new ItemTurret("bully") {{ - health = 240; - - range = 80f; - reload = 10f; - maxAmmo = 40; - inaccuracy = 4f; - targetGround = true; - targetAir = true; - - ammo(AeyamaItems.stonePebbles, new BulletType() {{ - reloadMultiplier = 1f; - ammoMultiplier = 2f; - lifetime = 60f; - damage = 10f; - speed = 1.8f; - inaccuracy = 12f; - - instantDisappear = true; - fragRandomSpread = 15f; - fragBullets = 4; - fragBullet = new BasicBulletType() {{ - damage = 6f; - speed = 1.8f; - lifetime = 40f; - width = 4f; - height = 4f; - }}; - }}, AeyamaItems.woodShreds, new BulletType() {{ - reloadMultiplier = 1f; - ammoMultiplier = 4f; - lifetime = 60f; - damage = 8f; - speed = 1.8f; - inaccuracy = 12f; - - instantDisappear = true; - fragRandomSpread = 30f; - fragBullets = 8; - fragBullet = new BasicBulletType() {{ - damage = 4f; - speed = 1.8f; - lifetime = 30f; - width = 2f; - height = 2f; - }}; - }}); - - requirements(Category.turret, with(AeyamaItems.woodLumber, 25, AeyamaItems.stoneBrick, 45, AeyamaItems.iron, 5)); - }}; - thrower = new ItemTurret("thrower") {{ - health = 270; - - range = 100f; - reload = 30f; - maxAmmo = 40; - inaccuracy = 4f; - targetGround = true; - targetAir = true; - ammo(AeyamaItems.stone, new BasicBulletType() {{ - reloadMultiplier = 1f; - ammoMultiplier = 2f; - lifetime = 60f; - damage = 24f; - height = 9.5f; - speed = 1.8f; - width = 7f; - }}, AeyamaItems.woodLumber, new BasicBulletType() {{ - reloadMultiplier = 1f; - ammoMultiplier = 4f; - lifetime = 60f; - damage = 16f; - height = 7.5f; - speed = 1.8f; - width = 5.5f; - }}); - - requirements(Category.turret, with(AeyamaItems.woodLumber, 45, AeyamaItems.stoneBrick, 70, AeyamaItems.iron, 15)); - }}; - craker = new ItemTurret("craker") {{ - health = 310; - size = 2; - - range = 90f; - reload = 40f; - inaccuracy = 4f; - targetGround = true; - targetAir = false; - shoot = new ShootSpread() {{ - shots = 10; - spread = 10f; - }}; - ammo(AeyamaItems.woodLumber, new BasicBulletType() {{ - reloadMultiplier = 1f; - ammoMultiplier = 1f; - lifetime = 60f; - damage = 11f; - height = 8f; - speed = 1.2f; - width = 4.5f; - }}, AeyamaItems.woodLumberDry, new BasicBulletType() {{ - reloadMultiplier = 1f; - ammoMultiplier = 1.5f; - lifetime = 90f; - damage = 16f; - height = 9f; - speed = 1.6f; - width = 6.5f; - }}); - - requirements(Category.turret, with(AeyamaItems.iron, 30, AeyamaItems.woodLumber, 65)); - }}; - penetration = new ItemTurret("penetration") {{ - scaledHealth = 100f; - size = 2; - range = 150f; - reload = 70f; - maxAmmo = 50; - targetGround = true; - targetAir = true; - ammoPerShot = 5; - shootY = 0; - ammo(AeyamaItems.iron, new BasicBulletType(6, 40) {{ - reloadMultiplier = 1f; - ammoMultiplier = 2f; - lifetime = 25f; - height = 10f; - width = 6f; - pierce = true; - pierceCap = 3; - }}, AeyamaItems.copper, new BasicBulletType(6, 25) {{ - reloadMultiplier = 1f; - ammoMultiplier = 3f; - lifetime = 25f; - height = 10f; - width = 6f; - pierce = true; - pierceCap = 5; - }}); - researchCostMultiplier = 0.4f; - requirements(Category.turret, with(AeyamaItems.woodLumber, 90, AeyamaItems.iron, 45, AeyamaItems.zinc, 30)); //TODO - }}; - - /* Walls */ - woodWall = new Wall("wall-wood") {{ - health = 120; - - requirements(Category.defense, with(AeyamaItems.woodLumber, 6)); - }}; - largeWoodWall = new Wall("wall-wood-large") {{ - health = woodWall.health * 4; - size = 2; - - requirements(Category.defense, with(AeyamaItems.woodLumber, 24)); - }}; - stoneBrickWall = new Wall("wall-stone-brick") {{ - health = 240; - - requirements(Category.defense, with(AeyamaItems.stoneBrick, 6)); - }}; - largeStoneBrickWall = new Wall("wall-stone-brick-large") {{ - health = stoneBrickWall.health * 4; - size = 2; - - requirements(Category.defense, with(AeyamaItems.stoneBrick, 24)); - }}; - ironWall = new Wall("wall-iron") {{ - scaledHealth = 270f; - - requirements(Category.defense, with(AeyamaItems.iron, 6)); - }}; - largeIronWall = new Wall("wall-iron-large") {{ - scaledHealth = ironWall.health * 4; - size = 2; - - requirements(Category.defense, with(AeyamaItems.iron, 24)); - }}; - steelWall = new Wall("wall-steel") {{ - scaledHealth = 324f; - - requirements(Category.defense, with(AeyamaItems.steel, 6)); - }}; - largeSteelWall = new Wall("wall-steel-large") {{ - scaledHealth = steelWall.health * 4; - size = 2; - - requirements(Category.defense, with(AeyamaItems.steel, 24)); - }}; - } -} diff --git a/src/aeyama/content/blocks/AeyamaDistributionBlocks.java b/src/aeyama/content/blocks/AeyamaDistributionBlocks.java deleted file mode 100644 index 18ac6e92..00000000 --- a/src/aeyama/content/blocks/AeyamaDistributionBlocks.java +++ /dev/null @@ -1,67 +0,0 @@ -package aeyama.content.blocks; - -import mindustry.type.*; -import mindustry.world.*; -import mindustry.world.blocks.distribution.*; - -import aeyama.content.*; - -import static mindustry.type.ItemStack.*; - -public class AeyamaDistributionBlocks { - public static Block - woodConveyor, woodRouter, woodJunction, - ironConveyor, ironRouter, ironJunction, ironBridge, - steelConveyor; - - public static void load() { - woodConveyor = new Conveyor("wood-conveyor") {{ - health = 8; - speed = 0.03f; - displayedSpeed = speed * 140; - - requirements(Category.distribution, with(AeyamaItems.woodLumber, 2)); - }}; - woodRouter = new Router("wood-router") {{ - health = 20; - - requirements(Category.distribution, with(AeyamaItems.woodLumber, 6, AeyamaItems.stone, 2)); - }}; - woodJunction = new Junction("wood-junction") {{ - health = 15; - - requirements(Category.distribution, with(AeyamaItems.woodLumber, 4, AeyamaItems.stoneBrick, 4)); - }}; - ironConveyor = new Conveyor("iron-conveyor") {{ - // scaledHealth = - speed = 0.06f; - displayedSpeed = speed * 140; - - requirements(Category.distribution, with(AeyamaItems.iron, 2, AeyamaItems.woodLumber, 2)); //TODO - }}; - ironRouter = new Router("iron-router") {{ - // scaledHealth = - speed = 16f; - - requirements(Category.distribution, with(AeyamaItems.iron, 6)); //TODO - }}; - ironJunction = new Junction("iron-junction") {{ - // scaledHealth = - - requirements(Category.distribution, with(AeyamaItems.iron, 4)); //TODO - }}; - ironBridge = new ItemBridge("iron-bridge") {{ - // scaledHealth = - range = 3; - - requirements(Category.distribution, with(AeyamaItems.iron, 8)); - }}; - steelConveyor = new Conveyor("steel-conveyor") {{ - // scaledHealth = - speed = 0.12f; - displayedSpeed = speed * 140; - - requirements(Category.distribution, with(AeyamaItems.iron, 2, AeyamaItems.steel, 2)); //TODO - }}; - } -} diff --git a/src/aeyama/content/blocks/AeyamaEffectBlocks.java b/src/aeyama/content/blocks/AeyamaEffectBlocks.java deleted file mode 100644 index b5e67315..00000000 --- a/src/aeyama/content/blocks/AeyamaEffectBlocks.java +++ /dev/null @@ -1,119 +0,0 @@ -package aeyama.content.blocks; - -import arc.graphics.*; -import arc.struct.*; - -import mindustry.type.*; -import mindustry.world.*; -import mindustry.world.blocks.production.*; -import mindustry.world.blocks.storage.*; -import mindustry.world.draw.*; -import mindustry.world.meta.*; - -import aeyama.content.*; -import aeyama.world.blocks.storage.*; -import aeyama.world.blocks.units.*; - -import static mindustry.type.ItemStack.*; - -public class AeyamaEffectBlocks { - public static Block - /* Core */ - coreDropPod, coreFrontline, coreControl, - - /* Equipment */ - armory, - - /* Storage */ - smallStockpile, stockpile, largeStockpile, - - /* Campaign */ - groundScanner; - - public static void load () { - /* Core */ - coreDropPod = new CoreBlock("core-drop-pod") {{ - health = 550; - alwaysUnlocked = true; - isFirstTier = true; - itemCapacity = 500; - - unitType = AeyamaUnits.colonist; - - requirements(Category.effect, BuildVisibility.editorOnly, with()); - }}; - coreFrontline = new CoreBlock("core-frontline") {{ - scaledHealth = 470; - size = 2; - itemCapacity = 1500; - - unitType = AeyamaUnits.sms; - - requirements(Category.effect, BuildVisibility.shown, with(AeyamaItems.woodLumber, 300, AeyamaItems.stoneBrick, 600, AeyamaItems.rawIron, 150)); - }}; - coreControl = new AeyamaCoreBlock("core-control") {{ - health = 2000; - size = 3; - itemCapacity = 3000; - - unitType = AeyamaUnits.sms; - - requirements(Category.effect, BuildVisibility.shown, with(AeyamaItems.woodLumber, 1000, AeyamaItems.stoneBrick, 1000, AeyamaItems.iron, 500)); - }}; - - /* Equipment */ - armory = new ArmoryBlock("armory") {{ - health = 1250; - size = 3; - - armorChoices = Seq.with( - AeyamaUnits.sms, - AeyamaUnits.assault, - AeyamaUnits.heavy, - AeyamaUnits.scout - ); - - requirements(Category.effect, with(/* TODO */)); - }}; - - /* Storage */ - smallStockpile = new StorageBlock("stockpile-small") {{ - scaledHealth = 48; - itemCapacity = 200; - - requirements(Category.effect, with(AeyamaItems.woodLumber, 40, AeyamaItems.stoneBrick, 60)); - }}; - stockpile = new StorageBlock("stockpile") {{ - scaledHealth = 420; - size = 2; - itemCapacity = 1000; - - requirements(Category.effect, with(AeyamaItems.woodLumber, 400, AeyamaItems.stoneBrick, 600, AeyamaItems.iron, 200)); - }}; - largeStockpile = new StorageBlock("stockpile-large") {{ - scaledHealth = 630; - size = 3; - itemCapacity = 2500; - - requirements(Category.effect, with(AeyamaItems.woodLumber, 750, AeyamaItems.stoneBrick, 900, AeyamaItems.steel, 200)); - }}; - - /* Campaing */ - groundScanner = new GenericCrafter("ground-scanner") {{ - health = 750; - size = 4; - - drawer = new DrawMulti( - new DrawDefault(), - new DrawSpikes(Color.valueOf("#FACF7F")) {{ rotateSpeed = .5f; }}, - new DrawPulseShape(false) {{ - radiusScl = 2.5f; - square = false; - timeScl = 250f; - }} - ); - - requirements(Category.effect, with(AeyamaItems.stoneBrick, 200, AeyamaItems.iron, 175)); - }}; - } -} diff --git a/src/aeyama/content/blocks/AeyamaEnvironmentBlocks.java b/src/aeyama/content/blocks/AeyamaEnvironmentBlocks.java deleted file mode 100644 index 8f06e7c6..00000000 --- a/src/aeyama/content/blocks/AeyamaEnvironmentBlocks.java +++ /dev/null @@ -1,207 +0,0 @@ -package aeyama.content.blocks; - -import mindustry.content.*; -import mindustry.graphics.*; -import mindustry.world.*; -import mindustry.world.blocks.environment.*; -import mindustry.world.meta.*; - -import aeyama.content.*; - -public class AeyamaEnvironmentBlocks { - public static Block - /* Floors */ - propsGrass, floorDirtA, floorDirtB, floorDirtC, floorGrassA, - floorGrassB, floorGrassC, floorGrassD, floorCopper, floorIron, - floorZinc, floorSand, floorStoneA, floorStoneB, floorStoneC, - floorDeepWater, floorSandWater, floorSulfuricAcid, - - /* Walls */ - wallDirtA, wallDirtB, wallDirtC, wallStoneA, wallStoneB, - wallStoneC, wallTree; - - public static void load() { - /* Floors */ - propsGrass = new OverlayFloor("props-grass") {{ - hasShadow = false; - variants = 9; - }}; - floorSand = new Floor("floor-sand", 1) {{ - itemDrop = Items.sand; - attributes.set(Attribute.get("sand"), .25f); - attributes.set(Attribute.get("stone"), .0875f); - }}; - floorGrassA = new Floor("floor-grassa", 3) {{ - attributes.set(Attribute.get("iron"), .025f); - attributes.set(Attribute.get("zinc"), .025f); - attributes.set(Attribute.get("copper"), .025f); - attributes.set(Attribute.get("stone"), .025f); - }}; - floorGrassB = new Floor("floor-grassb", 3) {{ - attributes.set(Attribute.get("iron"), .025f); - attributes.set(Attribute.get("zinc"), .025f); - attributes.set(Attribute.get("copper"), .025f); - attributes.set(Attribute.get("stone"), .025f); - }}; - floorGrassC = new Floor("floor-grassc", 3) {{ - attributes.set(Attribute.get("iron"), .025f); - attributes.set(Attribute.get("zinc"), .025f); - attributes.set(Attribute.get("copper"), .025f); - attributes.set(Attribute.get("stone"), .025f); - }}; - floorGrassD = new Floor("floor-grassd", 3) {{ - attributes.set(Attribute.get("iron"), .025f); - attributes.set(Attribute.get("zinc"), .025f); - attributes.set(Attribute.get("copper"), .025f); - attributes.set(Attribute.get("stone"), .025f); - }}; - floorDirtA = new Floor("floor-dirta", 3) {{ - attributes.set(Attribute.get("iron"), .05f); - attributes.set(Attribute.get("zinc"), .05f); - attributes.set(Attribute.get("copper"), .05f); - attributes.set(Attribute.get("stone"), .05f); - }}; - floorDirtB = new Floor("floor-dirtb", 3) {{ - attributes.set(Attribute.get("iron"), .05f); - attributes.set(Attribute.get("zinc"), .05f); - attributes.set(Attribute.get("copper"), .05f); - attributes.set(Attribute.get("stone"), .05f); - }}; - floorDirtC = new Floor("floor-dirtc", 3) {{ - attributes.set(Attribute.get("iron"), .05f); - attributes.set(Attribute.get("zinc"), .05f); - attributes.set(Attribute.get("copper"), .05f); - attributes.set(Attribute.get("stone"), .05f); - }}; - floorStoneA = new Floor("floor-stonea", 3) {{ - itemDrop = AeyamaItems.stone; - attributes.set(Attribute.get("iron"), .125f); - attributes.set(Attribute.get("zinc"), .125f); - attributes.set(Attribute.get("copper"), .125f); - attributes.set(Attribute.get("stone"), .25f); - }}; - floorStoneB = new Floor("floor-stoneb", 3) {{ - itemDrop = AeyamaItems.stone; - attributes.set(Attribute.get("iron"), .125f); - attributes.set(Attribute.get("zinc"), .125f); - attributes.set(Attribute.get("copper"), .125f); - attributes.set(Attribute.get("stone"), .25f); - }}; - floorStoneC = new Floor("floor-stonec", 3) {{ - itemDrop = AeyamaItems.stone; - attributes.set(Attribute.get("iron"), .125f); - attributes.set(Attribute.get("zinc"), .125f); - attributes.set(Attribute.get("copper"), .125f); - attributes.set(Attribute.get("stone"), .25f); - }}; - floorIron = new Floor("floor-ore-iron", 3) {{ - itemDrop = AeyamaItems.rawIron; - attributes.set(Attribute.get("iron"), .25f); - attributes.set(Attribute.get("zinc"), .075f); - attributes.set(Attribute.get("copper"), .075f); - attributes.set(Attribute.get("stone"), .125f); - }}; - floorCopper = new Floor("floor-ore-copper", 3) {{ - itemDrop = AeyamaItems.rawCopper; - attributes.set(Attribute.get("iron"), .075f); - attributes.set(Attribute.get("zinc"), .075f); - attributes.set(Attribute.get("copper"), .25f); - attributes.set(Attribute.get("stone"), .125f); - }}; - floorZinc = new Floor("floor-ore-zinc", 3) {{ - itemDrop = AeyamaItems.rawZinc; - attributes.set(Attribute.get("iron"), .075f); - attributes.set(Attribute.get("zinc"), .25f); - attributes.set(Attribute.get("copper"), .075f); - attributes.set(Attribute.get("stone"), .125f); - }}; - - floorSandWater = new Floor("floor-sand-water", 0) {{ - isLiquid = true; - liquidDrop = Liquids.water; - attributes.set(Attribute.get("water"), 1f); - - supportsOverlay = true; - cacheLayer = CacheLayer.water; - - albedo = 0.6f; - speedMultiplier = 0.8f; - status = StatusEffects.wet; - statusDuration = 30f; - }}; - floorDeepWater = new Floor("floor-deep-water", 0) {{ - isLiquid = true; - liquidDrop = Liquids.water; - attributes.set(Attribute.get("water"), 1f); - - supportsOverlay = true; - cacheLayer = CacheLayer.water; - - albedo = 0.9f; - speedMultiplier = 0.1f; - drownTime = 200f; - status = StatusEffects.wet; - statusDuration = 90f; - }}; - floorSulfuricAcid = new Floor("floor-sulfuric-acid", 0) {{ - isLiquid = true; - liquidDrop = AeyamaLiquids.sulfuricAcid; - - supportsOverlay = true; - cacheLayer = CacheLayer.water; - - albedo = 0.3f; - speedMultiplier = 0.7f; - status = AeyamaStatusEffects.corrosion; - statusDuration = 7.5f * 60f; - }}; - - /* Walls */ - wallDirtA = new StaticWall("wall-dirta") {{ - variants = 2; - attributes.set(Attribute.get("stone"), 0.1f); - - floorDirtA.asFloor().wall = this; - }}; - wallDirtB = new StaticWall("wall-dirtb") {{ - variants = 2; - attributes.set(Attribute.get("stone"), 0.1f); - - floorDirtB.asFloor().wall = this; - }}; - wallDirtC = new StaticWall("wall-dirtc") {{ - variants = 2; - attributes.set(Attribute.get("stone"), 0.1f); - - floorDirtC.asFloor().wall = this; - }}; - wallStoneA = new StaticWall("wall-stonea") {{ - variants = 2; - itemDrop = AeyamaItems.stone; - attributes.set(Attribute.get("stone"), 0.25f); - - floorStoneA.asFloor().wall = this; - }}; - wallStoneB = new StaticWall("wall-stoneb") {{ - variants = 2; - itemDrop = AeyamaItems.stone; - attributes.set(Attribute.get("stone"), 0.25f); - - floorStoneB.asFloor().wall = this; - }}; - wallStoneC = new StaticWall("wall-stonec") {{ - variants = 2; - itemDrop = AeyamaItems.stone; - attributes.set(Attribute.get("stone"), 0.25f); - - floorStoneC.asFloor().wall = this; - }}; - wallTree = new StaticWall("wall-tree") {{ - variants = 16; - itemDrop = AeyamaItems.woodLumber; - attributes.set(Attribute.get("wood"), 1f); - - floorGrassA.asFloor().wall = floorGrassB.asFloor().wall = floorGrassC.asFloor().wall = floorGrassD.asFloor().wall = this; - }}; - } -} diff --git a/src/aeyama/content/blocks/AeyamaProductionBlocks.java b/src/aeyama/content/blocks/AeyamaProductionBlocks.java deleted file mode 100644 index 357ba1e6..00000000 --- a/src/aeyama/content/blocks/AeyamaProductionBlocks.java +++ /dev/null @@ -1,344 +0,0 @@ -package aeyama.content.blocks; - -import arc.graphics.*; -import arc.struct.*; - -import mindustry.gen.*; -import mindustry.type.*; -import mindustry.world.*; -import mindustry.world.blocks.heat.*; -import mindustry.world.blocks.production.*; -import mindustry.world.blocks.storage.*; -import mindustry.world.consumers.*; -import mindustry.world.draw.*; -import mindustry.world.meta.*; - -import aeyama.content.*; -import multicraft.*; - -import static mindustry.type.ItemStack.*; - -public class AeyamaProductionBlocks { - public static Block - /* Drills */ - woodHarvester, stoneMiner, ironMiner, copperMiner, zincMiner, - - /* Factory */ - shredder, woodDryer, burner, brickMaker, ammunitionPress, - researchStation, researchLab, oreSmelter, oreFoundry; - - public static void load() { - /* Drills */ - woodHarvester = new WallCrafter("wood-harvester") {{ - scaledHealth = 20f; - size = 2; - - drillTime = 120f; - output = AeyamaItems.woodLumber; - attribute = Attribute.get("wood"); - - requirements(Category.production, with(AeyamaItems.woodLumber, 20)); - }}; - stoneMiner = new AttributeCrafter("stone-miner") {{ - scaledHealth = 35f; - size = 2; - - craftTime = 140f; - baseEfficiency = 0f; - outputItems = with(AeyamaItems.stone, 2); - drawer = new DrawMulti( - new DrawDefault(), - new DrawRegion("-rotator", 1f), - new DrawRegion("-top") - ); - attribute = Attribute.get("stone"); - - requirements(Category.production, with(AeyamaItems.woodLumber, 35)); - }}; - ironMiner = new AttributeCrafter("iron-miner") {{ - scaledHealth = 120; - size = 2; - - craftTime = 180f; - baseEfficiency = 0f; - outputItems = with(AeyamaItems.rawIron, 2); - drawer = new DrawMulti( - new DrawDefault(), - new DrawRegion("-rotator", 1f), - new DrawRegion("-top") - ); - attribute = Attribute.get("iron"); - ambientSound = Sounds.drill; - - requirements(Category.production, with(AeyamaItems.woodLumber, 25, AeyamaItems.stoneBrick, 45)); - }}; - copperMiner = new AttributeCrafter("copper-miner") {{ - scaledHealth = 50f; - size = 2; - - craftTime = 180f; - baseEfficiency = 0f; - outputItems = with(AeyamaItems.rawCopper, 2); - drawer = new DrawMulti( - new DrawDefault(), - new DrawRegion("-rotator", 1f), - new DrawRegion("-top") - ); - attribute = Attribute.get("copper"); - ambientSound = Sounds.drill; - - requirements(Category.production, with(AeyamaItems.woodLumber, 70, AeyamaItems.stoneBrick, 65, AeyamaItems.iron, 20)); - }}; - zincMiner = new AttributeCrafter("zinc-miner") {{ - scaledHealth = 50f; - size = 2; - - craftTime = 180f; - baseEfficiency = 0f; - outputItems = with(AeyamaItems.rawZinc, 2); - drawer = new DrawMulti( - new DrawDefault(), - new DrawRegion("-rotator", 1f), - new DrawRegion("-top") - ); - attribute = Attribute.get("zinc"); - ambientSound = Sounds.drill; - - requirements(Category.production, with(AeyamaItems.woodLumber, 70, AeyamaItems.stoneBrick, 65, AeyamaItems.iron, 20)); - }}; - - /* Factory */ - shredder = new MultiCrafter("shredder") {{ - scaledHealth = 278; - size = 2; - - resolvedRecipes = Seq.with( - new Recipe( - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.woodLumber, 1)), - Seq.with() - ), - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.woodShreds, 5)), - Seq.with() - ), 5f * 60f - ), - new Recipe( - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.woodLumberDry, 1)), - Seq.with() - ), - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.woodShreds, 5)), - Seq.with() - ), 2.5f * 60f - ), - new Recipe( - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.stone, 1)), - Seq.with() - ), - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.stonePebbles, 5)), - Seq.with() - ), 2.5f * 60f - ), - new Recipe( - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.stoneBrick, 1)), - Seq.with() - ), - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.stonePebbles, 10)), - Seq.with() - ), 5f * 60f - ) - ); - - drawer = new DrawMulti( - new DrawDefault(), - new DrawRegion("-blade", 3, true), - new DrawRegion("-blade", -3, true) - ); - - requirements(Category.crafting, with(AeyamaItems.woodLumber, 125, AeyamaItems.stoneBrick, 50, AeyamaItems.rawIron, 35)); - }}; - woodDryer = new GenericCrafter("wood-dryer") {{ - scaledHealth = 200f; - size = 2; - - craftTime = 4f * 60f; - consumeItem(AeyamaItems.woodLumber, 1); - outputItems = with(AeyamaItems.woodLumberDry, 1); - - requirements(Category.crafting, with(AeyamaItems.woodLumber, 125, AeyamaItems.stoneBrick, 75)); - }}; - burner = new HeatProducer("burner") {{ - health = 360; - - craftTime = 5f * 60f; - consume(new ConsumeItemFlammable() {{ minFlammability = 0.8f; }}); - heatOutput = 50f; - drawer = new DrawMulti( - new DrawDefault(), - new DrawFlame(Color.valueOf("#FF6230")) {{ - flameRadius = 1f; - flameRadiusIn = .7f; - flameRadiusScl = 7f; - flameRadiusMag = .8f; - flameRadiusInMag = .5f; - }} - ); - - requirements(Category.crafting, with(AeyamaItems.woodLumber, 50, AeyamaItems.stoneBrick, 100)); - }}; - brickMaker = new GenericCrafter("brick-maker") {{ - scaledHealth = 105f; - size = 2; - - craftTime = 60f; - consumeItem(AeyamaItems.stone, 1); - outputItems = with(AeyamaItems.stoneBrick, 2); - - requirements(Category.crafting, with(AeyamaItems.woodLumber, 75, AeyamaItems.stone, 30)); - }}; - ammunitionPress = new CoreBlock("ammunition-press") {{ - health = 550; - - itemCapacity = 550; - unitType = AeyamaUnits.sms; - - requirements(Category.effect, BuildVisibility.editorOnly, with()); - }}; - oreSmelter = new MultiCrafter("ore-smelter") {{ - health = 500; - size = 2; - - menu = "transform"; - maxEfficiency = 1f; - overheatScale = 1f; - - resolvedRecipes = Seq.with( - new Recipe( - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.rawIron, 3)), - Seq.with(), - 0f, 100f - ), - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.iron, 1)), - Seq.with() - ), 4f * 60f - ), - new Recipe( - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.rawCopper, 3)), - Seq.with(), - 0f, 100f - ), - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.copper, 1)), - Seq.with() - ), 4f * 60f - ), - new Recipe( - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.rawZinc, 3)), - Seq.with(), - 0f, 100f - ), - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.zinc, 1)), - Seq.with() - ), 4f * 60f - ) - ); - - drawer = new DrawMulti( - new DrawDefault(), - new DrawFlame(Color.valueOf("#FF9940")), - new DrawRecipe() {{ - drawers = new DrawBlock[] { - new DrawRegion("-iron"), - new DrawRegion("-copper"), - new DrawRegion("-zinc") - }; - }} - ); - - requirements(Category.crafting, with(AeyamaItems.stoneBrick, 125, AeyamaItems.woodLumber, 50, AeyamaItems.rawIron, 25)); - }}; - oreFoundry = new MultiCrafter("ore-foundry") {{ - health = 500; - size = 3; - - menu = "transform"; - maxEfficiency = 1f; - overheatScale = 1f; - - resolvedRecipes = Seq.with( - new Recipe( - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.copper, 2, AeyamaItems.zinc, 2)), - Seq.with(), - 0f, 200f - ), - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.brass, 1)), - Seq.with() - ), 8f * 60f - ), - new Recipe( - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.iron, 2, AeyamaItems.carbon, 4)), - Seq.with(), - 0f, 100f - ), - new IOEntry( - Seq.with(ItemStack.with(AeyamaItems.steel, 1)), - Seq.with() - ), 8f * 60f - ) - ); - - drawer = new DrawMulti( - new DrawDefault(), - new DrawGlowRegion("-glow") - // new DrawRecipe() {{ - // drawers = new DrawBlock[] { - // new DrawRegion("-iron"), - // new DrawRegion("-copper") - // }; - // }} - ); - - requirements(Category.crafting, with(AeyamaItems.stoneBrick, 300, AeyamaItems.woodLumber, 120, AeyamaItems.iron, 50)); - }}; - researchStation = new GenericCrafter("research-station") {{ - health = 800; - size = 3; - - craftTime = 20f * 60f; - outputItems = with(AeyamaItems.blueprint, 1); - - requirements(Category.crafting, with(AeyamaItems.woodLumber, 80, AeyamaItems.stoneBrick, 120, AeyamaItems.rawIron, 50)); - }}; - researchLab = new GenericCrafter("research-lab") {{ - scaledHealth = 263f; - size = 4; - - craftTime = 60f * 60f; - outputItems = with(AeyamaItems.advancedBlueprint, 1); - drawer = new DrawMulti( - new DrawDefault(), - new DrawRegion("-top"), - new DrawRegion("-antenna", .3f) {{ - x = 4f; - y = -4f; - }} - ); - - requirements(Category.crafting, with(AeyamaItems.woodLumber, 250, AeyamaItems.iron, 100)); //TODO - }}; - } -} diff --git a/src/aeyama/planets/AeyamaPlanetGenerator.java b/src/aeyama/planets/AeyamaPlanetGenerator.java deleted file mode 100644 index 5bbbeb84..00000000 --- a/src/aeyama/planets/AeyamaPlanetGenerator.java +++ /dev/null @@ -1,273 +0,0 @@ -package aeyama.planets; - -import arc.graphics.*; -import arc.math.*; -import arc.math.geom.*; -import arc.struct.*; -import arc.util.*; -import arc.util.noise.*; - -import mindustry.*; -import mindustry.ai.*; -import mindustry.content.*; -import mindustry.core.*; -import mindustry.game.*; -import mindustry.maps.generators.*; -import mindustry.type.*; -import mindustry.world.*; - -import aeyama.content.*; - -import static aeyama.content.blocks.AeyamaEnvironmentBlocks.*; - -public class AeyamaPlanetGenerator extends PlanetGenerator { - BaseGenerator basegen = new BaseGenerator(); - float scl = 5f; - float waterOffset = 0.07f; - - Block[] terrain = {floorGrassA, floorGrassA, floorGrassB, floorGrassB, floorGrassB, floorGrassC, floorGrassC, floorGrassD, floorGrassD}; - { - defaultLoadout = AeyamaLoadouts.basicFrontline; - } - - float water = 2f / terrain.length; - - float rawHeight(Vec3 position) { - position = Tmp.v33.set(position).scl(scl); - return (Mathf.pow(Simplex.noise3d(seed, 7, .5f, 1/3, position.x, position.y, position.z), 2.3f) + waterOffset) / (1 + waterOffset); - } - - @Override - public float getHeight(Vec3 position) { - return Math.max(rawHeight(position), water); - } - - @Override - public Color getColor(Vec3 position) { - Block block = getBlock(position); - if (block == null) return floorGrassB.mapColor; - return Tmp.c1.set(block.mapColor).a(1f - block.albedo); - } - - @Override - public void genTile(Vec3 position, TileGen tile) { - tile.floor = getBlock(position); - this.block = tile.floor.asFloor().wall; - - if (Ridged.noise3d(seed, position.x, position.y, position.z, 22) > .32f) { - tile.block = Blocks.air; - } - } - - Block getBlock(Vec3 position) { - float height = rawHeight(position); - Tmp.v31.set(position); - - position = Tmp.v33.set(position).scl(scl); - float rad = scl; - float temp = Mathf.clamp(Math.abs(position.y * 2) / rad); - float tnoise = Simplex.noise3d(seed, 7, .56f, 1/3, position.x, position.y + 999, position.z); - - temp = Mathf.lerp(temp, tnoise, .5f); - height *= 1.2f; - height = Mathf.clamp(height); - - Block result = terrain[(int) Mathf.clamp(Math.floor(temp * terrain.length), 0, terrain.length - 1)]; - return result; - } - - protected float noiseOct(float x, float y, double octaves, double falloff, double scl) { - Vec3 v = sector.rect.project(x, y).scl(5); - return Simplex.noise3d(seed, octaves, falloff, 1 / scl, v.x, v.y, v.z); - } - - @Override - public void generate(Tiles tiles, Sector sec, int seed) { - this.tiles = tiles; - this.sector = sec; - this.rand.setSeed(sec.id); - - TileGen gen = new TileGen(); - for (int y=0; y < tiles.height; y++) { - for (int x=0; x < tiles.width; x++) { - gen.reset(); - Vec3 position = sector.rect.project(x / tiles.width, y / tiles.height); - - genTile(position, gen); - tiles.set(x, y, new Tile(x, y, gen.floor, gen.overlay, gen.block)); - } - } - - class Room { - int x, y, radius; - ObjectSet connected = new ObjectSet<>(); - - Room(int x, int y, int radius) { - this.x = x; - this.y = y; - this.radius = radius; - connected.add(this); - } - - void connect(Room to) { - if (connected.contains(to)) return; - - connected.add(to); - - int nscl = rand.random(20, 60); - int stroke = rand.random(4, 12); - - brush(pathfind(x, y, to.x, to.y, tile -> (tile.solid() ? 5 : 0) + noiseOct(tile.x, tile.y, 1, 1, 1 / nscl * 60) * 60, Astar.manhattan), stroke); - } - } - - cells(4); - distort(10f, 12f); - - width = tiles.width; - height = tiles.height; - - float constraint = 1.3f; - float radius = width / 2 / Mathf.sqrt3; - int rooms = rand.random(2, 5); - Seq roomseq = new Seq<>(); - - for (int i=0; i < rooms; i++) { - Tmp.v1.trns(rand.random(360), rand.random(radius / constraint)); - float rx = (float) Math.floor(width / 2 + Tmp.v1.x); - float ry = (float) Math.floor(height / 2 + Tmp.v1.y); - float maxrad = radius - Tmp.v1.len(); - float rrad = (float) Math.floor(Math.min(rand.random(9, maxrad / 2), 30)); - - roomseq.add(new Room((int) rx, (int) ry, (int) rrad)); - } - - Room spawn = null; - Seq enemies = new Seq<>(); - int enemySpawns = rand.random(1, Math.max((int) Math.floor(sector.threat * 4), 1)); - - int offset = rand.nextInt(360); - float length = width / 2.55f - rand.random(12, 23); - int angleStep = 5; - int waterCheckRad = 5; - for (int i=0; i < 360; i += angleStep) { - int angle = offset + i; - int cx = (int) Math.floor(width / 2 + Angles.trnsx(angle, length)); - int cy = (int) Math.floor(height / 2 + Angles.trnsy(angle, length)); - - int waterTiles = 0; - - for (int rx = -waterCheckRad; rx <= waterCheckRad; rx++) { - for (int ry = -waterCheckRad; ry <= waterCheckRad; ry++) { - Tile tile = tiles.get(cx + rx, cy + ry); - - if (tile == null || tile.floor().liquidDrop != null) { - waterTiles++; - } - } - } - - if (waterTiles <= 4 || (i + angleStep >= 360)) { - spawn = new Room(cx, cy, rand.random(10, 18)); - roomseq.add(spawn); - - for (int j=0; j < enemySpawns; j++) { - float enemyOffset = rand.range(60); - - Tmp.v1.set(cx - width / 2, cy - height / 2).rotate(180 + enemyOffset).add(width / 2, this.height / 2); - Room espawn = new Room((int) Math.floor(Tmp.v1.x), (int) Math.floor(Tmp.v1.y), rand.random(10, 16)); - roomseq.add(espawn); - enemies.add(espawn); - }; - - break; - } - - } - for (Room room : roomseq) { - erase(room.x, room.y, room.radius); - } - - int connections = rand.random(Math.max(rooms - 1, 1), rooms + 3); - for (int i=0; i < connections; i++) { - roomseq.random(rand).connect(roomseq.random(rand)); - } - - for (Room room : roomseq) { - spawn.connect(room); - } - - cells(1); - distort(10, 6); - - inverseFloodFill(tiles.getn(spawn.x, spawn.y)); - - Seq ores = Seq.with(floorIron); - float poles = Math.abs(sector.tile.v.y); - float nmag = .5f; - float scl = 1; - float addscl = 1.3f; - - if (Simplex.noise3d(seed, 2, .5f, scl, sector.tile.v.x + 1, sector.tile.v.y, sector.tile.v.z) * nmag + poles > .5f * addscl) { - ores.add(floorZinc); - } - - FloatSeq frequencies = new FloatSeq(); - for (int i=0; i < ores.size; i++) { - frequencies.add(rand.random(-.1f, .01f) - i * .01f + poles * .04f); - } - - pass((x, y) -> { - if (!floor.asFloor().hasSurface()) return; - - int offsetX = x - 4, offsetY = y + 23; - for (int i = ores.size - 1; i >= 0; i--) { - Block entry = ores.get(i); - float freq = frequencies.get(i); - - if (Math.abs(.5f - noiseOct(offsetX, offsetY + i * 999, 2, .7f, (40 + i * 2))) > .22f + i * .01f && - Math.abs(.5f - noiseOct(offsetX, offsetY - i * 999, 1, 1, (30 + i * 4))) > .37f + freq) { - ore = entry; - break; - } - } - }); - - trimDark(); - median(2); - tech(); - - float difficulty = sector.threat; - ints.clear(); - ints.ensureCapacity(width * height / 4); - - Schematics.placeLaunchLoadout(spawn.x, spawn.y); - - for (Room espawn : enemies) { - tiles.getn(espawn.x, espawn.y).setOverlay(Blocks.spawn); - } - - GameState state = Vars.state; - - if (sector.hasEnemyBase()) { - basegen.generate(tiles, enemies.map(r -> tiles.getn(r.x, r.y)), tiles.get(spawn.x, spawn.y), state.rules.waveTeam, sector, difficulty); - - state.rules.attackMode = sector.info.attack = true; - } else { - state.rules.winWave = sector.info.winWave = (int) (10 + 5 * Math.max(difficulty * 10, 1)); - } - - float waveTimeDec = .4f; - - state.rules.waveSpacing = Mathf.lerp(60 * 65 * 2, 60 * 60 * 1, (float) Math.floor(Math.max(difficulty - waveTimeDec, 0) / .8f)); - state.rules.waves = sector.info.waves = true; - state.rules.enemyCoreBuildRadius = 480; - - state.rules.spawns = Waves.generate(difficulty, new Rand(), state.rules.attackMode); - } - - @Override - public void postGenerate(Tiles tiles) { - if (this.sector.hasEnemyBase()) basegen.postGenerate(); - } -} diff --git a/src/aeyama/ui/HeatImage.java b/src/aeyama/ui/HeatImage.java deleted file mode 100644 index be543cfc..00000000 --- a/src/aeyama/ui/HeatImage.java +++ /dev/null @@ -1,34 +0,0 @@ -package aeyama.ui; - -import arc.graphics.*; -import arc.scene.ui.*; -import arc.scene.ui.layout.*; -import arc.util.*; - -import mindustry.core.*; -import mindustry.gen.*; -import mindustry.ui.*; - -/** An ItemDisplay, but for heat. */ -public class HeatImage extends Table { - public final float amount; - - public HeatImage(float amount) { - this.amount = amount; - - add(new Stack() {{ - add(new Table(o -> { - o.left(); - o.add(new Image(Icon.waves)).size(32f).scaling(Scaling.fit).color(new Color(1f, 0.22f, 0.22f, 0.8f)); - })); - - if(amount != 0) { - add(new Table(t -> { - t.left().bottom(); - t.add(amount >= 1000f ? UI.formatAmount((int) amount) : (int) amount + "").style(Styles.outlineLabel); - t.pack(); - })); - } - }}); - } -} diff --git a/src/aeyama/ui/LiquidImage.java b/src/aeyama/ui/LiquidImage.java deleted file mode 100644 index bd4c1cdf..00000000 --- a/src/aeyama/ui/LiquidImage.java +++ /dev/null @@ -1,35 +0,0 @@ -package aeyama.ui; - -import arc.scene.ui.*; -import arc.scene.ui.layout.*; -import arc.util.*; - -import mindustry.core.*; -import mindustry.type.*; -import mindustry.ui.*; - -/** An ItemDisplay, but for liquids. Copy of Vanilla one to remove the localizedName */ -public class LiquidImage extends Table{ - public final Liquid liquid; - public final float amount; - - public LiquidImage(Liquid liquid, float amount){ - this.liquid = liquid; - this.amount = amount; - - add(new Stack() {{ - add(new Table(o -> { - o.left(); - o.add(new Image(liquid.uiIcon)).size(32f).scaling(Scaling.fit); - })); - - if(amount != 0) { - add(new Table(t -> { - t.left().bottom(); - t.add(amount >= 1000f ? UI.formatAmount((int) amount) : (int) amount + "").style(Styles.outlineLabel); - t.pack(); - })); - } - }}); - } -} diff --git a/src/aeyama/ui/PowerImage.java b/src/aeyama/ui/PowerImage.java deleted file mode 100644 index 4d98a18d..00000000 --- a/src/aeyama/ui/PowerImage.java +++ /dev/null @@ -1,34 +0,0 @@ -package aeyama.ui; - -import arc.scene.ui.*; -import arc.scene.ui.layout.*; -import arc.util.*; - -import mindustry.core.*; -import mindustry.gen.*; -import mindustry.graphics.*; -import mindustry.ui.*; - -/** An ItemDisplay, but for power. */ -public class PowerImage extends Table { - public final float amount; - - public PowerImage(float amount) { - this.amount = amount; - - add(new Stack() {{ - add(new Table(o -> { - o.left(); - o.add(new Image(Icon.power)).size(32f).scaling(Scaling.fit).color(Pal.power); - })); - - if(amount != 0) { - add(new Table(t -> { - t.left().bottom(); - t.add(amount >= 1000f ? UI.formatAmount((int) amount) : (int) amount + "").style(Styles.outlineLabel); - t.pack(); - })); - } - }}); - } -} diff --git a/src/aeyama/ui/dialogs/NewsDialog.java b/src/aeyama/ui/dialogs/NewsDialog.java deleted file mode 100644 index faeaf774..00000000 --- a/src/aeyama/ui/dialogs/NewsDialog.java +++ /dev/null @@ -1,124 +0,0 @@ -package aeyama.ui.dialogs; - -import arc.*; -import arc.scene.ui.layout.*; -import arc.util.*; -import mindustry.*; -import mindustry.game.EventType.*; -import mindustry.gen.*; -import mindustry.ui.dialogs.*; - -import static mindustry.Vars.*; -import static aeyama.AeyamaVars.*; - -public class NewsDialog { - static BaseDialog dialog; - static String urlNews = "https://raw.githubusercontent.com/" + repo + "/main/src/assets/news/" + Core.bundle.get("aeyama.news.file"); - static String urlGitHub = "https://github.com/Aeyama-Mod/aeyama"; - static String urlDiscord = "https://discord.gg/YVY9Y3uA85"; - static String urlProject = "https://github.com/users/FredyJabe/projects/2"; - - public static void load() { - dialog = new BaseDialog(Core.bundle.format("aeyama.news.title", mod.meta.version)); - - dialog.addCloseListener(); - Table news = getNews(); - - onResize(() -> { - dialog.cont.clear(); - loadBody(news); - loadButtons(); - }); - - dialog.show(); - } - - private static void loadBody(Table news) { - dialog.cont.image(Core.atlas.find("aeyama-logo", Core.atlas.find("clear"))) - .height(mobile ? 144f : 185f).width(mobile ? 480f : 620f).pad(3f).center() - .row(); - - dialog.cont.pane(news).width(mobile ? 480f : 600f) - .maxWidth(mobile ? 480f : 600f).pad(4f); - } - - private static void loadButtons() { - //Check if not on mobile Landscape mode - if (!(mobile && !Core.graphics.isPortrait())) { - dialog.cont.row(); - - dialog.cont.table(t -> { - t.defaults().size(256f, 64f).pad(3f); - t.button("@aeyama.news.github", Icon.githubSquare, () -> { - if (!Core.app.openURI(urlGitHub)) { - Vars.ui.showErrorMessage("@linkfail"); - Core.app.setClipboardText(urlGitHub); - } - }); - t.button("@aeyama.news.discord", Icon.discord, () -> { - if (!Core.app.openURI(urlDiscord)) { - Vars.ui.showErrorMessage("@linkfail"); - Core.app.setClipboardText(urlDiscord); - } - }).row(); - }).center().fillX().row(); - dialog.cont.table(t -> { - t.defaults().size(256f*2f, 64f).pad(3f); - t.button("@aeyama.news.project", Icon.trello, () -> { - if (!Core.app.openURI(urlProject)) { - Vars.ui.showErrorMessage("@linkfail"); - Core.app.setClipboardText(urlProject); - } - }).row(); - t.button("@close", Icon.cancel, dialog::hide); - }).center().fillX(); - } else { // If on landscape mobile - dialog.cont.table(t -> { - t.defaults().size(256f, 64f).pad(3f); - t.button("@aeyama.news.github", Icon.githubSquare, () -> { - if (!Core.app.openURI(urlGitHub)) { - Vars.ui.showErrorMessage("@linkfail"); - Core.app.setClipboardText(urlGitHub); - } - }).row(); - t.button("@aeyama.news.discord", Icon.discord, () -> { - if (!Core.app.openURI(urlDiscord)) { - Vars.ui.showErrorMessage("@linkfail"); - Core.app.setClipboardText(urlDiscord); - } - }).row(); - t.button("@aeyama.news.project", Icon.trello, () -> { - if (!Core.app.openURI(urlProject)) { - Vars.ui.showErrorMessage("@linkfail"); - Core.app.setClipboardText(urlProject); - } - }).row(); - t.button("@close", Icon.cancel, dialog::hide); - }).center().fillX(); - } - } - - private static Table getNews() { - Table table = new Table(); - Log.info("[green][Aeyama][lightgray] Fetching news..."); - - Http.get(urlNews).error(err -> { - table.add("[red][ERROR] FAILED TO GET NEWS.").center(); - Log.err("[red][Aeyama][lightgray] " + err.getMessage()); - }).block(res -> { - table.add(res.getResultAsString()).left().growX().wrap().labelAlign(Align.left); - }); - - return table; - } - - /* Copy of the method because it's protected */ - private static void onResize(Runnable run){ - Events.on(ResizeEvent.class, event -> { - if(dialog.isShown() && Core.scene.getDialog() == dialog){ - run.run(); - dialog.updateScrollFocus(); - } - }); - } -} diff --git a/src/aeyama/ui/dialogs/SettingsMenuDialog.java b/src/aeyama/ui/dialogs/SettingsMenuDialog.java deleted file mode 100644 index af3604a4..00000000 --- a/src/aeyama/ui/dialogs/SettingsMenuDialog.java +++ /dev/null @@ -1,18 +0,0 @@ -package aeyama.ui.dialogs; - -import arc.scene.style.*; - -import aeyama.content.*; - -import static mindustry.Vars.*; - -public class SettingsMenuDialog { - - public static void load() { - ui.settings.addCategory("@aeyama.displayName-simple", new TextureRegionDrawable(AeyamaItems.planet.uiIcon), t -> { - t.checkPref("aeyama-showNews", true); - t.checkPref("aeyama-checkUpdate", true); - t.checkPref("aeyama-checkBeta", false); - }); - } -} diff --git a/src/aeyama/world/blocks/storage/AeyamaCoreBlock.java b/src/aeyama/world/blocks/storage/AeyamaCoreBlock.java deleted file mode 100644 index 0fc54d31..00000000 --- a/src/aeyama/world/blocks/storage/AeyamaCoreBlock.java +++ /dev/null @@ -1,97 +0,0 @@ -package aeyama.world.blocks.storage; - -import arc.*; -import arc.graphics.*; -import arc.util.*; - -import mindustry.*; -import mindustry.content.*; -import mindustry.gen.*; -import mindustry.type.*; -import mindustry.ui.*; -import mindustry.world.*; -import mindustry.world.blocks.storage.*; -import mindustry.world.meta.*; - -import static mindustry.Vars.*; - -public class AeyamaCoreBlock extends CoreBlock { - /** The default unit of the core when no armor is equipped. */ - public UnitType defaultUnit; - - public AeyamaCoreBlock(String name) { - super(name); - } - - @Override - public void setStats() { - super.setStats(); - - stats.remove(Stat.buildTime); - stats.remove(Stat.unitType); - stats.add(Stat.unitType, table -> { - table.row(); - table.table(Styles.grayPanel, b -> { - b.image(defaultUnit.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit); - b.table(info -> { - info.add(defaultUnit.localizedName).left(); - if(Core.settings.getBool("console")){ - info.row(); - info.add(defaultUnit.name).left().color(Color.lightGray); - } - }); - b.button("?", Styles.flatBordert, () -> ui.content.show(defaultUnit)).size(40f).pad(10).right().grow().visible(() -> defaultUnit.unlockedNow()); - }).growX().pad(5).row(); - }); - } - - public static void playerSpawn(Tile tile, Player player) { - if (player == null || tile == null || !(tile.build instanceof AeyamaCoreBuild core)) return; - - // If no armor was selected use the default unit to avoid null crash. - UnitType spawnType = core.currentArmor != null ? core.currentArmor : ((AeyamaCoreBlock)core.block).defaultUnit; - if (core.wasVisible) { - Fx.spawn.at(core); - } - - player.set(core); - - if (!net.client()) { - Unit unit = spawnType.create(tile.team()); - unit.set(core); - unit.rotation(90f); - unit.impulse(0f, 3f); - unit.spawnedByCore(true); - unit.controller(player); - unit.add(); - } - - if (state.isCampaign() && player == Vars.player) { - spawnType.unlock(); - } - } - - - public class AeyamaCoreBuild extends CoreBuild { - /** The current armor linked to this build */ - public UnitType currentArmor = null; - - @Override - public void requestSpawn(Player player) { - // If no armor was selected use the default unit to avoid null crash. - UnitType unit = currentArmor != null ? currentArmor : defaultUnit; - if (!unit.supportsEnv(state.rules.env)) return; - - if (Vars.net.server() || !Vars.net.active()) { - AeyamaCoreBlock.playerSpawn(tile, player); - } - - if (Vars.net.server()) { - PlayerSpawnCallPacket packet = new PlayerSpawnCallPacket(); - packet.tile = tile; - packet.player = player; - Vars.net.send(packet, true); - } - } - } -} diff --git a/src/aeyama/world/blocks/units/ArmoryBlock.java b/src/aeyama/world/blocks/units/ArmoryBlock.java deleted file mode 100644 index 7fdf200b..00000000 --- a/src/aeyama/world/blocks/units/ArmoryBlock.java +++ /dev/null @@ -1,212 +0,0 @@ -package aeyama.world.blocks.units; - -import arc.graphics.*; -import arc.math.*; -import arc.scene.ui.*; -import arc.scene.ui.layout.*; -import arc.struct.*; -import arc.util.*; -import arc.util.io.*; - -import mindustry.*; -import mindustry.game.*; -import mindustry.gen.*; -import mindustry.graphics.*; -import mindustry.type.*; -import mindustry.ui.*; -import mindustry.world.*; -import mindustry.world.meta.*; - -import aeyama.world.blocks.storage.AeyamaCoreBlock.*; - -import static mindustry.Vars.*; - -public class ArmoryBlock extends Block { - /** List of all the available armor. */ - public Seq armorChoices = new Seq<>(UnitType.class); - /** For size offset in UI. */ - public int biggestTextLenght = 0; - - public ArmoryBlock(String name) { - super(name); - - solid = true; - update = true; - configurable = true; - sync = true; - flags = EnumSet.of(BlockFlag.unitAssembler); - - config(Integer.class, ArmoryBuild::setIndex); - config(UnitType.class, ArmoryBuild::setArmor); - } - - @Override - public void init() { - super.init(); - - for (UnitType armor : armorChoices) - biggestTextLenght = Math.max(armor.localizedName.length(), biggestTextLenght); - } - - /** Act as a core extension */ - @Override - public boolean canPlaceOn(Tile tile, Team team, int rotation) { - Seq tileAround = new Seq<>(); - - /* Thanks to @_agzam_ */ - final int to = (this.size + 2) / 2; - final int from = to + 1 - (this.size + 2); - - for (int ty = from; ty <= to; ty++) { - for (int tx = from; tx <= to; tx++) { - //Skip corners - if ((ty == from || ty == to) && (tx == from ||tx == to)) - continue; - - //Only check the side of the block - if ((ty == from || ty == to || tx == from || tx == to)) { - int xx = tile.x + tx; - int yy = tile.y + ty; - tileAround.add(Vars.world.tile(xx, yy)); - } - } - } - - return tileAround.contains(o -> o.build instanceof AeyamaCoreBuild); - } - - @Override - public void setStats() { - super.setStats(); - - stats.remove(Stat.unitType); - stats.add(new Stat("armors", StatCat.function), t -> { - t.row(); - for(UnitType armor : armorChoices) { - if (armor.unlocked()) { - t.table(Styles.grayPanel, b -> { - b.image(armor.uiIcon).size(iconLarge).pad(10f).left().scaling(Scaling.fit); - b.table(i -> { - i.add(armor.localizedName).left().row(); - i.add(armor.name).left().color(Color.lightGray); - }); - b.button("?", Styles.flatBordert, () -> ui.content.show(armor)).size(40f).pad(10f).right().grow(); - }).growX().pad(5f).row(); - } else { - t.table(Styles.grayPanel, b -> { - b.image(Icon.lock).size(iconLarge).pad(10f).left().scaling(Scaling.fit); - b.table(i -> { - i.add("???").left().row(); - i.add("???").left().color(Color.lightGray); - }); - }).growX().pad(5f).row(); - } - } - }); - } - - public @Nullable AeyamaCoreBuild getCore(Team team, float x, float y) { - return Vars.indexer.findClosestFlag(x, y, team, BlockFlag.core).as(); - } - - public class ArmoryBuild extends Building { - /** The Core build next to this build. Set after placement and each tile update. */ - public AeyamaCoreBuild coreBuild = null; - /** The currently selected armor for this build. */ - public UnitType currentArmor = null; - /** The index of the selected armor for this build. */ - public int index = 0; - /** Vanilla behavor found on other block, don't know what it really does. */ - public int lastChange = -2; - - /** On placement and on each update get the core. */ - @Override - public void updateTile() { - if (lastChange != world.tileChanges) { - lastChange = world.tileChanges; - - coreBuild = getCore(team, this.x, this.y); - coreBuild.currentArmor = getCurrentArmor(); - } - } - - /** Draw a selection on the linked core. */ - @Override - public void drawSelect() { - if (coreBuild != null) - Drawf.selected(coreBuild, Pal.accent); - } - - /** The configuration menu. */ - @Override - public void buildConfiguration(Table table) { - configurationMenu(ArmoryBlock.this, this, table); - } - - public void configurationMenu(ArmoryBlock b, ArmoryBuild c, Table table) { - for (UnitType armor : armorChoices) { - int index = armorChoices.indexOf(armor); - if (index != 0 && index % 2 == 0) - table.row(); - - ImageButton button = new ImageButton(Styles.clearTogglei); - if (armor.unlocked()) { - button.replaceImage(new Table(t -> { - t.image(armor.uiIcon).size(32f).scaling(Scaling.fit).center().row(); - t.add(armor.localizedName).center().row(); - })); - button.changed(() -> { - c.configure(index); - c.configure(armor); - }); - } else { - button.replaceImage(new Table(t -> { - t.image(Icon.lock).size(32f).scaling(Scaling.fit).center().row(); - t.add("???").center().row(); - })); - } - button.update(() -> button.setChecked(index == getIndex())); - // button.setSize(64f + biggestTextLenght); - button.getImageCell().scaling(Scaling.fit).size(Vars.iconLarge); - table.add(button).grow().pad(2.5f).margin(15f + biggestTextLenght); - } - table.left(); - } - - @Override - public void write(Writes write) { - super.write(write); - - write.i(index); - } - - @Override - public void read(Reads read, byte revision) { - super.read(read, revision); - - index = Mathf.clamp(read.i(), 0, armorChoices.size-1); - } - - public void setArmor(UnitType armor) { - if (armor != currentArmor && coreBuild != null) { - currentArmor = armor; - coreBuild.currentArmor = armor; - coreBuild.requestSpawn(player); - } - } - - public UnitType getCurrentArmor() { - return armorChoices.get(getIndex()); - } - - public void setIndex(int newIndex) { - newIndex = Mathf.clamp(newIndex, 0, armorChoices.size-1); - if (newIndex != index) - index = newIndex; - } - - public int getIndex() { - return Mathf.clamp(index, 0, armorChoices.size-1); - } - } -}