Skip to content

Commit

Permalink
202402120330
Browse files Browse the repository at this point in the history
  • Loading branch information
PiggyChu620 committed Feb 11, 2024
1 parent 0cce3c5 commit aa16771
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Mindustry Java Mod - Random Planet v0.4.5.2
# Mindustry Java Mod - Random Planet v0.4.6
A Java Mindustry mod.

Randomly generate a planet and its sectors, including the starting sector.
Expand Down Expand Up @@ -128,6 +128,9 @@ I combined both technologies from Serpulo and Erekir as best as I could, includi
*v0.4.5.2*
- Change the ore placement sorting criteria to hardness as it could better represent the "tier" of the ores and make it more "random".

*v0.4.6*
- Fix new sector loading forever if Mineable Alloys is not installed.

---

**1.** [Schematic Instruction](SchematicInstruction.md)
Expand Down
4 changes: 2 additions & 2 deletions mod.hjson
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#the mod name as displayed in-game
displayName: "Random Planet v0.4.5.2"
displayName: "Random Planet v0.4.6"

repo: "PiggyChu620/MindustryRandomPlanet"

Expand All @@ -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.5.2
version: 0.4.6

#the minimum game build required to run this mod
minGameVersion: 140
Expand Down
2 changes: 1 addition & 1 deletion src/ec620/EC620JavaMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public EC620JavaMod()
dd.titleFont= Fonts.def;
dd.titleFontColor=new Color(1,0,0);
BaseDialog dialog = new BaseDialog("Random Planet", dd);
dialog.cont.add("Welcome to Random Planet v0.4.5.2",Color.green,1.2f).center().row();
dialog.cont.add("Welcome to Random Planet v0.4.6",Color.green,1.2f).center().row();
dialog.cont.add("Please see Settings for customization",Color.cyan).center().row();
//dialog.cont.add("in order to see the setting info,",Color.cyan).row();
//dialog.cont.add("I can not figure out how to make it wrap,",Color.cyan).row();
Expand Down
19 changes: 10 additions & 9 deletions src/ec620/content/EC620PlanetGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ void setOre(Block block)
Seq<Block> ores = Seq.with(oreCopper,oreLead);
Seq<Block> availableOres= content.blocks().select(b->b instanceof OreBlock && !ores.contains(b) && !b.itemDrop.hidden);
int l= availableOres.size;
if(l<5) l=5;

if(sector.id==0)
{
Expand All @@ -605,14 +606,14 @@ void setOre(Block block)
// ores.add(availableOres.get(i));
// }
}
while(ores.size<5)
{
Block b=availableOres.getFrac(pgRand.nextFloat());
String n="ma620."+b.name;

if(Core.settings.has(n)) if(pgRand.chance(Core.settings.getFloat(n)/100f)) ores.add(b);
else if(pgRand.nextDouble()*2>=b.itemDrop.cost) ores.add(b);
}
// while(ores.size<5)
// {
// Block b=availableOres.getFrac(pgRand.nextFloat());
// String n="ma620."+b.name;
//
// if(Core.settings.has(n)) if(pgRand.chance(Core.settings.getFloat(n)/100f)) ores.add(b);
// else if(pgRand.nextDouble()*2>=b.itemDrop.cost) ores.add(b);
// }

}
if(!hasSand && !ores.contains(oreScrap) && !ores.contains(b->b.itemDrop == Items.sand)) ores.add(oreScrap);
Expand Down Expand Up @@ -1072,7 +1073,7 @@ void setOre(Block block)
//if(Core.settings.getBool("ec620.room")) newRooms.add(new Room((int)lh.center.x,(int)lh.center.y,(int)lh.radius));
int m=fores.size*i/oSeq.size;
m+=pgRand.random(-3,3);
if(m<0) m=pgRand.random(0,2);
if(m<0) m=pgRand.random(0,1);
else if(m>= fores.size) m= pgRand.random(0,fores.size-1);
for(Vec2 v:lh.pos)
{
Expand Down

0 comments on commit aa16771

Please sign in to comment.