From 7486d20c55926506436362a1d7657f77711e549d Mon Sep 17 00:00:00 2001 From: PiggyChu620 <68910494+PiggyChu620@users.noreply.github.com> Date: Sat, 24 Feb 2024 16:50:55 +0800 Subject: [PATCH] 202402241650 --- mod.hjson | 4 +- src/ec620/content/EC620Blocks.java | 8 ++- src/ec620/content/EC620TechTree.java | 5 +- src/ec620/content/EC620Waves.java | 82 ++++++++++++++++++++-------- 4 files changed, 71 insertions(+), 28 deletions(-) diff --git a/mod.hjson b/mod.hjson index 63bbca8..b815ad1 100644 --- a/mod.hjson +++ b/mod.hjson @@ -1,5 +1,5 @@ #the mod name as displayed in-game -displayName: "Random Planet v0.4.7.4" +displayName: "Random Planet v0.4.7.12" repo: "PiggyChu620/MindustryRandomPlanet" @@ -16,7 +16,7 @@ main: "ec620.EC620JavaMod" description: "Randomly generate a planet and its sectors.\nIt's a mixtech mod, I myself don't like the idea of \"Oh, you can only use these things here, and you can only use those things there, bruh, bruh, bruh!\", so I make one myself, if you don't like mixtech and think it's \"unbalanced\" and \"boring\", then please go away, much appreciated!" #the mod version -version: 0.4.7.4 +version: 0.4.7.12 #the minimum game build required to run this mod minGameVersion: 140 diff --git a/src/ec620/content/EC620Blocks.java b/src/ec620/content/EC620Blocks.java index 759048c..85e5e3e 100644 --- a/src/ec620/content/EC620Blocks.java +++ b/src/ec620/content/EC620Blocks.java @@ -96,8 +96,12 @@ public static void load() //region Unlock hidden items Blocks.slagCentrifuge.requirements(Category.crafting, with(Items.carbide, 70, Items.graphite, 60, Items.silicon, 40, Items.oxide, 40)); Blocks.heatReactor.requirements(Category.crafting, with(Items.oxide, 70, Items.graphite, 20, Items.carbide, 10, Items.thorium, 80)); + UnitTypes.renale.hidden=false; + UnitTypes.latum.hidden=false; Blocks.itemSource.requirements(Category.distribution, ItemStack.with(new Object[0])); Blocks.liquidSource.requirements(Category.liquid, ItemStack.with(new Object[0])); + Blocks.powerSource.requirements(Category.power, ItemStack.with(new Object[0])); + //content.blocks().forEach(b->b.buildVisibility=BuildVisibility.shown); //endregion //region Ores @@ -131,7 +135,9 @@ public static void load() // //endregion // // //region Factories - launchPadController=new EC620Classes.LauchPadController("launch-pad-controller"); + + //launchPadController=new EC620Classes.LauchPadController("launch-pad-controller"); + // duraluminFactory = new GenericCrafter("duralumin-factory"){{ // requirements(Category.crafting, with(Items.copper, 5, EC620Items.aluminum,95)); // craftEffect = Fx.smeltsmoke; diff --git a/src/ec620/content/EC620TechTree.java b/src/ec620/content/EC620TechTree.java index 1c3d604..fe15508 100644 --- a/src/ec620/content/EC620TechTree.java +++ b/src/ec620/content/EC620TechTree.java @@ -1701,10 +1701,11 @@ public static void load() root.planet= EC620Planets.ec620; root.children.each(c -> c.planet =EC620Planets.ec620); - mergeNode(launchPad,()-> + /*mergeNode(launchPad,()-> { node(EC620Blocks.launchPadController); - }); + });*/ + /*mergeNode(Liquids.water, () -> { node(Liquids.ozone,()->{ node(Liquids.hydrogen); diff --git a/src/ec620/content/EC620Waves.java b/src/ec620/content/EC620Waves.java index c224c52..129d4df 100644 --- a/src/ec620/content/EC620Waves.java +++ b/src/ec620/content/EC620Waves.java @@ -305,17 +305,20 @@ public static Seq generate(float difficulty, Rand rand, boolean atta } public static Seq generate(float difficulty, Rand rand, boolean attack, boolean airOnly, boolean naval){ - UnitType[][] species = { + UnitType[][] species = + { {dagger, mace, fortress, scepter, reign}, {nova, pulsar, quasar, vela, corvus}, {crawler, atrax, spiroct, arkyid, toxopid}, {risso, minke, bryde, sei, omura}, {risso, oxynoe, cyerce, aegires, navanax}, //retusa intentionally left out as it cannot damage the core properly - {flare, horizon, zenith, rand.chance(0.5) ? quad : antumbra, rand.chance(0.1) ? quad : eclipse}, + {flare, horizon, zenith, antumbra, eclipse}, {stell,locus, precept, vanquish,conquer}, { merui, cleroi, anthicus, tecta,collaris}, - { elude, avert, obviate, quell,disrupt} + { elude, avert, obviate, quell,disrupt}, + {renale,renale,renale,renale,latum} //Should ALWAYS be the last one! }; + UnitType[] repairUnits={mono, poly, mega, quad, oct}; if(airOnly) { @@ -348,20 +351,28 @@ public static Seq generate(float difficulty, Rand rand, boolean atta //main sequence UnitType[] curSpecies = Structs.random(fspec); int curTier = 0; + int curI; + UnitType curUnit; for(int i = start; i < cap;) { int f = i; - int next = rand.random(8, 16) + (int)Mathf.lerp(5f, 0f, difficulty) + curTier * 4; + //int next = rand.random(8, 16) + (int)Mathf.lerp(5f, 0f, difficulty) + curTier * 4; + int next=rand.random(8,16) + (int)((1-difficulty)*Math.pow(3.5,curTier+1)); float shieldAmount = Math.max((i - shieldStart) * shieldsPerWave, 0); int space = start == 0 ? 1 : rand.random(1, 2); int ctier = curTier; + if(ctier>0 && ctier<4) curI=rand.random(fspec.length-2); + else curI=rand.random(fspec.length-1); + curUnit=fspec[curI][ctier]; + //main progression - out.add(new SpawnGroup(curSpecies[Math.min(curTier, curSpecies.length - 1)]) + //out.add(new SpawnGroup(curSpecies[Math.min(curTier, curSpecies.length - 1)]) + out.add(new SpawnGroup(curUnit) {{ - unitAmount = f == start ? 1 : 6 / (int)scaling[ctier]; + unitAmount = f == start ? 1 : Math.max(6 / (int)scaling[ctier],1); begin = f; end = f + next >= cap ? never : f + next; max = 13; @@ -372,9 +383,10 @@ public static Seq generate(float difficulty, Rand rand, boolean atta }}); //extra progression that tails out, blends in - out.add(new SpawnGroup(curSpecies[Math.min(curTier, curSpecies.length - 1)]) + //out.add(new SpawnGroup(curSpecies[Math.min(curTier, curSpecies.length - 1)]) + out.add(new SpawnGroup(curUnit) {{ - unitAmount = 3 / (int)scaling[ctier]; + unitAmount = Math.max(1, 3 / (int)scaling[ctier]); begin = f + next - 1; end = f + next + rand.random(6, 10); max = 6; @@ -384,19 +396,20 @@ public static Seq generate(float difficulty, Rand rand, boolean atta shieldScaling = shieldsPerWave; }}); - i += next + 1; - if(curTier < 3 || (rand.chance(0.05) && difficulty > 0.8)) + i = next + 1; + //if(curTier < 3 || (rand.chance(0.05) && difficulty > 0.8)) + if(curTier<4) { curTier ++; } //do not spawn bosses - curTier = Math.min(curTier, 3); + //curTier = Math.min(curTier, 3); //small chance to switch species - if(rand.chance(0.3)){ - curSpecies = Structs.random(fspec); - } +// if(rand.chance(0.3)){ +// curSpecies = Structs.random(fspec); +// } } }; @@ -415,8 +428,15 @@ public static Seq generate(float difficulty, Rand rand, boolean atta int bossTier = difficulty < 0.6 ? 3 : 4; + int curI; + UnitType curBoss; + //main boss progression - out.add(new SpawnGroup(Structs.random(species)[bossTier]) + if(bossTier==4) curI=rand.random(species.length-1); + else curI=rand.random(species.length-2); + curBoss=species[curI][bossTier]; + //out.add(new SpawnGroup(Structs.random(species)[bossTier]) + out.add(new SpawnGroup(curBoss) {{ unitAmount = 1; begin = bossWave; @@ -429,7 +449,11 @@ public static Seq generate(float difficulty, Rand rand, boolean atta }}); //alt boss progression - out.add(new SpawnGroup(Structs.random(species)[bossTier]) + if(bossTier==4) curI=rand.random(species.length-1); + else curI=rand.random(species.length-2); + curBoss=species[curI][bossTier]; + //out.add(new SpawnGroup(Structs.random(species)[bossTier]) + out.add(new SpawnGroup(curBoss) {{ unitAmount = 1; begin = bossWave + rand.random(3, 5) * bossSpacing; @@ -444,7 +468,11 @@ public static Seq generate(float difficulty, Rand rand, boolean atta int finalBossStart = 120 + rand.random(30); //final boss waves - out.add(new SpawnGroup(Structs.random(species)[bossTier]) + if(bossTier==4) curI=rand.random(species.length-1); + else curI=rand.random(species.length-2); + curBoss=species[curI][bossTier]; + //out.add(new SpawnGroup(Structs.random(species)[bossTier]) + out.add(new SpawnGroup(curBoss) {{ unitAmount = 1; begin = finalBossStart; @@ -457,7 +485,11 @@ public static Seq generate(float difficulty, Rand rand, boolean atta }}); //final boss waves (alt) - out.add(new SpawnGroup(Structs.random(species)[bossTier]) + if(bossTier==4) curI=rand.random(species.length-1); + else curI=rand.random(species.length-2); + curBoss=species[curI][bossTier]; + //out.add(new SpawnGroup(Structs.random(species)[bossTier]) + out.add(new SpawnGroup(curBoss) {{ unitAmount = 1; begin = finalBossStart + 15; @@ -470,13 +502,16 @@ public static Seq generate(float difficulty, Rand rand, boolean atta }}); //add megas to heal the base. - if(attack && difficulty >= 0.5) + //if(attack && difficulty >= 0.5) + if(attack) { int amount = Mathf.random(1, 3 + (int)(difficulty*2)); - for(int i = 0; i < amount; i++){ - int wave = Mathf.random(3, 20); - out.add(new SpawnGroup(mega){{ + for(int i = 0; i < amount; i++) + { + int wave = (int)(20*difficulty); //Mathf.random(3, 20); + out.add(new SpawnGroup(repairUnits[(int)(5*difficulty)]) + {{ unitAmount = 1; begin = wave; end = wave; @@ -488,7 +523,8 @@ public static Seq generate(float difficulty, Rand rand, boolean atta //shift back waves on higher difficulty for a harder start int shift = Math.max((int)(difficulty * 14 - 5), 0); - for(SpawnGroup group : out){ + for(SpawnGroup group : out) + { group.begin -= shift; group.end -= shift; }