Skip to content

Commit

Permalink
FINALLY FIXED THE CONDUIT CRASHING THING, FFS IT WAS SO SIMPLE ANDSIB…
Browse files Browse the repository at this point in the history
…FKUSZFGSEYFYSGBCFSFE
  • Loading branch information
Eschatologue committed Oct 23, 2022
1 parent 86f1fce commit 04f49cb
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 28 deletions.
5 changes: 4 additions & 1 deletion src/UAW/content/blocks/UAWBlocksDefense.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ UAWItems.cryogel, new BasicBulletType(5f, 15) {{
limitRange();

squareSprite = false;
cooldownTime = reload * 0.6f;
drawer = new DrawTurret(modTurretBase) {{
parts.addAll(
new RegionPart("-barrel") {{
Expand Down Expand Up @@ -404,6 +405,7 @@ Items.titanium, new TrailBulletType(11f, 70f) {{
limitRange();

squareSprite = false;
cooldownTime = reload * 0.5f;
drawer = new DrawTurret(modTurretBase) {{
parts.addAll(
new RegionPart("-barrel") {{
Expand Down Expand Up @@ -641,7 +643,7 @@ UAWItems.stoutsteel, new HighVelocityShellBulletType(25f, 12500) {{

ammoUseEffect = UAWFx.casingCanister;

squareSprite = false;
cooldownTime = reload * 0.8f;
drawer = new DrawTurret(modTurretBase) {{
parts.addAll(
new RegionPart("-barrel") {{
Expand Down Expand Up @@ -707,6 +709,7 @@ UAWItems.stoutsteel, new HighVelocityShellBulletType(25f, 12500) {{
);
limitRange();

cooldownTime = reload * 0.8f;
drawer = new DrawTurret(modTurretBase) {{
parts.addAll(
new RegionPart("-side-front") {{
Expand Down
42 changes: 19 additions & 23 deletions src/UAW/content/blocks/UAWBlocksLogistic.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,6 @@ public static void load() {

// Liquid

pressurizedConduit = new PrzConduit("pressurized-conduit") {{
requirements(Category.liquid, with(
Items.titanium, 3,
Items.metaglass, 2,
Items.plastanium, 3
));
health = 550;
baseExplosiveness = 8f;
junctionReplacement = pressurizedLiquidJunction;
rotBridgeReplacement = pressurizedLiquidBridge;
}};
platedPressurizedConduit = new PrzPlatedConduit("plated-pressurized-conduit") {{
requirements(Category.liquid, with(
Items.titanium, 3,
Items.metaglass, 2,
Items.plastanium, 3,
UAWItems.stoutsteel, 2
));
health = 850;
baseExplosiveness = 8f;
junctionReplacement = pressurizedLiquidJunction;
rotBridgeReplacement = pressurizedLiquidBridge;
}};
pressurizedLiquidRouter = new LiquidRouter("pressurized-liquid-router") {{
requirements(Category.liquid, with(
UAWItems.stoutsteel, 3,
Expand Down Expand Up @@ -122,6 +99,25 @@ public static void load() {

squareSprite = false;
}};
pressurizedConduit = new PrzConduit("pressurized-conduit") {{
requirements(Category.liquid, with(
Items.titanium, 3,
Items.metaglass, 2,
Items.plastanium, 3
));
health = 550;
baseExplosiveness = 8f;
}};
platedPressurizedConduit = new PrzPlatedConduit("plated-pressurized-conduit") {{
requirements(Category.liquid, with(
Items.titanium, 3,
Items.metaglass, 2,
Items.plastanium, 3,
UAWItems.stoutsteel, 2
));
health = 850;
baseExplosiveness = 8f;
}};

}
}
Expand Down
25 changes: 22 additions & 3 deletions src/UAW/world/blocks/defense/turrets/UAWItemTurret.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package UAW.world.blocks.defense.turrets;

import UAW.world.meta.*;
import UAW.world.meta.UAWStatValues;
import arc.graphics.Color;
import mindustry.graphics.*;
import mindustry.world.blocks.defense.turrets.ItemTurret;
import mindustry.world.meta.Stat;
Expand All @@ -14,9 +15,21 @@
* </p>
*/
public class UAWItemTurret extends ItemTurret {
public Color minRangeColor = Pal.lightishOrange;

public boolean showMinRange = true;

public UAWItemTurret(String name) {
super(name);
squareSprite = false;
}

public void minRangeDraw(float x, float y, int type) {
if (minRange > 0 && showMinRange) {
if (type == 1) Drawf.dashCircle(x * tilesize + offset, y * tilesize + offset, minRange, minRangeColor);
if (type == 2) Drawf.dashCircle(x, y, minRange, minRangeColor);
}

}

@Override
Expand All @@ -29,8 +42,14 @@ public void setStats() {
@Override
public void drawPlace(int x, int y, int rotation, boolean valid) {
super.drawPlace(x, y, rotation, valid);
if (minRange > 0) {
Drawf.dashCircle(x * tilesize + offset, y * tilesize + offset, minRange, Pal.lightishOrange);
minRangeDraw(x, y, 1);
}

public class UAWItemTurretBuild extends ItemTurretBuild {
@Override
public void drawSelect() {
super.drawSelect();
minRangeDraw(x, y, 2);
}
}
}
2 changes: 1 addition & 1 deletion src/UAW/world/blocks/liquid/PrzConduit.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public PrzConduit(String name) {
public void init() {
super.init();
junctionReplacement = UAWBlocksLogistic.pressurizedLiquidJunction;
bridgeReplacement = UAWBlocksLogistic.pressurizedLiquidBridge;
rotBridgeReplacement = UAWBlocksLogistic.pressurizedLiquidBridge;
}

public class PrzConduitBuild extends ConduitBuild {
Expand Down

0 comments on commit 04f49cb

Please sign in to comment.