Skip to content

Commit

Permalink
Merge branch 'master' into v8
Browse files Browse the repository at this point in the history
# Conflicts:
#	core/src/mindustry/entities/comp/BuilderComp.java
#	core/src/mindustry/ui/dialogs/SchematicsDialog.java
#	core/src/mindustry/ui/fragments/PlacementFragment.java
#	gradle.properties
  • Loading branch information
buthed010203 committed Oct 2, 2024
2 parents a52d123 + 939b8a9 commit a8be6d8
Show file tree
Hide file tree
Showing 37 changed files with 339 additions and 96 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ project(":desktop"){
// implementation "com.github.mindustry-antigrief:steamworks4j:1.10.0-SNAPSHOT" // Local steamworks4j

implementation arcModule("backends:backend-sdl")
annotationProcessor 'com.github.Anuken:jabel:0.9.0'
}
}

Expand Down Expand Up @@ -416,6 +417,7 @@ project(":server"){
dependencies{
implementation project(":core")
implementation arcModule("backends:backend-headless")
annotationProcessor 'com.github.Anuken:jabel:0.9.0'
}
}

Expand Down
Binary file modified core/assets/maps/atolls.msav
Binary file not shown.
Binary file added core/assets/maps/frontier.msav
Binary file not shown.
Binary file added core/assets/maps/mycelialBastion.msav
Binary file not shown.
Binary file modified core/assets/maps/navalFortress.msav
Binary file not shown.
Binary file added core/assets/maps/seaPort.msav
Binary file not shown.
Binary file modified core/assets/maps/siege.msav
Binary file not shown.
Binary file added core/assets/maps/testingGrounds.msav
Binary file not shown.
Binary file added core/assets/maps/weatheredChannels.msav
Binary file not shown.
8 changes: 4 additions & 4 deletions core/src/mindustry/ai/Astar.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ public class Astar{
private static float[] costs;
private static byte[][] rotations;

public static Seq<Tile> pathfind(Tile from, Tile to, TileHueristic th, Boolf<Tile> passable){
public static Seq<Tile> pathfind(Tile from, Tile to, TileHeuristic th, Boolf<Tile> passable){
return pathfind(from.x, from.y, to.x, to.y, th, manhattan, passable);
}

public static Seq<Tile> pathfind(int startX, int startY, int endX, int endY, TileHueristic th, Boolf<Tile> passable){
public static Seq<Tile> pathfind(int startX, int startY, int endX, int endY, TileHeuristic th, Boolf<Tile> passable){
return pathfind(startX, startY, endX, endY, th, manhattan, passable);
}

public static Seq<Tile> pathfind(int startX, int startY, int endX, int endY, TileHueristic th, DistanceHeuristic dh, Boolf<Tile> passable){
public static Seq<Tile> pathfind(int startX, int startY, int endX, int endY, TileHeuristic th, DistanceHeuristic dh, Boolf<Tile> passable){
Tiles tiles = world.tiles;

Tile start = tiles.getn(startX, startY);
Expand Down Expand Up @@ -94,7 +94,7 @@ public interface DistanceHeuristic{
float cost(int x1, int y1, int x2, int y2);
}

public interface TileHueristic{
public interface TileHeuristic{
float cost(Tile tile);

default float cost(Tile from, Tile tile){
Expand Down
4 changes: 2 additions & 2 deletions core/src/mindustry/ai/ControlPathfinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public class ControlPathfinder implements Runnable{

costNaval = (team, tile) ->
//impassable same-team neutral block, or non-liquid
(PathTile.solid(tile) && ((PathTile.team(tile) == team && !PathTile.teamPassable(tile)) || PathTile.team(tile) == 0)) || !PathTile.liquid(tile) ? impassable :
1 +
(PathTile.solid(tile) && ((PathTile.team(tile) == team && !PathTile.teamPassable(tile)) || PathTile.team(tile) == 0)) ? impassable :
(!PathTile.liquid(tile) ? 6000 : 1) +
//impassable synthetic enemy block
((PathTile.team(tile) != team && PathTile.team(tile) != 0) && PathTile.solid(tile) ? wallImpassableCap : 0) +
(PathTile.nearGround(tile) || PathTile.nearSolid(tile) ? 6 : 0);
Expand Down
7 changes: 7 additions & 0 deletions core/src/mindustry/ai/types/CommandAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class CommandAI extends AIController{
protected Vec2 lastTargetPos;
protected boolean blockingUnit;
protected float timeSpentBlocked;
protected float payloadPickupCooldown;
protected int transferState = transferStateNone;

/** Stance, usually related to firing mode. */
Expand Down Expand Up @@ -125,6 +126,8 @@ void tryPickupUnit(Payloadc pay){
public void defaultBehavior(){

if(!net.client() && unit instanceof Payloadc pay){
payloadPickupCooldown -= Time.delta;

//auto-drop everything
if(command == UnitCommand.unloadPayloadCommand && pay.hasPayload()){
Call.payloadDropped(unit, unit.x, unit.y);
Expand Down Expand Up @@ -350,6 +353,8 @@ void finishPath(){
transferState = pay.hasPayload() ? transferStateUnload : transferStateLoad;
}

if(payloadPickupCooldown > 0f) return;

if(transferState == transferStateUnload){
//drop until there's a failure
int prev = -1;
Expand All @@ -362,6 +367,7 @@ void finishPath(){
if(pay.hasPayload()){
return;
}
payloadPickupCooldown = 60f;
}else if(transferState == transferStateLoad){
//pick up units until there's a failure
int prev = -1;
Expand All @@ -374,6 +380,7 @@ void finishPath(){
if(!pay.hasPayload()){
return;
}
payloadPickupCooldown = 60f;
}

//it will never finish
Expand Down
12 changes: 7 additions & 5 deletions core/src/mindustry/content/Blocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,7 @@ public static void load(){

titaniumConveyor = new Conveyor("titanium-conveyor"){{
requirements(Category.distribution, with(Items.copper, 1, Items.lead, 1, Items.titanium, 1));
health = 70;
health = 65;
speed = 0.08f;
displayedSpeed = 11f;
}};
Expand Down Expand Up @@ -2872,14 +2872,15 @@ public static void load(){
//region storage

coreShard = new CoreBlock("core-shard"){{
requirements(Category.effect, BuildVisibility.editorOnly, with(Items.copper, 1000, Items.lead, 800));
requirements(Category.effect, BuildVisibility.coreZoneOnly, with(Items.copper, 1000, Items.lead, 800));
alwaysUnlocked = true;

isFirstTier = true;
unitType = UnitTypes.alpha;
health = 1100;
itemCapacity = 4000;
size = 3;
buildCostMultiplier = 2f;

unitCapModifier = 8;
}};
Expand Down Expand Up @@ -2992,7 +2993,7 @@ public static void load(){
reinforcedContainer = new StorageBlock("reinforced-container"){{
requirements(Category.effect, with(Items.tungsten, 30, Items.graphite, 40));
size = 2;
itemCapacity = 80;
itemCapacity = 160;
scaledHealth = 120;
coreMerge = false;
}};
Expand Down Expand Up @@ -4228,6 +4229,7 @@ Items.thorium, new ArtilleryBulletType(2.5f, 350, "shell"){{

newTargetInterval = 40f;
shootWarmupSpeed = 0.07f;
warmupMaintainTime = 120f;

coolant = consume(new ConsumeLiquid(Liquids.water, 30f / 60f));
coolantMultiplier = 1.5f;
Expand Down Expand Up @@ -4951,7 +4953,7 @@ Items.surgeAlloy, new BasicBulletType(7f, 250){{
outlineColor = Pal.darkOutline;
size = 5;
envEnabled |= Env.space;
warmupMaintainTime = 30f;
warmupMaintainTime = 120f;
reload = 100f;
recoil = 2f;
range = 300;
Expand Down Expand Up @@ -5278,7 +5280,7 @@ Items.surgeAlloy, new BasicBulletType(7f, 250){{
velocityRnd = 0.15f;
heatRequirement = 90f;
maxHeatEfficiency = 2f;
warmupMaintainTime = 30f;
warmupMaintainTime = 120f;
consumePower(10f);

shoot = new ShootSummon(0f, 0f, circleRad, 48f);
Expand Down
2 changes: 0 additions & 2 deletions core/src/mindustry/content/Planets.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public static void load(){
};
campaignRuleDefaults.fog = true;
campaignRuleDefaults.showSpawns = true;
campaignRuleDefaults.rtsAI = true;

unlockedOnLand.add(Blocks.coreBastion);
}};
Expand Down Expand Up @@ -147,7 +146,6 @@ public static void load(){
r.placeRangeCheck = false;
r.showSpawns = false;
};
showRtsAIRule = true;
iconColor = Color.valueOf("7d4dff");
atmosphereColor = Color.valueOf("3c1b8f");
atmosphereRadIn = 0.02f;
Expand Down
33 changes: 28 additions & 5 deletions core/src/mindustry/content/SectorPresets.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public class SectorPresets{
public static SectorPreset
groundZero,
craters, biomassFacility, taintedWoods, frozenForest, ruinousShores, facility32m, windsweptIslands, stainedMountains, tarFields,
fungalPass, infestedCanyons, atolls, extractionOutpost, polarAerodrome, saltFlats, overgrowth,
frontier, fungalPass, infestedCanyons, atolls, mycelialBastion, extractionOutpost, saltFlats, testingGrounds, overgrowth, //polarAerodrome,
impact0078, desolateRift, nuclearComplex, planetaryTerminal,
coastline, navalFortress,
coastline, navalFortress, weatheredChannels, seaPort,

onset, aegis, lake, intersect, basin, atlas, split, marsh, peaks, ravine, caldera,
stronghold, crevice, siege, crossroads, karst, origin;
Expand All @@ -32,6 +32,11 @@ public static void load(){
difficulty = 5;
}};

testingGrounds = new SectorPreset("testingGrounds", serpulo, 3){{
difficulty = 7;
captureWave = 33;
}};

frozenForest = new SectorPreset("frozenForest", serpulo, 86){{
captureWave = 15;
difficulty = 2;
Expand All @@ -57,6 +62,10 @@ public static void load(){
difficulty = 3;
}};

seaPort = new SectorPreset("seaPort", serpulo, 47){{
difficulty = 4;
}};

facility32m = new SectorPreset("facility32m", serpulo, 64){{
captureWave = 25;
difficulty = 4;
Expand All @@ -76,19 +85,29 @@ public static void load(){
difficulty = 5;
}};

polarAerodrome = new SectorPreset("polarAerodrome", serpulo, 68){{
difficulty = 7;
}};
//TODO: removed for now
//polarAerodrome = new SectorPreset("polarAerodrome", serpulo, 68){{
// difficulty = 7;
//}};

coastline = new SectorPreset("coastline", serpulo, 108){{
captureWave = 30;
difficulty = 5;
}};

weatheredChannels = new SectorPreset("weatheredChannels", serpulo, 39){{
captureWave = 40;
difficulty = 7;
}};

navalFortress = new SectorPreset("navalFortress", serpulo, 216){{
difficulty = 9;
}};

frontier = new SectorPreset("frontier", serpulo, 203){{
difficulty = 4;
}};

fungalPass = new SectorPreset("fungalPass", serpulo, 21){{
difficulty = 4;
}};
Expand All @@ -101,6 +120,10 @@ public static void load(){
difficulty = 7;
}};

mycelialBastion = new SectorPreset("mycelialBastion", serpulo, 133){{
difficulty = 7;
}};

overgrowth = new SectorPreset("overgrowth", serpulo, 134){{
difficulty = 5;
}};
Expand Down
61 changes: 57 additions & 4 deletions core/src/mindustry/content/SerpuloTechTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public static void load(){

node(steamGenerator, Seq.with(new SectorComplete(craters)), () -> {
node(thermalGenerator, () -> {
node(differentialGenerator, () -> {
node(differentialGenerator, Seq.with(new SectorComplete(testingGrounds)), () -> {
node(thoriumReactor, Seq.with(new Research(Liquids.cryofluid)), () -> {
node(impactReactor, () -> {

Expand Down Expand Up @@ -378,7 +378,7 @@ public static void load(){
node(flare, () -> {
node(horizon, () -> {
node(zenith, () -> {
node(antumbra, Seq.with(new SectorComplete(polarAerodrome)), () -> {
node(antumbra, () -> {
node(eclipse, () -> {

});
Expand Down Expand Up @@ -448,12 +448,34 @@ public static void load(){
new Research(mender),
new Research(combustionGenerator)
), () -> {
node(frontier, Seq.with(
new Research(groundFactory),
new Research(airFactory),
new Research(thermalGenerator),
new Research(dagger),
new Research(mono)
), () -> {

});

node(ruinousShores, Seq.with(
new SectorComplete(craters),
new Research(graphitePress),
new Research(kiln),
new Research(mechanicalPump)
), () -> {
node(seaPort, Seq.with(
new SectorComplete(biomassFacility),
new Research(navalFactory),
new Research(risso),
new Research(retusa),
new Research(steamGenerator),
new Research(cultivator),
new Research(coalCentrifuge)
), () -> {

});

node(windsweptIslands, Seq.with(
new SectorComplete(ruinousShores),
new Research(pneumaticDrill),
Expand Down Expand Up @@ -514,17 +536,22 @@ public static void load(){
new Research(airFactory),
new Research(mono)
), () -> {
node(polarAerodrome, Seq.with(
//TODO: removed for now
/*node(polarAerodrome, Seq.with(
new SectorComplete(fungalPass),
new SectorComplete(desolateRift),
new SectorComplete(overgrowth),
new Research(multiplicativeReconstructor),
new Research(zenith),
new Research(swarmer),
new Research(cyclone),
new Research(blastDrill)
new Research(blastDrill),
new Research(blastDrill),
new Research(massDriver)
), () -> {
});
*/
});
});

Expand All @@ -535,17 +562,35 @@ public static void load(){
new Research(airFactory),
new Research(door)
), () -> {
node(testingGrounds, Seq.with(
new Research(cryofluidMixer),
new Research(Liquids.cryofluid),
new Research(waterExtractor),
new Research(ripple)
), () -> {

});

node(coastline, Seq.with(
new SectorComplete(windsweptIslands),
new SectorComplete(saltFlats),
new Research(navalFactory),
new Research(payloadConveyor)
), () -> {
node(weatheredChannels, Seq.with(
new SectorComplete(impact0078)
), () -> {

});

node(navalFortress, Seq.with(
new SectorComplete(coastline),
new SectorComplete(extractionOutpost),
new Research(coreNucleus),
new Research(massDriver),
new Research(oxynoe),
new Research(minke),
new Research(bryde),
new Research(cyclone),
new Research(ripple)
), () -> {
Expand All @@ -565,6 +610,14 @@ public static void load(){
new Research(UnitTypes.mace),
new Research(UnitTypes.flare)
), () -> {
node(mycelialBastion, Seq.with(
new Research(atrax),
new Research(spiroct),
new Research(multiplicativeReconstructor)
), () -> {

});

node(atolls, Seq.with(
new SectorComplete(windsweptIslands),
new Research(multiplicativeReconstructor),
Expand Down
2 changes: 1 addition & 1 deletion core/src/mindustry/editor/MapObjectivesCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public ObjectiveTile(MapObjective obj, int x, int y){
() -> obj,
res -> {}
);
}).width(400f).fillY()).grow();
}).width(Math.min(Core.graphics.getWidth() * 0.95f / Scl.scl(1f) - Scl.scl(20f), 700f)).fillY()).grow();

dialog.addCloseButton();
dialog.show();
Expand Down
Loading

0 comments on commit a8be6d8

Please sign in to comment.