Skip to content

Commit 3b67275

Browse files
author
=
committed
shrink the unit
1 parent aa8f265 commit 3b67275

File tree

8 files changed

+13
-10
lines changed

8 files changed

+13
-10
lines changed

assets/bundles/bundle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ unit.sw-retreat.description = A unit with short range artillery, is invisible to
5959
unit.sw-evade.name = Evade
6060
unit.sw-evade.description = A moderately sized submarine that has a torpedo launcher and short range fuse-like mounts.
6161

62+
unit.sw-bakler.name = Bakler
63+
unit.sw-bakler.description = A small Silicon crucible inside a unit.
64+
6265
category.sw-heat = Heat
6366

6467
stat.sw-recipes = Recipes
49 Bytes
Loading
-746 Bytes
Loading

assets/sprites/units/bakler.png

-778 Bytes
Loading

src/sw/content/SWBlocks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public static void load() {
138138
rotateSpeed = 0.2f;
139139
blurThresh = 1.1f;
140140
}});
141-
outputItems = with(Items.graphite, 8);
141+
outputItems = with(Items.graphite, 1);
142142
}};
143143
rebuilder = new MultiCrafter("rebuilder") {{
144144
requirements(Category.crafting, with(

src/sw/content/SWUnitTypes.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,9 @@ public static void load() {
256256
useUnitCap = false;
257257
flying = true;
258258

259-
engineOffset = 12f;
260-
engineSize = 5f;
261-
setEnginesMirror(new UnitEngine(10, -2, 5, -45));
262-
engines.add(new UnitEngine(0, 0, 3, 90));
259+
engineOffset = 9f;
260+
engineSize = 3f;
261+
setEnginesMirror(new UnitEngine(7, -2, 3, -45));
263262

264263
recipe = new GenericRecipe() {{
265264
consumeItems = with(Items.coal, 6, Items.sand, 10);

src/sw/entities/comp/CrafterUnit.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ public void update() {
3838
for (ItemStack stack : type().recipe.consumeItems) {
3939
if (payload.build.items().get(stack.item) < stack.amount) crafting = false;
4040
}
41+
for (ItemStack stack : type().recipe.outputItems) {
42+
if (payload.build.items().get(stack.item) > payload.build.block.itemCapacity - stack.amount) crafting = false;
43+
}
4144

4245
if (crafting) {
4346
progress += Time.delta;
@@ -49,9 +52,7 @@ public void update() {
4952
if (progress >= type().recipe.craftTime) {
5053
progress %= 1f;
5154
for (ItemStack stack : type().recipe.consumeItems) payload.build.items().remove(stack);
52-
for (ItemStack stack : type().recipe.outputItems) {
53-
if (payload.build.items().get(stack.item) <= payload.build.block.itemCapacity) payload.build.items().add(stack.item, stack.amount);
54-
}
55+
for (ItemStack stack : type().recipe.outputItems) payload.build.items().add(stack.item, stack.amount);
5556
type().recipe.craftEffect.at(this);
5657
}
5758
}

src/sw/world/blocks/production/StackCrafter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public class StackCrafterBuild extends GenericCrafterBuild {
2626
public void craft() {
2727
consume();
2828
stack++;
29-
if (stack >= stacks) if (outputItems != null) {
29+
if (stack >= stacks && outputItems != null) {
3030
for (ItemStack output : outputItems) {
31-
for (int i = 0; i < output.amount * stacks; i++) offload(output.item);
31+
for (int i = 0; i < output.amount; i++) offload(output.item);
3232
}
3333
stack = 0;
3434
stackCraftEffect.at(x, y);

0 commit comments

Comments
 (0)