Skip to content

Commit

Permalink
transmisson that needs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Oct 30, 2024
1 parent 0ad6993 commit 36b2d80
Show file tree
Hide file tree
Showing 26 changed files with 398 additions and 226 deletions.
3 changes: 3 additions & 0 deletions assets/bundles/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ block.sw-wire-shaft.description = A spinning bar able to transfer angular moment
block.sw-wire-shaft-router.name = Axle Router
block.sw-wire-shaft-router.description = A router capable of transfering angular momentum between both axis.

block.sw-shaft-transmission.name = Shaft Transmission
block.sw-shaft-transmission.description = A transmission that halves the angular momentum.

block.sw-boiler.name = Boiler
block.sw-boiler.description = A machine that boils solvent to make motion.

Expand Down
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified atlas.sai2
Binary file not shown.
118 changes: 58 additions & 60 deletions src/sw/content/blocks/SWCrafting.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import mindustry.world.blocks.production.*;
import mindustry.world.draw.*;
import sw.content.*;
import sw.util.*;
import sw.world.blocks.production.*;
import sw.world.meta.*;

import static mindustry.type.ItemStack.*;

Expand Down Expand Up @@ -74,37 +72,37 @@ public static void load() {

outputItem = new ItemStack(SWItems.compound, 1);
}};
chalkSeparator = new SWGenericCrafter("chalk-separator") {{
requirements(Category.crafting, with(
SWItems.iron, 50,
SWItems.compound, 35,
Items.silicon, 30
));
size = 2;
health = 160;

spinConfig = new SpinConfig() {{
connections = BlockGeometry.sides2;
}};

drawer = new DrawMulti(
new DrawRegion("-bottom"),
new DrawWarmupRegion() {{
sinMag = 0f;
}},
new DrawDefault(),
new DrawRegion("-top")
);

craftTime = 120f;
consumeItems(with(
Items.sand, 1,
SWItems.compound, 2
));
consumeGas(0.1f, 4f, 12f, 1f, 1f, true);

outputItem = new ItemStack(SWItems.chalk, 2);
}};
// chalkSeparator = new SWGenericCrafter("chalk-separator") {{
// requirements(Category.crafting, with(
// SWItems.iron, 50,
// SWItems.compound, 35,
// Items.silicon, 30
// ));
// size = 2;
// health = 160;
//
// spinConfig = new SpinConfig() {{
// connections = BlockGeometry.sides2;
// }};
//
// drawer = new DrawMulti(
// new DrawRegion("-bottom"),
// new DrawWarmupRegion() {{
// sinMag = 0f;
// }},
// new DrawDefault(),
// new DrawRegion("-top")
// );
//
// craftTime = 120f;
// consumeItems(with(
// Items.sand, 1,
// SWItems.compound, 2
// ));
// consumeGas(0.1f, 4f, 12f, 1f, 1f, true);
//
// outputItem = new ItemStack(SWItems.chalk, 2);
// }};

densePress = new SWGenericCrafter("dense-press") {{
requirements(Category.crafting, with(
Expand All @@ -130,32 +128,32 @@ public static void load() {

outputItem = new ItemStack(SWItems.denseAlloy, 2);
}};
thermiteMixer = new SWGenericCrafter("thermite-mixer") {{
requirements(Category.crafting, with(
SWItems.iron, 50,
SWItems.denseAlloy, 35,
Items.silicon, 30
));
size = 2;
health = 160;

spinConfig = new SpinConfig() {{
connections = BlockGeometry.sides2;
}};

consumeItem(SWItems.denseAlloy, 1);
consumeGas(0.1f, 4f, 12f, 1f, 1f, true);

drawer = new DrawMulti(
new DrawRegion("-bottom"),
new DrawRegion("-rotator") {{
spinSprite = true;
rotateSpeed = 3f;
}},
new DrawDefault()
);

outputItems = with(SWItems.thermite, 1);
}};
// thermiteMixer = new SWGenericCrafter("thermite-mixer") {{
// requirements(Category.crafting, with(
// SWItems.iron, 50,
// SWItems.denseAlloy, 35,
// Items.silicon, 30
// ));
// size = 2;
// health = 160;
//
// spinConfig = new SpinConfig() {{
// connections = BlockGeometry.sides2;
// }};
//
// consumeItem(SWItems.denseAlloy, 1);
// consumeGas(0.1f, 4f, 12f, 1f, 1f, true);
//
// drawer = new DrawMulti(
// new DrawRegion("-bottom"),
// new DrawRegion("-rotator") {{
// spinSprite = true;
// rotateSpeed = 3f;
// }},
// new DrawDefault()
// );
//
// outputItems = with(SWItems.thermite, 1);
// }};
}
}
32 changes: 28 additions & 4 deletions src/sw/content/blocks/SWPower.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package sw.content.blocks;

import arc.struct.*;
import mindustry.content.*;
import mindustry.type.*;
import mindustry.world.*;
import mindustry.world.draw.*;
import sw.content.*;
import sw.util.*;
import sw.math.*;
import sw.world.blocks.power.*;
import sw.world.blocks.production.*;
import sw.world.meta.*;
Expand All @@ -15,7 +16,7 @@
public class SWPower {
public static Block
boiler,
wireShaft, wireShaftRouter;
wireShaft, wireShaftRouter, shaftTransmission;

public static void load() {
wireShaft = new WireShaft("wire-shaft") {{
Expand All @@ -32,6 +33,24 @@ public static void load() {
rotate = false;
}};

shaftTransmission = new ShaftTransmission("shaft-transmission") {{
requirements(Category.power, with(
SWItems.nickel, 50,
SWItems.iron, 40,
Items.silicon, 30
));
size = 2;

spinConfig = new SpinConfig() {{
connections = new Seq[]{
BlockGeometry.sides21,
BlockGeometry.sides22,
BlockGeometry.sides23,
BlockGeometry.sides24
};
}};
}};

boiler = new SWGenericCrafter("boiler") {{
requirements(Category.power, with(
SWItems.iron, 20,
Expand All @@ -42,7 +61,12 @@ public static void load() {
health = 160;

spinConfig = new SpinConfig() {{
connections = BlockGeometry.half2;
connections = new Seq[]{
BlockGeometry.half2,
BlockGeometry.half2,
BlockGeometry.half2,
BlockGeometry.half2
};
}};

drawer = new DrawMulti(
Expand All @@ -59,7 +83,7 @@ public static void load() {
consumeLiquid(SWLiquids.solvent, 0.1f);
craftTime = 30;

outputRotation = 0.2f;
outputRotation = 5f;
}};
}
}
40 changes: 40 additions & 0 deletions src/sw/math/BlockGeometry.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package sw.math;

import arc.math.geom.*;
import arc.struct.*;

public class BlockGeometry {
public static Seq<Point2>

half2 = Seq.with(
new Point2(2, 0),
new Point2(1, 2),
new Point2(-1, 1),
new Point2(0, -1)
),

sides21 = Seq.with(
new Point2(2, 0),
new Point2(-1, 0),
new Point2(2, 1),
new Point2(-1, 1)
),
sides22 = Seq.with(
new Point2(1, 2),
new Point2(1, -1),
new Point2(0, 2),
new Point2(0, -1)
),
sides23 = Seq.with(
new Point2(2, 1),
new Point2(-1, 1),
new Point2(2, 0),
new Point2(-1, 0)
),
sides24 = Seq.with(
new Point2(0, 2),
new Point2(0, -1),
new Point2(1, 2),
new Point2(1, -1)
);
}
22 changes: 0 additions & 22 deletions src/sw/util/BlockGeometry.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/sw/world/blocks/power/GasJunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void draw() {
Draw.rect(region, x, y, 0);
}

@Override public HasSpin getGasDestination(HasSpin from) {
@Override public HasSpin getSpinGraphDestination(HasSpin from) {
return (nearby(from.relativeTo(tile)) instanceof HasSpin other && !(other instanceof SpinJunctionBuild)) ? other : this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/sw/world/blocks/power/GasPipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void read(Reads read, byte revision) {
public void onGraphUpdate() {
tiling = 0;
for (int i = 0; i < 4; i++) {
if (nearby(i) instanceof HasSpin gas && HasSpin.connects(this, gas.getGasDestination(this))) {
if (nearby(i) instanceof HasSpin gas && HasSpin.connects(this, gas.getSpinGraphDestination(this))) {
tiling |= 1 << i;
}
}
Expand Down
Loading

0 comments on commit 36b2d80

Please sign in to comment.