Skip to content

Commit

Permalink
container
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jul 31, 2024
1 parent d8c129d commit 3241af9
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 56 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/sprites/blocks/storage/filler-arm.png
Binary file not shown.
Binary file removed assets/sprites/blocks/storage/filler-top.png
Binary file not shown.
Binary file removed assets/sprites/blocks/storage/filler.png
Binary file not shown.
Binary file modified atlas.sai2
Binary file not shown.
58 changes: 5 additions & 53 deletions src/sw/content/SWBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import mindustry.content.*;
import mindustry.type.*;
import mindustry.world.*;
import mindustry.world.blocks.power.*;
import mindustry.world.blocks.storage.*;
import mindustry.world.blocks.units.*;
import mindustry.world.draw.*;
import sw.content.blocks.*;
Expand All @@ -25,25 +23,21 @@ public class SWBlocks {
rebuilder,
pressModule, smelterModule, arcSmelterModule, impactPressModule, mixerModule, crystalizerModule,

powerWire,
burner,

subFactory,
constructor,
upgrader,

coreScaffold,

allSource;

public static void load() {
SWEnvironment.load();
SWTurrets.load();
SWProduction.load();
SWCrafting.load();
SWDefense.load();
SWDistribution.load();
SWCrafting.load();
SWEnvironment.load();
SWProduction.load();
SWPower.load();
SWStorage.load();
SWTurrets.load();

// region crafting

Expand Down Expand Up @@ -195,36 +189,6 @@ public static void load() {
}};
// endregion

// region power
powerWire = new PowerNode("power-wire") {{
requirements(Category.power, with(
SWItems.iron, 10,
SWItems.nickel, 5
));
size = 2;
health = 80;
maxNodes = 3;
maxRange = 80f;
}};
burner = new ConsumeGenerator("burner") {{
requirements(Category.power, with(
SWItems.iron, 50,
SWItems.nickel, 80
));
researchCost = with(
Items.titanium, 500,
SWItems.nickel, 800
);
size = 2;
health = 160;

consumeItem(Items.graphite, 1);

itemDuration = 60f;
powerProduction = 0.5f;
}};
// endregion

// region units
subFactory = new UnitFactory("submarine-factory") {{
requirements(Category.units, with(
Expand Down Expand Up @@ -278,18 +242,6 @@ public static void load() {
}};
// endregion

// region storage
coreScaffold = new CoreBlock("core-scaffold") {{
requirements(Category.effect, with(SWItems.nickel, 1000, Items.graphite, 800));
size = 3;
health = 2000;
alwaysUnlocked = true;
unitType = SWUnitTypes.lambda;
itemCapacity = 5000;
unitCapModifier = 12;
}};
// endregion

// region sandbox
allSource = new ResourceSource("all-source") {{
health = 2147483647;
Expand Down
2 changes: 1 addition & 1 deletion src/sw/content/SWPlanets.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static void load() {
Items.silicon
);

defaultCore = SWBlocks.coreScaffold;
defaultCore = SWStorage.coreScaffold;

generator = new ModularPlanetGenerator() {{
heights.addAll(
Expand Down
2 changes: 1 addition & 1 deletion src/sw/content/SWTechTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

import static arc.struct.Seq.*;
import static mindustry.content.TechTree.*;
import static sw.content.SWBlocks.*;
import static sw.content.SWItems.*;
import static sw.content.SWLiquids.*;
import static sw.content.blocks.SWCrafting.*;
import static sw.content.blocks.SWDefense.*;
import static sw.content.blocks.SWDistribution.*;
import static sw.content.blocks.SWPower.*;
import static sw.content.blocks.SWProduction.*;
import static sw.content.blocks.SWStorage.*;
import static sw.content.blocks.SWTurrets.*;

public class SWTechTree {
Expand Down
41 changes: 41 additions & 0 deletions src/sw/content/blocks/SWStorage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package sw.content.blocks;

import mindustry.content.*;
import mindustry.type.*;
import mindustry.world.*;
import mindustry.world.blocks.storage.*;
import sw.content.*;

import static mindustry.type.ItemStack.*;

public class SWStorage {
public static Block
compactContainer,
coreScaffold;

public static void load() {
compactContainer = new StorageBlock("compact-container") {{
requirements(Category.effect, with(
SWItems.nickel, 40,
SWItems.iron, 50,
Items.silicon, 30
));
size = 2;
health = 500;
coreMerge = false;
}};

coreScaffold = new CoreBlock("core-scaffold") {{
requirements(Category.effect, with(
SWItems.nickel, 1000,
Items.graphite, 800
));
size = 3;
health = 2000;
alwaysUnlocked = true;
unitType = SWUnitTypes.lambda;
itemCapacity = 5000;
unitCapModifier = 12;
}};
}
}
2 changes: 1 addition & 1 deletion src/sw/world/blocks/distribution/MechanicalTunnel.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public MechanicalTunnel(String name) {

@Override
public void changePlacementPath(Seq<Point2> points, int rotation) {
Placement.calculateNodes(points, this, rotation, (point, other) -> Math.max(Math.abs(point.x - other.x), Math.abs(point.y - other.y)) <= maxDistance(Vars.world.tile(points.first().x, points.first().y), rotation));
Placement.calculateNodes(points, this, rotation, (point, other) -> Math.max(Math.abs(point.x - other.x), Math.abs(point.y - other.y)) <= maxDistance(Vars.world.tile(points.first().x, points.first().y), rotation) - 1);
points.removeAll(point -> points.indexOf(point) > 1);
}

Expand Down

0 comments on commit 3241af9

Please sign in to comment.